Commit c82fc54e authored by hongguangwu's avatar hongguangwu

减档加变更记录

parent aaa17af0
...@@ -348,8 +348,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -348,8 +348,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
ErrorMessageVO errorMessageVO; ErrorMessageVO errorMessageVO;
Map<Integer, Integer> errorMsgMap = new HashMap<>(); Map<Integer, Integer> errorMsgMap = new HashMap<>();
TEmployeeInfo oldEmployee;
TEmployeeInfo employee; TEmployeeInfo employee;
// 可以更新的列表
List<TEmployeeInfo> canDeleteList = new ArrayList<>(); List<TEmployeeInfo> canDeleteList = new ArrayList<>();
// 为了记录变更日志而加的
List<TEmployeeInfo> deleteOldList = new ArrayList<>();
Set<String> errorMsg; Set<String> errorMsg;
EmployeeLeaveVO excel; EmployeeLeaveVO excel;
...@@ -413,6 +417,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -413,6 +417,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (projectList != null && !projectList.isEmpty()) { if (projectList != null && !projectList.isEmpty()) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HAVE_PROJECT, employee.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HAVE_PROJECT, employee.getEmpIdcard()));
} else { } else {
oldEmployee = existEmpMap.get(excel.getEmpIdcard());
// 开始减档 // 开始减档
employee.setFileStatus(CommonConstants.ONE_INT); employee.setFileStatus(CommonConstants.ONE_INT);
employee.setLeaveUser(user.getId()); employee.setLeaveUser(user.getId());
...@@ -421,6 +426,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -421,6 +426,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
employee.setLeaveReason(excel.getLeaveReason()); employee.setLeaveReason(excel.getLeaveReason());
employee.setLeaveRemark(excel.getLeaveRemark()); employee.setLeaveRemark(excel.getLeaveRemark());
canDeleteList.add(employee); canDeleteList.add(employee);
deleteOldList.add(oldEmployee);
} }
} else { } else {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_NOT_EXISTS, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_NOT_EXISTS, excel.getEmpIdcard()));
...@@ -444,12 +450,18 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -444,12 +450,18 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} else { } else {
// 仅更新自己 // 仅更新自己
this.updateBatchById(canDeleteList); this.updateBatchById(canDeleteList);
for (int i = 0; i < canDeleteList.size(); i++) {
this.updateById(canDeleteList.get(i));
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], canDeleteList.get(i).getId(), "", deleteOldList.get(i), canDeleteList.get(i));
}
} }
return R.ok(); return R.ok();
} }
@Override @Override
public R<String> minusEmployee(String id, String leaveReason, String leaveRemark) { public R<String> minusEmployee(String id, String leaveReason, String leaveRemark) {
TEmployeeInfo oldEmp = this.getById(id);
TEmployeeInfo employee = this.getById(id); TEmployeeInfo employee = this.getById(id);
if (employee != null) { if (employee != null) {
// 获取项目档案,传参0,过滤项目状态 // 获取项目档案,传参0,过滤项目状态
...@@ -468,6 +480,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -468,6 +480,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
employee.setLeaveReason(leaveReason); employee.setLeaveReason(leaveReason);
employee.setLeaveRemark(leaveRemark); employee.setLeaveRemark(leaveRemark);
this.updateById(employee); this.updateById(employee);
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], id, "", oldEmp, employee);
return R.ok("已减档"); return R.ok("已减档");
} else { } else {
return R.failed("未找到人员档案信息"); return R.failed("未找到人员档案信息");
...@@ -668,7 +682,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -668,7 +682,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
errorMsg = new HashSet<>(); errorMsg = new HashSet<>();
// 判空 // 判空
this.checkEmployeeVOR((i+2L), excelVOList.get(i), errorMsgMap, errorMsg); this.checkEmployeeVOR((i + 2L), excelVOList.get(i), errorMsgMap, errorMsg);
idCard = excelVOList.get(i).getEmpIdcard(); idCard = excelVOList.get(i).getEmpIdcard();
if (Common.isEmpty(idCard)) { if (Common.isEmpty(idCard)) {
...@@ -747,9 +761,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -747,9 +761,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 调用区域服务,渲染区域值 // 调用区域服务,渲染区域值
R<Map<String,Map<String, String>>> areaR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId() R<Map<String, Map<String, String>>> areaR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/area/inner/getAreaToName", null, Map.class, SecurityConstants.FROM_IN); , "/area/inner/getAreaToName", null, Map.class, SecurityConstants.FROM_IN);
Map<String,Map<String, String>> areaMapR; Map<String, Map<String, String>> areaMapR;
Map<String, String> areaMap; Map<String, String> areaMap;
if (areaR == null) { if (areaR == null) {
return R.failed("获取区域失败!"); return R.failed("获取区域失败!");
...@@ -934,7 +948,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -934,7 +948,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isEmpty(excel.getHignEducation())) { if (Common.isEmpty(excel.getHignEducation())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR, excel.getEmpIdcard()));
} }
} else if (CommonConstants.IS_FALSE.equals(excel.getIsCollege())){ } else if (CommonConstants.IS_FALSE.equals(excel.getIsCollege())) {
saveEmp.setIsCollege(CommonConstants.ZERO_INT); saveEmp.setIsCollege(CommonConstants.ZERO_INT);
} else { } else {
errorMsg.add(EmployeeConstants.IS_OR_NOT); errorMsg.add(EmployeeConstants.IS_OR_NOT);
...@@ -1214,13 +1228,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1214,13 +1228,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 调用区域服务,渲染区域值 // 调用区域服务,渲染区域值
R<Map<String,Map<String, String>>> areaMapR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId() R<Map<String, Map<String, String>>> areaMapR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/area/inner/getAreaToName", null, Map.class, SecurityConstants.FROM_IN); , "/area/inner/getAreaToName", null, Map.class, SecurityConstants.FROM_IN);
Map<String, String> areaMap; Map<String, String> areaMap;
if (areaMapR == null) { if (areaMapR == null) {
return R.failed("获取区域失败!"); return R.failed("获取区域失败!");
} else { } else {
Map<String,Map<String, String>> areaMaps = areaMapR.getData(); Map<String, Map<String, String>> areaMaps = areaMapR.getData();
areaMap = areaMaps.get("data"); areaMap = areaMaps.get("data");
} }
...@@ -1369,7 +1383,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1369,7 +1383,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isEmpty(excel.getHignEducation())) { if (Common.isEmpty(excel.getHignEducation())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR, excel.getEmpIdcard()));
} }
} else if (CommonConstants.IS_FALSE.equals(excel.getIsCollege())){ } else if (CommonConstants.IS_FALSE.equals(excel.getIsCollege())) {
saveEmp.setIsCollege(CommonConstants.ZERO_INT); saveEmp.setIsCollege(CommonConstants.ZERO_INT);
} else { } else {
errorMsg.add(EmployeeConstants.IS_OR_NOT); errorMsg.add(EmployeeConstants.IS_OR_NOT);
...@@ -1518,7 +1532,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1518,7 +1532,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
try { try {
ExcelUtil<EmployeeExportVO> util = new ExcelUtil<>(EmployeeExportVO.class); ExcelUtil<EmployeeExportVO> util = new ExcelUtil<>(EmployeeExportVO.class);
for (EmployeeExportVO vo : list) { for (EmployeeExportVO vo : list) {
util.convertEntity(vo,null,null,null); util.convertEntity(vo, null, null, null);
} }
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
......
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