|
@@ -1227,9 +1227,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
InputStream inputStream = (InputStream) map.get("inputStream");
|
|
InputStream inputStream = (InputStream) map.get("inputStream");
|
|
List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(inputStream, Lists.newArrayList(SysUserImportDto.class, DescribeImportDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
|
|
List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(inputStream, Lists.newArrayList(SysUserImportDto.class, DescribeImportDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
|
|
List<ExcelError> excelErrorTemp = new ArrayList<>();
|
|
List<ExcelError> excelErrorTemp = new ArrayList<>();
|
|
-// Map<String, String> checkName = new HashMap<>();
|
|
|
|
- Map<String, String> checkCode = new HashMap<>();
|
|
|
|
- Map<String, String> checkPhoneMap = new HashMap<>();
|
|
|
|
|
|
+ Map<String,SysUserImportDto> checkDtoMap = new HashMap<>();
|
|
|
|
+
|
|
for (int i = 0; i < finalExcelList.size(); i++) {
|
|
for (int i = 0; i < finalExcelList.size(); i++) {
|
|
LinkedMultiValueMap<Integer, Object> excelMap = finalExcelList.get(i);
|
|
LinkedMultiValueMap<Integer, Object> excelMap = finalExcelList.get(i);
|
|
List<Object> sysUserImportDtoList = excelMap.get(i);
|
|
List<Object> sysUserImportDtoList = excelMap.get(i);
|
|
@@ -1245,24 +1244,28 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
String orgName = sysUserImportDto.getOrgName();
|
|
String orgName = sysUserImportDto.getOrgName();
|
|
String roleName = sysUserImportDto.getRoleName();
|
|
String roleName = sysUserImportDto.getRoleName();
|
|
|
|
|
|
- // 检验excel中
|
|
|
|
-// if (checkName.containsKey(name)) {
|
|
|
|
-// throw ExceptionResultEnum.ERROR.exception("导入的excel中包含在重复的【姓名】:" + name);
|
|
|
|
-// } else {
|
|
|
|
-// checkName.put(name, code);
|
|
|
|
-// }
|
|
|
|
- if (checkCode.containsKey(code)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("导入的excel中包含在重复的【工号】:" + code);
|
|
|
|
- } else {
|
|
|
|
- checkCode.put(code, name);
|
|
|
|
- }
|
|
|
|
- // 如果电话有值则检验电话excel中唯一性
|
|
|
|
- if (SystemConstant.strNotNull(phoneNumber)) {
|
|
|
|
- if (checkPhoneMap.containsKey(phoneNumber)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("导入的excel中包含在重复的【电话号码】:" + phoneNumber);
|
|
|
|
- } else {
|
|
|
|
- checkPhoneMap.put(phoneNumber, code);
|
|
|
|
|
|
+ if (checkDtoMap.containsKey(code)){
|
|
|
|
+ SysUserImportDto primaryCell = checkDtoMap.get(code);
|
|
|
|
+ String priName = primaryCell.getName();
|
|
|
|
+ String priPhoneNumber = primaryCell.getPhoneNumber();
|
|
|
|
+ String priOrgName = primaryCell.getOrgName();
|
|
|
|
+ if (!Objects.equals(priName,name)){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("【工号】 :" + code + ",的用户存在不同的用户名称异常");
|
|
|
|
+ }
|
|
|
|
+ if (!Objects.equals(priPhoneNumber,phoneNumber)){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("【工号】 :" + code + ",的用户存在不同的手机号异常");
|
|
|
|
+ }
|
|
|
|
+ if (!Objects.equals(priOrgName,orgName)){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("【工号】 :" + code + ",的用户存在不同的组织架构异常");
|
|
|
|
+ }
|
|
|
|
+ String priRoleName = primaryCell.getRoleName();
|
|
|
|
+ if (SystemConstant.strNotNull(roleName)){
|
|
|
|
+ priRoleName = priRoleName + "," + roleName;
|
|
|
|
+ primaryCell.setRoleName(priRoleName);
|
|
}
|
|
}
|
|
|
|
+ sysUserImportDtoList.remove(sysUserImportDto);
|
|
|
|
+ }else {
|
|
|
|
+ checkDtoMap.put(code,sysUserImportDto);
|
|
}
|
|
}
|
|
|
|
|
|
excelErrorTemp.addAll(ExcelUtil.checkExcelField(sysUserImportDto, y, i));
|
|
excelErrorTemp.addAll(ExcelUtil.checkExcelField(sysUserImportDto, y, i));
|