Commit 9ceb00ed authored by fangxinjiang's avatar fangxinjiang

合同续签待办-fxj

parent 0d194f70
......@@ -385,9 +385,12 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
}
//初始化岗位名称
TAutoContractScheme scheme = contractSchemeMapper.selectById(pre.getConfigId());
if (Common.isNotNull(pre.getConfigId()) && "固定岗位".equals(preVo.getPost()) && null != scheme){
pre.setPost(scheme.getPost());
TAutoContractScheme scheme = contractSchemeMapper.selectById(preVo.getConfigId());
if (Common.isNotNull(preVo.getConfigId()) && "固定岗位".equals(preVo.getPost()) && null != scheme){
preVo.setPost(scheme.getPost());
}else {
//等于上一份合同的岗位明细
preVo.setPost(contract.getPost());
}
//处理预计发起时间
TAutoContractRuleInfo rule = null;
......@@ -417,6 +420,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
continue;
}
// 调整提醒日期为最近工作日 (0 上一份合同到期前第5个工作日的场景才调整)
if (CommonConstants.ZERO_STRING.equals(rule.getRenewalDateType())){
reminderDate = adjustToNearestWorkday(reminderDate);
}
// 检查电子签是否超期(和续签的合同开始日期进行比较)
if (null != preVo.getContractStart() && CommonConstants.ZERO_STRING.equals(preVo.getSignType())){
LocalDate contractStartDateNew = parseContractEndDate(preVo.getContractStart());
......@@ -425,19 +432,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
errorList.add(checkVo);
continue;
}
if (reminderDate.isAfter(contractStartDateNew.minusMonths(1))) {
if (reminderDate.isAfter(contractStartDateNew.plusMonths(1))) {
checkVo = buildErrorCheckVo(contract, preVo, EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR);
errorList.add(checkVo);
continue;
}
}
// 调整提醒日期为最近工作日 (0 上一份合同到期前第5个工作日的场景才调整)
if (CommonConstants.ZERO_STRING.equals(rule.getRenewalDateType())){
reminderDate = adjustToNearestWorkday(reminderDate);
}
// 设置预计发起时间
pre.setExpectedCollectionTime(DateUtil.getDateByLocalDate(reminderDate));
preVo.setExpectedCollectionTime(DateUtil.getDateByLocalDate(reminderDate));
}
......@@ -467,6 +470,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
boolean res = false;
if (preList != null && preList.size() > 0){
res = this.saveBatch(preList);
}else {
res = true;
}
if (res){
if (!errorList.isEmpty()) {
......@@ -529,7 +534,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
* 调整日期为最近工作日
*/
private LocalDate adjustToNearestWorkday(LocalDate date) {
return date.isBefore(LocalDate.now()) ? calculateReminderWorkDaysBefore(date, 1, 0) : date;
return date.isBefore(LocalDate.now()) ? calculateReminderWorkDaysBefore(LocalDate.now(), 1, 0) : date;
}
private String initDateInfo(TEmployeeContractPreNewVo preVo, TEmployeeContractInfo contract) {
......@@ -586,7 +591,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
preVo.setContractEnd(preVo.getInternshipPeriodEnd());
}
}
if (CommonConstants.THREE_STRING.equals(preVo.getContractType())){
if (CommonConstants.TWENTY_STRING.equals(preVo.getContractType())){
//处理劳务协议
preVo.setDispatchPeriodStart(DateUtil.addDayByDate(contract.getContractEnd(),1));
if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){
......@@ -857,14 +862,21 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
contractPreTemp.setRequestId(result.getData());
baseMapper.updateById(contractPreTemp);
}
if (Common.isNotNull(contractPreTemp.getContractId())) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("签署中");
audit.setLinkId(contractPreTemp.getContractId());
audit.setLinkType(CommonConstants.ONE_INT);
audit.setCreateName("法大大电子签");
audit.setCreateBy("1");
tEmployeeContractAuditService.save(audit);
if (Common.isNotNull(contractPreTemp.getId())) {
TEmployeeContractInfo empContract = contractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getPreNewId, contractPreTemp.getId())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.orderByDesc(BaseEntity::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (null != empContract && empContract.getId() != null){
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("签署中");
audit.setLinkId(empContract.getId());
audit.setLinkType(CommonConstants.ONE_INT);
audit.setCreateName("法大大电子签");
audit.setCreateBy("1");
tEmployeeContractAuditService.save(audit);
}
//更新合同的办理状态
updateEmpContractAlertHandleStatus(contractPre.getContractId(), CommonConstants.ONE_STRING);
// 更新processStatus为电子签发起失败
......
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