Commit 79fe85a8 authored by yangyang's avatar yangyang

fix(人员同步): 增加判断,岗位不为空

parent 6a28c37e
......@@ -2348,7 +2348,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
});
// 添加人员管理角色
String post = tzsUserInfoDto.getPost();
if (post.contains(PersonManageRoleEnum.code.getId().toString())) {
if (post != null && post.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();
......@@ -2374,13 +2374,15 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if (!ObjectUtils.isEmpty(roleGroup) && roleGroup.getExtend() != null) {
Privilege.groupUserClient.create(Long.valueOf(roleGroup.getExtend()), userIds);
}
// 绑定两个规定用户组
post = post.replace("[", "").replace("]", "").replace("\"", "");
for (String code : post.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());
Privilege.groupUserClient.create(Long.valueOf(groupId.getExtend()), userIds);
if (post != null) {
// 绑定两个规定用户组
post = post.replace("[", "").replace("]", "").replace("\"", "");
for (String code : post.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());
Privilege.groupUserClient.create(Long.valueOf(groupId.getExtend()), userIds);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment