Commit 79fe85a8 authored by yangyang's avatar yangyang

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

parent 6a28c37e
...@@ -2348,7 +2348,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -2348,7 +2348,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}); });
// 添加人员管理角色 // 添加人员管理角色
String post = tzsUserInfoDto.getPost(); 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); CompanyModel companyModel = Optional.ofNullable(Privilege.companyClient.seleteOne(companySeq)).map(FeignClientResult::getResult).orElse(null);
if (!ValidationUtil.isEmpty(companyModel)) { if (!ValidationUtil.isEmpty(companyModel)) {
String companyType = companyModel.getCompanyType(); String companyType = companyModel.getCompanyType();
...@@ -2374,13 +2374,15 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -2374,13 +2374,15 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if (!ObjectUtils.isEmpty(roleGroup) && roleGroup.getExtend() != null) { if (!ObjectUtils.isEmpty(roleGroup) && roleGroup.getExtend() != null) {
Privilege.groupUserClient.create(Long.valueOf(roleGroup.getExtend()), userIds); Privilege.groupUserClient.create(Long.valueOf(roleGroup.getExtend()), userIds);
} }
// 绑定两个规定用户组 if (post != null) {
post = post.replace("[", "").replace("]", "").replace("\"", ""); // 绑定两个规定用户组
for (String code : post.split(",")) { post = post.replace("[", "").replace("]", "").replace("\"", "");
DataDictionary groupId = iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getCode, code).likeRight(DataDictionary::getType, QYRYGW)); for (String code : post.split(",")) {
if (!ObjectUtils.isEmpty(groupId) && groupId.getExtend() != null) { DataDictionary groupId = iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getCode, code).likeRight(DataDictionary::getType, QYRYGW));
Privilege.groupUserClient.deleteGroupUser(Long.valueOf(groupId.getExtend()), userResult.getResult().getUserId()); if (!ObjectUtils.isEmpty(groupId) && groupId.getExtend() != null) {
Privilege.groupUserClient.create(Long.valueOf(groupId.getExtend()), userIds); 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