|
@@ -1380,7 +1380,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
|
|
|
String studentName = StringUtils.isNotBlank(basicStudentImportDto.getStudentName()) ? basicStudentImportDto.getStudentName().trim() : null;
|
|
String studentName = StringUtils.isNotBlank(basicStudentImportDto.getStudentName()) ? basicStudentImportDto.getStudentName().trim() : null;
|
|
String studentCode = StringUtils.isNotBlank(basicStudentImportDto.getStudentCode()) ? basicStudentImportDto.getStudentCode().trim() : null;
|
|
String studentCode = StringUtils.isNotBlank(basicStudentImportDto.getStudentCode()) ? basicStudentImportDto.getStudentCode().trim() : null;
|
|
- String phoneNumber = StringUtils.isNotBlank(basicStudentImportDto.getPhoneNumber()) ? basicStudentImportDto.getPhoneNumber().trim() : null;
|
|
|
|
studentCodeList.add(studentCode);
|
|
studentCodeList.add(studentCode);
|
|
|
|
|
|
StringJoiner errorStringJoiner = new StringJoiner(";");
|
|
StringJoiner errorStringJoiner = new StringJoiner(";");
|
|
@@ -1398,21 +1397,10 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
checkCodeMap.put(studentCode, studentName);
|
|
checkCodeMap.put(studentCode, studentName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 如果电话有值则检验电话excel中唯一性
|
|
|
|
- if (SystemConstant.strNotNull(phoneNumber)) {
|
|
|
|
- if (checkPhoneMap.containsKey(phoneNumber)) {
|
|
|
|
- errorStringJoiner.add("手机号[" + phoneNumber + "]查询到多条数据");
|
|
|
|
- } else {
|
|
|
|
- checkPhoneMap.put(phoneNumber, studentCode);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
if (Objects.nonNull(studentCode) && !studentCode.matches(SystemConstant.REGULAR_EXPRESSION_OF_CODE)) {
|
|
if (Objects.nonNull(studentCode) && !studentCode.matches(SystemConstant.REGULAR_EXPRESSION_OF_CODE)) {
|
|
errorStringJoiner.add("学号[" + studentCode + "]不符合规范");
|
|
errorStringJoiner.add("学号[" + studentCode + "]不符合规范");
|
|
}
|
|
}
|
|
- if (Objects.nonNull(phoneNumber) && !phoneNumber.matches(SystemConstant.REGULAR_EXPRESSION_OF_PHONE)) {
|
|
|
|
- errorStringJoiner.add("手机号[" + phoneNumber + "]不符合规范");
|
|
|
|
- }
|
|
|
|
String errorString = errorStringJoiner.toString();
|
|
String errorString = errorStringJoiner.toString();
|
|
if (errorString.length() > 0) {
|
|
if (errorString.length() > 0) {
|
|
basicStudentErrorExportDto.setErrorMsg(errorString);
|
|
basicStudentErrorExportDto.setErrorMsg(errorString);
|
|
@@ -1432,7 +1420,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
map.put(SystemConstant.SUCCESS_DATA_COUNT, successInteger.get());
|
|
map.put(SystemConstant.SUCCESS_DATA_COUNT, successInteger.get());
|
|
map.put(SystemConstant.ERROR_DATA_COUNT, errorDataList.size());
|
|
map.put(SystemConstant.ERROR_DATA_COUNT, errorDataList.size());
|
|
return finalExcelList;
|
|
return finalExcelList;
|
|
- });
|
|
|
|
|
|
+ },2);
|
|
return basicStudentService.executeBasicStudentImportLogic(finalList, map);
|
|
return basicStudentService.executeBasicStudentImportLogic(finalList, map);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1450,11 +1438,12 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
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);
|
|
- if (sysUserImportDtoList.isEmpty() || sysUserImportDtoList.get(0) instanceof DescribeImportDto) {
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(sysUserImportDtoList)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
map.put(SystemConstant.DATA_COUNT, sysUserImportDtoList.size());
|
|
map.put(SystemConstant.DATA_COUNT, sysUserImportDtoList.size());
|
|
- List<SysUserImportDto> duplicateData = new ArrayList<>();
|
|
|
|
|
|
+ List<Integer> errorIndex = new ArrayList<>();
|
|
|
|
+ Map<String, Integer> phoneNumberMap = new HashMap<>();
|
|
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);
|
|
totalInteger.getAndIncrement();
|
|
totalInteger.getAndIncrement();
|
|
@@ -1472,7 +1461,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
if (errorStringEmpty.length() > 0) {
|
|
if (errorStringEmpty.length() > 0) {
|
|
errorStringJoiner.add(errorStringEmpty);
|
|
errorStringJoiner.add(errorStringEmpty);
|
|
}
|
|
}
|
|
-
|
|
|
|
if (checkDtoMap.containsKey(code)) {
|
|
if (checkDtoMap.containsKey(code)) {
|
|
SysUserImportDto primaryCell = checkDtoMap.get(code);
|
|
SysUserImportDto primaryCell = checkDtoMap.get(code);
|
|
String priName = primaryCell.getName();
|
|
String priName = primaryCell.getName();
|
|
@@ -1492,7 +1480,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
priRoleName = priRoleName + SystemConstant.COMMA + roleName;
|
|
priRoleName = priRoleName + SystemConstant.COMMA + roleName;
|
|
primaryCell.setRoleName(priRoleName);
|
|
primaryCell.setRoleName(priRoleName);
|
|
}
|
|
}
|
|
- duplicateData.add(sysUserImportDto);
|
|
|
|
} else {
|
|
} else {
|
|
checkDtoMap.put(code, sysUserImportDto);
|
|
checkDtoMap.put(code, sysUserImportDto);
|
|
}
|
|
}
|
|
@@ -1503,17 +1490,26 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
if (Objects.nonNull(phoneNumber) && !phoneNumber.matches(SystemConstant.REGULAR_EXPRESSION_OF_PHONE)) {
|
|
if (Objects.nonNull(phoneNumber) && !phoneNumber.matches(SystemConstant.REGULAR_EXPRESSION_OF_PHONE)) {
|
|
errorStringJoiner.add("[手机号]不符合输入规范");
|
|
errorStringJoiner.add("[手机号]不符合输入规范");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (Objects.nonNull(phoneNumber)) {
|
|
|
|
+ if (phoneNumberMap.containsKey(phoneNumber)) {
|
|
|
|
+ errorStringJoiner.add("[手机号]和第" + phoneNumberMap.get(phoneNumber) + "重复");
|
|
|
|
+ } else {
|
|
|
|
+ phoneNumberMap.put(phoneNumber, y);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
String errorString = errorStringJoiner.toString();
|
|
String errorString = errorStringJoiner.toString();
|
|
if (errorString.length() > 0) {
|
|
if (errorString.length() > 0) {
|
|
sysUserErrorExportDto.setErrorMsg(errorString);
|
|
sysUserErrorExportDto.setErrorMsg(errorString);
|
|
errorDataList.add(sysUserErrorExportDto);
|
|
errorDataList.add(sysUserErrorExportDto);
|
|
- sysUserImportDtoList.remove(y);
|
|
|
|
|
|
+ errorIndex.add(y);
|
|
} else {
|
|
} else {
|
|
// 校验通过的数据
|
|
// 校验通过的数据
|
|
successInteger.getAndIncrement();
|
|
successInteger.getAndIncrement();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ for (int index : errorIndex) {
|
|
|
|
+ sysUserImportDtoList.remove(index);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (!errorDataList.isEmpty()) {
|
|
if (!errorDataList.isEmpty()) {
|
|
map.put(SystemConstant.ERROR_DATA_LIST, errorDataList);
|
|
map.put(SystemConstant.ERROR_DATA_LIST, errorDataList);
|
|
@@ -1522,7 +1518,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
map.put(SystemConstant.SUCCESS_DATA_COUNT, successInteger.get());
|
|
map.put(SystemConstant.SUCCESS_DATA_COUNT, successInteger.get());
|
|
map.put(SystemConstant.ERROR_DATA_COUNT, errorDataList.size());
|
|
map.put(SystemConstant.ERROR_DATA_COUNT, errorDataList.size());
|
|
return finalExcelList;
|
|
return finalExcelList;
|
|
- });
|
|
|
|
|
|
+ }, 2);
|
|
return sysUserService.executeSysUserImportLogic(finalList, map);
|
|
return sysUserService.executeSysUserImportLogic(finalList, map);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1560,7 +1556,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(excelErrorTemp));
|
|
throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(excelErrorTemp));
|
|
}
|
|
}
|
|
return finalExcelList;
|
|
return finalExcelList;
|
|
- });
|
|
|
|
|
|
+ },2);
|
|
return basicClazzService.executeBasicClazzImportLogic(finalList, map);
|
|
return basicClazzService.executeBasicClazzImportLogic(finalList, map);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1637,7 +1633,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
tcStatisticsService.importJoinData(tcStatisticsImportTempList);
|
|
tcStatisticsService.importJoinData(tcStatisticsImportTempList);
|
|
tcStatisticsTempService.removeByIds(tcStatisticsImportTempList.stream().map(BaseEntity::getId).collect(Collectors.toSet()));
|
|
tcStatisticsTempService.removeByIds(tcStatisticsImportTempList.stream().map(BaseEntity::getId).collect(Collectors.toSet()));
|
|
return finalExcelList;
|
|
return finalExcelList;
|
|
- });
|
|
|
|
|
|
+ },2);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|