Commit a55cde94 authored by fangxinjiang's avatar fangxinjiang

合同续签优化-fxj

parent 64c39899
...@@ -633,7 +633,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -633,7 +633,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
} }
} }
if (CommonConstants.TWENTY_STRING.equals(preVo.getContractType())){ if (CommonConstants.TWENTY_STRING.equals(preVo.getContractType())){
//处理劳务协议: 先看上一份合同是否为劳务协议,如果是取值上一份合同的劳务协议结束日期 //处理务派遣合同: 先看上一份合同是否为劳务协议,如果是取值上一份合同的劳务协议结束日期
Date initDate = contract.getContractEnd(); Date initDate = contract.getContractEnd();
if (Common.isNotNull(contract.getPreNewId())){ if (Common.isNotNull(contract.getPreNewId())){
TEmployeeContractPreNew preNew = baseMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda() TEmployeeContractPreNew preNew = baseMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
...@@ -652,6 +652,22 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -652,6 +652,22 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
} }
preVo.setDispatchPeriodStart(DateUtil.addDayByDate(initDate,1)); preVo.setDispatchPeriodStart(DateUtil.addDayByDate(initDate,1));
if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){ if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){
//校验劳务派遣的派遣年限必须为两年
final int REQUIRED_SERVICE_YEARS = 2;
int year = 0;
try {
year = Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0" : preVo.getDispatchPeriodYear().trim());
} catch (NumberFormatException e) {
return "劳务派遣的派遣年限格式不正确";
}
String dispatchMonth = preVo.getDispatchPeriodMonth();
if ("12".equals(dispatchMonth)) {
year = year + 1;
}
if (year < REQUIRED_SERVICE_YEARS) {
return "劳务派遣合同的合同年限不能小于2年,请检查";
}
vo = new TEmployeeContractDateVo(); vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodMonth()) ? "0": preVo.getDispatchPeriodMonth())); vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodMonth()) ? "0": preVo.getDispatchPeriodMonth()));
vo.setYearAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0": preVo.getDispatchPeriodYear())); vo.setYearAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0": preVo.getDispatchPeriodYear()));
...@@ -663,6 +679,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -663,6 +679,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
return "派遣结束日期需大于等于派遣开始日期"; return "派遣结束日期需大于等于派遣开始日期";
} }
} }
//合同开始时间、合同截止时间 与派遣的合同开始时间、合同截止时间一致
if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getDispatchPeriodStart())
&& !preVo.getContractStart().equals(preVo.getDispatchPeriodStart())){
return "合同开始日期与派遣开始日期不一致";
}
if (Common.isNotNull(preVo.getContractEnd()) && Common.isNotNull(preVo.getDispatchPeriodEnd())
&& !preVo.getContractEnd().equals(preVo.getDispatchPeriodEnd())){
return "合同截止日期与派遣截止日期不一致";
}
} }
//同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉 //同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉
if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getContractEnd())){ if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getContractEnd())){
......
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