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
1a19b06c
Commit
1a19b06c
authored
Aug 08, 2025
by
hcing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tcm): 绑定系统账号,按照人员类型,添加风险报送员的角色
parent
9564c118
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
15 deletions
+47
-15
PersonManageRoleEnum.java
.../amos/boot/module/tcm/api/enums/PersonManageRoleEnum.java
+8
-1
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+39
-14
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/enums/PersonManageRoleEnum.java
View file @
1a19b06c
...
...
@@ -12,6 +12,7 @@ public enum PersonManageRoleEnum {
/**
* 人员管理角色枚举
*/
// 业务办理人员 -> 6616
code
(
"人员管理角色字典code"
,
6616L
),
use
(
"使用单位"
,
1735591519093547010L
),
...
...
@@ -23,7 +24,13 @@ public enum PersonManageRoleEnum {
// jyjc("检验检测机构", 1735590873120399362L);
jyjg
(
"检验机构"
,
1947231335688990722L
),
jcjg
(
"检测机构"
,
1947231362847109122L
);
jcjg
(
"检测机构"
,
1947231362847109122L
),
/**
* 风险报送员
*/
risk_code
(
"风险报送员"
,
6766L
),
fxbsy
(
"风险报送员"
,
1953650773397106689L
);
String
name
;
Long
id
;
...
...
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 @
1a19b06c
...
...
@@ -530,11 +530,17 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
// 添加人员管理角色
String
post
=
tzsUserInfo
.
getPost
();
if
(
post
.
contains
(
PersonManageRoleEnum
.
code
.
getId
().
toString
()))
{
String
newPostStr
=
tzsUserInfo
.
getNewPost
();
if
(
newPostStr
!=
null
)
{
JSONArray
newPost
=
JSON
.
parseArray
(
newPostStr
);
if
(
newPost
.
contains
(
PersonManageRoleEnum
.
code
.
getId
().
toString
()))
{
String
companyType
=
tzsUserInfoMapper
.
selectCompanyTypeById
(
companySeq
);
setBizOperateUserRole
(
companyType
,
roleIds
);
}
if
(
newPost
.
contains
(
PersonManageRoleEnum
.
risk_code
.
getId
().
toString
()))
{
setBizOperateUserRoleWithPost
(
newPost
,
roleIds
);
}
}
Map
<
Long
,
List
<
Long
>>
roleSeqMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
...
...
@@ -558,8 +564,8 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
Privilege
.
groupUserClient
.
create
(
Long
.
valueOf
(
roleGroup
.
getExtend
()),
userIds
);
}
// 绑定两个规定用户组
post
=
post
.
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replace
(
"\""
,
""
);
for
(
String
code
:
post
.
split
(
","
))
{
newPostStr
=
newPostStr
.
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replace
(
"\""
,
""
);
for
(
String
code
:
newPostStr
.
split
(
","
))
{
bind2PermissionGroup
(
userIds
,
code
);
}
tzsUserInfoMapper
.
updateById
(
tzsUserInfo
);
...
...
@@ -2098,10 +2104,16 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
agencyUserModel
.
setMobile
(
tzsUserInfo
.
getPhone
());
agencyUserModel
.
setEmail
(
tzsUserInfo
.
getEmail
());
// 添加业务办理人员角色
String
post
=
tzsUserInfo
.
getPost
();
if
(
post
.
contains
(
PersonManageRoleEnum
.
code
.
getId
().
toString
()))
{
String
newPostStr
=
tzsUserInfo
.
getNewPost
();
if
(
newPostStr
!=
null
)
{
JSONArray
newPost
=
JSON
.
parseArray
(
newPostStr
);
if
(
newPost
.
contains
(
PersonManageRoleEnum
.
code
.
getId
().
toString
()))
{
setBizOperateUserRole
(
companyType
,
roleIds
);
}
if
(
newPost
.
contains
(
PersonManageRoleEnum
.
risk_code
.
getId
().
toString
()))
{
setBizOperateUserRoleWithPost
(
newPost
,
roleIds
);
}
}
Map
<
Long
,
List
<
Long
>>
roleSeqMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
roleSeqMap
.
put
(
companyModel
.
getSequenceNbr
(),
roleIds
);
...
...
@@ -2455,14 +2467,20 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}
});
// 添加人员管理角色
String
post
=
tzsUserInfoDto
.
getPost
();
if
(
post
!=
null
&&
post
.
contains
(
PersonManageRoleEnum
.
code
.
getId
().
toString
()))
{
String
newPostStr
=
tzsUserInfoDto
.
getNewPost
();
if
(
newPostStr
!=
null
)
{
JSONArray
newPost
=
JSON
.
parseArray
(
newPostStr
);
if
(
newPost
.
contains
(
PersonManageRoleEnum
.
code
.
getId
().
toString
()))
{
CompanyModel
companyModel
=
Optional
.
ofNullable
(
Privilege
.
companyClient
.
seleteOne
(
companySeq
)).
map
(
FeignClientResult:
:
getResult
).
orElse
(
null
);
if
(!
ValidationUtil
.
isEmpty
(
companyModel
))
{
String
companyType
=
companyModel
.
getCompanyType
();
setBizOperateUserRole
(
companyType
,
roleIds
);
}
}
if
(
newPost
.
contains
(
PersonManageRoleEnum
.
risk_code
.
getId
().
toString
()))
{
setBizOperateUserRoleWithPost
(
newPost
,
roleIds
);
}
}
Map
<
Long
,
List
<
Long
>>
roleSeqMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
roleSeqMap
.
put
(
companySeq
,
roleIds
);
...
...
@@ -2482,10 +2500,10 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if
(!
ObjectUtils
.
isEmpty
(
roleGroup
)
&&
roleGroup
.
getExtend
()
!=
null
)
{
Privilege
.
groupUserClient
.
create
(
Long
.
valueOf
(
roleGroup
.
getExtend
()),
userIds
);
}
if
(
post
!=
null
)
{
if
(
newPostStr
!=
null
)
{
// 绑定两个规定用户组
post
=
post
.
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replace
(
"\""
,
""
);
for
(
String
code
:
post
.
split
(
","
))
{
newPostStr
=
newPostStr
.
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replace
(
"\""
,
""
);
for
(
String
code
:
newPostStr
.
split
(
","
))
{
DataDictionary
groupId
=
iDataDictionaryService
.
getOne
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getCode
,
code
).
likeRight
(
DataDictionary:
:
getType
,
QYRYGW
));
if
(!
ObjectUtils
.
isEmpty
(
groupId
)
&&
groupId
.
getExtend
()
!=
null
)
{
Privilege
.
groupUserClient
.
deleteGroupUser
(
Long
.
valueOf
(
groupId
.
getExtend
()),
userResult
.
getResult
().
getUserId
());
...
...
@@ -2496,6 +2514,12 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}
}
private
void
setBizOperateUserRoleWithPost
(
JSONArray
newPost
,
List
<
Long
>
roleIds
)
{
if
(
newPost
.
contains
(
PersonManageRoleEnum
.
risk_code
.
getId
().
toString
()))
{
roleIds
.
add
(
PersonManageRoleEnum
.
fxbsy
.
getId
());
}
}
public
void
refreshAdminUserRole
(
List
<
TzsUserInfo
>
userInfos
,
List
<
String
>
userId
)
{
List
<
String
>
adminUserIdList
;
if
(
ValidationUtil
.
isEmpty
(
userInfos
))
{
...
...
@@ -2628,10 +2652,11 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
// 监管查询自己单位下 + 管辖辖区下的数据
if
(
companyType
.
equals
(
BaseController
.
COMPANY_TYPE_SUPERVISION
))
{
// 和综合统计处查询逻辑保持一致
BoolQueryBuilder
meBuilder
=
QueryBuilders
.
boolQuery
();
meBuilder
.
should
(
QueryBuilders
.
termQuery
(
"unitCode"
,
company
.
getCompanyCode
()));
meBuilder
.
should
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
company
.
getOrgCode
()));
meBuilder
.
minimumShouldMatch
(
1
);
//
meBuilder.should(QueryBuilders.termQuery("unitCode", company.getCompanyCode()));
meBuilder
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode"
,
company
.
getOrgCode
()));
//
meBuilder.minimumShouldMatch(1);
boolMust
.
must
(
meBuilder
);
}
...
...
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