Commit a5281688 authored by hongguangwu's avatar hongguangwu

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

parents c09adc18 d0c1fc72
......@@ -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<>();
......
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