Commit eae2c643 authored by fangxinjiang's avatar fangxinjiang

合同续签待办-fxj

parent daa5833f
......@@ -235,6 +235,15 @@ public class TEmployeeContractPreNew extends BaseEntity {
@ExcelProperty("预计合同发起时间")
@Schema(description = "预计合同发起时间")
private Date expectedCollectionTime;
/**
* 续签合同发起时间类型 0 上一份合同到期前一个月 最新更新为:0 上一份合同到期前第5个工作日 1 上一份合同到期后第10个工作日
*/
@TableField(exist = false)
@ExcelAttribute(name = "续签合同发起时间类型 ")
@ExcelProperty("续签合同发起时间类型 ")
@Schema(description = "续签合同发起时间类型 0 上一份合同到期前一个月")
private String renewalDateType;
/**
* 签订类型-续签、新签等
*/
......
......@@ -16,6 +16,7 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import cn.hutool.core.date.DateTime;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -234,7 +235,7 @@ public class TEmployeeContractPreNewVo extends TEmployeeContractPreNew implement
@ExcelAttribute(name = "预计合同发起时间", isDate = true)
@ExcelProperty("预计合同发起时间")
@Schema(description = "预计合同发起时间")
private Date expectedCollectionTime;
private DateTime expectedCollectionTime;
/**
* 签订类型-续签、新签等
*/
......
......@@ -62,6 +62,7 @@ import java.io.IOException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
......@@ -365,12 +366,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
TEmployeeAutoRegistCheckVo checkVo;
TEmpContractAlert alert = null;
//已合同Id 组建map
Map<String,ContractAlertConfirmResVo> confirmMap = null;
List<ContractAlertConfirmResVo> confirmVos = preVo.getConfirmVos();
if (null != confirmVos && confirmVos.size() > 0){
confirmMap = confirmVos.stream().filter(v -> v.getContractId() != null)
.collect(Collectors.toMap(ContractAlertConfirmResVo::getContractId, v -> v));
}
ContractAlertConfirmResVo temp = null;
TEmployeeContractPreNewVo preVoTemp = null;
for (TEmployeeContractInfo contract : contractList){
......@@ -422,7 +417,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
pre.setDeptId(alert.getDeptId());
pre.setEmpPhone(alert.getEmpPhone());
pre.setEmployeeNature(alert.getEmpType());
pre.setPost(alert.getPost());
pre.setIsUrg(CommonConstants.ZERO_STRING);
pre.setOverFlag(CommonConstants.ONE_STRING);
pre.setSignFlag(CommonConstants.ONE_STRING);
......@@ -495,15 +489,13 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
// 计算预计发起日期
LocalDate reminderDate = calculateReminderDate(rule.getRenewalDateType(), contractEndDate);
LocalDate reminderDate = calculateReminderDate(preVoTemp.getRenewalDateType(), contractEndDate);
if (null == reminderDate) {
return buildErrorCheckVo(contract, preVoTemp, "预计发起时间初始化失败");
}
// 调整提醒日期为最近工作日 (0 上一份合同到期前第5个工作日的场景才调整)
if (CommonConstants.ZERO_STRING.equals(rule.getRenewalDateType())){
// 当前时间之前调整提醒日期为最近工作日
reminderDate = adjustToNearestWorkday(reminderDate);
}
// 检查电子签是否超期(和续签的合同开始日期进行比较)
if (null != preVoTemp.getContractStart() && CommonConstants.ZERO_STRING.equals(preVoTemp.getSignType())){
LocalDate contractStartDateNew = parseContractEndDate(preVoTemp.getContractStart());
......@@ -514,9 +506,11 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
return buildErrorCheckVo(contract, preVoTemp, EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR);
}
}
//reminderDate 设置15:20
// 设置预计发起时间
preVoTemp.setExpectedCollectionTime(DateUtil.getDateByLocalDate(reminderDate));
preVoTemp.setExpectedCollectionTime(DateUtil.stringToDate(
DateUtil.dateToString(DateUtil.getDateByLocalDate(reminderDate),
DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 15:20", DateUtil.DATETIME_PATTERN_MINUTE));
}
return null;
}
......@@ -645,6 +639,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
vo.setYearAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0": preVo.getDispatchPeriodYear()));
vo.setRegistDate(preVo.getDispatchPeriodStart());
preVo.setDispatchPeriodEnd(this.addYearsMonths(vo));
preVo.setContractEnd(preVo.getDispatchPeriodEnd());
}
if (Common.isNotNull(preVo.getDispatchPeriodStart()) && Common.isNotNull(preVo.getDispatchPeriodEnd())){
if (preVo.getDispatchPeriodEnd().before(preVo.getDispatchPeriodStart())){
......@@ -1990,10 +1985,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (null == reminderDate) {
return null;
}
// 调整提醒日期为最近工作日 (0 上一份合同到期前第5个工作日的场景才调整)
if (CommonConstants.ZERO_STRING.equals(rule.getRenewalDateType())){
// 当前时间之前调整提醒日期为最近工作日
reminderDate = adjustToNearestWorkday(reminderDate);
}
return reminderDate;
}
}
......
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