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
95c60ba6
Commit
95c60ba6
authored
Nov 27, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FLC 监管端人员更新接口
parent
bddb2076
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
0 deletions
+136
-0
IUnitPersonService.java
...s/boot/module/tzs/flc/api/service/IUnitPersonService.java
+2
-0
UnitPersonController.java
...t/module/tzs/flc/biz/controller/UnitPersonController.java
+12
-0
UnitPersonServiceImpl.java
...odule/tzs/flc/biz/service/impl/UnitPersonServiceImpl.java
+122
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IUnitPersonService.java
View file @
95c60ba6
...
...
@@ -24,4 +24,6 @@ public interface IUnitPersonService {
UnitPersonInfoDto
saveSupUser
(
UnitPersonInfoDto
unitPersonInfoDto
);
UnitPersonInfoDto
updateUser
(
UnitPersonInfoDto
unitPersonInfoDto
);
UnitPersonInfoDto
updateSupUser
(
UnitPersonInfoDto
unitPersonInfoDto
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/UnitPersonController.java
View file @
95c60ba6
...
...
@@ -372,6 +372,18 @@ public class UnitPersonController extends BaseController {
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
updateUser
(
unitPersonInfoDto
));
}
/**
* 更新监管端人员信息
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateSupUser"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新监管端人员信息"
,
notes
=
"更新监管端人员信息"
)
public
ResponseModel
<?>
updateSupUser
(
@RequestBody
UnitPersonInfoDto
unitPersonInfoDto
)
{
return
ResponseHelper
.
buildResponse
(
iUnitPersonService
.
updateSupUser
(
unitPersonInfoDto
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/UnitPersonServiceImpl.java
View file @
95c60ba6
...
...
@@ -486,6 +486,128 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
@Transactional
@Override
public
UnitPersonInfoDto
updateSupUser
(
UnitPersonInfoDto
unitPersonInfoDto
)
{
unitPersonInfoDto
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
OrgPersonDto
orgPersonVo
=
new
OrgPersonDto
();
if
(
StringUtils
.
isNotBlank
(
unitPersonInfoDto
.
getOrgExpandAttr2
()))
{
String
pwd
=
DesUtil
.
encode
(
unitPersonInfoDto
.
getOrgExpandAttr2
(),
"qaz"
);
unitPersonInfoDto
.
setOrgExpandAttr2
(
pwd
);
}
// 只有parentId 需要手动填充name
FeignClientResult
<
CompanyModel
>
company
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
parseLong
(
unitPersonInfoDto
.
getParentId
()));
if
(
company
==
null
||
company
.
getResult
()
==
null
)
{
throw
new
BadRequest
(
"所在单位选择有误"
);
}
unitPersonInfoDto
.
setParentName
(
company
.
getResult
().
getCompanyName
());
BeanUtils
.
copyProperties
(
unitPersonInfoDto
,
orgPersonVo
);
try
{
iOrgUsrService
.
updateByIdOrgPersonFlc
(
orgPersonVo
,
unitPersonInfoDto
.
getSequenceNbr
());
PersonQualityDto
personQualityDto
=
unitPersonInfoDto
.
getPersonQualityDto
();
PersonEducationDto
personEducationDto
=
unitPersonInfoDto
.
getPersonEducationDto
();
// 处理图片信息 -- 证照和图片
Map
<
String
,
List
<
AttachmentDto
>>
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
LICENCE_PIC
,
unitPersonInfoDto
.
getLicencePic
());
userAttach
.
put
(
TzsCommonParam
.
HEAD_SHOT
,
unitPersonInfoDto
.
getHeadshot
());
iSourceFileService
.
saveAttachments
(
unitPersonInfoDto
.
getSequenceNbr
(),
userAttach
);
if
(
personQualityDto
!=
null
)
{
String
[]
licenceTypeCode
=
personQualityDto
.
getLicenceTypeCode
().
split
(
","
);
List
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getIsDelete
,
false
).
in
(
DataDictionary:
:
getCode
,
licenceTypeCode
));
String
licenceType
=
""
;
for
(
DataDictionary
temp
:
list
)
{
licenceType
+=
","
+
temp
.
getName
();
}
if
(
licenceType
.
length
()
>
0
)
{
licenceType
=
licenceType
.
substring
(
1
);
personQualityDto
.
setLicenceType
(
licenceType
);
}
// 更新人员资质信息
personQualityDto
.
setPsersonId
(
unitPersonInfoDto
.
getSequenceNbr
());
personQualityDto
=
flcPersonQualityServiceImpl
.
updateWithModel
(
personQualityDto
);
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
LICENCE_INFO
,
personQualityDto
.
getLicenceInfo
());
iSourceFileService
.
saveAttachments
(
personQualityDto
.
getSequenceNbr
(),
userAttach
);
unitPersonInfoDto
.
setPersonQualityDto
(
personQualityDto
);
}
if
(
personEducationDto
!=
null
)
{
// 更新人员教育信息
personEducationDto
.
setPsersonId
(
unitPersonInfoDto
.
getSequenceNbr
());
personEducationDto
=
personEducationServiceImpl
.
updateWithModel
(
personEducationDto
);
userAttach
=
new
HashMap
<>();
userAttach
.
put
(
TzsCommonParam
.
ATTACHMENT
,
personEducationDto
.
getAttachment
());
iSourceFileService
.
saveAttachments
(
personEducationDto
.
getSequenceNbr
(),
userAttach
);
unitPersonInfoDto
.
setPersonEducationDto
(
personEducationDto
);
}
// 更新账号信息
if
(
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr1
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr2
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr3
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr4
())
&&
StringUtils
.
isNotEmpty
(
unitPersonInfoDto
.
getOrgExpandAttr5
()
))
{
String
roleName
=
unitPersonInfoDto
.
getOrgExpandAttr5
();
Long
companyId
=
Long
.
parseLong
(
unitPersonInfoDto
.
getOrgExpandAttr3
());
String
appcode
=
unitPersonInfoDto
.
getOrgExpandAttr4
();
// 创建人员账户信息
FeignClientResult
<
List
<
RoleModel
>>
roleListResult
=
Privilege
.
roleClient
.
queryRoleList
(
null
,
null
);
AgencyUserModel
agencyUserModel
=
Privilege
.
agencyUserClient
.
queryByUserId
(
orgPersonVo
.
getAmosOrgId
()).
getResult
();
agencyUserModel
.
setUserName
(
unitPersonInfoDto
.
getOrgExpandAttr1
());
agencyUserModel
.
setRealName
(
unitPersonInfoDto
.
getBizOrgName
());
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
agencyUserModel
.
setPassword
(
unitPersonInfoDto
.
getOrgExpandAttr2
());
agencyUserModel
.
setRePassword
(
unitPersonInfoDto
.
getOrgExpandAttr2
());
agencyUserModel
.
setAgencyCode
(
"tzs"
);
// agencyUserModel.setMobile(adminTel); 不存储电话信息
// 所属组织
Map
<
Long
,
List
<
Long
>>
roleSeqsMap
=
new
HashMap
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
List
<
RoleModel
>
allRoleList
=
roleListResult
.
getResult
();
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
allRoleList
.
stream
().
forEach
(
t
->
{
if
(
t
.
getRoleName
().
equals
(
roleName
))
{
userRoleList
.
add
(
t
);
}
});
userRoleList
.
stream
().
forEach
(
r
->
{
roleIds
.
add
(
r
.
getSequenceNbr
());
});
roleSeqsMap
.
put
(
companyId
,
roleIds
);
List
<
String
>
appCodes
=
new
ArrayList
<>();
appCodes
.
add
(
appcode
);
agencyUserModel
.
setAppCodes
(
appCodes
);
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
orgRoles
.
put
(
companyId
,
userRoleList
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqsMap
);
Privilege
.
agencyUserClient
.
update
(
agencyUserModel
,
orgPersonVo
.
getAmosOrgId
());
// 密码另外更新
Privilege
.
agencyUserClient
.
modifyPassword
(
orgPersonVo
.
getAmosOrgId
(),
agencyUserModel
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
unitPersonInfoDto
;
}
@Transactional
@Override
public
UnitPersonInfoDto
updateUser
(
UnitPersonInfoDto
unitPersonInfoDto
)
{
unitPersonInfoDto
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
OrgPersonDto
orgPersonVo
=
new
OrgPersonDto
();
...
...
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