Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
entrance_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王琮
entrance_api
Commits
a78012e2
Commit
a78012e2
authored
Dec 14, 2022
by
mx
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/import' into import
parents
872eda0f
a001a999
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
118 additions
and
87 deletions
+118
-87
IJieLinkService.java
.../rcisoft/integration/jieLink/service/IJieLinkService.java
+7
-0
JieLinkServiceImpl.java
.../integration/jieLink/service/impl/JieLinkServiceImpl.java
+65
-19
SysUserServiceImpl.java
.../rcisoft/sys/sysuser/service/impl/SysUserServiceImpl.java
+30
-30
CheckUtil.java
src/main/java/org/rcisoft/sys/sysuser/util/CheckUtil.java
+1
-1
VisitInfomationController.java
...isoft/sys/visit/controller/VisitInfomationController.java
+1
-1
VisitUserServiceImpl.java
.../rcisoft/sys/visit/service/impl/VisitUserServiceImpl.java
+7
-33
application-common.yml
src/main/resources/application-common.yml
+2
-2
application-dev-conf.yml
src/main/resources/application-dev-conf.yml
+1
-0
application-prod-conf.yml
src/main/resources/application-prod-conf.yml
+1
-0
VisitInfomationMapper.xml
src/main/resources/mapper/VisitInfomationMapper.xml
+3
-1
No files found.
src/main/java/org/rcisoft/integration/jieLink/service/IJieLinkService.java
View file @
a78012e2
...
@@ -35,6 +35,13 @@ public interface IJieLinkService {
...
@@ -35,6 +35,13 @@ public interface IJieLinkService {
*/
*/
public
boolean
pushModifyUserData
(
SysUser
userData
);
public
boolean
pushModifyUserData
(
SysUser
userData
);
/**
* 推送更新的用户信息到接口服务中
* @param userData
* @return
*/
public
boolean
pushDelUserData
(
SysUser
userData
);
/**
/**
* 推送方可邀请记录到接口服务中
* 推送方可邀请记录到接口服务中
...
...
src/main/java/org/rcisoft/integration/jieLink/service/impl/JieLinkServiceImpl.java
View file @
a78012e2
...
@@ -97,7 +97,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
...
@@ -97,7 +97,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
try
{
try
{
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
log
.
debug
(
"getAppKeyInfo接口返回信息:
{0}"
,
responseEntity
.
getBody
().
toJSONString
());
log
.
debug
(
"getAppKeyInfo接口返回信息:
"
+
responseEntity
.
getBody
().
toJSONString
());
JSONObject
body
=
responseEntity
.
getBody
();
JSONObject
body
=
responseEntity
.
getBody
();
if
(
StringUtils
.
equals
(
body
.
getString
(
"code"
),
"0"
)){
if
(
StringUtils
.
equals
(
body
.
getString
(
"code"
),
"0"
)){
List
<
AppInfoDto
>
appInfoDtoList
=
JSONArray
.
parseArray
(
body
.
getJSONArray
(
"data"
).
toJSONString
(),
AppInfoDto
.
class
);
List
<
AppInfoDto
>
appInfoDtoList
=
JSONArray
.
parseArray
(
body
.
getJSONArray
(
"data"
).
toJSONString
(),
AppInfoDto
.
class
);
...
@@ -145,7 +145,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
...
@@ -145,7 +145,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
try
{
try
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
log
.
debug
(
"pushAddUserData接口返回信息:
{0}"
,
responseEntity
.
getBody
().
toJSONString
());
log
.
debug
(
"pushAddUserData接口返回信息:
"
+
responseEntity
.
getBody
().
toJSONString
());
JieLinkResultDto
<
JieLinkPersonDto
>
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
JieLinkResultDto
<
JieLinkPersonDto
>
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
JieLinkPersonDto
persion
=
resultData
.
getData
();
JieLinkPersonDto
persion
=
resultData
.
getData
();
...
@@ -206,7 +206,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
...
@@ -206,7 +206,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
try
{
try
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
log
.
debug
(
"pushModifyUserData接口返回信息:
{0}"
,
responseEntity
.
getBody
().
toJSONString
());
log
.
debug
(
"pushModifyUserData接口返回信息:
"
+
responseEntity
.
getBody
().
toJSONString
());
JieLinkResultDto
<
JieLinkPersonDto
>
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
JieLinkResultDto
<
JieLinkPersonDto
>
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
return
true
;
return
true
;
...
@@ -235,6 +235,49 @@ public class JieLinkServiceImpl implements IJieLinkService {
...
@@ -235,6 +235,49 @@ public class JieLinkServiceImpl implements IJieLinkService {
}
}
}
}
@Override
public
boolean
pushDelUserData
(
SysUser
userData
)
{
if
(
userData
!=
null
&&
StringUtils
.
isNotBlank
(
userData
.
getPersonId
())){
String
apiUri
=
"/api/base/deleteperson"
;
HttpHeaders
headers
=
this
.
loadHeaderHandle
();
if
(
headers
!=
null
){
JSONObject
paramMap
=
new
JSONObject
();
paramMap
.
put
(
"personId"
,
userData
.
getPersonId
());
HttpEntity
<
JSONObject
>
httpEntity
=
new
HttpEntity
<>(
paramMap
,
headers
);
StringBuffer
uriAddr
=
new
StringBuffer
();
uriAddr
.
append
(
jieLinkUri
).
append
(
apiUri
);
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
try
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
log
.
debug
(
"pushDelUserData接口返回信息:"
+
responseEntity
.
getBody
().
toJSONString
());
JieLinkResultDto
<
JieLinkPersonDto
>
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
return
true
;
}
else
{
log
.
error
(
"pushDelUserData接口返回错误信息:"
+
resultData
.
getMsg
());
//请求返回结果错误啦
return
false
;
}
}
else
{
//请求失败啦
log
.
error
(
"pushDelUserData接口请求失败"
);
return
false
;
}
}
catch
(
Exception
ex
){
log
.
error
(
ex
.
getMessage
(),
ex
);
return
false
;
}
}
else
{
//认证信息获取失败
log
.
error
(
"pushDelUserData接口获取认证参数失败"
);
return
false
;
}
}
else
{
log
.
error
(
"当前用户没有捷顺系统的ID,无法更新"
);
return
true
;
}
}
/**
/**
* 用户对象转换
* 用户对象转换
* @param userData
* @param userData
...
@@ -287,7 +330,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
...
@@ -287,7 +330,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
try
{
try
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
//后续处理逻辑
//后续处理逻辑
log
.
debug
(
"pushVisitorData接口返回信息:
{0}"
,
responseEntity
.
getBody
().
toJSONString
());
log
.
debug
(
"pushVisitorData接口返回信息:
"
+
responseEntity
.
getBody
().
toJSONString
());
JieLinkResultDto
<
JSONObject
>
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
JieLinkResultDto
<
JSONObject
>
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
return
true
;
return
true
;
...
@@ -340,7 +383,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
...
@@ -340,7 +383,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
try
{
try
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
log
.
debug
(
"cancelVisitorData接口返回信息:
{0}"
,
responseEntity
.
getBody
().
toJSONString
());
log
.
debug
(
"cancelVisitorData接口返回信息:
"
+
responseEntity
.
getBody
().
toJSONString
());
JieLinkResultDto
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
JieLinkResultDto
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
return
true
;
return
true
;
...
@@ -490,7 +533,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
...
@@ -490,7 +533,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
try
{
try
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
log
.
debug
(
"pullVisitUserQrCode接口返回信息:
{0}"
,
responseEntity
.
getBody
().
toJSONString
());
log
.
debug
(
"pullVisitUserQrCode接口返回信息:
"
+
responseEntity
.
getBody
().
toJSONString
());
JieLinkResultDto
<
JSONObject
>
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
JieLinkResultDto
<
JSONObject
>
resultData
=
JSONObject
.
toJavaObject
(
responseEntity
.
getBody
(),
JieLinkResultDto
.
class
);
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
if
(
StringUtils
.
equals
(
resultData
.
getCode
(),
"0"
)){
JSONObject
data
=
resultData
.
getData
();
JSONObject
data
=
resultData
.
getData
();
...
@@ -643,21 +686,24 @@ public class JieLinkServiceImpl implements IJieLinkService {
...
@@ -643,21 +686,24 @@ public class JieLinkServiceImpl implements IJieLinkService {
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
ResponseEntity
<
JSONObject
>
responseEntity
=
restTemplate
.
postForEntity
(
uriAddr
.
toString
(),
httpEntity
,
JSONObject
.
class
);
try
{
try
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
if
(
HttpStatus
.
OK
.
value
()
==
responseEntity
.
getStatusCode
().
value
())
{
log
.
info
(
"syncDeviceInfo接口返回信息:
{0}"
,
responseEntity
.
getBody
().
toJSONString
());
log
.
info
(
"syncDeviceInfo接口返回信息:
"
+
responseEntity
.
getBody
().
toJSONString
());
JSONObject
body
=
responseEntity
.
getBody
();
JSONObject
body
=
responseEntity
.
getBody
();
if
(
StringUtils
.
equals
(
body
.
getString
(
"code"
),
"0"
)){
if
(
StringUtils
.
equals
(
body
.
getString
(
"code"
),
"0"
)){
List
<
Devices
>
devicesList
=
JSONObject
.
parseArray
(
body
.
getString
(
"data"
),
Devices
.
class
);
JSONObject
data
=
body
.
getJSONObject
(
"data"
);
if
(
devicesList
!=
null
&&
!
devicesList
.
isEmpty
()){
if
(
data
.
containsKey
(
"devices"
)
&&
StringUtils
.
isNotBlank
(
data
.
getString
(
"devices"
))){
List
<
Devices
>
searchList
=
devicesService
.
findAll
(
null
);
List
<
Devices
>
devicesList
=
JSONArray
.
parseArray
(
data
.
getJSONArray
(
"devices"
).
toJSONString
(),
Devices
.
class
);
Map
<
String
,
Devices
>
searchMap
=
new
HashMap
<>();
if
(
devicesList
!=
null
&&
!
devicesList
.
isEmpty
()){
for
(
Devices
d:
searchList
){
List
<
Devices
>
searchList
=
devicesService
.
findAll
(
null
);
searchMap
.
put
(
d
.
getDeviceGuid
(),
d
);
Map
<
String
,
Devices
>
searchMap
=
new
HashMap
<>();
}
for
(
Devices
d:
searchList
){
for
(
Devices
inDevice:
devicesList
){
searchMap
.
put
(
d
.
getDeviceGuid
(),
d
);
if
(
searchMap
.
containsKey
(
inDevice
.
getDeviceGuid
())){
}
devicesService
.
merge
(
inDevice
);
for
(
Devices
inDevice:
devicesList
){
}
else
{
if
(
searchMap
.
containsKey
(
inDevice
.
getDeviceGuid
())){
devicesService
.
persist
(
inDevice
);
devicesService
.
merge
(
inDevice
);
}
else
{
devicesService
.
persist
(
inDevice
);
}
}
}
}
}
}
}
...
...
src/main/java/org/rcisoft/sys/sysuser/service/impl/SysUserServiceImpl.java
View file @
a78012e2
...
@@ -11,7 +11,6 @@ import org.rcisoft.core.util.CyCompareToolUtils;
...
@@ -11,7 +11,6 @@ import org.rcisoft.core.util.CyCompareToolUtils;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.integration.jieLink.service.impl.JieLinkServiceImpl
;
import
org.rcisoft.integration.jieLink.service.impl.JieLinkServiceImpl
;
import
org.rcisoft.sys.constant.CyDictCons
;
import
org.rcisoft.sys.dictionary.dao.DictDataRepository
;
import
org.rcisoft.sys.dictionary.dao.DictDataRepository
;
import
org.rcisoft.sys.dictionary.entity.DictData
;
import
org.rcisoft.sys.dictionary.entity.DictData
;
import
org.rcisoft.sys.dictionary.service.DictionaryService
;
import
org.rcisoft.sys.dictionary.service.DictionaryService
;
...
@@ -44,11 +43,11 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -44,11 +43,11 @@ import org.springframework.transaction.annotation.Transactional;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -84,6 +83,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
...
@@ -84,6 +83,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
private
PasswordEncoder
passwordEncoder
;
private
PasswordEncoder
passwordEncoder
;
@Value
(
"${cy.init.password}"
)
@Value
(
"${cy.init.password}"
)
private
String
password
;
private
String
password
;
/**
* 接口密码
*/
@Value
(
"${jieLink.synchronization}"
)
private
boolean
synchronization
;
/**
/**
* 保存 用户表
* 保存 用户表
...
@@ -97,6 +101,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
...
@@ -97,6 +101,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
// 如果传入的sysUser有id,则说明传入的用户为访客,则删除其作为访客的数据
// 如果传入的sysUser有id,则说明传入的用户为访客,则删除其作为访客的数据
if
(
sysUser
.
getBusinessId
()
!=
null
)
{
if
(
sysUser
.
getBusinessId
()
!=
null
)
{
visitPersonRepositorys
.
delSysUser
(
Long
.
valueOf
(
sysUser
.
getBusinessId
()));
visitPersonRepositorys
.
delSysUser
(
Long
.
valueOf
(
sysUser
.
getBusinessId
()));
if
(
synchronization
)
{
if
(!
jieLinkService
.
pushDelUserData
(
sysUser
))
{
try
{
throw
new
CyServiceException
(
500
,
"添加员工失败,请稍后重试"
);
}
finally
{
//手工回滚异常
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
}
}
}
}
// 判断是否存在用户
// 判断是否存在用户
List
<
SysUser
>
userList
=
sysUserRepositorys
.
querySysUsersByPhone
(
sysUser
.
getPhone
());
List
<
SysUser
>
userList
=
sysUserRepositorys
.
querySysUsersByPhone
(
sysUser
.
getPhone
());
...
@@ -109,10 +123,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
...
@@ -109,10 +123,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
}
}
return
new
CyPersistModel
(
1
);
return
new
CyPersistModel
(
1
);
}
else
{
}
else
{
/* //判断手机号在访客中是否重复
if (userList.size() != 0 && userList.get(0).getUserType().equals("1")) {
sysUserRepositorys.delSysUser(Long.valueOf(userList.get(0).getBusinessId()));
}*/
// 新增员工
// 新增员工
if
(
userList
.
size
()
>
0
)
{
if
(
userList
.
size
()
>
0
)
{
throw
new
CyServiceException
(
500
,
"手机号已存在"
);
throw
new
CyServiceException
(
500
,
"手机号已存在"
);
...
@@ -128,14 +138,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
...
@@ -128,14 +138,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
//添加身份
//添加身份
sysUser
.
setIdentity
(
"1"
);
sysUser
.
setIdentity
(
"1"
);
sysUserRepositorys
.
addSysUsers
(
sysUser
);
sysUserRepositorys
.
addSysUsers
(
sysUser
);
/* if (!jieLinkService.pushAddUserData(sysUser)) {
if
(
synchronization
)
{
try {
if
(!
jieLinkService
.
pushAddUserData
(
sysUser
))
{
throw new CyServiceException(500, "添加员工失败,请稍后重试");
try
{
} finally {
throw
new
CyServiceException
(
500
,
"添加员工失败,请稍后重试"
);
//手工回滚异常
}
finally
{
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//手工回滚异常
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
}
}
}
*/
}
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
sysUser
.
getBusinessId
()
+
"的用户表信息"
);
sysUser
.
getBusinessId
()
+
"的用户表信息"
);
return
new
CyPersistModel
(
1
);
return
new
CyPersistModel
(
1
);
...
@@ -147,10 +159,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
...
@@ -147,10 +159,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
**/
**/
@Override
@Override
public
SysUser
persistIsVisitPerson
(
SysUser
sysUser
)
{
public
SysUser
persistIsVisitPerson
(
SysUser
sysUser
)
{
List
<
SysUser
>
visitPersonList
=
visitPersonRepositorys
.
queryVisitPersonByPhone
(
sysUser
.
getPhone
());
List
<
SysUser
>
visitPersonList
=
visitPersonRepositorys
.
queryVisitPersonByPhone
(
sysUser
.
getPhone
());
if
(
visitPersonList
.
size
()
>
0
)
{
if
(
visitPersonList
.
size
()
>
0
)
{
sysUser
.
setBusinessId
(
visitPersonList
.
get
(
0
).
getBusinessId
());
sysUser
.
setBusinessId
(
visitPersonList
.
get
(
0
).
getBusinessId
());
sysUser
.
setPersonId
(
visitPersonList
.
get
(
0
).
getPersonId
());
}
}
return
sysUser
;
return
sysUser
;
}
}
...
@@ -222,14 +234,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
...
@@ -222,14 +234,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
}
}
line
=
sysUserRepositorys
.
updateSysUser
(
sysUser
);
line
=
sysUserRepositorys
.
updateSysUser
(
sysUser
);
// 修改员工和外部系统同步数据
// 修改员工和外部系统同步数据
if
(
sysUser
.
getUserType
().
equals
(
"0"
))
{
if
(
sysUser
.
getUserType
().
equals
(
"0"
)
&&
synchronization
)
{
/* if(!jieLinkService.pushModifyUserData(sysUser))
if
(!
jieLinkService
.
pushModifyUserData
(
sysUser
))
{
try
{
try
{
throw
new
CyServiceException
(
500
,
"修改员工失败,请稍后重试"
);
throw
new
CyServiceException
(
500
,
"修改员工失败,请稍后重试"
);
}
finally
{
}
finally
{
//手工回滚异常
//手工回滚异常
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}*/
}
}
}
}
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
sysUser
.
getBusinessId
()
+
"的用户表信息"
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
sysUser
.
getBusinessId
()
+
"的用户表信息"
);
return
new
CyPersistModel
(
line
);
return
new
CyPersistModel
(
line
);
...
@@ -305,19 +318,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
...
@@ -305,19 +318,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
sysUserIPage
.
getRecords
().
get
(
i
).
setDictLabelByPosition
(
dictLabel
);
sysUserIPage
.
getRecords
().
get
(
i
).
setDictLabelByPosition
(
dictLabel
);
sysUserIPage
.
getRecords
().
get
(
i
).
setDictSort
(
dictSort
);
sysUserIPage
.
getRecords
().
get
(
i
).
setDictSort
(
dictSort
);
}
}
/*
//查询班次id
String nltBz = sysUserIPage.getRecords().get(i).getNltBz();
List<SysDictData> sysDictData1 = sysDictDataRepositorys.queryDataByNltBz(nltBz);
if (sysDictData1.size() != 0) {
//查询班次中文名
String dictLabel = sysDictData1.get(0).getDictLabel();
sysUserIPage.getRecords().get(i).setDictLabelBynltBz(dictLabel);
}
//查询园区id
String address = sysUserIPage.getRecords().get(i).getAddress();
*/
}
}
return
sysUserIPage
;
return
sysUserIPage
;
}
}
...
...
src/main/java/org/rcisoft/sys/sysuser/util/CheckUtil.java
View file @
a78012e2
...
@@ -137,7 +137,7 @@ public class CheckUtil {
...
@@ -137,7 +137,7 @@ public class CheckUtil {
notTrue
.
add
(
"访客手机号不符合规范"
);
notTrue
.
add
(
"访客手机号不符合规范"
);
for
(
String
temp:
userName
){
for
(
String
temp:
userName
){
if
(
temp
.
length
()
>
32
){
if
(
temp
.
length
()
>
32
){
notTrue
.
add
(
"访客姓名
格式错误
"
);
notTrue
.
add
(
"访客姓名
超出32个字符
"
);
continue
;
continue
;
}
}
}
}
...
...
src/main/java/org/rcisoft/sys/visit/controller/VisitInfomationController.java
View file @
a78012e2
...
@@ -235,7 +235,7 @@ public class VisitInfomationController extends CyPaginationController<VisitInfoM
...
@@ -235,7 +235,7 @@ public class VisitInfomationController extends CyPaginationController<VisitInfoM
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
visitInfomationServiceImpl
.
importUserExcel
(
file
,
response
));
visitInfomationServiceImpl
.
importUserExcel
(
file
,
response
));
}
}
@CyOpeLogAnno
(
title
=
"内勤系统-用户管理-导出用户"
,
businessType
=
CyLogTypeEnum
.
EXPORT
)
@CyOpeLogAnno
(
title
=
"内勤系统-用户管理-导出用户"
,
businessType
=
CyLogTypeEnum
.
EXPORT
)
...
...
src/main/java/org/rcisoft/sys/visit/service/impl/VisitUserServiceImpl.java
View file @
a78012e2
...
@@ -22,6 +22,7 @@ import org.rcisoft.sys.visit.service.VisitUserService;
...
@@ -22,6 +22,7 @@ import org.rcisoft.sys.visit.service.VisitUserService;
import
org.rcisoft.sys.wbac.user.dto.ErrorDTO
;
import
org.rcisoft.sys.wbac.user.dto.ErrorDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Isolation
;
...
@@ -214,42 +215,12 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
...
@@ -214,42 +215,12 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
if
(!
flag
)
{
if
(!
flag
)
{
throw
new
CyServiceException
(
500
,
"非模板文件"
);
throw
new
CyServiceException
(
500
,
"非模板文件"
);
}
}
// if (!flag || !CyCompareToolUtils.compareFileName(file, "访客信息", 0, 0)) {
// String errorBefore = "上传模板错误请重新下载!";
// errorText(errorBefore, importUserDTO, maps, fileName);
// try {
// errorTxt.exportTxtPaper(maps, fileName);
// } catch (Exception e) {
// throw new CyServiceException(CyResSvcExcEnum.EXCEL_IMPORT_HEADER_ERROR);
// }
// return importUserDTO;
// }
/** 从excel表中读到数据,有一部分为空值 */
/** 从excel表中读到数据,有一部分为空值 */
List
<
ExportVisitUserDTO
>
sysUserList
=
CyEpExcelUtil
.
importExcel
(
file
,
2
,
1
,
ExportVisitUserDTO
.
class
);
List
<
ExportVisitUserDTO
>
sysUserList
=
CyEpExcelUtil
.
importExcel
(
file
,
2
,
1
,
ExportVisitUserDTO
.
class
);
List
<
ExportVisitUserDTO
>
addUserList
=
new
ArrayList
<>();
List
<
ExportVisitUserDTO
>
addUserList
=
new
ArrayList
<>();
/** 遍历 从Excel表中读到的数据 抛出不合适的数据 */
/** 遍历 从Excel表中读到的数据 抛出不合适的数据 */
//判断整个Excel是不是为空 计算非空数据有多少条
//判断整个Excel是不是为空 计算非空数据有多少条
int
information
=
CyCompareToolUtils
.
cmpareInformation
(
sysUserList
);
int
information
=
CyCompareToolUtils
.
cmpareInformation
(
sysUserList
);
// if (information == 0) {
// String errorBefore = "Excel文件不可为空,请检查Excel文件是否填写!";
// errorText(errorBefore, importUserDTO, maps, fileName);
// try {
// errorTxt.exportTxtPaper(maps, fileName);
// } catch (Exception e) {
// throw new CyServiceException(CyResSvcExcEnum.ERROR_NETWORK);
// }
// return importUserDTO;
// } else if (information > 500) {
// String errorMore = "单次导入数据不可超过500,请检查!";
// errorText(errorMore, importUserDTO, maps, fileName);
// try {
// errorTxt.exportTxtPaper(maps, fileName);
// } catch (Exception e) {
// throw new CyServiceException(CyResSvcExcEnum.ERROR_NETWORK);
// }
// return importUserDTO;
// }
if
(
information
==
0
)
{
if
(
information
==
0
)
{
throw
new
CyServiceException
(
500
,
"Excel文件不可为空,请检查Excel文件是否填写!"
);
throw
new
CyServiceException
(
500
,
"Excel文件不可为空,请检查Excel文件是否填写!"
);
}
else
if
(
information
>
500
)
{
}
else
if
(
information
>
500
)
{
...
@@ -261,8 +232,6 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
...
@@ -261,8 +232,6 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
CyServiceException
(
CyResSvcExcEnum
.
ERROR_NETWORK
);
throw
new
CyServiceException
(
CyResSvcExcEnum
.
ERROR_NETWORK
);
}
}
//校验 将错误信息放入maps
// int index = 3; //从第3行开始
for
(
ExportVisitUserDTO
sysUser
:
sysUserList
)
{
for
(
ExportVisitUserDTO
sysUser
:
sysUserList
)
{
//判断 是否为空
//判断 是否为空
VisitPersonDTO
userNull
=
CheckUtil
.
visvitNotNull
(
sysUser
);
VisitPersonDTO
userNull
=
CheckUtil
.
visvitNotNull
(
sysUser
);
...
@@ -271,7 +240,6 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
...
@@ -271,7 +240,6 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
visitPersonList
.
add
(
userNull
);
visitPersonList
.
add
(
userNull
);
}
else
{
}
else
{
addUserList
.
add
(
sysUser
);
addUserList
.
add
(
sysUser
);
// index++;
if
(
sysUsers
.
size
()
!=
0
)
{
if
(
sysUsers
.
size
()
!=
0
)
{
userNull
.
setError
(
"已有员工绑定此手机号"
);
userNull
.
setError
(
"已有员工绑定此手机号"
);
}
}
...
@@ -322,4 +290,10 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
...
@@ -322,4 +290,10 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
}
}
return
null
;
return
null
;
}
}
@Async
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
public
void
updateTest
(){
}
}
}
src/main/resources/application-common.yml
View file @
a78012e2
...
@@ -17,8 +17,8 @@ mybatis-plus:
...
@@ -17,8 +17,8 @@ mybatis-plus:
db-config
:
db-config
:
logic-delete-value
:
1
# 逻辑已删除值(默认为 1)
logic-delete-value
:
1
# 逻辑已删除值(默认为 1)
logic-not-delete-value
:
0
# 逻辑未删除值(默认为 0)
logic-not-delete-value
:
0
# 逻辑未删除值(默认为 0)
configuration
:
#
configuration:
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
#
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
spring
:
spring
:
main
:
main
:
...
...
src/main/resources/application-dev-conf.yml
View file @
a78012e2
...
@@ -103,3 +103,4 @@ jieLink:
...
@@ -103,3 +103,4 @@ jieLink:
apiUrl
:
http://192.168.18.192:8091
apiUrl
:
http://192.168.18.192:8091
account
:
9999
account
:
9999
pwd
:
123456
pwd
:
123456
synchronization
:
false
src/main/resources/application-prod-conf.yml
View file @
a78012e2
...
@@ -98,3 +98,4 @@ jieLink:
...
@@ -98,3 +98,4 @@ jieLink:
apiUrl
:
http://192.168.18.192:8091
apiUrl
:
http://192.168.18.192:8091
account
:
9999
account
:
9999
pwd
:
123456
pwd
:
123456
synchronization
:
false
src/main/resources/mapper/VisitInfomationMapper.xml
View file @
a78012e2
...
@@ -271,6 +271,7 @@
...
@@ -271,6 +271,7 @@
vi.create_date,
vi.create_date,
vi.visit_reason,
vi.visit_reason,
vi.visit_region,
vi.visit_region,
vi.visit_reason_other,
vi.visit_date,
vi.visit_date,
vi.visit_time,
vi.visit_time,
vi.visit_status,
vi.visit_status,
...
@@ -328,7 +329,7 @@
...
@@ -328,7 +329,7 @@
<select
id=
"queryVisitInfomationsByUserIdPaged"
resultMap=
"BaseResultMap"
>
<select
id=
"queryVisitInfomationsByUserIdPaged"
resultMap=
"BaseResultMap"
>
select
select
vi.business_id,vi.user_name,vi.dept_name,vi.post_name,vi.visit_reason_other,vi.create_date,vi.visit_reason_code,vi.visit_reason,vi.visit_region_code,vi.visit_region,vi.visit_date,vi.visit_time,vi.visit_status,vi.visit_real_time
vi.business_id,vi.user_name,vi.dept_name,vi.post_name,vi.visit_reason_other,vi.create_date,vi.visit_reason_code,vi.visit_reason,vi.visit_region_code,vi.visit_re
ason_other,vi.visit_re
gion,vi.visit_date,vi.visit_time,vi.visit_status,vi.visit_real_time
from visit_infomation vi
from visit_infomation vi
where 1=1 and del_flag = 0
where 1=1 and del_flag = 0
and vi.user_id = #{userId}
and vi.user_id = #{userId}
...
@@ -402,6 +403,7 @@
...
@@ -402,6 +403,7 @@
vi.visit_real_time
vi.visit_real_time
</if>
</if>
</if>
</if>
order by vi.visit_real_time desc
</select>
</select>
<select
id=
"findByUser"
resultType=
"org.rcisoft.sys.visit.entity.VisitInfoMation"
>
<select
id=
"findByUser"
resultType=
"org.rcisoft.sys.visit.entity.VisitInfoMation"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment