fixed:导入用户
parent
f5fbc6a8bd
commit
4fcdbc6d5d
|
|
@ -78,7 +78,7 @@ public class UserImportExe {
|
||||||
// 角色数据
|
// 角色数据
|
||||||
MultiResponse<RoleCO> roleCOMultiResponse = roleFacade.listRoles();
|
MultiResponse<RoleCO> roleCOMultiResponse = roleFacade.listRoles();
|
||||||
if (roleCOMultiResponse == null || CollUtil.isEmpty(roleCOMultiResponse.getData())) {
|
if (roleCOMultiResponse == null || CollUtil.isEmpty(roleCOMultiResponse.getData())) {
|
||||||
throw new BizException("未创建默认通用角色,请联系管理员");
|
throw new BizException("未创建角色,请联系管理员");
|
||||||
}
|
}
|
||||||
// 部门数据
|
// 部门数据
|
||||||
List<DepartmentDO> departmentDOList = departmentRepository.listByCorpInfoId(corpinfoId);
|
List<DepartmentDO> departmentDOList = departmentRepository.listByCorpInfoId(corpinfoId);
|
||||||
|
|
@ -349,12 +349,17 @@ public class UserImportExe {
|
||||||
if(StringUtils.isBlank(importEntity.getRoleName())){
|
if(StringUtils.isBlank(importEntity.getRoleName())){
|
||||||
throw new BizException("角色名称不能为空");
|
throw new BizException("角色名称不能为空");
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
Map<String, RoleCO> roleCOMap = roleList.stream().collect(Collectors.toMap(RoleCO::getRoleName, role -> role));
|
Map<String, RoleCO> roleCOMap = roleList.stream().collect(Collectors.toMap(RoleCO::getRoleName, role -> role));
|
||||||
String roleName = importEntity.getRoleName();
|
String roleName = importEntity.getRoleName();
|
||||||
if(roleCOMap.get(roleName) == null){
|
if(roleCOMap.get(roleName) == null){
|
||||||
throw new BizException("角色不存在: " + roleName);
|
throw new BizException("角色不存在: " + roleName);
|
||||||
}
|
}
|
||||||
return roleCOMap.get(roleName).getId();
|
return roleCOMap.get(roleName).getId();
|
||||||
|
}catch (IllegalStateException e){
|
||||||
|
throw new BizException("系统角色名称重复,请联系管理员");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue