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
5a574e05
Commit
5a574e05
authored
May 19, 2025
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG:28890
parent
fbb315c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+25
-21
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/service/impl/TzsUserInfoServiceImpl.java
View file @
5a574e05
...
...
@@ -284,17 +284,17 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getEquipType
()))
{
JSONArray
equipTypeJSONArray
=
JSON
.
parseArray
(
tzsUserInfo
.
getEquipType
());
tzsUserInfoVo
.
setEquipType
(
equipTypeJSONArray
);
if
(
CollUtil
.
isNotEmpty
(
equipTypeJSONArray
))
{
if
(
CollUtil
.
isNotEmpty
(
equipTypeJSONArray
))
{
StringBuilder
equipTypeName
=
new
StringBuilder
();
for
(
Object
o
:
equipTypeJSONArray
)
{
String
s
=
EquipmentClassifityEnum
.
getName
.
get
(
o
);
if
(
StringUtils
.
isEmpty
(
s
))
{
if
(
StringUtils
.
isEmpty
(
s
))
{
s
=
String
.
valueOf
(
o
);
}
equipTypeName
.
append
(
s
);
equipTypeName
.
append
(
","
);
}
tzsUserInfoVo
.
setEquipTypeName
(
equipTypeName
.
substring
(
0
,
equipTypeName
.
length
()-
1
));
tzsUserInfoVo
.
setEquipTypeName
(
equipTypeName
.
substring
(
0
,
equipTypeName
.
length
()
-
1
));
}
}
tzsUserInfoVo
.
setIdentification
(
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getIdentification
())
?
null
:
JSON
.
parseArray
(
tzsUserInfo
.
getIdentification
()));
...
...
@@ -724,13 +724,14 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override
public
List
<
DataDictionary
>
getSubPostByParentsIds
(
String
postIds
)
{
return
iDataDictionaryService
.
lambdaQuery
()
.
in
(
DataDictionary:
:
getParent
,
new
ArrayList
<>(
Arrays
.
asList
(
postIds
.
split
(
","
))))
.
in
(
DataDictionary:
:
getParent
,
new
ArrayList
<>(
Arrays
.
asList
(
postIds
.
split
(
","
))))
.
orderByAsc
(
DataDictionary:
:
getSortNum
)
.
list
();
}
/**
* 人员转出
*
* @param userSeqNbrs 用户seqNbrs,逗号分隔
* @return res
*/
...
...
@@ -752,7 +753,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
.
stream
()
.
map
(
TzsUserInfo:
:
getAmosUserId
)
.
collect
(
Collectors
.
joining
(
","
));
Privilege
.
agencyUserClient
.
multDeleteUser
(
deleteUserIds
);
Optional
.
of
(
deleteUserIds
)
.
filter
(
ids
->
!
ObjectUtils
.
isEmpty
(
ids
))
.
ifPresent
(
ids
->
Privilege
.
agencyUserClient
.
multDeleteUser
(
ids
));
return
Boolean
.
TRUE
;
}
...
...
@@ -767,9 +770,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
.
eq
(
TzsUserInfo:
:
getIsDelete
,
Boolean
.
FALSE
)
).
size
();
return
JSONObject
.
parseObject
(
String
.
format
(
TOTALTYPESTEMPLATE
,
total
));
}
else
if
(
"subType"
.
equals
(
type
))
{
}
else
if
(
"subType"
.
equals
(
type
))
{
ArrayList
<
JSONObject
>
jsonObjects
=
this
.
getSubTypeCount
(
companyCode
);
return
new
JSONObject
().
fluentPut
(
"records"
,
jsonObjects
);
return
new
JSONObject
().
fluentPut
(
"records"
,
jsonObjects
);
}
return
null
;
}
...
...
@@ -797,7 +800,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
});
return
new
JSONObject
().
fluentPut
(
"records"
,
Arrays
.
asList
(
new
JSONObject
()
.
fluentPut
(
"name"
,
dictionary
.
getName
()+
"(人)"
)
.
fluentPut
(
"name"
,
dictionary
.
getName
()
+
"(人)"
)
.
fluentPut
(
"value"
,
tzsUserInfoMapper
.
selectList
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
select
(
TzsUserInfo:
:
getSequenceNbr
)
.
eq
(
TzsUserInfo:
:
getUnitCode
,
companyCode
)
...
...
@@ -819,7 +822,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
.
like
(
TzsUserInfo:
:
getNewPost
,
postCode
)
.
eq
(
TzsUserInfo:
:
getIsDelete
,
Boolean
.
FALSE
)
).
size
();
jsonObjects
.
add
(
new
JSONObject
().
fluentPut
(
"name"
,
item
.
getName
()
+
"(人)"
).
fluentPut
(
"value"
,
size
));
jsonObjects
.
add
(
new
JSONObject
().
fluentPut
(
"name"
,
item
.
getName
()
+
"(人)"
).
fluentPut
(
"value"
,
size
));
});
return
jsonObjects
;
}
...
...
@@ -909,7 +912,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
private
String
castNoPermissionData
(
String
type
,
String
permissionStatus
)
{
// 历史数据处理:之前检验人员、检测人员、作业人员资质为非必输,调整为必输后,数据为空时打标记为<资质不全>
if
((
type
.
equals
(
"jy"
)
||
type
.
equals
(
"jc"
)
||
type
.
equals
(
"zyry"
))
&&
"无资质要求"
.
equals
(
permissionStatus
))
{
if
((
type
.
equals
(
"jy"
)
||
type
.
equals
(
"jc"
)
||
type
.
equals
(
"zyry"
))
&&
"无资质要求"
.
equals
(
permissionStatus
))
{
return
"资质不全"
;
}
return
permissionStatus
;
...
...
@@ -1078,7 +1081,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
throw
new
BadRequest
(
"该用户手机号已被其他单位人员绑定!"
);
}
//删除人员与组的关系
//
删除人员与组的关系
QueryWrapper
<
TzsUserInfo
>
queryWrapper2
=
new
QueryWrapper
<>();
queryWrapper2
.
eq
(
"sequence_nbr"
,
rowId
);
queryWrapper2
.
eq
(
"is_delete"
,
false
);
...
...
@@ -1240,9 +1243,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
// 3.2部分类型用户平台创建人员
this
.
createAmosUser
(
userInfoMap
,
userSet
);
}
catch
(
Exception
e
)
{
if
(!
userInfoMap
.
values
().
isEmpty
())
{
if
(!
userInfoMap
.
values
().
isEmpty
())
{
List
<
String
>
userIds
=
userInfoMap
.
values
().
stream
().
map
(
TzsUserInfo:
:
getAmosUserId
).
filter
(
StringUtils:
:
isNotEmpty
).
collect
(
Collectors
.
toList
());
for
(
String
userId
:
userIds
)
{
for
(
String
userId
:
userIds
)
{
// 单个删除,平台接口删除时,判断了有才能删除,匹配删除可能存在某个用户不存在导致删除失败
try
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
userId
);
...
...
@@ -1280,9 +1283,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}
private
void
bindUserToGroup
(
Collection
<
TzsUserInfo
>
values
)
{
List
<
String
>
userIds
=
values
.
stream
().
map
(
TzsUserInfo:
:
getAmosUserId
).
filter
(
StringUtils:
:
isNotEmpty
).
collect
(
Collectors
.
toList
());
List
<
String
>
userIds
=
values
.
stream
().
map
(
TzsUserInfo:
:
getAmosUserId
).
filter
(
StringUtils:
:
isNotEmpty
).
collect
(
Collectors
.
toList
());
try
{
if
(!
userIds
.
isEmpty
())
{
if
(!
userIds
.
isEmpty
())
{
// 绑定企业整改用户组
String
roleGroupCode
=
"6596"
;
DataDictionary
roleGroup
=
iDataDictionaryService
...
...
@@ -1291,7 +1294,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
Privilege
.
groupUserClient
.
create
(
Long
.
valueOf
(
roleGroup
.
getExtend
()),
userIds
);
}
// 绑定两个规定用户组
for
(
TzsUserInfo
userInfo
:
values
)
{
for
(
TzsUserInfo
userInfo
:
values
)
{
String
newPost
=
userInfo
.
getPost
();
List
<
String
>
posts
=
Optional
.
ofNullable
(
JSONArray
.
parseArray
(
newPost
,
String
.
class
)).
orElse
(
new
ArrayList
<>());
for
(
String
code
:
posts
)
{
...
...
@@ -1307,6 +1310,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
/**
* 两个规定用户组绑定
*
* @param userIds 用户id
* @param post 人员类型
*/
...
...
@@ -1406,8 +1410,8 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
String
companyType
=
companyModel
.
getCompanyType
();
// 增加约束,增加的人的单位类型不能大于单位的单位类型
boolean
existIllegalUnitType
=
userImportDto
.
getUnitTypePostMap
().
keySet
().
stream
().
anyMatch
(
u
->
!
companyType
.
contains
(
u
));
if
(
existIllegalUnitType
)
{
throw
new
BadRequest
(
"导入的用户:"
+
tzsUserInfo
.
getName
()
+
",手机号:"
+
tzsUserInfo
.
getPhone
()
+
",公司类型只能为:"
+
companyType
+
"之一!"
);
if
(
existIllegalUnitType
)
{
throw
new
BadRequest
(
"导入的用户:"
+
tzsUserInfo
.
getName
()
+
",手机号:"
+
tzsUserInfo
.
getPhone
()
+
",公司类型只能为:"
+
companyType
+
"之一!"
);
}
}
...
...
@@ -1460,9 +1464,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
&&
StringUtils
.
isNotEmpty
(
userResult
.
getResult
().
getUserId
()))
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
userResult
.
getResult
().
getUserId
());
}
if
(
e
instanceof
InnerInvokException
)
{
if
(
e
instanceof
InnerInvokException
)
{
String
message
=
e
.
getLocalizedMessage
();
if
(
StringUtils
.
isNotEmpty
(
message
)
&&
message
.
contains
(
"用户名已存在"
))
{
if
(
StringUtils
.
isNotEmpty
(
message
)
&&
message
.
contains
(
"用户名已存在"
))
{
throw
new
BadRequest
(
"手机号:"
+
tzsUserInfo
.
getPhone
()
+
"已经被使用,请更换!"
);
}
}
...
...
@@ -1476,7 +1480,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
companyModel
=
companyCodeCompanyMap
.
get
(
tzsUserInfo
.
getUnitCode
());
}
else
{
companyModel
=
baseEnterpriseInfoService
.
getBaseMapper
().
getOneByCompanyCode
(
tzsUserInfo
.
getUnitCode
());
if
(
companyModel
==
null
)
{
if
(
companyModel
==
null
)
{
throw
new
BadRequest
(
"单位统一信用代码为:"
+
tzsUserInfo
.
getUnitCode
()
+
"的单位还未进行注册,请确认数据是否正确!"
);
}
companyCodeCompanyMap
.
put
(
tzsUserInfo
.
getUnitCode
(),
companyModel
);
...
...
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