Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
174d798c
Commit
174d798c
authored
Jul 30, 2025
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(编辑企业信息): 新增手动刷新用户组的接口
parent
35e87aeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
8 deletions
+63
-8
TzsUserInfoController.java
...boot/module/tcm/biz/controller/TzsUserInfoController.java
+8
-0
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+55
-8
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzsUserInfoController.java
View file @
174d798c
...
...
@@ -495,4 +495,12 @@ public class TzsUserInfoController extends BaseController {
public
ResponseModel
<
String
>
deletePersonSubtypeHistoricalData
()
{
return
ResponseHelper
.
buildResponse
(
tzsUserInfoService
.
deletePersonSubtypeHistoricalData
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/refreshUserGroupInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"同步人员信息"
,
notes
=
"同步人员信息"
)
public
ResponseModel
<
TzsUserInfoDto
>
refreshUserInfo
(
@RequestBody
List
<
String
>
userIds
)
{
tzsUserInfoServiceImpl
.
refreshUserGroupInfo
(
userIds
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
View file @
174d798c
...
...
@@ -46,6 +46,7 @@ import com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserInfoService;
import
com.yeejoin.amos.boot.module.tcm.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.tcm.api.vo.TzsUserInfoVo
;
import
com.yeejoin.amos.boot.module.tcm.api.vo.UserInfoVo
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.entity.RegUnitInfo
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitInfoServiceImpl
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -72,6 +73,7 @@ import org.springframework.util.ObjectUtils;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
...
@@ -2320,6 +2322,16 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}
private
void
syncNewPost
(
TzsUserInfoDto
tzsUserInfoDto
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
return
;
}
Long
companySeq
=
reginParams
.
getCompany
().
getSequenceNbr
();
List
<
String
>
appCodesSet
=
reginParams
.
getUserModel
().
getAppCodes
();
syncNewPost
(
tzsUserInfoDto
,
companySeq
,
appCodesSet
);
}
private
void
syncNewPost
(
TzsUserInfoDto
tzsUserInfoDto
,
Long
companySeq
,
List
<
String
>
appCodesSet
)
{
System
.
out
.
println
(
tzsUserInfoDto
);
// tzs_user_info;
if
(
ValidationUtil
.
isEmpty
(
tzsUserInfoDto
.
getAmosUserId
()))
{
...
...
@@ -2329,13 +2341,10 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if
(
userFeignClientResult
==
null
||
userFeignClientResult
.
getResult
()
==
null
)
{
return
;
}
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
return
;
}
List
<
DataDictionary
>
dataDictionaries
=
iDataDictionaryService
.
lambdaQuery
()
.
in
(
DataDictionary:
:
getType
,
Arrays
.
asList
(
"QYRYJS"
,
"QYRYYHZ"
))
.
eq
(
DataDictionary:
:
getIsDelete
,
false
).
list
();
.
in
(
DataDictionary:
:
getType
,
Arrays
.
asList
(
"QYRYJS"
,
"QYRYYHZ"
))
.
eq
(
DataDictionary:
:
getIsDelete
,
false
).
list
();
List
<
DataDictionary
>
qyrygwList
=
dataDictionaries
.
stream
().
filter
(
item
->
"QYRYJS"
.
equals
(
item
.
getType
())).
collect
(
Collectors
.
toList
());
List
<
DataDictionary
>
qyryyhzList
=
dataDictionaries
.
stream
().
filter
(
item
->
"QYRYYHZ"
.
equals
(
item
.
getType
())).
collect
(
Collectors
.
toList
());
...
...
@@ -2343,8 +2352,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
String
roles
=
qyrygwList
.
get
(
0
).
getCode
();
String
roleGroupCode
=
qyryyhzList
.
get
(
0
).
getCode
();
Long
companySeq
=
reginParams
.
getCompany
().
getSequenceNbr
();
List
<
String
>
appCodesSet
=
reginParams
.
getUserModel
().
getAppCodes
();
List
<
RoleModel
>
allRoleList
=
new
ArrayList
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
DataDictionary
unitType
=
iDataDictionaryService
.
getOne
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getCode
,
roles
).
eq
(
DataDictionary:
:
getType
,
USER_ROLE
));
...
...
@@ -2397,4 +2404,44 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}
}
}
public
void
refreshUserGroupInfo
(
List
<
String
>
userId
)
{
if
(
ObjectUtils
.
isEmpty
(
userId
))
{
return
;
}
// 根据userId获取用户
List
<
TzsUserInfo
>
userInfos
=
tzsUserInfoMapper
.
selectList
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
in
(
TzsUserInfo:
:
getAmosUserId
,
userId
));
if
(
ObjectUtils
.
isEmpty
(
userInfos
))
{
return
;
}
List
<
String
>
unitCodes
=
userInfos
.
stream
().
map
(
TzsUserInfo:
:
getUnitCode
).
collect
(
Collectors
.
toList
());
List
<
RegUnitInfo
>
regUnitInfos
=
regUnitInfoService
.
lambdaQuery
().
in
(
RegUnitInfo:
:
getUnitCode
,
unitCodes
).
list
();
String
adminUserIds
=
regUnitInfos
.
stream
().
map
(
RegUnitInfo:
:
getAdminUserId
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
joining
(
","
));
List
<
AgencyUserModel
>
userList
=
Privilege
.
agencyUserClient
.
queryByIds
(
adminUserIds
,
true
).
getResult
();
Map
<
String
,
AgencyUserModel
>
userModelMap
=
userList
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
x
->
x
,
(
oldValue
,
newValue
)
->
newValue
));
Map
<
String
,
RegUnitInfo
>
regUnitInfoMap
=
regUnitInfos
.
stream
().
collect
(
Collectors
.
toMap
(
RegUnitInfo:
:
getUnitCode
,
x
->
x
,
(
oldValue
,
newValue
)
->
newValue
));
for
(
TzsUserInfo
userInfo
:
userInfos
)
{
// 更新人员信息同步平台
TzsUserInfoDto
tzsUserInfoDto
=
new
TzsUserInfoDto
();
Bean
.
toModel
(
userInfo
,
tzsUserInfoDto
);
RegUnitInfo
regUnitInfo
=
regUnitInfoMap
.
get
(
tzsUserInfoDto
.
getUnitCode
());
if
(
regUnitInfo
==
null
||
StringUtils
.
isEmpty
(
regUnitInfo
.
getAdminUserId
()))
{
continue
;
}
AgencyUserModel
adminUserModel
=
userModelMap
.
get
(
regUnitInfo
.
getAdminUserId
());
if
(
adminUserModel
==
null
)
{
continue
;
}
Long
companySeq
=
Long
.
valueOf
(
regUnitInfo
.
getAmosCompanySeq
());
List
<
String
>
appCodesSet
=
adminUserModel
.
getAppCodes
();
// 根据post同步平台的用户组
syncNewPost
(
tzsUserInfoDto
,
companySeq
,
appCodesSet
);
}
}
}
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