Commit 40814872 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent 18b7146e
......@@ -135,6 +135,7 @@ public class TEmployeeProject extends BaseEntity {
* 是否同步减档(0否;1是)
*/
@Schema(description ="是否同步减档(0否;1是)")
@TableField(exist = false)
private Integer isLeaveEmployee;
/**
......
......@@ -324,7 +324,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 新老项目档案List
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
for (int i = 0; i < excelVOList.size(); i++) {
EmployeeXProjectVO excel = excelVOList.get(i);
......@@ -341,7 +343,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (tEmployeeProject.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] || tEmployeeProject.getSocialStatus() != CommonConstants.dingleDigitIntArray[0] ||
tEmployeeProject.getFundStatus() != CommonConstants.dingleDigitIntArray[0]) {
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()
......@@ -355,21 +357,31 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
boolean flag = false;
for (TEmployeeProject tEmployeeProject1 : list) {
if (!selectList.stream().anyMatch(e -> saveCheck(e, tEmployeeProject1))) {
checkList.add(tEmployeeProject1);
flag = true;
}
}
if (flag) {
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 {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.QT_PROJECT_CHANGE_NOT_EXIST)));
boolean checkUpd = false;
for (TEmployeeProject tEmployeeCheck : checkList) {
if (tEmployeeCheck.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] || tEmployeeCheck.getSocialStatus() != CommonConstants.dingleDigitIntArray[0] ||
tEmployeeCheck.getFundStatus() != CommonConstants.dingleDigitIntArray[0]) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.QT_PROJECT_CHANGE_NOT_EXIST)));
checkUpd = true;
break;
}
}
if (!checkUpd) {
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 {
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
......
......@@ -60,7 +60,6 @@
a.SALARY_TYPE,
a.SALARY_STANDARD_PER_HOUR,
a.SALARY_STANDARD_PER_PIECE,
a.CREATE_USER_ID,
a.REMARK,
a.DELETE_FLAG,
a.WORK_SPACE,
......
......@@ -129,7 +129,6 @@
a.LEAVE_TIME,
a.LEAVE_REASON,
a.LEAVE_REMARK,
a.IS_LEAVE_EMPLOYEE,
a.EMP_NO,
a.UNIT_ID,
a.UNIT_NAME,
......@@ -265,9 +264,6 @@
<if test="tEmployeeProject.leaveRemark != null and tEmployeeProject.leaveRemark.trim() != ''">
AND a.LEAVE_REMARK = #{tEmployeeProject.leaveRemark}
</if>
<if test="tEmployeeProject.isLeaveEmployee != null">
AND a.IS_LEAVE_EMPLOYEE = #{tEmployeeProject.isLeaveEmployee}
</if>
<if test="tEmployeeProject.empNo != null and tEmployeeProject.empNo.trim() != ''">
AND a.EMP_NO = #{tEmployeeProject.empNo}
</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