Commit 52831663 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/develop' into develop

parents 1898706a ba17ef1c
...@@ -29,6 +29,7 @@ public class EmployeeConstants { ...@@ -29,6 +29,7 @@ public class EmployeeConstants {
public static final String FILE_ROVINCE_MUST = "更新档案市,档案省必填"; public static final String FILE_ROVINCE_MUST = "更新档案市,档案省必填";
public static final String FILE_CITY_MUST = "更新档案县,档案市必填"; public static final String FILE_CITY_MUST = "更新档案县,档案市必填";
public static final String DEPT_NO_ERROR = "项目编码错误"; public static final String DEPT_NO_ERROR = "项目编码错误";
public static final String DEPT_NO_EXIST = "根据项目编码未找到项目";
/** /**
* 无数据可更新 * 无数据可更新
......
...@@ -778,7 +778,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -778,7 +778,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e); log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR); return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
} }
return R.ok(errorMessageList); if (errorMessageList.isEmpty()) {
return R.ok();
} else {
return R.failed(errorMessageList);
}
} }
...@@ -786,9 +790,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -786,9 +790,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (excelVOList == null || excelVOList.isEmpty()) { if (excelVOList == null || excelVOList.isEmpty()) {
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY); return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
} }
Set<String> errorMsg;
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
return R.failed("请登录!"); errorMsg = new HashSet<>();
errorMsg.add(CommonConstants.PLEASE_LOG_IN);
errorMessageList.add(new ErrorMessage(2L, errorMsg));
return R.failed(errorMessageList);
} }
Map<Long, ErrorMessage> errorMsgMap = new HashMap<>(); Map<Long, ErrorMessage> errorMsgMap = new HashMap<>();
if (Common.isNotNull(errorMessageList)) { if (Common.isNotNull(errorMessageList)) {
...@@ -801,7 +809,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -801,7 +809,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
Map<String, Integer> idCardMap = new HashMap<>(); Map<String, Integer> idCardMap = new HashMap<>();
String idCard; String idCard;
// 个性化校验逻辑 // 个性化校验逻辑
Set<String> errorMsg;
List<String> deptNoList = new ArrayList<>(); List<String> deptNoList = new ArrayList<>();
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
errorMsg = new HashSet<>(); errorMsg = new HashSet<>();
...@@ -842,7 +849,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -842,7 +849,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
Map<String, Integer> deptMap = new HashMap<>(); Map<String, Integer> deptMap = new HashMap<>();
if (deptList == null || deptList.isEmpty()) { if (deptList == null || deptList.isEmpty()) {
return R.failed("根据项目编码未找到项目!"); errorMsg = new HashSet<>();
errorMsg.add(EmployeeConstants.DEPT_NO_EXIST);
errorMessageList.add(new ErrorMessage(2L, errorMsg));
return R.failed(errorMessageList);
} else { } else {
for (TSettleDomain dept : deptList) { for (TSettleDomain dept : deptList) {
deptMap.put(dept.getDepartNo(), CommonConstants.ONE_INT); deptMap.put(dept.getDepartNo(), CommonConstants.ONE_INT);
...@@ -1342,16 +1352,27 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1342,16 +1352,27 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e); log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR); return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
} }
return R.ok(errorMessageList); if (errorMessageList.isEmpty()) {
return R.ok();
} else {
return R.failed(errorMessageList);
}
} }
private R<List<ErrorMessage>> batchUpdateCore(List<EmployeeVO> excelVOList, List<ErrorMessage> errorMessageList) { private R<List<ErrorMessage>> batchUpdateCore(List<EmployeeVO> excelVOList, List<ErrorMessage> errorMessageList) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
Set<String> errorMsg;
if (user == null || Common.isEmpty(user.getId())) { if (user == null || Common.isEmpty(user.getId())) {
return R.failed("请登录!"); errorMsg = new HashSet<>();
errorMsg.add(CommonConstants.PLEASE_LOG_IN);
errorMessageList.add(new ErrorMessage(2L, errorMsg));
return R.failed(errorMessageList);
} }
if (excelVOList == null || excelVOList.isEmpty()) { if (excelVOList == null || excelVOList.isEmpty()) {
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY); errorMsg = new HashSet<>();
errorMsg.add(CommonConstants.DATA_CAN_NOT_EMPTY);
errorMessageList.add(new ErrorMessage(2L, errorMsg));
return R.failed(errorMessageList);
} }
// 通用校验获取失败的数据 // 通用校验获取失败的数据
Map<Long, ErrorMessage> errorMsgMap = new HashMap<>(); Map<Long, ErrorMessage> errorMsgMap = new HashMap<>();
...@@ -1399,7 +1420,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1399,7 +1420,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 个性化校验逻辑 // 个性化校验逻辑
Set<String> errorMsg;
EmployeeVO excel; EmployeeVO excel;
// 需要保存的档案信息 // 需要保存的档案信息
TEmployeeInfo saveEmp; TEmployeeInfo saveEmp;
......
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