Commit ecfa886e authored by yangyang's avatar yangyang

fix(经销商人员管理): fixed bug 20138

parent 987fa649
......@@ -211,6 +211,13 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
FeignClientResult<AgencyUserModel> userResult =null;
try {
List<Long> newRole = userDataZHDto.getRole();
List<Long> oldRole = JSONArray.parseArray(publicAgencyUser.getRole(), Long.class);
for(Long item: oldRole) {
if(!newRole.contains(item)){
throw new BadRequest("角色只能增加, 不能删除");
}
}
// 1 修改平台用户
List<RoleModel> userRoleList = new ArrayList<>();
AgencyUserModel agencyUserModel = new AgencyUserModel();
......
......@@ -981,7 +981,22 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
userEmpowerMapper.insert(stdUserEmpower);
}
// region 同步平台的单位信息
QueryWrapper<PersonnelBusiness> personnelBusinessWrapper = new QueryWrapper<>();
personnelBusinessWrapper.eq("amos_unit_id", unitInfo.getAmosCompanySeq());
List<PersonnelBusiness> personnelBusiness = personnelBusinessMapper.selectList(personnelBusinessWrapper);
Long amosDealerId = personnelBusiness.get(0).getAmosDealerId();
FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.seleteOne(amosDealerId);
if (companyResult == null || companyResult.getStatus() != 200) {
throw new BadRequest("修改单位失败!" + companyResult.getDevMessage());
}
CompanyModel updateCompanyModel = companyResult.getResult();
updateCompanyModel.setCompanyName(unitInfo.getName());
FeignClientResult<CompanyModel> companyUpdateResult = Privilege.companyClient.update(updateCompanyModel, amosDealerId);
if (companyUpdateResult == null || companyUpdateResult.getStatus() != 200) {
throw new BadRequest("修改单位失败!" + companyResult.getDevMessage());
}
// endregion
return true;
}
......
......@@ -430,6 +430,16 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
PersonAccount oldpersonAccount = new PersonAccount();
personUser.setPhone(personAccount.getPhoneNum());
oldpersonAccount = personAccountService.getById(personAccount.getSequenceNbr());
// region 判断工号是否存在
if (!personAccount.getJobNumber().equals(oldpersonAccount.getJobNumber())) {
List<Map<String, Object>> maps = privilegeCompanyMapper.selectJobNumIsExist(personAccount.getJobNumber());
if (CollectionUtils.isNotEmpty(maps) || maps.size()> 0) {
throw new BadRequest("工号已存在");
}
}
// endregion
// 人员基础信息
PersonBasic personBasic = personBasicMapper.selectById(sequenceNbr);
personBasic.setSequenceNbr(sequenceNbr);
......@@ -536,7 +546,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
// 人员账号信息
personAccount.setPersonId(sequenceNbr);
oldpersonAccount = personAccountService.getById(personAccount.getSequenceNbr());
personAccountService.updateById(personAccount);
// 新增平台账号
// 组装数据
......
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