Commit 46d11022 authored by fangxinjiang's avatar fangxinjiang

合同续签待办-fxj

parent f7973a0e
...@@ -1252,7 +1252,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -1252,7 +1252,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
vo.setEmpPhone(employeeInfo.getEmpPhone()); vo.setEmpPhone(employeeInfo.getEmpPhone());
} }
TEmployeeContractPreNew preNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>lambdaQuery() TEmployeeContractPreNew preNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>lambdaQuery()
.eq(TEmployeeContractPreNew::getContractId, contractInfo.getId()).last(CommonConstants.LAST_ONE_SQL)); .eq(TEmployeeContractPreNew::getId, contractInfo.getPreNewId()).last(CommonConstants.LAST_ONE_SQL));
vo.setPreNew(preNew); vo.setPreNew(preNew);
TEmployeeContractPreHistory pre = contractPreHistoryMapper.selectOne(Wrappers.<TEmployeeContractPreHistory>lambdaQuery() TEmployeeContractPreHistory pre = contractPreHistoryMapper.selectOne(Wrappers.<TEmployeeContractPreHistory>lambdaQuery()
.eq(TEmployeeContractPreHistory::getContractId, contractInfo.getId()).last(CommonConstants.LAST_ONE_SQL)); .eq(TEmployeeContractPreHistory::getContractId, contractInfo.getId()).last(CommonConstants.LAST_ONE_SQL));
......
...@@ -59,6 +59,7 @@ import javax.servlet.ServletOutputStream; ...@@ -59,6 +59,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.*; import java.util.*;
...@@ -542,12 +543,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -542,12 +543,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (!CommonConstants.FIVE_STRING.equals(preVo.getContractType())){ if (!CommonConstants.FIVE_STRING.equals(preVo.getContractType())){
//合同开始日期=上一份合同截止日期+1日 //合同开始日期=上一份合同截止日期+1日
preVo.setContractStart(DateUtil.addDayByDate(contract.getContractEnd(),1)); preVo.setContractStart(DateUtil.addDayByDate(contract.getContractEnd(),1));
//同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉
if (Common.isNotNull(preVo.getContractEnd())){
if (preVo.getContractEnd().before(preVo.getContractStart())){
return "合同截止日期需大于等于合同开始日期";
}
}
//单个确认中,针对预计合同发起时间、合同开始日期、合同截止日期的信息为显示具体日期,而批量确认显示的是规则文字,具体确认完毕至每条的续签信息中时,才显示具体日期 TODO //单个确认中,针对预计合同发起时间、合同开始日期、合同截止日期的信息为显示具体日期,而批量确认显示的是规则文字,具体确认完毕至每条的续签信息中时,才显示具体日期 TODO
//增加“合同开始日期规则、合同截止日期规则”信息 //增加“合同开始日期规则、合同截止日期规则”信息
//——合同开始日期规则,只有一种:等于上一份合同截止日期+1日,文字显示 //——合同开始日期规则,只有一种:等于上一份合同截止日期+1日,文字显示
...@@ -594,6 +589,11 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -594,6 +589,11 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
preVo.setInternshipPeriodEnd(this.addYearsMonths(vo)); preVo.setInternshipPeriodEnd(this.addYearsMonths(vo));
preVo.setContractEnd(preVo.getInternshipPeriodEnd()); preVo.setContractEnd(preVo.getInternshipPeriodEnd());
} }
if (Common.isNotNull(preVo.getInternshipPeriodStart()) && Common.isNotNull(preVo.getInternshipPeriodEnd())){
if (preVo.getInternshipPeriodEnd().before(preVo.getInternshipPeriodStart())){
return "实习结束日期需大于等于实习开始日期";
}
}
} }
if (CommonConstants.TWENTY_STRING.equals(preVo.getContractType())){ if (CommonConstants.TWENTY_STRING.equals(preVo.getContractType())){
//处理劳务协议 //处理劳务协议
...@@ -605,6 +605,17 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -605,6 +605,17 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
vo.setRegistDate(preVo.getDispatchPeriodStart()); vo.setRegistDate(preVo.getDispatchPeriodStart());
preVo.setDispatchPeriodEnd(this.addYearsMonths(vo)); preVo.setDispatchPeriodEnd(this.addYearsMonths(vo));
} }
if (Common.isNotNull(preVo.getDispatchPeriodStart()) && Common.isNotNull(preVo.getDispatchPeriodEnd())){
if (preVo.getDispatchPeriodEnd().before(preVo.getDispatchPeriodStart())){
return "派遣结束日期需大于等于派遣开始日期";
}
}
}
//同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉
if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getContractEnd())){
if (preVo.getContractEnd().before(preVo.getContractStart())){
return "合同截止日期需大于等于合同开始日期";
}
} }
//更新岗位名称 //更新岗位名称
return null; return null;
...@@ -674,16 +685,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -674,16 +685,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
for (EmployeeContractVO contractVO : electronicSignList) { for (EmployeeContractVO contractVO : electronicSignList) {
TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreNewId()); TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreNewId());
if ("2".equals(type)){
contractVO.setReNewSubmitter("自动化自动-超管");
} else if("1".equals(type)){
YifuUser user = SecurityUtils.getUser();
if (user != null){
contractVO.setReNewSubmitter("自动化手动-"+user.getNickname());
}else {
contractVO.setReNewSubmitter("自动化手动-"+ (null==contractPre.getCustomerUsername()?"":contractPre.getCustomerUsername())); contractVO.setReNewSubmitter("自动化手动-"+ (null==contractPre.getCustomerUsername()?"":contractPre.getCustomerUsername()));
}
}
if (contractPre != null && contractPre.getContractStart() != null) { if (contractPre != null && contractPre.getContractStart() != null) {
if ("2".equals(type) && Common.isNotNull(contractPre.getCustomerUserLoginname()) && if ("2".equals(type) && Common.isNotNull(contractPre.getCustomerUserLoginname()) &&
null == loginNameMap.get(contractPre.getCustomerUserLoginname())) { null == loginNameMap.get(contractPre.getCustomerUserLoginname())) {
...@@ -760,7 +762,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -760,7 +762,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
} }
// 添加错误信息 // 添加错误信息
ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "电子签发起失败:已超过合同开始日期一个月"); ErrorMessage<EmployeeContractVO> errorMessage = new ErrorMessage<>(contractVO.getRowIndex(), "发起时间距离合同开始日期已超过一个月,禁止使用电子签,请切换为线下签");
errorMessage.setData(contractVO); errorMessage.setData(contractVO);
errorMessageListAll.add(errorMessage); errorMessageListAll.add(errorMessage);
} else { } else {
...@@ -1693,6 +1695,16 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -1693,6 +1695,16 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (Common.isEmpty(startDate) || Common.isEmpty(endDate)) { if (Common.isEmpty(startDate) || Common.isEmpty(endDate)) {
return R.failed(CommonConstants.PARAM_INFO_ERROR); return R.failed(CommonConstants.PARAM_INFO_ERROR);
} }
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
try {
Date parseStartDate = sdf.parse(startDate);
Date parseEndDate = sdf.parse(endDate);
if (parseStartDate.after(parseEndDate)){
return R.ok( null);
}
}catch (Exception e){
return R.ok( null);
}
ContractTermCalculator.ContractTerm term = calculator.calculateTerm(startDate, endDate); ContractTermCalculator.ContractTerm term = calculator.calculateTerm(startDate, endDate);
return R.ok( term); return R.ok( term);
} }
......
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