Commit 40814872 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent 18b7146e
...@@ -135,6 +135,7 @@ public class TEmployeeProject extends BaseEntity { ...@@ -135,6 +135,7 @@ public class TEmployeeProject extends BaseEntity {
* 是否同步减档(0否;1是) * 是否同步减档(0否;1是)
*/ */
@Schema(description ="是否同步减档(0否;1是)") @Schema(description ="是否同步减档(0否;1是)")
@TableField(exist = false)
private Integer isLeaveEmployee; private Integer isLeaveEmployee;
/** /**
......
...@@ -324,7 +324,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -324,7 +324,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 新老项目档案List // 新老项目档案List
List<EmployeeProjectNewOldVO> updateProjectList = new ArrayList<>(); List<EmployeeProjectNewOldVO> updateProjectList = new ArrayList<>();
List<EmployeeXProjectVO> selectList = excelVOList.stream().filter(e -> e.getIsLeaveEmployee().equals(CommonConstants.ONE_STRING)).collect(Collectors.toList()); List<EmployeeXProjectVO> selectList = excelVOList.stream().filter(e -> e.getIsLeaveEmployee().equals(CommonConstants.IS_TRUE)).collect(Collectors.toList());
List<TEmployeeProject> checkList = new ArrayList<>();
// 执行数据插入操作 组装 PostDto // 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
EmployeeXProjectVO excel = excelVOList.get(i); EmployeeXProjectVO excel = excelVOList.get(i);
...@@ -341,7 +343,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -341,7 +343,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (tEmployeeProject.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] || tEmployeeProject.getSocialStatus() != CommonConstants.dingleDigitIntArray[0] || if (tEmployeeProject.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] || tEmployeeProject.getSocialStatus() != CommonConstants.dingleDigitIntArray[0] ||
tEmployeeProject.getFundStatus() != CommonConstants.dingleDigitIntArray[0]) { tEmployeeProject.getFundStatus() != CommonConstants.dingleDigitIntArray[0]) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_CHANGE_NOT_EXIST))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_CHANGE_NOT_EXIST)));
} else if (CommonConstants.ONE_STRING.equals(excel.getIsLeaveEmployee())) { } else if (CommonConstants.IS_TRUE.equals(excel.getIsLeaveEmployee())) {
//查询该人员其他的项目档案 //查询该人员其他的项目档案
List<TEmployeeProject> list = this.list(Wrappers.<TEmployeeProject>query().lambda() List<TEmployeeProject> list = this.list(Wrappers.<TEmployeeProject>query().lambda()
...@@ -355,21 +357,31 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -355,21 +357,31 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
boolean flag = false; boolean flag = false;
for (TEmployeeProject tEmployeeProject1 : list) { for (TEmployeeProject tEmployeeProject1 : list) {
if (!selectList.stream().anyMatch(e -> saveCheck(e, tEmployeeProject1))) { if (!selectList.stream().anyMatch(e -> saveCheck(e, tEmployeeProject1))) {
checkList.add(tEmployeeProject1);
flag = true; flag = true;
} }
} }
if (flag) { if (flag) {
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]); boolean checkUpd = false;
tEmployeeInfo.setLeaveReason(excel.getLeaveReason()); for (TEmployeeProject tEmployeeCheck : checkList) {
tEmployeeInfo.setLeaveRemark(excel.getLeaveRemark()); if (tEmployeeCheck.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] || tEmployeeCheck.getSocialStatus() != CommonConstants.dingleDigitIntArray[0] ||
tEmployeeInfo.setLeaveTime(LocalDateTime.now()); tEmployeeCheck.getFundStatus() != CommonConstants.dingleDigitIntArray[0]) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.QT_PROJECT_CHANGE_NOT_EXIST)));
List<String> idList = list.stream().map(TEmployeeProject::getId).collect(Collectors.toList()); checkUpd = true;
//从剩下的项目档案中查找员工类型并更新 break;
setEmpNature(tEmployeeProject.getEmpIdcard(), tEmployeeInfo, idList); }
updList.add(tEmployeeInfo); }
} else { if (!checkUpd) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.QT_PROJECT_CHANGE_NOT_EXIST))); tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveReason(excel.getLeaveReason());
tEmployeeInfo.setLeaveRemark(excel.getLeaveRemark());
tEmployeeInfo.setLeaveTime(LocalDateTime.now());
List<String> idList = list.stream().map(TEmployeeProject::getId).collect(Collectors.toList());
//从剩下的项目档案中查找员工类型并更新
setEmpNature(tEmployeeProject.getEmpIdcard(), tEmployeeInfo, idList);
updList.add(tEmployeeInfo);
}
} }
} else { } else {
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]); tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
a.SALARY_TYPE, a.SALARY_TYPE,
a.SALARY_STANDARD_PER_HOUR, a.SALARY_STANDARD_PER_HOUR,
a.SALARY_STANDARD_PER_PIECE, a.SALARY_STANDARD_PER_PIECE,
a.CREATE_USER_ID,
a.REMARK, a.REMARK,
a.DELETE_FLAG, a.DELETE_FLAG,
a.WORK_SPACE, a.WORK_SPACE,
......
...@@ -129,7 +129,6 @@ ...@@ -129,7 +129,6 @@
a.LEAVE_TIME, a.LEAVE_TIME,
a.LEAVE_REASON, a.LEAVE_REASON,
a.LEAVE_REMARK, a.LEAVE_REMARK,
a.IS_LEAVE_EMPLOYEE,
a.EMP_NO, a.EMP_NO,
a.UNIT_ID, a.UNIT_ID,
a.UNIT_NAME, a.UNIT_NAME,
...@@ -265,9 +264,6 @@ ...@@ -265,9 +264,6 @@
<if test="tEmployeeProject.leaveRemark != null and tEmployeeProject.leaveRemark.trim() != ''"> <if test="tEmployeeProject.leaveRemark != null and tEmployeeProject.leaveRemark.trim() != ''">
AND a.LEAVE_REMARK = #{tEmployeeProject.leaveRemark} AND a.LEAVE_REMARK = #{tEmployeeProject.leaveRemark}
</if> </if>
<if test="tEmployeeProject.isLeaveEmployee != null">
AND a.IS_LEAVE_EMPLOYEE = #{tEmployeeProject.isLeaveEmployee}
</if>
<if test="tEmployeeProject.empNo != null and tEmployeeProject.empNo.trim() != ''"> <if test="tEmployeeProject.empNo != null and tEmployeeProject.empNo.trim() != ''">
AND a.EMP_NO = #{tEmployeeProject.empNo} AND a.EMP_NO = #{tEmployeeProject.empNo}
</if> </if>
......
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