Commit 35ed9bc1 authored by fangxinjiang's avatar fangxinjiang

合同续签待办-fxj

parent 92bb4f0f
......@@ -544,6 +544,10 @@ public class TEmployeeContractInfo extends BaseEntity {
@TableField(exist = false)
private String preId;
@Schema(description = "合同续签待办确认preNewId")
private String preNewId;
/**
* preName
*/
......@@ -566,5 +570,10 @@ public class TEmployeeContractInfo extends BaseEntity {
private String tryPeriod;
/**
* 自动化提交人
*/
@Schema(description = "自动化提交人")
@TableField(exist = false)
private String reNewSubmitter;
}
......@@ -204,6 +204,15 @@ public class TEmployeeContractPreNew extends BaseEntity {
@ExcelProperty("合同类型")
@Schema(description = "合同类型 标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同")
private String contractType;
/**
* 合同名称 标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同
*/
@ExcelAttribute(name = "合同名称", maxLength = 8)
@Length(max = 8, message = "合同名称不能超过8个字符")
@ExcelProperty("合同名称")
@Schema(description = "合同名称 标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同")
private String contractName;
/**
* 签署甲方
*/
......
......@@ -25,6 +25,14 @@ import java.util.Date;
@Data
public class ContractAlertConfirmVo implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelAttribute(name = "主键" )
@Schema(description ="主键")
@ExcelIgnore
private String id;
/**
* 员工名称
*/
......
......@@ -249,6 +249,13 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
@ExcelProperty(value ="preId")
private String preId;
/**
* 续签待办确认信息ID
*/
@ExcelAttribute(name = "preNewId")
@ExcelProperty(value ="preNewId")
private String preNewId;
/**
* preName
*/
......@@ -263,4 +270,10 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
@TableField(exist = false)
private String leaveName;
/**
* 自动化提交人
*/
@Schema(description = "自动化提交人")
@TableField(exist = false)
private String reNewSubmitter;
}
......@@ -19,16 +19,13 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 合同续签确认信息--批量发起明细 系统会自动拉取当前前端客服+“预计合同发起时间”为空的或为今日及今日之前的,续签状态为“待发起、发起失败、审核不通过、签署失败”的合同信息;
......@@ -147,4 +144,20 @@ public class TEmployeeContractPreNewDetailVo {
@Schema(description = "合同截止日期")
private Date contractEnd;
/**
* 合同开始日期-上一份合同
*/
@ExcelAttribute(name = "合同开始日期-上一份合同" )
@Schema(description ="合同开始日期-上一份合同")
@ExcelProperty("合同开始日期-上一份合同")
private Date contractStartPre;
/**
* 合同截止日期-上一份合同
*/
@ExcelAttribute(name = "合同截止日期-上一份合同" )
@Schema(description ="合同截止日期-上一份合同")
@ExcelProperty("合同截止日期-上一份合同")
private Date contractEndPre;
}
......@@ -204,6 +204,15 @@ public class TEmployeeContractPreNewVo extends TEmployeeContractPreNew implement
@ExcelProperty("合同类型")
@Schema(description = "合同类型 标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同")
private String contractType;
/**
* 合同类型 标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同
*/
@ExcelAttribute(name = "合同名称", maxLength = 8)
@Length(max = 8, message = "合合同名称不能超过8个字符")
@ExcelProperty("合同名称")
@Schema(description = "合同名称 标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同")
private String contractName;
/**
* 签署甲方
*/
......@@ -570,7 +579,7 @@ public class TEmployeeContractPreNewVo extends TEmployeeContractPreNew implement
@Schema(description = "发起失败时间")
private Date errorTime;
/**
* 合同截止日期类型
* 合同截止日期类型 0 合同年限推算 1 同商务合同一致 2 工作任务完成时止 3 指定日期
*/
@ExcelAttribute(name = "合同截止日期类型", maxLength = 1)
@Length(max = 1, message = "合同截止日期类型不能超过1个字符")
......
......@@ -79,6 +79,18 @@ public class TEmployeeContractPreNewController {
public R<List<TEmployeeContractPreNewDetailVo>> getDetailList( TEmployeeContractPreNewSearchVo tEmployeeContractPreNew) {
return tEmployeeContractPreNewService.getDetailList(tEmployeeContractPreNew);
}
/**
* 简单分页查询--批量发起总数(权限内)
* 系统会自动拉取当前客服且“预计合同发起时间”为空的或为今日及今日之前的,续签状态为“待发起、发起失败、审核不通过、签署失败”的合同信息;
*
* @param tEmployeeContractPreNew 合同续签预派单信息
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/getDetailListCount")
public R<Integer> getDetailListCount( TEmployeeContractPreNewSearchVo tEmployeeContractPreNew) {
return tEmployeeContractPreNewService.getDetailListCount(tEmployeeContractPreNew);
}
/**
* 不分页查询
......@@ -101,7 +113,6 @@ public class TEmployeeContractPreNewController {
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('archives_temployeecontractprenew_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('archives_temployeecontractprenew_get')")
public R<TEmployeeContractPreNew> getById(@PathVariable("id") String id) {
return R.ok(tEmployeeContractPreNewService.getById(id));
}
......@@ -208,8 +219,8 @@ public class TEmployeeContractPreNewController {
/**
* 每天11点15点/15点20推送待派单数据 --- 工作日
* 会将发起失败、签署失败、审核不通过的“预计合同发起时间”为当日及之前日期的(空白的不在)合同续签任务自动尝试发起
* @author huych
* @date 2025-06-16 14:18:26
* @author fxj
* @date 2025-02-24
* @return void
*/
@SysLog("每天11、15、15:20 发起电子签自动发起任务")
......@@ -254,6 +265,7 @@ public class TEmployeeContractPreNewController {
/**
* @Author fxj
* @Description 一键催办
* @Param id loginName
* @Date 19:19 2026/2/10
**/
@Operation(description = "一键催办")
......@@ -294,20 +306,21 @@ public class TEmployeeContractPreNewController {
* 提醒至前端客服,点击提醒,提示:请至HRO系统及时进行合同确认,以免续签不及时!
* @author fxj
*/
@SysLog("派单当日9点统一推送续签确认信息")
@SysLog("日9点统一推送续签确认信息")
@Inner
@PostMapping("/inner/pushWxConfrimMessage")
public R pushWxConfrimMessage() {
return tEmployeeContractPreNewService.pushWxConfrimMessage();
}
/**
* @Author fxj
* @Description
* @Date 19:08 2026/2/10
* @Description 反推年限信息
* @Date 19:19 2026/2/10
**/
/*@Inner
@PostMapping("/inner/electronicSignExpiringReminder")
public R electronicSignExpiringReminder() {
return tEmployeeContractPreNewService.electronicSignExpiringReminder();
}*/
@Operation(description = "反推年限信息")
@GetMapping("/getContractTerm")
public R getContractTerm(@RequestParam String startDate, @RequestParam String endDate) {
return tEmployeeContractPreNewService.getContractTerm(startDate,endDate);
}
}
......@@ -50,4 +50,6 @@ public interface TEmployeeContractPreNewMapper extends BaseMapper<TEmployeeContr
List<TEmployeeContractPreNewDetailVo> getDetailList(@Param("tEmployeeContractPreNew")TEmployeeContractPreNewSearchVo tEmployeeContractPreNew);
List<String> getUnDispatchList();
int getDetailListCount(@Param("tEmployeeContractPreNew")TEmployeeContractPreNewSearchVo tEmployeeContractPreNew);
}
......@@ -78,4 +78,8 @@ public interface TEmployeeContractPreNewService extends IService<TEmployeeContra
R pushWxConfrimMessage();
void pushDisConfrimContracts();
R<Integer> getDetailListCount(TEmployeeContractPreNewSearchVo tEmployeeContractPreNew);
R getContractTerm(String startDate, String endDate);
}
......@@ -383,7 +383,8 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
return R.failed(FASC_NO_CONTRACT);
}
TEmployeeContractInfo empContract = tEmployeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getPreId,id)
.lambda().eq(TEmployeeContractInfo::getPreNewId,id)
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
String empIdCard = contract.getEmpIdcard();
if (Common.isEmpty(empIdCard)) {
......@@ -416,8 +417,11 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
}
// 如果状态过多,可以改为这个:
// ArrayUtils.contains(forbidStatusArr, tGzOfferInfo.getOfferStatus())
if (Common.isNotNull(contract.getRequestId())) {
//系统自动撤销及客服撤销都放行
if (Common.isNotNull(contract.getRequestId())
&& !CommonConstants.ELEVEN_STRING.equals(contract.getProcessStatus())
&& !CommonConstants.TEN_STRING.equals(contract.getProcessStatus())
&& !CommonConstants.FIVE_STRING.equals(contract.getProcessStatus())) {
return R.failed("合同已发起,请勿重复发起!");
}
TFascTemplate tFascTemplate = tFascTemplateService.getOne(Wrappers.<TFascTemplate>query()
......
......@@ -529,7 +529,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setFirstAlertTime(new Date());
}
//获取项目信息,合同配置信息,初始化前端客服、续签状态、自动化标识
alert.setProcessStatus(CommonConstants.ZERO_INT);
//alert.setProcessStatus(CommonConstants.ZERO_INT);
if (null != project){
alert.setCsName(project.getCsName());
......@@ -1270,7 +1270,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if (null == alert){
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
vo.setEmpContractAlert( alert);
if (Common.isNotNull(alert.getContractId())){
TEmployeeContractPreNew preNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getContractId,alert.getContractId())
......@@ -1278,19 +1278,26 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
vo.setContractPreNew(preNew);
if (null != preNew && Common.isNotNull(preNew.getId())){
TEmployeeContractInfo contractInfo = contractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getPreId,preNew.getId())
.eq(TEmployeeContractInfo::getPreNewId,preNew.getId())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
vo.setContractInfo(contractInfo);
if (Common.isNotNull(preNew.getProcessStatus())){
alert.setProcessStatus(Integer.parseInt(preNew.getProcessStatus()));
}
}else {
alert.setProcessStatus(CommonConstants.ZERO_INT);
}
}
vo.setEmpContractAlert( alert);
return R.ok(vo);
}
@Override
public R<List<ContractAlertConfirmVo>> getAutoRenewForConfirm(ContractAlertSearchVo tEmpContractAlert) {
// 如果查询条件续签状态为空默认查询 非已完成 状态数据
if (Common.isNotNull(tEmpContractAlert.getProcessStatusList())){
tEmpContractAlert.setProcessStatusList(Stream.of("0","1","2","3","4","5","6","7","8","10","11").collect(Collectors.toList()));
if (!Common.isNotNull(tEmpContractAlert.getProcessStatusList())){
tEmpContractAlert.setProcessStatusList(Stream.of("0").collect(Collectors.toList()));
}
//初始化客服的项目权限 ,管理员及SSC 全量
initSearchVo(tEmpContractAlert);
......
......@@ -584,7 +584,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
//续签待办自动化状态更新
if (Common.isNotNull(tEmployeeContractInfo.getPreId())) {
TEmployeeContractPreNew contractPreNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getId, tEmployeeContractInfo.getPreId())
.eq(TEmployeeContractPreNew::getId, tEmployeeContractInfo.getPreNewId())
.in(TEmployeeContractPreNew::getProcessStatus, Arrays.asList("0","1","3","5","7","11"))
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPreNew)) {
......@@ -630,7 +630,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
//续签撤销签署重新提交的话判断有没有合同待签订数据,有的话更新状态 2026-02-10
TEmployeeContractPreNew contractPreNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getId, tEmployeeContractInfo.getPreId())
.eq(TEmployeeContractPreNew::getId, tEmployeeContractInfo.getPreNewId())
.eq(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TEN_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPreNew)) {
......@@ -762,6 +762,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
audit.setCreateBy("1");
audit.setCreateTime(LocalDateTime.now());
}
if (Common.isNotNull(tEmployeeContractInfo.getReNewSubmitter())){
audit.setCreateName(tEmployeeContractInfo.getReNewSubmitter());
}
tEmployeeContractAuditMapper.updateById(audit);
}
}
......@@ -1013,8 +1016,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
//更新续签待办续签状态为4线下签待归档
TEmployeeContractPreNew contractPreNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getId, contractInfo.getPreId())
.eq(TEmployeeContractPreNew::getProcessStatus, CommonConstants.FOUR_STRING)
.eq(TEmployeeContractPreNew::getId, contractInfo.getPreNewId())
.eq(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPreNew)) {
contractPreNew.setProcessStatus(CommonConstants.FOUR_STRING);
......@@ -1045,11 +1048,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
//更新续签待办的续签状态为3线下签审核不通过
TEmployeeContractPreNew contractPreNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getId, contractInfo.getId())
.eq(TEmployeeContractPreNew::getId, contractInfo.getPreNewId())
.eq(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPreNew)) {
contractPreNew.setProcessStatus(CommonConstants.THREE_STRING);
contractPreNew.setErrorInfo(tEmployeeContractInfo.getAuditRemark());
contractPreNew.setErrorTime(new Date());
contractPreNewMapper.updateById(contractPreNew);
//更新合同提醒办理状态
LambdaUpdateWrapper<TEmpContractAlert> updateWrapper = new LambdaUpdateWrapper<>();
......@@ -1192,7 +1197,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
//更新续签待办合同待签订数据状态为4线下签待归档 为已归档
TEmployeeContractPreNew contractPreNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getId, tEmployeeContractInfo.getPreId())
.eq(TEmployeeContractPreNew::getId, tEmployeeContractInfo.getPreNewId())
.eq(TEmployeeContractPreNew::getProcessStatus, CommonConstants.FOUR_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPreNew)) {
......@@ -1201,7 +1206,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
//更新合同续签提醒办理状态为已完成
LambdaUpdateWrapper<TEmpContractAlert> updateWrapperAlert = new LambdaUpdateWrapper<>();
updateWrapperAlert.eq(TEmpContractAlert::getContractId, contractPreNew.getContractId())
.eq(TEmpContractAlert::getHandleStatus, CommonConstants.TWO_INT);
.set(TEmpContractAlert::getHandleStatus, CommonConstants.TWO_INT);
contractAlertMapper.update(null, updateWrapperAlert);
//把关联的其他附件置空
LambdaUpdateWrapper<TAttaInfo> updateWrapper = new LambdaUpdateWrapper<>();
......@@ -2255,7 +2260,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
//续签待办:更新续签状态为4线下签待归档
TEmployeeContractPreNew contractPreNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getId, contract.getPreId())
.eq(TEmployeeContractPreNew::getId, contract.getPreNewId())
.eq(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPreNew)) {
......@@ -2287,11 +2292,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
//续签待办:更新合同状态为3线下签审核不通过,合同续签提醒更新为待处理
TEmployeeContractPreNew contractPreNew = contractPreNewMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getId, contract.getPreId())
.eq(TEmployeeContractPreNew::getId, contract.getPreNewId())
.eq(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPreNew)) {
contractPreNew.setProcessStatus(CommonConstants.THREE_STRING);
contractPreNew.setErrorInfo(tEmployeeContractInfo.getAuditRemark());
contractPreNew.setErrorTime(new Date());
contractPreNewMapper.updateById(contractPreNew);
//更新合同提醒办理状态为待处理
LambdaUpdateWrapper<TEmpContractAlert> updateWrapper = new LambdaUpdateWrapper<>();
......
......@@ -16,8 +16,15 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.alibaba.excel.util.DateUtils;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasc.open.api.exception.ApiException;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationBatchErrorVo;
......@@ -26,16 +33,19 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpContractAlertMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.ContractTermCalculator;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreNewMapper;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.bean.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
......@@ -43,40 +53,15 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.*;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import org.springframework.web.client.RestTemplate;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.List;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -112,6 +97,16 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
@Autowired
private SocialDaprUtils socialDaprUtils;
@Autowired
private ContractTermCalculator calculator = new ContractTermCalculator();
@Autowired
private TAutoContractSchemeMapper contractSchemeMapper;
@Autowired
private TAutoContractRuleInfoMapper contractRuleInfoMapper;
/**
* 合同续签预派单信息简单分页查询
*
......@@ -255,12 +250,26 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
TEmpContractAlert alert = empContractAlertMapper.selectOne(Wrappers.<TEmpContractAlert>query().lambda()
.eq(TEmpContractAlert::getContractId,preVo.getContractId())
.last(CommonConstants.LAST_ONE_SQL));
if (null == alert){
return R.failed("未找到合同续签待办信息");
}
TEmployeeContractPreNew pre = new TEmployeeContractPreNew();
BeanCopyUtils.copyProperties(preVo,pre);
pre.setProcessStatus(CommonConstants.ONE_STRING);
if (null != alert){
pre.setCustomerUsername(alert.getCsName());
pre.setCustomerUserLoginname(alert.getCsLoginName());
pre.setDeptName(alert.getProject());
pre.setDeptNo(alert.getProjectNo());
pre.setEmployeeName(alert.getEmpName());
pre.setEmpIdcard(alert.getEmpIdcard());
pre.setDeptId(alert.getDeptId());
pre.setEmpPhone(alert.getEmpPhone());
pre.setEmployeeNature(alert.getEmpType());
pre.setPosition(alert.getPost());
pre.setIsUrg(CommonConstants.ZERO_STRING);
pre.setOverFlag(CommonConstants.ONE_STRING);
pre.setSignFlag(CommonConstants.ONE_STRING);
}
int res = -1;
if (Common.isNotNull(pre.getId())){
......@@ -296,7 +305,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
.groupBy(TEmpContractAlert::getContractId));
Map<String, TEmpContractAlert> alertMap = new HashMap<>();
if (alertList != null){
alertList.stream().filter(v -> v.getContractId() != null)
alertMap = alertList.stream().filter(v -> v.getContractId() != null)
.collect(Collectors.toMap(TEmpContractAlert::getContractId, v -> v));
}
TEmployeeContractPreNew pre = null;
......@@ -306,7 +315,34 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
TEmpContractAlert alert = null;
TEmployeeContractDateVo vo = null;
TEmployeeContractPreNew preNew = null;
String innitError = null;
for (TEmployeeContractInfo contract : contractList){
alert = alertMap.get(contract.getId());
if (null == alert){
checkVo = new TEmployeeAutoRegistCheckVo();
checkVo.setEmployeeName(contract.getEmpName());
checkVo.setEmpIdcard(contract.getEmpIdcard());
checkVo.setDeptName(preVo.getDeptName());
checkVo.setDeptNo(preVo.getDeptNo());
checkVo.setType("合同");
checkVo.setErrorMsg("未找到合同续签待办信息");
errorList.add(checkVo);
continue;
}
//初始化数据
innitError = initDateInfo(preVo, contract);
if (Common.isNotNull(innitError)){
checkVo = new TEmployeeAutoRegistCheckVo();
checkVo.setEmployeeName(contract.getEmpName());
checkVo.setEmpIdcard(contract.getEmpIdcard());
checkVo.setDeptName(preVo.getDeptName());
checkVo.setDeptNo(preVo.getDeptNo());
checkVo.setType("合同");
checkVo.setErrorMsg(innitError);
errorList.add(checkVo);
continue;
}
//判断两个合同时间是否重合
if (LocalDateUtil.hasOverlap(contract.getContractStart(),contract.getContractEnd(),preVo.getContractStart(),preVo.getContractEnd())){
checkVo = new TEmployeeAutoRegistCheckVo();
......@@ -340,32 +376,37 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
BeanCopyUtils.copyProperties(preVo,pre);
pre.setContractId(contract.getId());
pre.setProcessStatus(CommonConstants.ONE_STRING);
alert = alertMap.get(contract.getId());
if (null != alert){
pre.setCustomerUsername(alert.getCsName());
pre.setCustomerUserLoginname(alert.getCsLoginName());
pre.setDeptName(alert.getProject());
pre.setDeptNo(alert.getProjectNo());
pre.setEmployeeName(alert.getEmpName());
pre.setEmpIdcard(alert.getEmpIdcard());
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);
}
//合同开始日期=上一份合同截止日期+1日
pre.setContractStart(DateUtil.addDayByDate(contract.getContractEnd(),1));
//单个确认中,针对预计合同发起时间、合同开始日期、合同截止日期的信息为显示具体日期,而批量确认显示的是规则文字,具体确认完毕至每条的续签信息中时,才显示具体日期 TODO
//增加“合同开始日期规则、合同截止日期规则”信息
//——合同开始日期规则,只有一种:等于上一份合同截止日期+1日,文字显示
//——合同截止日期规则,有两种:①合同年限推算;②固定截止日期;
//规则确定后,对应到人员头上,显示具体的合同开始日期、合同截止日期;
//合同年限推算
if (Common.isEmpty(pre.getContractStart())
&& Common.isEmpty(pre.getContractEnd())
&& (Common.isNotNull(pre.getContractDurationYear())
|| Common.isNotNull(pre.getContractDurationMonth()))
&& Common.isNotNull(pre.getContractEndType())
&& CommonConstants.ZERO_STRING.equals(pre.getContractEndType())) {
vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(pre.getContractDurationMonth()) ? "0":pre.getContractDurationMonth()));
vo.setYearAfter(Integer.parseInt(Common.isEmpty(pre.getContractDurationYear()) ? "0":pre.getContractDurationYear()));
vo.setRegistDate(pre.getContractStart());
pre.setContractEnd(this.addYearsMonths(vo));
//初始化岗位名称
TAutoContractScheme scheme = contractSchemeMapper.selectById(pre.getConfigId());
if (Common.isNotNull(pre.getConfigId()) && "固定岗位".equals(preVo.getPost()) && null != scheme){
pre.setPost(scheme.getPost());
}
//处理预计发起时间
TAutoContractRuleInfo rule = null;
if (null != scheme){
rule = contractRuleInfoMapper.selectOne(Wrappers.<TAutoContractRuleInfo>query().lambda()
.eq(TAutoContractRuleInfo::getDeptNo,scheme.getDeptNo())
.last(CommonConstants.LAST_ONE_SQL));
}
//续签合同发起时间类型 :0 上一份合同到期前一个月
if (null != rule && CommonConstants.ZERO_STRING.equals(rule.getRenewalDateType()) && null != contract.getContractEnd()){
pre.setExpectedCollectionTime(DateUtil.addDayByDate(DateUtil.addMonthByDate(contract.getContractEnd(),-1),-1));
}
preList.add(pre);
}
boolean res = false;
......@@ -385,6 +426,75 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
}
private String initDateInfo(TEmployeeContractPreNewVo preVo, TEmployeeContractInfo contract) {
TEmployeeContractDateVo vo;
//标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同
//1:"标准合同,3:“劳务协议”,5:“实习协议,8:“非全日制’,9:"补贴合同,13:’见习协议,18:“兼职协议”,19:”临时聘用合同,20:"劳务派遣合同’,21:’其他
if (!CommonConstants.FIVE_STRING.equals(preVo.getContractType())){
//合同开始日期=上一份合同截止日期+1日
preVo.setContractStart(DateUtil.addDayByDate(contract.getContractEnd(),1));
//单个确认中,针对预计合同发起时间、合同开始日期、合同截止日期的信息为显示具体日期,而批量确认显示的是规则文字,具体确认完毕至每条的续签信息中时,才显示具体日期 TODO
//增加“合同开始日期规则、合同截止日期规则”信息
//——合同开始日期规则,只有一种:等于上一份合同截止日期+1日,文字显示
//——合同截止日期规则,有两种:①合同年限推算;②固定截止日期;
//规则确定后,对应到人员头上,显示具体的合同开始日期、合同截止日期;
if (Common.isNotNull(preVo.getContractEndType())){
if (CommonConstants.ZERO_STRING.equals(preVo.getContractEndType())){
//合同年限推算
if (Common.isNotNull(preVo.getContractStart())
&& Common.isEmpty(preVo.getContractEnd())
&& Common.isNotNull(preVo.getContractDurationYear())
&& Common.isNotNull(preVo.getContractDurationMonth())
) {
vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getContractDurationMonth()) ? "0": preVo.getContractDurationMonth()));
vo.setYearAfter(Integer.parseInt(Common.isEmpty(preVo.getContractDurationYear()) ? "0": preVo.getContractDurationYear()));
vo.setRegistDate(preVo.getContractStart());
preVo.setContractEnd(this.addYearsMonths(vo));
}
} else if (CommonConstants.ONE_STRING.equals(preVo.getContractEndType())
|| CommonConstants.THREE_STRING.equals(preVo.getContractEndType())){
//处理合同年限
ContractTermCalculator.ContractTerm term = calculator.calculateTerm(
DateUtil.formatDatePatten(preVo.getContractStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT),
DateUtil.formatDatePatten(preVo.getContractEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT));
if (term != null){
preVo.setContractDurationYear(Integer.toString(term.getYears()));
preVo.setContractDurationMonth(Integer.toString(term.getMonths()));
}else {
return "合同年限推算错误";
}
}
}
}
if (CommonConstants.FIVE_STRING.equals(preVo.getContractType())){
//处理实习协议
preVo.setInternshipPeriodStart(DateUtil.addDayByDate(contract.getContractEnd(),1));
preVo.setContractStart(DateUtil.addDayByDate(contract.getContractEnd(),1));
if (Common.isNotNull(preVo.getInternshipPeriod())){
vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getInternshipPeriod()) ? "0": preVo.getInternshipPeriod()));
vo.setYearAfter(0);
vo.setRegistDate(preVo.getInternshipPeriodStart());
preVo.setInternshipPeriodEnd(this.addYearsMonths(vo));
preVo.setContractEnd(preVo.getInternshipPeriodEnd());
}
}
if (CommonConstants.THREE_STRING.equals(preVo.getContractType())){
//处理劳务协议
preVo.setDispatchPeriodStart(DateUtil.addDayByDate(contract.getContractEnd(),1));
if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){
vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodMonth()) ? "0": preVo.getDispatchPeriodMonth()));
vo.setYearAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0": preVo.getDispatchPeriodYear()));
vo.setRegistDate(preVo.getDispatchPeriodStart());
preVo.setDispatchPeriodEnd(this.addYearsMonths(vo));
}
}
//更新岗位名称
return null;
}
/**
* @Author fxj
* @Description 合同续签待签订信息单个/批量发起签署任务
......@@ -394,7 +504,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
@Override
public R dispatcherContract(List<String> idList,String type) {
List<TEmployeeContractPreNew> contractPreList;
List<String> processStatus = Arrays.asList("0", "1", "3", "5", "7", "11");
List<String> processStatus = Arrays.asList("0", "1", "3", "5", "7", "11", "10");
if ("2".equals(type)) {
//自动 待发起、发起失败、撤销签署-客服撤销、撤销签署-系统自动撤销、签署失败、审核不通过
contractPreList = baseMapper.selectList(Wrappers.<TEmployeeContractPreNew>query()
......@@ -426,7 +536,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (Common.isNotNull(excelVOList) && !excelVOList.isEmpty()) {
for (EmployeeContractVO contractVO : excelVOList) {
TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreId());
TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreNewId());
if (contractPre != null && "0".equals(contractPre.getSignType())) {
// 电子签
electronicSignList.add(contractVO);
......@@ -445,7 +555,17 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
LocalDate currentDate = LocalDate.now();
for (EmployeeContractVO contractVO : electronicSignList) {
TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreId());
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()));
}
}
if (contractPre != null && contractPre.getContractStart() != null) {
if ("2".equals(type) && Common.isNotNull(contractPre.getCustomerUserLoginname()) &&
null == loginNameMap.get(contractPre.getCustomerUserLoginname())) {
......@@ -507,8 +627,9 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
updateWrapper.eq(TEmployeeContractPreNew::getId, contractPre.getId())
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPreNew::getErrorInfo, "电子签发起失败:已超过合同开始日期一个月")
.set(TEmployeeContractPreNew::getChangeTypeUser, type.equals("1") ? "自动化手动—" + contractPre.getCustomerUsername()
: "自动化自动—" + contractPre.getCustomerUsername() )
.set(TEmployeeContractPreNew::getChangeTypeUser, type.equals("1") ? "自动化手动—" +
(null==contractPre.getCustomerUsername()?"":contractPre.getCustomerUsername())
: "自动化自动—" + "超管" )
.set(TEmployeeContractPreNew::getChangeTypeReason, "已超过合同开始日期一个月,自动转线下签")
.set(TEmployeeContractPreNew::getChangeTypeTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()))
.set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING)
......@@ -579,10 +700,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
result = fascService.submitContractRenew(contractPreTemp.getId() );
} catch (Exception e) {
// 更新合同:
if (Common.isNotNull(contractPreTemp.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contractPreTemp.getContractId());
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
if (Common.isNotNull(contractPreTemp.getId())) {
TEmployeeContractInfo empContract = contractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getPreNewId, contractPreTemp.getId())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (null != empContract && empContract.getId() != null){
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
}
}
log.error("法大大推送执行异常", e);
}
......@@ -598,10 +724,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
.set(TEmployeeContractPreNew::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
this.update(updateWrapper);
// 更新合同:
if (Common.isNotNull(contractPreTemp.getContractId())) {
TEmployeeContractInfo empContract = contractInfoService.getById(contractPreTemp.getContractId());
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
if (Common.isNotNull(contractPreTemp.getId())) {
TEmployeeContractInfo empContract = contractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getPreNewId, contractPreTemp.getId())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (null != empContract && empContract.getId() != null){
empContract.setDeleteFlag(CommonConstants.ONE_INT);
contractInfoService.updateById(empContract);
}
}
if ("2".equals(type)) {
......@@ -633,6 +764,11 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
tEmployeeContractAuditService.save(audit);
//更新合同的办理状态
updateEmpContractAlertHandleStatus(contractPre.getContractId(), CommonConstants.ONE_STRING);
// 更新processStatus为电子签发起失败
LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPreNew::getId, contractPreTemp.getId())
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.SIX_STRING);
this.update(updateWrapper);
}
}
}
......@@ -646,7 +782,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
// 统计线下签的发起数量
for (EmployeeContractVO contractVO : offlineSignList) {
TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreId());
TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreNewId());
if (contractPre != null) {
String customerLoginName = contractPre.getCustomerUserLoginname();
CustomerStatistics customerStats = customerStatisticsMap.computeIfAbsent(customerLoginName, k -> {
......@@ -681,7 +817,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
EmployeeContractVO contractVO = disList.stream().filter(vo -> Objects.equals(vo.getRowIndex(), errorMessage.getLineNum())).collect(Collectors.toList()).get(0);
// 获取合同预签订信息以便统计
TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreId());
TEmployeeContractPreNew contractPre = preContractMap.get(contractVO.getPreNewId());
if ("2".equals(type) && Common.isNotNull(contractPre.getCustomerUserLoginname()) &&
null == loginNameMap.get(contractPre.getCustomerUserLoginname())) {
UUID uuid = UUID.randomUUID();
......@@ -710,7 +846,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TEmployeeContractPreNew::getId, contractVO.getPreId())
updateWrapper.in(TEmployeeContractPreNew::getId, contractVO.getPreNewId())
.in(TEmployeeContractPreNew::getProcessStatus, CommonConstants.contractDIsStatus)
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING)
......@@ -722,9 +858,31 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
//线下签发起失败 更新合同提醒为待处理
LambdaUpdateWrapper<TEmpContractAlert> updateWrapperAlert = new LambdaUpdateWrapper<>();
updateWrapperAlert.in(TEmpContractAlert::getContractId, contractVO.getContractId())
.in(TEmpContractAlert::getProcessStatus, CommonConstants.contractDIsStatus)
.set(TEmpContractAlert::getHandleStatus, CommonConstants.ZERO_STRING);
empContractAlertMapper.update(null, updateWrapperAlert);
} else {
//处理成功更新数据
EmployeeContractVO contractVO = disList.stream().filter(vo -> Objects.equals(vo.getRowIndex(), errorMessage.getLineNum())).collect(Collectors.toList()).get(0);
LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TEmployeeContractPreNew::getId, contractVO.getPreNewId())
.in(TEmployeeContractPreNew::getProcessStatus, CommonConstants.contractDIsStatus)
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING)
.set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING);
this.update(updateWrapper);
}
}
}
if (errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) {
for (ErrorMessage errorMessage : errorMessageList) {
if (errorMessage.getMessage().equals(CommonConstants.SAVE_SUCCESS)){
//处理成功更新数据
EmployeeContractVO contractVO = disList.stream().filter(vo -> Objects.equals(vo.getRowIndex(), errorMessage.getLineNum())).collect(Collectors.toList()).get(0);
LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPreNew::getId, contractVO.getPreNewId())
.in(TEmployeeContractPreNew::getProcessStatus, CommonConstants.contractDIsStatus)
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.TWO_STRING)
.set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING);
this.update(updateWrapper);
}
}
}
......@@ -881,10 +1039,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
//更新合同续签待办提醒的办理状态为待办理
updateEmpContractAlertHandleStatus(pre.getContractId(), CommonConstants.ZERO_STRING);
}
if (Common.isNotNull(pre.getContractId())) {
if (Common.isNotNull(pre.getId())) {
//如果存在合同申请审核数据,将状态更新成待提交
contractInfo = contractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getId, pre.getContractId())
.lambda().eq(TEmployeeContractInfo::getPreNewId, pre.getId())
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractInfo)) {
......@@ -909,6 +1067,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
try {
// 查询符合条件的合同:状态为"签署中"(6) 且 为电子签任务(signType=0) 且 合同开始日期到当日正好一个月
LocalDate currentDate = LocalDate.now();
// 计算一个月前的日期(当前日期减去1个月再加1天)
LocalDate oneMonthAgo = currentDate.minusMonths(1).plusDays(1);
List<TEmployeeContractPreNew> contractsToRevoke = baseMapper.selectList(Wrappers.<TEmployeeContractPreNew>query()
......@@ -922,15 +1081,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
return R.ok("未找到需要撤销的超时电子签署任务");
}
for (TEmployeeContractPreNew contractPre : contractsToRevoke) {
for (TEmployeeContractPreNew preNew : contractsToRevoke) {
try {
// 调用法大大撤销签署接口
R<String> revokeResult = fascService.cancelTaskRenew(contractPre.getId());
R<String> revokeResult = fascService.cancelTaskRenew(preNew.getId());
if (revokeResult.getCode() == 200) {
// 撤销成功:状态更新为"待发起"(1) 且 签署方式变更为"线下签"(1)
LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPreNew::getId, contractPre.getId())
updateWrapper.eq(TEmployeeContractPreNew::getId, preNew.getId())
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.ELEVEN_STRING) // 11 撤销签署-系统自动撤销
.set(TEmployeeContractPreNew::getSignType, CommonConstants.ONE_STRING) // 线下签
.set(TEmployeeContractPreNew::getRevokeReason, "超时未签署自行变更为线下签")
......@@ -941,29 +1100,29 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("续签-撤销签署");
audit.setCreateName("系统自动撤销");
audit.setLinkId(contractPre.getContractId());
audit.setLinkId(preNew.getContractId());
audit.setLinkType(CommonConstants.ONE_INT);
audit.setRemark("电子合同签署超过1个月未完成签署系统,自动撤销");
tEmployeeContractAuditService.save(audit);
//更新合同续签待办提醒的办理状态为待办理
updateEmpContractAlertHandleStatus(contractPre.getContractId(), CommonConstants.ZERO_STRING);
updateEmpContractAlertHandleStatus(preNew.getContractId(), CommonConstants.ZERO_STRING);
} else if ("已完成签署".equals(revokeResult.getMsg())) {
// 撤销失败原因为已完成签署:更新为签署完成的"待归档"状态(8)
LambdaUpdateWrapper<TEmployeeContractPreNew> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeContractPreNew::getId, contractPre.getId())
updateWrapper.eq(TEmployeeContractPreNew::getId, preNew.getId())
.set(TEmployeeContractPreNew::getProcessStatus, CommonConstants.EIGHT_STRING); // 电子待归档
this.update(updateWrapper);
//更新合同续签待办提醒的办理状态为办理中
updateEmpContractAlertHandleStatus(contractPre.getContractId(), CommonConstants.ONE_STRING);
updateEmpContractAlertHandleStatus(preNew.getContractId(), CommonConstants.ONE_STRING);
} else {
// 其他撤销失败原因
log.error("合同ID:{},撤销失败,原因:{}", contractPre.getId(), revokeResult.getMsg());
log.error("合同ID:{},撤销失败,原因:{}", preNew.getId(), revokeResult.getMsg());
}
} catch (Exception e) {
log.error("处理合同ID:{}时发生异常", contractPre.getId(), e);
log.error("处理合同ID:{}时发生异常", preNew.getId(), e);
}
}
return R.ok();
......@@ -983,7 +1142,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
//更新合同续签待办提醒的办理状态为待办理
LambdaUpdateWrapper<TEmpContractAlert> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmpContractAlert::getContractId, contractId)
.eq(TEmpContractAlert::getHandleStatus, handleStatus);
.set(TEmpContractAlert::getHandleStatus, handleStatus);
empContractAlertMapper.update(null, updateWrapper);
}
/**
......@@ -1040,8 +1199,8 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
Map<String, CustomerRevokeStatistics> customerStatsMap = new HashMap<>();
Map<String, String> loginNameMap = new HashMap<>();
for (TEmployeeContractPreNew contract : revokedContracts) {
String customerLoginName = contract.getCustomerUserLoginname();
for (TEmployeeContractPreNew preNew : revokedContracts) {
String customerLoginName = preNew.getCustomerUserLoginname();
if (Common.isNotNull(customerLoginName)) {
if (null == loginNameMap.get(customerLoginName)) {
UUID uuid = UUID.randomUUID();
......@@ -1056,11 +1215,11 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
//生成快照数据
TContractAutoLog contractAutoLog = new TContractAutoLog();
contractAutoLog.setContractId(loginNameMap.get(customerLoginName));
contractAutoLog.setEmpName(contract.getEmployeeName());
contractAutoLog.setEmpIdcard(contract.getEmpIdcard());
contractAutoLog.setPhone(contract.getEmpPhone());
contractAutoLog.setContractStartDate(contract.getContractStart());
contractAutoLog.setMainId(contract.getId());
contractAutoLog.setEmpName(preNew.getEmployeeName());
contractAutoLog.setEmpIdcard(preNew.getEmpIdcard());
contractAutoLog.setPhone(preNew.getEmpPhone());
contractAutoLog.setContractStartDate(preNew.getContractStart());
contractAutoLog.setMainId(preNew.getId());
contractAutoLogService.save(contractAutoLog);
}
}
......@@ -1160,7 +1319,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
Map<String, String> loginNameMap = new HashMap<>();
for (TEmployeeContractPreNew contract : signingContracts) {
if (contract.getContractStart() != null) {
// 计算入职一个月的最后一天
// 计算合同开始日期一个月的最后一天
LocalDate localDate = contract.getContractStart().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
......@@ -1267,7 +1426,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
}
/**
* 计算入职一个月最后一天往前count个工作日的日期列表
* 计算合同开始日期一个月最后一天往前count个工作日的日期列表
* @param lastDay 入职一个月的最后一天
* @return 3个工作日的日期列表
*/
......@@ -1347,19 +1506,54 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
@Override
public R<List<TEmployeeContractPreNewDetailVo>> getDetailList(TEmployeeContractPreNewSearchVo tEmployeeContractPreNew) {
YifuUser yifuUser = SecurityUtils.getUser();
if (null == yifuUser){
return R.failed(CommonConstants.USER_FAIL);
}
//系统会自动拉取当前客服且“预计合同发起时间”为空的或为今日及今日之前的,续签状态为“待发起、发起失败、审核不通过、签署失败”的合同信息
List<String> statusList = new ArrayList<>();
statusList.add(CommonConstants.FIVE_STRING);
statusList.add(CommonConstants.ONE_STRING);
tEmployeeContractPreNew.setStatusList(statusList);
tEmployeeContractPreNew.setCustomerUserLoginname(yifuUser.getUsername());
initSearchVo(tEmployeeContractPreNew);
return R.ok(baseMapper.getDetailList(tEmployeeContractPreNew));
}
@Override
public R<Integer> getDetailListCount(TEmployeeContractPreNewSearchVo tEmployeeContractPreNew) {
//系统会自动拉取当前客服且“预计合同发起时间”为空的或为今日及今日之前的,续签状态为“待发起、发起失败、审核不通过、签署失败”的合同信息
List<String> statusList = new ArrayList<>();
statusList.add(CommonConstants.FIVE_STRING);
statusList.add(CommonConstants.ONE_STRING);
tEmployeeContractPreNew.setStatusList(statusList);
initSearchVo(tEmployeeContractPreNew);
return R.ok(baseMapper.getDetailListCount(tEmployeeContractPreNew));
}
@Override
public R getContractTerm(String startDate, String endDate) {
if (Common.isEmpty(startDate) || Common.isEmpty(endDate)) {
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
ContractTermCalculator.ContractTerm term = calculator.calculateTerm(startDate, endDate);
return R.ok( term);
}
public void initSearchVo(TEmployeeContractPreNewSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId);
if (isSsc || CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
searchVo.setAuthSql(null);
return;
}
//非管理员及SSC 走前端客服查询逻辑
searchVo.setCustomerUserLoginname(user.getUsername());
}
public boolean haveRole(YifuUser user, long roleId) {
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
for (Long role : roleList) {
if (role == roleId) {
return true;
}
}
return false;
}
@Override
public R<TEmployeeContractInfo> getRenewContractByPreId(String preId) {
return R.ok(contractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query()
......@@ -1380,7 +1574,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
try {
LocalDate today = LocalDate.now();
// 查询所有状态为自动化+待确认的合同提醒数据
// 查询所有状态为自动化+待确认的合同提醒数据 (数据集减少优化:取值时间为当前时间前1个月+15天 后一个月+15天的数据)
List<ContractAlertAutoVo> confirmContracts = empContractAlertMapper.getPushWxConfrimInfos();
if (Common.isEmpty(confirmContracts)) {
......@@ -1388,8 +1582,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
// 按前端客服分组统计需要提醒的合同
Map<String, CustomerExpiringStatistics> customerStatsMap = new HashMap<>();
Map<String, String> loginNameMap = new HashMap<>();
boolean isSend = false;
LocalDate localDate;
......
package com.yifu.cloud.plus.v1.yifu.archives.utils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
/**
* @Author fxj
* @Date 2026/2/24
* @Description
* @Version 1.0
*/
@Service
public class ContractTermCalculator {
/**
* 合同期限计算结果
*/
public static class ContractTerm {
private final int years;
private final int months;
public ContractTerm(int years, int months) {
this.years = years;
this.months = months;
}
public int getYears() { return years; }
public int getMonths() { return months; }
}
/**
* 计算合同期限(年数和月数)
* @param startDate 合同开始日期
* @param endDate 合同截止日期
* @return ContractTerm 包含年数和月数
*/
public static ContractTerm calculateTerm(String startDate, String endDate) {
// 验证日期
if (startDate == null || endDate == null) {
throw new IllegalArgumentException("开始日期和截止日期不能为空");
}
// 计算相差的年数
int years = 0;
int months = (int) LocalDateUtil.betweenMonth(startDate, endDate);
// 处理月份进位
if (months >= 12) {
years = (months / 12);
months = months % 12;
}
return new ContractTerm(years, months);
}
/**
* 解析日期字符串(支持yyyy-MM-dd和yyyy年MM月dd日格式)
*/
private static LocalDate parseDate(String dateStr) {
if (dateStr == null || dateStr.trim().isEmpty()) {
throw new IllegalArgumentException("日期不能为空");
}
dateStr = dateStr.trim();
try {
// 处理 yyyy-MM-dd 格式
if (dateStr.contains("-")) {
String[] parts = dateStr.split("-");
if (parts.length == 3) {
return LocalDate.of(
Integer.parseInt(parts[0]),
Integer.parseInt(parts[1]),
Integer.parseInt(parts[2])
);
}
}
// 处理 yyyy年MM月dd日 格式
if (dateStr.contains("年")) {
String yearPart = dateStr.substring(0, dateStr.indexOf("年"));
String monthPart = dateStr.substring(dateStr.indexOf("年") + 1, dateStr.indexOf("月"));
String dayPart = dateStr.substring(dateStr.indexOf("月") + 1, dateStr.indexOf("日"));
return LocalDate.of(
Integer.parseInt(yearPart),
Integer.parseInt(monthPart),
Integer.parseInt(dayPart)
);
}
throw new IllegalArgumentException("不支持的日期格式: " + dateStr);
} catch (Exception e) {
throw new IllegalArgumentException("日期解析失败: " + dateStr, e);
}
}
/**
* 测试方法
*/
public static void main(String[] args) {
System.out.println("=== 合同期限计算测试 ===");
// 测试示例1:2026年2月3日到2027年2月2日(正好一年)
testCase("2026-02-03", "2027-02-02", "正好一年");
// 测试示例2:2026年2月3日到2027年2月3日(一年零一天,应算一年一个月)
testCase("2026-02-03", "2027-02-03", "一年零一天");
// 测试示例3:2026年2月3日到2027年2月28日(一年零25天,应算一年一个月)
testCase("2026-02-03", "2027-02-28", "一年零25天");
// 测试示例3:2026年2月3日到2027年3月3日(应算一年2个月)
testCase("2026-02-03", "2027-03-02", "一年1月零1天");
// 测试示例4:2026年2月3日到2027年3月1日(一年零26天,应算一年一个月)
testCase("2026-02-03", "2027-03-03", "跨月一天");
// 测试示例5:2026年2月3日到2028年2月2日(正好两年)
testCase("2026-02-03", "2028-03-04", "正好两年");
// 测试示例6:2026年2月3日到2028年3月1日(两年多,应算两年一个月)
testCase("2026-02-03", "2028-03-01", "两年多一天");
// 测试示例7:2026年1月31日到2026年2月28日(一个月差几天)
testCase("2026-01-31", "2026-02-28", "跨月边界");
}
private static void testCase(String start, String end, String description) {
try {
ContractTerm term = calculateTerm(start, end);
LocalDate startDate = parseDate(start);
LocalDate endDate = parseDate(end);
System.out.printf("开始:%-12s | 截止:%-12s | 结果:(%d年%d个月)%n",
start, end, term.getYears(), term.getMonths());
} catch (Exception e) {
System.out.println("错误:" + e.getMessage());
}
}
}
......@@ -79,7 +79,8 @@ public class DoFascTask {
TEmployeeContractInfo contractInfo = null;
if (preNew != null){
contractInfo = tEmployeeContractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getPreId,preNew.getId())
.lambda().eq(TEmployeeContractInfo::getPreNewId,preNew.getId())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
}
if (contractInfo != null) {
......@@ -139,6 +140,7 @@ public class DoFascTask {
}
if (!CommonConstants.ELEVEN_STRING.equals(preNew.getProcessStatus())) {
preNew.setProcessStatus(CommonConstants.TEN_STRING);
preNew.setRequestId("");
}
preNew.setSignFlag(CommonConstants.ZERO_STRING);
preNew.setRevokeReason(terminationNote);
......
......@@ -1196,6 +1196,7 @@ public class FascUtil {
contract.setProcessStatus(CommonConstants.dingleDigitStrArray[1]);
contract.setSignType(CommonConstants.dingleDigitStrArray[1]);
contract.setRequestMsg("");
contract.setRequestId("");
tEmployeeContractPreNewMapper.updateById(contract);
return R.ok();
} else {
......
......@@ -420,6 +420,7 @@
<!--tEmpContractAlert简单分页查询-->
<select id="getAutoRenewForConfirm" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertConfirmVo">
SELECT
a.id,
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_TYPE,
......@@ -429,7 +430,8 @@
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,
c.EMP_PHONE
c.EMP_PHONE,
a.contract_id
FROM t_emp_contract_alert a
LEFT JOIN t_employee_contract_pre_new b on a.CONTRACT_ID = b.contract_id
LEFT JOIN t_employee_info c on a.EMP_ID = c.id
......
......@@ -149,10 +149,6 @@
a.default_amount,
a.contract_duration_year,
a.contract_duration_month,
a.try_period_start,
a.try_period_end,
a.try_period_type,
a.try_period,
a.labor_cost,
a.risk_buy_desc,
a.salary_standard_per_hour,
......@@ -485,7 +481,8 @@
a.emp_idcard empIdcard,
a.dept_no deptNo,
a.situation,
a.contract_type contractName,
a.contract_name contractName,
a.contract_term contractType,
a.CONTRACT_SUB_NAME contractSubName,
null reason,
a.signatory contractParty,
......@@ -501,8 +498,8 @@
null remark,
a.sign_type signType,
null changeContractAndEmployee,
if(a.TRY_PERIOD = '' or a.TRY_PERIOD is null,'无',a.TRY_PERIOD) as tryPeriod,
a.id preId,a.contract_id contractId,
'无' as tryPeriod,
a.id preNewId,a.contract_id contractId,
if(#{type} = '1',concat('自动化手动-',a.customer_username),concat('自动化自动-',a.customer_username)) preName
FROM t_employee_contract_pre_new a,(select @i:=0) as itable
<where>
......@@ -525,4 +522,136 @@
FROM t_employee_contract_pre_new a
where a.process_status in('3','4','7') and (a.expected_collection_time is null or a.expected_collection_time <![CDATA[ <= ]]> now())
</select>
<!--tEmployeeContractPreNew简单分页查询-->
<select id="getDetailList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewDetailVo">
SELECT
a.id,
a.dept_name,
a.dept_no,
a.dept_id,
a.employee_name,
a.emp_idcard,
a.emp_phone,
a.employee_nature,
a.position,
a.customer_username,
a.customer_user_loginname,
a.sign_type,
a.contract_content,
a.fadada_template,
a.data_source,
a.process_status,
a.config_name,
a.update_flag,
a.contract_type,
a.signatory,
a.expected_confirm_time,
a.expected_collection_time,
a.situation,
a.contract_term,
case when a.CONTRACT_TYPE = 5 then a.internship_period_start
else a.contract_start end as "CONTRACT_START",
case when a.CONTRACT_TYPE = 5 then a.internship_period_end
else a.contract_end end as "CONTRACT_END",
a.post_type,
a.post,
a.working_dept,
a.work_address,
a.working_hours,
a.salary_type,
a.other_wage,
a.default_amount,
a.contract_duration_year,
a.contract_duration_month,
a.labor_cost,
a.risk_buy_desc,
a.salary_standard_per_hour,
a.salary_standard_per_piece,
a.config_id,
a.work_type,
a.work_day_count,
a.work_day,
a.work_hours,
a.settlement_cycle,
a.payment_time,
a.payment_type,
a.working_company,
a.dispatch_period_year,
a.dispatch_period_month,
a.dispatch_period_start,
a.dispatch_period_end,
a.other_work_day,
a.internship_period,
a.internship_period_start,
a.internship_period_end,
a.sign_flag,
a.error_info,
a.contract_id,
a.revoke_reason,
a.error_time,
a.contract_end_type,
a.confirm_emp_select,
a.timeout_elec_sign,
a.task,
a.task_type,
a.task_end_standard,
a.contract_flag,
a.CONTRACT_SUB_NAME,
a.fadada_template_id,
a.request_id,
a.request_msg,
a.over_flag,
a.change_type_reason,
a.change_type_user,
a.change_type_time,
a.is_urg,
a.working_reward,
a.update_time,
a.create_by,
a.create_name,
a.create_time,
a.update_by,
b.CONTRACT_START as "CONTRACT_START_PRE",
b.CONTRACT_END as "CONTRACT_END_PRE"
FROM t_employee_contract_pre_new a
LEFT JOIN t_employee_contract_info b on b.id=a.contract_id
<where>
1=1 AND (a.expected_collection_time is null or a.expected_collection_time <![CDATA[ <= ]]> concat(DATE_FORMAT(curdate(),'%Y-%m-%d'), ' 23:59:59'))
<if test="tEmployeeContractPreNew != null">
<if test="tEmployeeContractPreNew.statusList != null and tEmployeeContractPreNew.statusList.size>0">
AND a.process_status IN
<foreach collection="tEmployeeContractPreNew.statusList" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="tEmployeeContractPreNew.customerUserLoginname != null and tEmployeeContractPreNew.customerUserLoginname.trim() != ''">
AND a.customer_user_loginname = #{tEmployeeContractPreNew.customerUserLoginname}
</if>
</if>
<include refid="tEmployeeContractPreNew_where"/>
</where>
limit 2000
</select>
<select id="getDetailListCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_employee_contract_pre_new a
<where>
1=1 AND (a.expected_collection_time is null or a.expected_collection_time <![CDATA[ <= ]]> concat(DATE_FORMAT(curdate(),'%Y-%m-%d'), ' 23:59:59'))
<if test="tEmployeeContractPreNew != null">
<if test="tEmployeeContractPreNew.statusList != null and tEmployeeContractPreNew.statusList.size>0">
AND a.process_status IN
<foreach collection="tEmployeeContractPreNew.statusList" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="tEmployeeContractPreNew.customerUserLoginname != null and tEmployeeContractPreNew.customerUserLoginname.trim() != ''">
AND a.customer_user_loginname = #{tEmployeeContractPreNew.customerUserLoginname}
</if>
</if>
<include refid="tEmployeeContractPreNew_where"/>
</where>
</select>
</mapper>
......@@ -182,4 +182,68 @@ public class ArchiveTask {
log.info("-------------每日定时获取法大大模板和详情-定时任务结束------------");
}
/**
* @Author fxj
* @Description 每天15、15:20 续签待办发起电子签自动发起任务
* @Date 15:25 2026/2/24
**/
public void pushDisConfrimContractsNew() {
log.info("-------------每天11、15.00、15.20点续签待办发起电子签自动发起任务--定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/temployeecontractprenew/inner/pushDisConfrimContracts", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每天11、15.00、15.20点续签待办发起电子签自动发起任务--定时任务截止------------");
}
/**
* @Author fxj
* @Description 每日晚23:00自动撤销超时电子签署任务(当前时间正好为合同开始日期一个月的数据)
* @Date 15:25 2026/2/24
**/
public void autoRevokeElectronicSign() {
log.info("-------------每日晚23:00自动撤销超时电子签署任务--定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/temployeecontractprenew/inner/autoRevokeElectronicSign", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每日晚23:00自动撤销超时电子签署任务--定时任务截止------------");
}
/**
* @Author fxj
* @Description 每日早9点通知前端客服前一日撤销电子签署情况
* @Date 15:25 2026/2/24
**/
public void notifyRevokedElectronicSign() {
log.info("-------------每日早9点通知前端客服前一日撤销电子签署情况--定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/temployeecontractprenew/inner/notifyRevokedElectronicSign", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每日早9点通知前端客服前一日撤销电子签署情况--定时任务截止------------");
}
/**
* @Author fxj
* @Description 每日早9点电子签合同即将超期提醒
* @Date 15:25 2026/2/24
**/
public void electronicSignExpiringReminder() {
log.info("-------------每日早9点电子签合同即将超期提醒--定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/temployeecontractprenew/inner/electronicSignExpiringReminder", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每日早9点电子签合同即将超期提醒--定时任务截止------------");
}
/**
* @Author fxj
* @Description 每日9点统一推送续签确认信息
* @Date 15:25 2026/2/24
**/
public void pushWxConfrimMessage() {
log.info("-------------每日9点统一推送续签确认信息--定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/temployeecontractprenew/inner/pushWxConfrimMessage", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每日9点统一推送续签确认信息--定时任务截止------------");
}
}
\ No newline at end of file
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