|
@@ -33,6 +33,7 @@ import com.qmth.paper.library.common.service.SysUserService;
|
|
import com.qmth.paper.library.common.util.*;
|
|
import com.qmth.paper.library.common.util.*;
|
|
import com.qmth.paper.library.common.util.excel.ExcelError;
|
|
import com.qmth.paper.library.common.util.excel.ExcelError;
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.poi.ss.usermodel.*;
|
|
import org.apache.poi.ss.usermodel.*;
|
|
import org.apache.poi.xssf.usermodel.*;
|
|
import org.apache.poi.xssf.usermodel.*;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -135,25 +136,25 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
List<SysUserImportDto> duplicateData = new ArrayList<>();
|
|
List<SysUserImportDto> duplicateData = new ArrayList<>();
|
|
for (int y = 0; y < Objects.requireNonNull(sysUserImportDtoList).size(); y++) {
|
|
for (int y = 0; y < Objects.requireNonNull(sysUserImportDtoList).size(); y++) {
|
|
SysUserImportDto sysUserImportDto = (SysUserImportDto) sysUserImportDtoList.get(y);
|
|
SysUserImportDto sysUserImportDto = (SysUserImportDto) sysUserImportDtoList.get(y);
|
|
- String name = sysUserImportDto.getName().trim();
|
|
|
|
- String loginName = sysUserImportDto.getLoginName().trim();
|
|
|
|
- String phoneNumber = sysUserImportDto.getPhoneNumber().trim();
|
|
|
|
- String orgName = sysUserImportDto.getOrgName().trim();
|
|
|
|
- String roleName = sysUserImportDto.getRoleName().trim();
|
|
|
|
|
|
+ String name = StringUtils.isNotBlank(sysUserImportDto.getName()) ? sysUserImportDto.getName().trim() : null;
|
|
|
|
+ String loginName = StringUtils.isNotBlank(sysUserImportDto.getLoginName()) ? sysUserImportDto.getLoginName().trim() : null;
|
|
|
|
+// String phoneNumber = StringUtils.isNotBlank(sysUserImportDto.getPhoneNumber()) ? sysUserImportDto.getPhoneNumber().trim() : null;
|
|
|
|
+ String orgName = StringUtils.isNotBlank(sysUserImportDto.getOrgName()) ? sysUserImportDto.getOrgName().trim() : null;
|
|
|
|
+ String roleName = StringUtils.isNotBlank(sysUserImportDto.getRoleName()) ? sysUserImportDto.getRoleName().trim() : null;
|
|
|
|
|
|
if (checkDtoMap.containsKey(loginName)) {
|
|
if (checkDtoMap.containsKey(loginName)) {
|
|
SysUserImportDto primaryCell = checkDtoMap.get(loginName);
|
|
SysUserImportDto primaryCell = checkDtoMap.get(loginName);
|
|
String priName = primaryCell.getName();
|
|
String priName = primaryCell.getName();
|
|
- String priPhoneNumber = primaryCell.getPhoneNumber();
|
|
|
|
|
|
+// String priPhoneNumber = primaryCell.getPhoneNumber();
|
|
String priOrgName = primaryCell.getOrgName();
|
|
String priOrgName = primaryCell.getOrgName();
|
|
if (!Objects.equals(priName, name)) {
|
|
if (!Objects.equals(priName, name)) {
|
|
- throw ExceptionResultEnum.ERROR.exception("【账号】 :" + loginName + "的用户存在不同的名称");
|
|
|
|
- }
|
|
|
|
- if (!Objects.equals(priPhoneNumber, phoneNumber)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("【账号】 :" + loginName + "的用户存在不同的手机号");
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("【用户名】 :" + loginName + "的用户存在不同的名称");
|
|
}
|
|
}
|
|
|
|
+// if (!Objects.equals(priPhoneNumber, phoneNumber)) {
|
|
|
|
+// throw ExceptionResultEnum.ERROR.exception("【账号】 :" + loginName + "的用户存在不同的手机号");
|
|
|
|
+// }
|
|
if (!Objects.equals(priOrgName, orgName)) {
|
|
if (!Objects.equals(priOrgName, orgName)) {
|
|
- throw ExceptionResultEnum.ERROR.exception("【账号】 :" + loginName + "的用户存在不同的组织架构");
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("【用户名】 :" + loginName + "的用户存在不同的组织架构");
|
|
}
|
|
}
|
|
String priRoleName = primaryCell.getRoleName();
|
|
String priRoleName = primaryCell.getRoleName();
|
|
if (SystemConstant.strNotNull(roleName)) {
|
|
if (SystemConstant.strNotNull(roleName)) {
|
|
@@ -172,9 +173,9 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
if (Objects.isNull(name) || name.length() > 30) {
|
|
if (Objects.isNull(name) || name.length() > 30) {
|
|
excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[姓名]不符合输入规范"));
|
|
excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[姓名]不符合输入规范"));
|
|
}
|
|
}
|
|
- if (Objects.nonNull(phoneNumber) && !phoneNumber.matches(SystemConstant.REGULAR_EXPRESSION_OF_PHONE)) {
|
|
|
|
- excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[电话号码]不符合输入规范"));
|
|
|
|
- }
|
|
|
|
|
|
+// if (Objects.nonNull(phoneNumber) && !phoneNumber.matches(SystemConstant.REGULAR_EXPRESSION_OF_PHONE)) {
|
|
|
|
+// excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[电话号码]不符合输入规范"));
|
|
|
|
+// }
|
|
}
|
|
}
|
|
sysUserImportDtoList.removeAll(duplicateData);
|
|
sysUserImportDtoList.removeAll(duplicateData);
|
|
}
|
|
}
|