Commit f79432e3 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.20' into MVP1.7.20

parents 68b6d208 4fab56f9
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import cn.hutool.core.date.DateTime;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
......@@ -235,6 +236,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;
......
......@@ -53,7 +53,6 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import javax.servlet.ServletOutputStream;
......@@ -277,7 +276,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
//判断两个合同时间是否重合
if (LocalDateUtil.hasOverlap(contract.getContractStart(),contract.getContractEnd(),preVo.getContractStart(),preVo.getContractEnd())){
return R.failed(EmployeeConstants.DATA_CONTRACT_OVERLAP);
return R.failed("发起时间距离合同开始日期已超过一个月,禁止使用电子签,请切换为线下签");
}
TEmpContractAlert alert = empContractAlertMapper.selectOne(Wrappers.<TEmpContractAlert>query().lambda()
.eq(TEmpContractAlert::getContractId,preVo.getContractId())
......@@ -365,12 +364,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){
......@@ -380,7 +373,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
temp = new ContractAlertConfirmResVo();
temp.setContractId(contract.getId());
temp.setContractEnd(null==contract.getContractEnd()?"":DateUtil.dateToString(contract.getContractEnd(), DateUtil.ISO_EXPANDED_DATE_FORMAT));
temp.setContractStart(null==contract.getContractEnd()?"":DateUtil.dateToString(contract.getContractEnd(), DateUtil.ISO_EXPANDED_DATE_FORMAT));
temp.setContractStart(null==contract.getContractStart()?"":DateUtil.dateToString(contract.getContractStart(), DateUtil.ISO_EXPANDED_DATE_FORMAT));
temp.setEmpIdcard(contract.getEmpIdcard());
temp.setEmpName(contract.getEmpName());
temp.setContractType(preVoTemp.getContractName());
......@@ -422,7 +415,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 +487,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 +504,12 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
return buildErrorCheckVo(contract, preVoTemp, EmployeeConstants.DATA_CONTRACT_EXPECTED_SIGN_TIME_ERROR);
}
}
//reminderDate 设置15:20
Date reminderDateNew =DateUtil.getDateByLocalDate(reminderDate);
reminderDateNew.setHours(15);
reminderDateNew.setMinutes(20);
// 设置预计发起时间
preVoTemp.setExpectedCollectionTime(DateUtil.getDateByLocalDate(reminderDate));
preVoTemp.setExpectedCollectionTime(reminderDateNew);
}
return null;
}
......@@ -1289,19 +1282,25 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPreNew::getId, preNew.getId())
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.ELEVEN_STRING) // 11 撤销签署-系统自动撤销
.set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING) // 线下签
.set(TEmployeeContractPreNew::getRevokeReason, "超时未签署自行变更为线下签")
.set(TEmployeeContractPreNew::getChangeTypeReason, "超时未签署自行变更为线下签")
.set(TEmployeeContractPreNew::getChangeTypeUser, "超管")
.set(TEmployeeContractPreNew::getChangeTypeTime, DateUtil.getCurrentDateTime());
this.update(updateWrapper);
TEmployeeContractInfo contractInfo = contractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getPreNewId, preNew.getId())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(BaseEntity::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (null != contractInfo){
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("续签-撤销签署");
audit.setCreateName("系统自动撤销");
audit.setLinkId(preNew.getContractId());
audit.setLinkId(contractInfo.getId());
audit.setLinkType(CommonConstants.ONE_INT);
audit.setRemark("电子合同签署超过1个月未完成签署系统,自动撤销");
audit.setRemark("电子合同续签超过一个月未完成签署,系统自动撤销");
tEmployeeContractAuditService.save(audit);
}
//更新合同续签待办提醒的办理状态为待办理
updateEmpContractAlertHandleStatus(preNew.getContractId(), CommonConstants.ZERO_STRING);
......@@ -1385,7 +1384,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
.lambda()
.in(TEmployeeContractPreNew::getContractId, contractIds)
.eq(TEmployeeContractPreNew::getProcessStatus, CommonConstants.ELEVEN_STRING) // 撤销签署-系统自动撤销
.eq(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING) // 线下签
.eq(TEmployeeContractPreNew::getSignType, CommonConstants.ZERO_STRING) // 线下签
.eq(TEmployeeContractPreNew::getChangeTypeReason, "超时未签署自行变更为线下签")
);
......@@ -1563,7 +1562,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
CustomerExpiringStatistics stats = entry.getValue();
if (stats.getExpiringCount() > 0 && Common.isNotNull(stats.getCustomerUserLoginname())) {
// 生成提醒内容
String reminderContent = String.format("距离合同开始日期1个月还剩3天,仍未签署合同的员工数:%d人",
String reminderContent = String.format("距离电子签续签到期还剩3天,仍未签署合同的员工数:%d人",
stats.getExpiringCount());
// 发送企微提醒
......@@ -1990,10 +1989,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;
}
}
......
......@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCutsomerDataPermissonMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpContractAlertMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreNewMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TSettleDomainMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.EmployeeRegistrationPreService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService;
......@@ -90,6 +91,10 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
@Lazy
private TEmployeeContractPreService employeeContractPreService;
@Autowired
@Lazy
private TEmployeeContractPreNewMapper employeeContractPreNewMapper;
@Autowired
@Lazy
private EmployeeRegistrationPreService registrationPreService;
......@@ -606,6 +611,12 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
.set(TEmployeeContractPre::getCustomerUsername, vo.getName())
.set(TEmployeeContractPre::getCustomerUserLoginname, vo.getLoginName());
employeeContractPreService.update(updateContractWrapper);
//更新合同待续签的前端客服
LambdaUpdateWrapper<TEmployeeContractPreNew> updateContractNewWrapper = new LambdaUpdateWrapper<>();
updateContractNewWrapper.eq(TEmployeeContractPreNew::getDeptNo,vo.getDepartNo())
.set(TEmployeeContractPreNew::getCustomerUsername, vo.getName())
.set(TEmployeeContractPreNew::getCustomerUserLoginname, vo.getLoginName());
employeeContractPreNewMapper.update(null,updateContractNewWrapper);
//更新社保待购买的前端客服
socialDaprUtils.updateSocialPreCustomerName(updateVo);
......
......@@ -1194,7 +1194,6 @@ public class FascUtil {
tFascPushLogService.updateById(pushLog);
if (res.isSuccess()) {
contract.setProcessStatus(CommonConstants.dingleDigitStrArray[1]);
contract.setSignType(CommonConstants.dingleDigitStrArray[1]);
contract.setRequestMsg("");
contract.setRequestId("");
tEmployeeContractPreNewMapper.updateById(contract);
......
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