Commit 17c743ca authored by hongguangwu's avatar hongguangwu

减档

parent b9f2fa04
......@@ -255,7 +255,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMessageList.add(errorMessageVO);
}
}
if (!isTrue && CollUtil.isNotEmpty(errorMessageList)) {
if (!isTrue) {
return R.failed(errorMessageList);
} else {
List<TEmployeeProject> projectList;
......@@ -357,6 +357,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_LEAVEREASON_MUST, excel.getEmpIdcard()));
errorMsgMap.put(i + 2, CommonConstants.ZERO_INT);
}
if (Common.isNotNull(excel.getLeaveRemark()) && excel.getLeaveRemark().length() > 200) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_LEAVEREMARK_LENGTH, excel.getEmpIdcard()));
errorMsgMap.put(i + 2, CommonConstants.ZERO_INT);
}
// 数据不合法
if (!CollUtil.isEmpty(errorMsg)) {
isTrue = false;
......@@ -373,6 +377,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
existEmpMap.put(employeeInfo.getEmpIdcard(), employeeInfo);
}
}
List<TEmployeeProject> projectList;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
// 已有验证报错直接下一个
......@@ -386,13 +391,18 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (employee != null) {
// 档案在职
if (employee.getFileStatus() == CommonConstants.ZERO_INT) {
// 开始减档
employee.setFileStatus(CommonConstants.ONE_INT);
employee.setLeaveUser(user.getId());
employee.setLeaveUserName(user.getNickname());
employee.setLeaveReason(excel.getLeaveReason());
employee.setLeaveRemark(excel.getLeaveRemark());
canDeleteList.add(employee);
projectList = tEmployeeProjectService.getListByEmpId(employee.getId(), CommonConstants.ZERO_INT);
if (projectList != null && !projectList.isEmpty()) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HAVE_PROJECT, employee.getEmpIdcard()));
} else {
// 开始减档
employee.setFileStatus(CommonConstants.ONE_INT);
employee.setLeaveUser(user.getId());
employee.setLeaveUserName(user.getNickname());
employee.setLeaveReason(excel.getLeaveReason());
employee.setLeaveRemark(excel.getLeaveRemark());
canDeleteList.add(employee);
}
} else {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_IDCARD_LEAVE_EXISTING, excel.getEmpIdcard()));
}
......@@ -410,7 +420,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
errorMessageList.add(errorMessageVO);
}
if (!isTrue && CollUtil.isNotEmpty(errorMessageList)) {
if (!isTrue) {
return R.failed(errorMessageList);
} else {
// 仅更新自己
......@@ -426,7 +436,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 获取项目档案,传参0,过滤项目状态
List<TEmployeeProject> projectList = tEmployeeProjectService.getListByEmpId(id, CommonConstants.ZERO_INT);
if (projectList != null && !projectList.isEmpty()) {
return R.failed("还有【" + projectList.size() + "】条项目未减项,请先去减项!");
return R.failed(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_HAVE_PROJECT, employee.getEmpIdcard()));
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
......
......@@ -257,6 +257,8 @@ public interface ErrorCodes {
String ARCHIVES_IMPORT_EMP_IDCARD_MUST = "archives.import.emp.idCard.must";
// 减档原因必填
String ARCHIVES_IMPORT_EMP_LEAVEREASON_MUST = "archives.import.emp.leaveReason.must";
String ARCHIVES_IMPORT_EMP_LEAVEREMARK_LENGTH = "archives.import.emp.leaveRemark.length";
String ARCHIVES_IMPORT_EMP_HAVE_PROJECT = "archives.import.emp.have.project";
/**
* 项目档案状态为已审核,禁止删除
......
......@@ -82,6 +82,8 @@ archives.import.emp.high.education.error=\u5927\u4E13\u53CA\u4EE5\u4E0A\uFF0C\u6
archives.import.emp.not.exists=\u6839\u636E\u8EAB\u4EFD\u8BC1\u672A\u627E\u5230\u4EBA\u5458\u6863\u6848\u4FE1\u606F
archives.import.emp.idCard.must=\u8EAB\u4EFD\u8BC1\u5FC5\u586B
archives.import.emp.leaveReason.must=\u51CF\u6863\u539F\u56E0\u5FC5\u586B
archives.import.emp.leaveRemark.length=\u51CF\u6863\u5907\u6CE8\u8D85\u8FC7200
archives.import.emp.have.project=\u7981\u6B62\u201C\u51CF\u6863\u201D \u8BE5\u4EBA\u5458\u5B58\u5728\u201C\u6B63\u5E38\u201D\u5B58\u7EED\u7684\u201C\u9879\u76EE\u6863\u6848\u201D
import.file.type.error=\u5BFC\u5165\u7684\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E
......
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