Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
ec3b01b2
Commit
ec3b01b2
authored
Feb 11, 2026
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同续签-fxj
parent
7e38887d
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
3530 additions
and
168 deletions
+3530
-168
TContractAutoLog.java
.../cloud/plus/v1/yifu/archives/entity/TContractAutoLog.java
+8
-0
TEmpContractAlert.java
...cloud/plus/v1/yifu/archives/entity/TEmpContractAlert.java
+6
-1
TEmployeeContractPreNew.java
...plus/v1/yifu/archives/entity/TEmployeeContractPreNew.java
+52
-41
ContractAlertAutoVo.java
...u/cloud/plus/v1/yifu/archives/vo/ContractAlertAutoVo.java
+404
-0
ContractAlertConfirmVo.java
...loud/plus/v1/yifu/archives/vo/ContractAlertConfirmVo.java
+120
-0
EmpContractRenewVO.java
...fu/cloud/plus/v1/yifu/archives/vo/EmpContractRenewVO.java
+44
-0
EmpProjectVO.java
...com/yifu/cloud/plus/v1/yifu/archives/vo/EmpProjectVO.java
+17
-17
TEmpContractAlertExportVo.java
...d/plus/v1/yifu/archives/vo/TEmpContractAlertExportVo.java
+3
-8
TEmployeeContractPreNewDetailVo.java
.../v1/yifu/archives/vo/TEmployeeContractPreNewDetailVo.java
+150
-0
TEmployeeContractPreNewSearchVo.java
.../v1/yifu/archives/vo/TEmployeeContractPreNewSearchVo.java
+6
-0
TEmployeeContractPreNewVo.java
...d/plus/v1/yifu/archives/vo/TEmployeeContractPreNewVo.java
+7
-5
EmployeeConstants.java
...ud/plus/v1/yifu/archives/constants/EmployeeConstants.java
+16
-0
FascController.java
...loud/plus/v1/yifu/archives/controller/FascController.java
+51
-1
TEmpContractAlertController.java
...yifu/archives/controller/TEmpContractAlertController.java
+31
-5
TEmployeeContractPreNewController.java
...rchives/controller/TEmployeeContractPreNewController.java
+146
-11
TEmpContractAlertMapper.java
...plus/v1/yifu/archives/mapper/TEmpContractAlertMapper.java
+8
-5
TEmployeeContractPreNewMapper.java
...1/yifu/archives/mapper/TEmployeeContractPreNewMapper.java
+11
-0
FascService.java
...yifu/cloud/plus/v1/yifu/archives/service/FascService.java
+13
-0
TEmpContractAlertService.java
...us/v1/yifu/archives/service/TEmpContractAlertService.java
+6
-5
TEmployeeContractPreNewService.java
...yifu/archives/service/TEmployeeContractPreNewService.java
+26
-0
FascServiceImpl.java
...d/plus/v1/yifu/archives/service/impl/FascServiceImpl.java
+131
-1
TEmpContractAlertServiceImpl.java
...u/archives/service/impl/TEmpContractAlertServiceImpl.java
+92
-21
TEmployeeContractInfoServiceImpl.java
...chives/service/impl/TEmployeeContractInfoServiceImpl.java
+128
-0
TEmployeeContractPreNewServiceImpl.java
...ives/service/impl/TEmployeeContractPreNewServiceImpl.java
+1318
-8
TSettleDomainServiceImpl.java
.../yifu/archives/service/impl/TSettleDomainServiceImpl.java
+11
-0
DoFascTask.java
...om/yifu/cloud/plus/v1/yifu/archives/utils/DoFascTask.java
+172
-3
FascUtil.java
.../com/yifu/cloud/plus/v1/yifu/archives/utils/FascUtil.java
+375
-3
TContractAutoLogMapper.xml
...-biz/src/main/resources/mapper/TContractAutoLogMapper.xml
+2
-1
TEmpContractAlertMapper.xml
...biz/src/main/resources/mapper/TEmpContractAlertMapper.xml
+121
-16
TEmployeeContractPreNewMapper.xml
...c/main/resources/mapper/TEmployeeContractPreNewMapper.xml
+55
-16
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TContractAutoLog.java
View file @
ec3b01b2
...
...
@@ -61,6 +61,14 @@ public class TContractAutoLog extends BaseEntity {
@ExcelProperty
(
"入职日期"
)
@Schema
(
description
=
"入职日期"
)
private
Date
joinLeaveDate
;
/**
* 合同开始日期
*/
@ExcelAttribute
(
name
=
"合同开始日期"
,
isDate
=
true
)
@ExcelProperty
(
"合同开始日期"
)
@Schema
(
description
=
"合同开始日期"
)
private
Date
contractStartDate
;
/**
* 手机号码
*/
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmpContractAlert.java
View file @
ec3b01b2
...
...
@@ -321,6 +321,7 @@ public class TEmpContractAlert extends BaseEntity {
/**
* 预计合同发起时间
*/
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"预计合同发起时间"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"预计合同发起时间"
)
...
...
@@ -329,6 +330,7 @@ public class TEmpContractAlert extends BaseEntity {
/**
* 签署方式:1线下签0电子签
*/
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"签署方式"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"签署方式"
)
...
...
@@ -338,15 +340,17 @@ public class TEmpContractAlert extends BaseEntity {
/**
* 续签状态:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署
*/
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"续签状态"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"续签状态"
)
@Schema
(
description
=
"签署方式:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署"
)
@Schema
(
description
=
"签署方式:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署
-客服撤销 11撤销签署-系统自动撤销
"
)
private
Integer
processStatus
;
/**
* 前端客服
*/
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"前端客服"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"前端客服"
)
...
...
@@ -356,6 +360,7 @@ public class TEmpContractAlert extends BaseEntity {
/**
* 前端客服
*/
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"前端客服"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"前端客服"
)
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmployeeContractPreNew.java
View file @
ec3b01b2
...
...
@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
...
...
@@ -148,12 +149,12 @@ public class TEmployeeContractPreNew extends BaseEntity {
@Schema
(
description
=
"签署方式1线下签0电子签"
)
private
String
signType
;
/**
* 合同签订内容:0
自定义、
上一份合同
* 合同签订内容:0
项目配置、1自定义、2
上一份合同
*/
@ExcelAttribute
(
name
=
"合同签订内容"
,
maxLength
=
100
)
@Length
(
max
=
100
,
message
=
"合同签订内容同不能超过100个字符"
)
@ExcelProperty
(
"合同签订内容"
)
@Schema
(
description
=
"合同签订内容:0
自定义、
上一份合同"
)
@Schema
(
description
=
"合同签订内容:0
项目配置、1自定义、2
上一份合同"
)
private
String
contractContent
;
/**
* 法大大模版名称
...
...
@@ -177,7 +178,7 @@ public class TEmployeeContractPreNew extends BaseEntity {
@ExcelAttribute
(
name
=
"续签状态"
,
maxLength
=
2
)
@Length
(
max
=
2
,
message
=
"续签状态不能超过2个字符"
)
@ExcelProperty
(
"续签状态"
)
@Schema
(
description
=
"续签状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署"
)
@Schema
(
description
=
"续签状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署
-客服撤销 11撤销签署-系统自动撤销
"
)
private
String
processStatus
;
/**
* 配置名称
...
...
@@ -248,6 +249,16 @@ public class TEmployeeContractPreNew extends BaseEntity {
@ExcelProperty
(
"合同开始日期"
)
@Schema
(
description
=
"合同开始日期"
)
private
Date
contractStart
;
/**
* 合同截止日期类型
*/
@ExcelAttribute
(
name
=
"合同截止日期类型"
,
maxLength
=
1
)
@Length
(
max
=
1
,
message
=
"合同截止日期类型不能超过1个字符"
)
@ExcelProperty
(
"合同截止日期类型"
)
@Schema
(
description
=
"合同截止日期类型: 0 合同年限推算 1 同商务合同一致 2 工作任务完成时止 3 指定日期 "
)
private
String
contractEndType
;
/**
* 合同截止日期
*/
...
...
@@ -335,36 +346,7 @@ public class TEmployeeContractPreNew extends BaseEntity {
@ExcelProperty
(
"合同年限-月"
)
@Schema
(
description
=
"合同年限-月"
)
private
String
contractDurationMonth
;
/**
* 合同试用期开始时间-续签无,冗余
*/
@ExcelAttribute
(
name
=
"合同试用期开始时间"
,
isDate
=
true
)
@ExcelProperty
(
"合同试用期开始时间"
)
@Schema
(
description
=
"合同试用期开始时间-续签无,冗余"
)
private
Date
tryPeriodStart
;
/**
* 合同试用期结束时间-续签无,冗余
*/
@ExcelAttribute
(
name
=
"合同试用期结束时间"
,
isDate
=
true
)
@ExcelProperty
(
"合同试用期结束时间"
)
@Schema
(
description
=
"合同试用期结束时间-续签无,冗余"
)
private
Date
tryPeriodEnd
;
/**
* 是否有试用期 0是1否-续签无,冗余
*/
@ExcelAttribute
(
name
=
"是否有试用期"
,
maxLength
=
1
)
@Length
(
max
=
1
,
message
=
"是否有试用期不能超过1个字符"
)
@ExcelProperty
(
"是否有试用期"
)
@Schema
(
description
=
"是否有试用期 0是1否-续签无,冗余"
)
private
String
tryPeriodType
;
/**
* 试用期(单位月)-续签无,冗余
*/
@ExcelAttribute
(
name
=
"试用期(单位月)"
,
maxLength
=
5
)
@Length
(
max
=
5
,
message
=
"试用期(单位月)不能超过5个字符"
)
@ExcelProperty
(
"试用期(单位月)"
)
@Schema
(
description
=
"试用期(单位月)-续签无,冗余"
)
private
String
tryPeriod
;
/**
* 劳务费(元/月)
*/
...
...
@@ -561,6 +543,14 @@ public class TEmployeeContractPreNew extends BaseEntity {
@ExcelProperty
(
"撤销签署原因"
)
@Schema
(
description
=
"撤销签署原因"
)
private
String
revokeReason
;
/**
* 撤销签署时间
*/
@ExcelAttribute
(
name
=
"撤销签署时间"
)
@ExcelProperty
(
"撤销签署时间"
)
@Schema
(
description
=
"撤销签署时间"
)
private
Date
revokeTime
;
/**
* 发起失败时间
*/
...
...
@@ -568,14 +558,7 @@ public class TEmployeeContractPreNew extends BaseEntity {
@ExcelProperty
(
"发起失败时间"
)
@Schema
(
description
=
"发起失败时间"
)
private
Date
errorTime
;
/**
* 合同截止日期类型
*/
@ExcelAttribute
(
name
=
"合同截止日期类型"
,
maxLength
=
1
)
@Length
(
max
=
1
,
message
=
"合同截止日期类型不能超过1个字符"
)
@ExcelProperty
(
"合同截止日期类型"
)
@Schema
(
description
=
"合同截止日期类型"
)
private
String
contractEndType
;
/**
* 入职确认选择 0 配置方案内选择、1 自定义 2 配置方案+自定义
*/
...
...
@@ -705,4 +688,32 @@ public class TEmployeeContractPreNew extends BaseEntity {
@Schema
(
description
=
"试用期工资(元/月)"
)
private
String
workingReward
;
// 紧急联系人表
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"紧急联系人"
)
private
String
contactEmpName
;
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"紧急联系人电话"
)
private
String
contactTel
;
// relationProvince,relationCity,relationTown
// address
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"紧急联系人地址"
)
private
String
contactAddress
;
// 电子签推送需要的新字段:——START
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"户籍所在地"
)
private
String
huArea
;
// contactProvince,contactCity,contactTown,
// contactAddress
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"通讯地址"
)
private
String
contactArea
;
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"邮箱"
)
private
String
empEmail
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/ContractAlertAutoVo.java
0 → 100644
View file @
ec3b01b2
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.HeadFontStyle
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Author fxj
* @Date 2022/7/1
* @Description
* @Version 1.0
*/
@Data
public
class
ContractAlertAutoVo
extends
TEmpContractAlert
implements
Serializable
{
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ExcelAttribute
(
name
=
"主键"
)
@Schema
(
description
=
"主键"
)
@ExcelIgnore
private
String
id
;
/**
* 员工名称
*/
@ExcelAttribute
(
name
=
"员工名称"
)
@Schema
(
description
=
"员工名称"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"员工名称"
)
private
String
empName
;
/**
* 员工ID
*/
@ExcelAttribute
(
name
=
"员工ID"
)
@Schema
(
description
=
"员工ID"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"员工ID"
)
private
String
empId
;
/**
* 项目id
*/
@ExcelAttribute
(
name
=
"项目id"
)
@Schema
(
description
=
"项目id"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"项目id"
)
private
String
deptId
;
/**
* 项目名称
*/
@ExcelAttribute
(
name
=
"项目名称"
)
@Schema
(
description
=
"项目名称"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"项目名称"
)
private
String
project
;
/**
* 项目编码
*/
@ExcelAttribute
(
name
=
"项目编码"
)
@Schema
(
description
=
"项目编码"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"项目编码"
)
private
String
projectNo
;
/**
* 身份证号
*/
@ExcelAttribute
(
name
=
"身份证号"
)
@Schema
(
description
=
"身份证号"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"身份证号"
)
private
String
empIdcard
;
/**
* 员工编码
*/
@ExcelAttribute
(
name
=
"员工编码"
)
@Schema
(
description
=
"员工编码"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"员工编码"
)
private
String
empCode
;
/**
* 合同开始日期
*/
@ExcelAttribute
(
name
=
"合同开始日期"
)
@Schema
(
description
=
"合同开始日期"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"合同开始日期"
)
private
Date
contractStart
;
/**
* 合同截止日期
*/
@ExcelAttribute
(
name
=
"合同截止日期"
)
@Schema
(
description
=
"合同截止日期"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"合同截止日期"
)
private
Date
contractEnd
;
/**
* 档案地-省
*/
@ExcelAttribute
(
name
=
"档案地-省"
)
@Schema
(
description
=
"档案地-省"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"档案地-省"
)
private
String
fileProvince
;
/**
* 档案地-市
*/
@ExcelAttribute
(
name
=
"档案地-市"
)
@Schema
(
description
=
"档案地-市"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"档案地-市"
)
private
String
fileCity
;
/**
* 档案地-县
*/
@ExcelAttribute
(
name
=
"档案地-县"
)
@Schema
(
description
=
"档案地-县"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"档案地-县"
)
private
String
fileTown
;
/**
* 员工类型
*/
@ExcelAttribute
(
name
=
"员工类型"
)
@Schema
(
description
=
"员工类型"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"员工类型"
)
private
String
empType
;
/**
* 合同类型
*/
@ExcelAttribute
(
name
=
"合同类型"
)
@Schema
(
description
=
"合同类型"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"合同类型"
)
private
String
contractType
;
/**
* 合同期限
*/
@ExcelAttribute
(
name
=
"合同期限"
)
@Schema
(
description
=
"合同期限"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"合同期限"
)
private
String
contractTerm
;
/**
* 到期天数
*/
@ExcelAttribute
(
name
=
"到期天数"
)
@Schema
(
description
=
"到期天数"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"到期天数"
)
private
Integer
daysDue
;
/**
* 是否过期:0 未过期 1 过期
*/
@ExcelAttribute
(
name
=
"是否过期:0 未过期 1 过期"
)
@Schema
(
description
=
"是否过期:0 未过期 1 过期"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"是否过期:0 未过期 1 过期"
)
private
String
dueFlag
;
/**
* 过期天数
*/
@ExcelAttribute
(
name
=
"过期天数"
)
@Schema
(
description
=
"过期天数"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"过期天数"
)
private
Integer
daysOver
;
/**
* 首次提醒时间
*/
@ExcelAttribute
(
name
=
"首次提醒时间"
)
@Schema
(
description
=
"首次提醒时间"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"首次提醒时间"
)
private
Date
firstAlertTime
;
/**
* 提醒人
*/
@ExcelAttribute
(
name
=
"提醒人"
)
@Schema
(
description
=
"提醒人"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"提醒人"
)
private
String
alertPerson
;
/**
* 处理状态 0 待处理 1 处理中
*/
@ExcelAttribute
(
name
=
"处理状态"
)
@Schema
(
description
=
"处理状态"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"处理状态"
)
private
String
handleStatus
;
/**
* 合同ID
*/
@ExcelAttribute
(
name
=
"合同ID"
,
isExport
=
false
)
@Schema
(
description
=
"合同ID"
)
@ExcelIgnore
private
String
contractId
;
/**
* 客户id
*/
@Schema
(
description
=
"客户id"
)
private
String
unitId
;
/**
* 客户名称
*/
@Schema
(
description
=
"客户名称"
)
private
String
unitName
;
/**
* 客户编码
*/
@Schema
(
description
=
"客户编码"
)
private
String
unitNo
;
/**
* 手机号码
*/
@Schema
(
description
=
"手机号码"
)
private
String
empPhone
;
/**
* 是否反馈
*/
@ExcelAttribute
(
name
=
"是否反馈"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"是否反馈"
)
@Schema
(
description
=
"是否反馈"
)
private
Integer
isFeedback
;
/**
* 反馈原因
*/
@ExcelAttribute
(
name
=
"未续签原因"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"未续签原因"
)
@Schema
(
description
=
"未续签原因"
)
private
String
feedbackReason
;
/**
* 详情
*/
@ExcelAttribute
(
name
=
"具体描述信息"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"具体描述信息"
)
@Schema
(
description
=
"具体描述信息"
)
private
String
feedbackDetail
;
/**
* 反馈人
*/
@ExcelAttribute
(
name
=
"反馈人"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"反馈人"
)
@Schema
(
description
=
"反馈人"
)
private
String
feedbackPerson
;
/**
* 反馈时间
*/
@ExcelAttribute
(
name
=
"反馈时间"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"反馈时间"
)
@Schema
(
description
=
"反馈时间"
)
private
Date
feedbackTime
;
/**
* 预计合同发起时间
*/
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"预计合同发起时间"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"预计合同发起时间"
)
@Schema
(
description
=
"预计合同发起时间"
)
private
Date
expectedCollectionTime
;
/**
* 签署方式:1线下签0电子签
*/
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"签署方式"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"签署方式"
)
@Schema
(
description
=
"签署方式:1线下签0电子签"
)
private
Integer
signType
;
/**
* 续签状态:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署
*/
@TableField
(
exist
=
false
)
@ExcelAttribute
(
name
=
"续签状态"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"续签状态"
)
@Schema
(
description
=
"签署方式:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署-客服撤销 11撤销签署-系统自动撤销"
)
private
Integer
processStatus
;
/**
* 前端客服
*/
@ExcelAttribute
(
name
=
"前端客服"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"前端客服"
)
@Schema
(
description
=
"前端客服"
)
private
String
csName
;
/**
* 前端客服
*/
@ExcelAttribute
(
name
=
"前端客服"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"前端客服"
)
@Schema
(
description
=
"前端客服"
)
private
String
csLoginName
;
/**
* 合同截止日期
*/
@TableField
(
exist
=
false
)
private
Date
auditTime
;
@Schema
(
description
=
"申请编码"
)
private
String
applyNo
;
/**
* 工时制(数据字典) 1标准工时 2 综合工时 3不定时工时制
*/
@Length
(
max
=
32
,
message
=
"工时制不能超过32个字符"
)
@ExcelAttribute
(
name
=
"工时制"
,
maxLength
=
32
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
WORKING_HOURS
)
@Schema
(
description
=
"工时制(数据字典) 1标准工时 2 综合工时 3不定时工时制"
,
name
=
"workingHours"
)
private
String
workingHours
;
/**
* 合同岗位
*/
@Length
(
max
=
32
,
message
=
"合同岗位不能超过32个字符"
)
@ExcelAttribute
(
name
=
"合同岗位"
,
maxLength
=
32
,
needExport
=
true
)
@Schema
(
description
=
"合同岗位"
,
name
=
"post"
)
private
String
post
;
/**
* 是否自动化: 0 是 1 否 默认1
*/
@Length
(
max
=
1
,
message
=
"工是否自动化不能超过1个字符"
)
@ExcelAttribute
(
name
=
"是否自动化"
,
maxLength
=
32
)
@Schema
(
description
=
"是否自动化: 0 是 1 否 默认1"
,
name
=
"autoFlag"
)
private
String
autoFlag
;
/**
* 发起失败时间
*/
@ExcelAttribute
(
name
=
"发起失败时间"
,
isDate
=
true
)
@ExcelProperty
(
"发起失败时间"
)
@Schema
(
description
=
"发起失败时间"
)
private
Date
errorTime
;
/**
* 异常原因说明
*/
@ExcelAttribute
(
name
=
"异常原因说明"
,
maxLength
=
200
)
@Length
(
max
=
200
,
message
=
"异常原因说明不能超过200个字符"
)
@ExcelProperty
(
"异常原因说明"
)
@Schema
(
description
=
"异常原因说明"
)
private
String
errorInfo
;
/**
* 续签确认ID
*/
@Schema
(
description
=
"续签确认ID"
)
private
String
preId
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/ContractAlertConfirmVo.java
0 → 100644
View file @
ec3b01b2
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.HeadFontStyle
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Author fxj
* @Date 2022/7/1
* @Description
* @Version 1.0
*/
@Data
public
class
ContractAlertConfirmVo
implements
Serializable
{
/**
* 员工名称
*/
@ExcelAttribute
(
name
=
"员工名称"
)
@Schema
(
description
=
"员工名称"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"员工名称"
)
private
String
empName
;
/**
* 身份证号
*/
@ExcelAttribute
(
name
=
"身份证号"
)
@Schema
(
description
=
"身份证号"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"身份证号"
)
private
String
empIdcard
;
/**
* 手机号码
*/
@Schema
(
description
=
"手机号码"
)
private
String
empPhone
;
/**
* 员工类型
*/
@ExcelAttribute
(
name
=
"员工类型"
)
@Schema
(
description
=
"员工类型"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"员工类型"
)
private
String
empType
;
/**
* 合同类型
*/
@ExcelAttribute
(
name
=
"合同类型"
)
@Schema
(
description
=
"合同类型"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"合同类型"
)
private
String
contractType
;
/**
* 合同开始日期
*/
@ExcelAttribute
(
name
=
"合同开始日期"
)
@Schema
(
description
=
"合同开始日期"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"合同开始日期"
)
private
Date
contractStart
;
/**
* 合同截止日期
*/
@ExcelAttribute
(
name
=
"合同截止日期"
)
@Schema
(
description
=
"合同截止日期"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"合同截止日期"
)
private
Date
contractEnd
;
/**
* 档案地-省
*/
@ExcelAttribute
(
name
=
"档案地-省"
)
@Schema
(
description
=
"档案地-省"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"档案地-省"
)
private
String
fileProvince
;
/**
* 档案地-市
*/
@ExcelAttribute
(
name
=
"档案地-市"
)
@Schema
(
description
=
"档案地-市"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"档案地-市"
)
private
String
fileCity
;
/**
* 档案地-县
*/
@ExcelAttribute
(
name
=
"档案地-县"
)
@Schema
(
description
=
"档案地-县"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"档案地-县"
)
private
String
fileTown
;
/**
* 合同ID
*/
@ExcelAttribute
(
name
=
"合同ID"
,
isExport
=
false
)
@Schema
(
description
=
"合同ID"
)
@ExcelIgnore
private
String
contractId
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpContractRenewVO.java
0 → 100644
View file @
ec3b01b2
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author fxj
* @Description 获取合同续签待办的 续签提醒数据、续签确认数据、新续签合同信息
* @Date 16:54 2026/2/11
* @Param
* @return
**/
@Data
public
class
EmpContractRenewVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
//合同续签提醒数据
private
TEmpContractAlert
empContractAlert
;
//新续签合同信息
private
TEmployeeContractInfo
contractInfo
;
//续签确认数据
private
TEmployeeContractPreNew
contractPreNew
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpProjectVO.java
View file @
ec3b01b2
...
...
@@ -20,6 +20,10 @@ import com.alibaba.excel.annotation.ExcelProperty;
import
com.alibaba.excel.annotation.format.DateTimeFormat
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.alibaba.excel.annotation.write.style.HeadFontStyle
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreHistory
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex
;
...
...
@@ -34,13 +38,11 @@ import java.io.Serializable;
import
java.util.Date
;
/**
* 项目档案表excel对应的实体
*
* @author huyc
* @date 2022-06-20 17:54:40
*/
* @Author fxj
* @Description 人员手机号、项目信息、提醒对应合同信息、提醒对应合同的电子签信息
* @Date 17:32 2026/2/11
**/
@Data
@ColumnWidth
(
30
)
public
class
EmpProjectVO
extends
RowIndex
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -48,35 +50,27 @@ public class EmpProjectVO extends RowIndex implements Serializable {
/**
* 员工类型(字典值,0外包1派遣2代理)
*/
@NotNull
(
message
=
"员工类型不能为空"
)
@ExcelAttribute
(
name
=
"员工类型"
,
isNotEmpty
=
true
,
errorInfo
=
"员工类型不能为空"
,
maxLength
=
5
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
EMP_NATRUE
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"员工类型"
)
private
String
empNatrue
;
/**
* 员工姓名
*/
@NotNull
(
message
=
"员工姓名不能为空"
)
@ExcelAttribute
(
name
=
"员工姓名"
,
isNotEmpty
=
true
,
errorInfo
=
"员工姓名不能为空"
,
maxLength
=
20
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"员工姓名"
)
private
String
empName
;
/**
* 身份证号码
*/
@NotNull
(
message
=
"身份证号不能为空"
)
@ExcelAttribute
(
name
=
"身份证号"
,
isNotEmpty
=
true
,
errorInfo
=
"身份证号不能为空"
,
maxLength
=
20
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"身份证号"
)
private
String
empIdcard
;
/**
* 项目编码
*/
@NotNull
(
message
=
"项目编码不能为空"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"项目编码"
)
@ExcelAttribute
(
name
=
"项目编码"
,
isNotEmpty
=
true
,
errorInfo
=
"项目编码不能为空"
,
maxLength
=
20
)
private
String
deptNo
;
...
...
@@ -85,18 +79,24 @@ public class EmpProjectVO extends RowIndex implements Serializable {
* 项目名称
*/
@ExcelAttribute
(
name
=
"项目名称"
,
maxLength
=
50
)
@Length
(
max
=
50
,
message
=
"项目名称不能超过50个字符"
)
@ExcelProperty
(
"项目名称"
)
@Schema
(
description
=
"项目名称"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
private
String
departName
;
/**
* 手机号码
*/
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"手机号码"
)
@Size
(
max
=
11
,
message
=
"手机号码不可超过11位"
)
private
String
empPhone
;
/**
* 合同信息
*/
@ExcelProperty
(
value
=
"合同信息"
)
private
TEmployeeContractInfo
contractInfo
;
//自动化合同续签确认信息
private
TEmployeeContractPreNew
preNew
;
//自动化合同新签信息
private
TEmployeeContractPreHistory
pre
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TEmpContractAlertExportVo.java
View file @
ec3b01b2
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.format.DateTimeFormat
;
import
com.alibaba.excel.annotation.write.style.HeadFontStyle
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
...
...
@@ -296,11 +291,11 @@ public class TEmpContractAlertExportVo {
/**
* 续签状态:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署
*/
@ExcelAttribute
(
name
=
"续签状态"
,
isDataId
=
true
,
readConverterExp
=
"0=待确认,1=待发起,2=线待审核,3=审核不通过,4=线下签待归档,5=发起失败,6=签署中,7=签署失败,8=电子待归档,9=已归档,10=撤销签署
"
)
@ExcelAttribute
(
name
=
"续签状态"
,
readConverterExp
=
"0=待确认,1=待发起,2=线待审核,3=审核不通过,4=线下签待归档,5=发起失败,6=签署中,7=签署失败,8=电子待归档,9=已归档,10=撤销签署-客服撤销 11=撤销签署-系统自动撤销
"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"续签状态"
)
@Schema
(
description
=
"签署方式:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署"
)
private
Integer
processStatus
;
@Schema
(
description
=
"签署方式:0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9(已归档-电子签+线下签)已完结10撤销签署
-客服撤销 11撤销签署-系统自动撤销
"
)
private
String
processStatus
;
/**
* 预计合同发起时间
*/
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TEmployeeContractPreNewDetailVo.java
0 → 100644
View file @
ec3b01b2
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
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
;
/**
* 合同续签确认信息--批量发起明细 系统会自动拉取当前前端客服+“预计合同发起时间”为空的或为今日及今日之前的,续签状态为“待发起、发起失败、审核不通过、签署失败”的合同信息;
*
* @author fxj
* @date 2026-02-05 15:45:40
*/
@Data
public
class
TEmployeeContractPreNewDetailVo
{
/**
* id
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@ExcelProperty
(
"id"
)
@Schema
(
description
=
"id"
)
private
String
id
;
/**
* 项目名称
*/
@ExcelAttribute
(
name
=
"项目名称"
,
maxLength
=
50
)
@Length
(
max
=
50
,
message
=
"项目名称不能超过50个字符"
)
@ExcelProperty
(
"项目名称"
)
@Schema
(
description
=
"项目名称"
)
private
String
deptName
;
/**
* 项目编码
*/
@ExcelAttribute
(
name
=
"项目编码"
,
isNotEmpty
=
true
,
errorInfo
=
"项目编码不能为空"
,
maxLength
=
30
)
@NotBlank
(
message
=
"项目编码不能为空"
)
@Length
(
max
=
30
,
message
=
"项目编码不能超过30个字符"
)
@ExcelProperty
(
"项目编码"
)
@Schema
(
description
=
"项目编码"
)
private
String
deptNo
;
/**
* 项目id
*/
@ExcelAttribute
(
name
=
"项目id"
,
maxLength
=
36
)
@Length
(
max
=
36
,
message
=
"项目id不能超过36个字符"
)
@ExcelProperty
(
"项目id"
)
@Schema
(
description
=
"项目id"
)
private
String
deptId
;
/**
* 员工姓名
*/
@ExcelAttribute
(
name
=
"员工姓名"
,
maxLength
=
30
)
@Length
(
max
=
30
,
message
=
"员工姓名不能超过30个字符"
)
@ExcelProperty
(
"员工姓名"
)
@Schema
(
description
=
"员工姓名"
)
private
String
employeeName
;
/**
* 身份证号
*/
@ExcelAttribute
(
name
=
"身份证号"
,
isNotEmpty
=
true
,
errorInfo
=
"身份证号不能为空"
,
maxLength
=
18
)
@NotBlank
(
message
=
"身份证号不能为空"
)
@Length
(
max
=
18
,
message
=
"身份证号不能超过18个字符"
)
@ExcelProperty
(
"身份证号"
)
@Schema
(
description
=
"身份证号"
)
private
String
empIdcard
;
/**
* 上一份合同起止日期
*/
@ExcelAttribute
(
name
=
"上一份合同起止日期"
,
isDate
=
true
)
@ExcelProperty
(
"上一份合同起止日期"
)
@Schema
(
description
=
"上一份合同起止日期"
)
private
String
lastContractDate
;
/**
* 就职岗位
*/
@ExcelAttribute
(
name
=
"就职岗位"
,
maxLength
=
50
)
@Length
(
max
=
50
,
message
=
"就职岗位不能超过50个字符"
)
@ExcelProperty
(
"就职岗位"
)
@Schema
(
description
=
"就职岗位"
)
private
String
position
;
/**
* 合同类型 标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同
*/
@ExcelAttribute
(
name
=
"合同类型"
,
maxLength
=
8
)
@Length
(
max
=
8
,
message
=
"合同类型不能超过8个字符"
)
@ExcelProperty
(
"合同类型"
)
@Schema
(
description
=
"合同类型 标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同"
)
private
String
contractType
;
/**
* 签署甲方
*/
@ExcelAttribute
(
name
=
"签署甲方"
,
maxLength
=
50
)
@Length
(
max
=
50
,
message
=
"签署甲方不能超过50个字符"
)
@ExcelProperty
(
"签署甲方"
)
@Schema
(
description
=
"签署甲方"
)
private
String
signatory
;
/**
* 签署方式1线下签0电子签
*/
@ExcelAttribute
(
name
=
"签署方式"
,
maxLength
=
1
)
@Length
(
max
=
1
,
message
=
"签署方式不能超过1个字符"
)
@ExcelProperty
(
"签署方式"
)
@Schema
(
description
=
"签署方式1线下签0电子签"
)
private
String
signType
;
/**
* 合同开始日期
*/
@ExcelAttribute
(
name
=
"合同开始日期"
,
isDate
=
true
)
@ExcelProperty
(
"合同开始日期"
)
@Schema
(
description
=
"合同开始日期"
)
private
Date
contractStart
;
/**
* 合同截止日期
*/
@ExcelAttribute
(
name
=
"合同截止日期"
,
isDate
=
true
)
@ExcelProperty
(
"合同截止日期"
)
@Schema
(
description
=
"合同截止日期"
)
private
Date
contractEnd
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TEmployeeContractPreNewSearchVo.java
View file @
ec3b01b2
...
...
@@ -16,11 +16,13 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* 合同续签预派单信息
...
...
@@ -55,4 +57,8 @@ public class TEmployeeContractPreNewSearchVo extends TEmployeeContractPreNew {
@Schema
(
description
=
"查询limit 数据条数"
)
private
int
limitEnd
;
@Schema
(
description
=
"处理状态数组"
)
@TableField
(
exist
=
false
)
private
List
<
String
>
statusList
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TEmployeeContractPreNewVo.java
View file @
ec3b01b2
...
...
@@ -20,6 +20,8 @@ import com.alibaba.excel.annotation.ExcelProperty;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
...
...
@@ -40,7 +42,7 @@ import java.util.List;
* @date 2026-02-05 15:45:40
*/
@Data
public
class
TEmployeeContractPreNewVo
implements
Serializable
{
public
class
TEmployeeContractPreNewVo
extends
TEmployeeContractPreNew
implements
Serializable
{
/**
* id
...
...
@@ -147,12 +149,12 @@ public class TEmployeeContractPreNewVo implements Serializable {
@Schema
(
description
=
"签署方式1线下签0电子签"
)
private
String
signType
;
/**
* 合同签订内容:0
自定义、
上一份合同
* 合同签订内容:0
项目配置、1自定义、2
上一份合同
*/
@ExcelAttribute
(
name
=
"合同签订内容"
,
maxLength
=
100
)
@Length
(
max
=
100
,
message
=
"合同签订内容同不能超过100个字符"
)
@ExcelProperty
(
"合同签订内容"
)
@Schema
(
description
=
"合同签订内容:0
自定义、
上一份合同"
)
@Schema
(
description
=
"合同签订内容:0
项目配置、1自定义、2
上一份合同"
)
private
String
contractContent
;
/**
* 法大大模版名称
...
...
@@ -287,12 +289,12 @@ public class TEmployeeContractPreNewVo implements Serializable {
@Schema
(
description
=
"工作地点"
)
private
String
workAddress
;
/**
* 工时制
0 标准工时 1综合工时 2
不定时工时制
* 工时制
1标准工时 2 综合工时 3
不定时工时制
*/
@ExcelAttribute
(
name
=
"工时制 "
,
maxLength
=
1
)
@Length
(
max
=
1
,
message
=
"工时制不能超过1个字符"
)
@ExcelProperty
(
"工时制 "
)
@Schema
(
description
=
"工时制
0 标准工时 1综合工时 2 不定时工时制
"
)
@Schema
(
description
=
"工时制
:1标准工时 2 综合工时 3不定时工时制 4其他
"
)
private
String
workingHours
;
/**
* 工资形式 1.计时工资 2.计件工资 3.其他
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/constants/EmployeeConstants.java
View file @
ec3b01b2
...
...
@@ -90,4 +90,20 @@ public class EmployeeConstants {
**/
public
static
final
String
CONTRACT_NAME
[]
=
{
"标准合同"
,
"劳务派遣合同"
,
"其他"
};
/**
* 未找到合同信息
**/
public
static
final
String
DATA_CAN_NOT_FOUND
=
"未找到合同信息!"
;
/**
* 合同起止日期与被续签合同日期重叠
**/
public
static
final
String
DATA_CONTRACT_OVERLAP
=
"合同起止日期与被续签合同日期重叠!"
;
/**
* 系统自动撤销签署必须走线下签
**/
public
static
final
String
DATA_CONTRACT_CANCEL_MUST_OFFLINE_SIGN
=
"系统自动撤销签署必须走线下签!"
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FascController.java
View file @
ec3b01b2
...
...
@@ -128,6 +128,19 @@ public class FascController {
return
fascService
.
submitContract
(
id
);
}
/**
* @Author fxj
* @Description 自动化待办续签:发起电子签署
* @Date 9:40 2026/2/11
* @Param 合同待签订任务记录表TEmployeeContractPreNew:id
* @return
**/
@Operation
(
description
=
"自动化待办续签:发起电子签署"
)
@GetMapping
(
"/submitContractRenew"
)
public
R
<
String
>
submitContractRenew
(
@RequestParam
String
id
)
throws
ApiException
{
return
fascService
.
submitContractRenew
(
id
);
}
/**
* @param id 合同待签订任务记录表TEmployeeContractPre:id
* @Description: 撤销签署
...
...
@@ -140,7 +153,18 @@ public class FascController {
public
R
<
String
>
cancelTask
(
@RequestParam
String
id
)
throws
ApiException
{
return
fascService
.
cancelTask
(
id
);
}
/**
* @Author fxj
* @Description 自动化待办续签:撤销签署
* @Date 9:41 2026/2/11
* @Param id 合同待签订任务记录表TEmployeeContractPreNew:id
* @return
**/
@Operation
(
description
=
"自动化待办续签:撤销签署"
)
@GetMapping
(
"/cancelTaskRenew"
)
public
R
<
String
>
cancelTaskRenew
(
@RequestParam
String
id
)
throws
ApiException
{
return
fascService
.
cancelTaskRenew
(
id
);
}
/**
* @param id 合同待签订任务记录表TEmployeeContractPre:id
* @Description: 催办
...
...
@@ -154,6 +178,19 @@ public class FascController {
return
fascService
.
urgeTask
(
id
);
}
/**
* @Author fxj
* @Description
* @Date 9:42 2026/2/11
* @Param 合同待签订任务记录表TEmployeeContractPreNew:id
* @return
**/
@Operation
(
description
=
"自动化待办续签:催办"
)
@GetMapping
(
"/urgeTaskRenew"
)
public
R
<
String
>
urgeTaskRenew
(
@RequestParam
String
id
)
throws
ApiException
{
return
fascService
.
urgeTaskRenew
(
id
);
}
/**
* @param id 合同待签订任务记录表TEmployeeContractPre:id
* @Description: 获取附件
...
...
@@ -167,6 +204,19 @@ public class FascController {
fascService
.
getFileByRequestId
(
id
);
return
R
.
ok
();
}
/**
* @Author fxj
* @Description 获取附件
* @Date 19:37 2026/2/10
* @Param id 合同待签订任务记录表TEmployeeContractPreNew:id
* @return
**/
@Operation
(
description
=
"自动化待办续签获取附件"
)
@GetMapping
(
"/getRenewFileByRequestId"
)
public
R
<
String
>
getRenewFileByRequestId
(
@RequestParam
String
id
)
throws
ApiException
{
fascService
.
getFileByRequestIdRenew
(
id
);
return
R
.
ok
();
}
@Operation
(
summary
=
"异步通知"
,
description
=
"异步通知"
)
@RequestMapping
(
value
=
"/api/fascCallback"
)
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmpContractAlertController.java
View file @
ec3b01b2
...
...
@@ -21,10 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeFeedBackAllVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractAlertUpdateVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpProjectVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
...
...
@@ -44,6 +41,7 @@ import org.springframework.web.bind.annotation.*;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -69,12 +67,29 @@ public class TEmpContractAlertController {
*/
@Operation
(
description
=
"自动化合同续签待办查询"
)
@GetMapping
(
"/autoPage"
)
public
R
<
IPage
<
TEmpContractAlert
>>
getTEmpContractAlertAutoPage
(
Page
<
TEmpContractAlert
>
page
,
ContractAlertSearchVo
tEmpContractAlert
)
{
public
R
<
IPage
<
ContractAlertAutoVo
>>
getTEmpContractAlertAutoPage
(
Page
<
TEmpContractAlert
>
page
,
ContractAlertSearchVo
tEmpContractAlert
)
{
//默认开启自动化的
tEmpContractAlert
.
setAutoFlag
(
CommonConstants
.
ZERO_STRING
);
return
R
.
ok
(
tEmpContractAlertService
.
getTEmpContractAlertAutoPage
(
page
,
tEmpContractAlert
));
}
/**
* 自动化合同续签待办查询
* @param tEmpContractAlert 自动化合同续签待办查询
* @return
*/
@Operation
(
description
=
"自动化合同续签待办查询"
)
@GetMapping
(
"/autoRenewForConfirm"
)
public
R
<
List
<
ContractAlertConfirmVo
>>
getAutoRenewForConfirm
(
ContractAlertSearchVo
tEmpContractAlert
)
{
//默认开启自动化的
tEmpContractAlert
.
setAutoFlag
(
CommonConstants
.
ZERO_STRING
);
//默认查询待确认的信息
List
<
String
>
processStatusList
=
new
ArrayList
<>();
processStatusList
.
add
(
CommonConstants
.
ZERO_STRING
);
tEmpContractAlert
.
setProcessStatusList
(
processStatusList
);
return
tEmpContractAlertService
.
getAutoRenewForConfirm
(
tEmpContractAlert
);
}
/**
* @Author fxj
* @Description 自动化合同续签待办数量
...
...
@@ -334,4 +349,15 @@ public class TEmpContractAlertController {
public
R
<
EmpProjectVO
>
getProjectInfoByContractId
(
@RequestParam
(
"id"
)
String
id
)
{
return
R
.
ok
(
tEmpContractAlertService
.
getProjectInfoByContractId
(
id
));
}
/**
* @Author fxj
* @Description 通过合同提醒ID查询合同提醒信息、确认接收信息、新增续签合同信息
* @Date 16:53 2026/2/11
**/
@Operation
(
summary
=
"通过合同提醒ID查询合同提醒信息、确认接收信息、新增续签合同信息"
,
description
=
"通过合同提醒ID查询合同提醒信息、确认接收信息、新增续签合同信息"
)
@GetMapping
(
"/getAllRenewInfoById"
)
public
R
<
EmpContractRenewVO
>
getAllRenewInfoById
(
@RequestParam
(
"id"
)
String
id
)
{
return
tEmpContractAlertService
.
getAllRenewInfoById
(
id
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeContractPreNewController.java
View file @
ec3b01b2
...
...
@@ -18,25 +18,22 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreNewService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeAutoRegistRevokeVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewDetailVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewSearchVo
;
import
lombok.SneakyThrows
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.security.SecurityRequirement
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.
http.HttpHeaders
;
import
org.springframework.
security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
...
...
@@ -70,6 +67,19 @@ public class TEmployeeContractPreNewController {
return
new
R
<>(
tEmployeeContractPreNewService
.
getTEmployeeContractPreNewPage
(
page
,
tEmployeeContractPreNew
));
}
/**
* 简单分页查询--批量发起选择数据 最大2000条
* 系统会自动拉取当前客服且“预计合同发起时间”为空的或为今日及今日之前的,续签状态为“待发起、发起失败、审核不通过、签署失败”的合同信息;
*
* @param tEmployeeContractPreNew 合同续签预派单信息
* @return
*/
@Operation
(
description
=
"简单分页查询"
)
@GetMapping
(
"/getDetailList"
)
public
R
<
List
<
TEmployeeContractPreNewDetailVo
>>
getDetailList
(
TEmployeeContractPreNewSearchVo
tEmployeeContractPreNew
)
{
return
tEmployeeContractPreNewService
.
getDetailList
(
tEmployeeContractPreNew
);
}
/**
* 不分页查询
*
...
...
@@ -175,4 +185,129 @@ public class TEmployeeContractPreNewController {
public
R
batchConfirmReceive
(
@RequestBody
TEmployeeContractPreNewVo
preVo
)
{
return
tEmployeeContractPreNewService
.
batchCconfirmRenewalContract
(
preVo
);
}
/**
* 合同续签待签订信息单个/批量发起签署任务
* @param idList id数组
**/
@Operation
(
description
=
"合同续签待签订信息单个/批量发起签署任务"
)
@PostMapping
(
"/dispatcherContract"
)
public
R
dispatcherContract
(
@RequestBody
List
<
String
>
idList
)
{
return
tEmployeeContractPreNewService
.
dispatcherContract
(
idList
,
"1"
);
}
/**
* 合同待签订撤销签署
* @param registRevokeVoList 撤销合同数组
**/
@Operation
(
description
=
"合同待签订撤销签署"
)
@PostMapping
(
"/revokeSign"
)
public
R
revokeSign
(
@RequestBody
List
<
TEmployeeAutoRegistRevokeVo
>
registRevokeVoList
)
{
return
tEmployeeContractPreNewService
.
revokeSign
(
registRevokeVoList
);
}
/**
* 每天11点15点/15点20推送待派单数据 --- 工作日
* 会将发起失败、签署失败、审核不通过的“预计合同发起时间”为当日及之前日期的(空白的不在)合同续签任务自动尝试发起
* @author huych
* @date 2025-06-16 14:18:26
* @return void
*/
@SysLog
(
"每天11、15、15:20 发起电子签自动发起任务"
)
@Inner
@PostMapping
(
"/inner/pushDisConfrimContracts"
)
public
void
pushDisConfrimContracts
()
{
tEmployeeContractPreNewService
.
pushDisConfrimContracts
();
}
/**
* @Author fxj
* @Description 每日晚23:00自动撤销超时电子签署任务(当前时间超出当前合同开始日期一个月的数据)
* @Date 18:06 2026/2/10
**/
@Inner
@PostMapping
(
"/inner/autoRevokeElectronicSign"
)
public
R
autoRevokeElectronicSign
()
{
return
tEmployeeContractPreNewService
.
autoRevokeElectronicSign
();
}
/**
* @Author fxj
* @Description 每日早9点通知前端客服前一日撤销电子签署情况
* @Date 18:42 2026/2/10
**/
@Inner
@PostMapping
(
"/inner/notifyRevokedElectronicSign"
)
public
R
notifyRevokedElectronicSign
()
{
return
tEmployeeContractPreNewService
.
notifyRevokedElectronicSign
();
}
/**
* @Author fxj
* @Description 每日早9点电子签合同即将超期提醒
* @Date 19:08 2026/2/10
**/
@Inner
@PostMapping
(
"/inner/electronicSignExpiringReminder"
)
public
R
electronicSignExpiringReminder
()
{
return
tEmployeeContractPreNewService
.
electronicSignExpiringReminder
();
}
/**
* @Author fxj
* @Description 一键催办
* @Date 19:19 2026/2/10
**/
@Operation
(
description
=
"一键催办"
)
@PostMapping
(
"/contractUrg"
)
public
R
contractUrg
(
@RequestParam
String
id
)
{
return
tEmployeeContractPreNewService
.
contractUrg
(
id
);
}
/**
* 通过preId查询合同续签已确认信息
* @param preId
* @return R
*/
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过preId查询合同续签已确认信息"
)
@GetMapping
(
"/getInfoByPreId"
)
public
R
<
TEmployeeContractPreNew
>
getInfoByPreId
(
@RequestParam
(
"preId"
)
String
preId
)
{
return
tEmployeeContractPreNewService
.
getInfoByPreId
(
preId
);
}
/**
* 通过preId查询已续签合同信息
* @param preId
* @return R
*/
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过preId查询已续签合同信息"
)
@GetMapping
(
"/getRenewContractByPreId"
)
public
R
<
TEmployeeContractInfo
>
getRenewContractByPreId
(
@RequestParam
(
"preId"
)
String
preId
)
{
return
tEmployeeContractPreNewService
.
getRenewContractByPreId
(
preId
);
}
/**
* 续签确认提醒 9:00
* 续签确认提醒节点:
* 第一个时间:上一份合同截止日期前一个月往前找最近的工作日(若前一个月当天是工作日,那就取当日);
* 第二个时间:合同截止日期(若为节假日,往前找最近的一个工作日);
* 第三个时间:合同截止日期后一个月往前找第五个工作日(找不到就找第四、第三、第二、第一),都找不到,就不提醒
* 提醒至前端客服,点击提醒,提示:请至HRO系统及时进行合同确认,以免续签不及时!
* @author fxj
*/
@SysLog
(
"派单当日9点统一推送续签确认信息"
)
@Inner
@PostMapping
(
"/inner/pushWxConfrimMessage"
)
public
R
pushWxConfrimMessage
()
{
return
tEmployeeContractPreNewService
.
pushWxConfrimMessage
();
}
/**
* @Author fxj
* @Description
* @Date 19:08 2026/2/10
**/
/*@Inner
@PostMapping("/inner/electronicSignExpiringReminder")
public R electronicSignExpiringReminder() {
return tEmployeeContractPreNewService.electronicSignExpiringReminder();
}*/
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TEmpContractAlertMapper.java
View file @
ec3b01b2
...
...
@@ -21,10 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeFeedBackAllVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractAlertUpdateVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAlertExportVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -50,7 +47,7 @@ public interface TEmpContractAlertMapper extends BaseMapper<TEmpContractAlert> {
* @param tEmpContractAlert 员工合同续签待办
* @return
*/
IPage
<
TEmpContractAlert
>
getTEmpContractAlertAutoPage
(
Page
<
TEmpContractAlert
>
page
,
@Param
(
"tEmpContractAlert"
)
TEmpContractAlert
tEmpContractAlert
);
IPage
<
ContractAlertAutoVo
>
getTEmpContractAlertAutoPage
(
Page
<
TEmpContractAlert
>
page
,
@Param
(
"tEmpContractAlert"
)
ContractAlertSearchVo
tEmpContractAlert
);
/**
* @Author fxj
...
...
@@ -62,4 +59,10 @@ public interface TEmpContractAlertMapper extends BaseMapper<TEmpContractAlert> {
int
getTEmpContractAlertAutoCount
(
@Param
(
"tEmpContractAlert"
)
ContractAlertSearchVo
tEmpContractAlert
);
List
<
TEmpContractAlertExportVo
>
listExport
(
@Param
(
"tEmpContractAlert"
)
ContractAlertSearchVo
searchVo
);
void
updateProcessStatus
();
List
<
ContractAlertConfirmVo
>
getAutoRenewForConfirm
(
@Param
(
"tEmpContractAlert"
)
ContractAlertSearchVo
tEmpContractAlert
);
List
<
ContractAlertAutoVo
>
getPushWxConfrimInfos
();
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TEmployeeContractPreNewMapper.java
View file @
ec3b01b2
...
...
@@ -21,9 +21,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewDetailVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewSearchVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 合同续签预派单信息
*
...
...
@@ -39,4 +44,10 @@ public interface TEmployeeContractPreNewMapper extends BaseMapper<TEmployeeContr
* @return
*/
IPage
<
TEmployeeContractPreNew
>
getTEmployeeContractPreNewPage
(
Page
<
TEmployeeContractPreNew
>
page
,
@Param
(
"tEmployeeContractPreNew"
)
TEmployeeContractPreNew
tEmployeeContractPreNew
);
List
<
EmployeeContractVO
>
getDisPatcherContractListRenew
(
@Param
(
"idList"
)
List
<
String
>
idList
,
@Param
(
"statusList"
)
List
<
String
>
statusList
,
@Param
(
"type"
)
String
type
);
List
<
TEmployeeContractPreNewDetailVo
>
getDetailList
(
@Param
(
"tEmployeeContractPreNew"
)
TEmployeeContractPreNewSearchVo
tEmployeeContractPreNew
);
List
<
String
>
getUnDispatchList
();
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/FascService.java
View file @
ec3b01b2
...
...
@@ -45,12 +45,25 @@ public interface FascService extends IService<FddContractInfo> {
// 推送法大大任务
R
<
String
>
submitContract
(
String
id
)
throws
ApiException
;
// 自动化续签待办:推送法大大任务
R
<
String
>
submitContractRenew
(
String
id
)
throws
ApiException
;
// 撤销签署任务
R
<
String
>
cancelTask
(
String
id
)
throws
ApiException
;
// 自动化续签待办:撤销签署任务
R
<
String
>
cancelTaskRenew
(
String
id
)
throws
ApiException
;
// 催办签署任务
R
<
String
>
urgeTask
(
String
id
)
throws
ApiException
;
// 自动化续签待办:催办签署任务
R
<
String
>
urgeTaskRenew
(
String
id
)
throws
ApiException
;
// 获取附件
boolean
getFileByRequestId
(
String
id
)
throws
ApiException
;
// 自动化续签待办:获取附件
boolean
getFileByRequestIdRenew
(
String
id
)
throws
ApiException
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmpContractAlertService.java
View file @
ec3b01b2
...
...
@@ -22,10 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FeedBackDetail
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ChangeFeedBackAllVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractAlertUpdateVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpProjectVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
...
@@ -46,7 +43,7 @@ public interface TEmpContractAlertService extends IService<TEmpContractAlert> {
* @param tEmpContractAlert 员工合同续签待办
* @return
*/
IPage
<
TEmpContractAlert
>
getTEmpContractAlertAutoPage
(
Page
<
TEmpContractAlert
>
page
,
ContractAlertSearchVo
tEmpContractAlert
);
IPage
<
ContractAlertAutoVo
>
getTEmpContractAlertAutoPage
(
Page
<
TEmpContractAlert
>
page
,
ContractAlertSearchVo
tEmpContractAlert
);
IPage
<
TEmpContractAlert
>
pageDiy
(
Page
page
,
ContractAlertSearchVo
searchVo
);
// 给自动化用的-合同待续签-分页查询
...
...
@@ -88,4 +85,8 @@ public interface TEmpContractAlertService extends IService<TEmpContractAlert> {
void
listAutoExport
(
HttpServletResponse
response
,
ContractAlertSearchVo
searchVo
);
EmpProjectVO
getProjectInfoByContractId
(
String
id
);
R
<
EmpContractRenewVO
>
getAllRenewInfoById
(
String
id
);
R
<
List
<
ContractAlertConfirmVo
>>
getAutoRenewForConfirm
(
ContractAlertSearchVo
tEmpContractAlert
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeContractPreNewService.java
View file @
ec3b01b2
...
...
@@ -18,9 +18,13 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeAutoRegistRevokeVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewDetailVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
...
@@ -52,4 +56,26 @@ public interface TEmployeeContractPreNewService extends IService<TEmployeeContra
R
confirmRenewalContract
(
TEmployeeContractPreNewVo
preVo
);
R
batchCconfirmRenewalContract
(
TEmployeeContractPreNewVo
preVo
);
R
dispatcherContract
(
List
<
String
>
idList
,
String
type
);
R
revokeSign
(
List
<
TEmployeeAutoRegistRevokeVo
>
registRevokeVoList
);
R
autoRevokeElectronicSign
();
R
notifyRevokedElectronicSign
();
R
electronicSignExpiringReminder
();
R
contractUrg
(
String
id
);
R
<
TEmployeeContractPreNew
>
getInfoByPreId
(
String
preId
);
R
<
List
<
TEmployeeContractPreNewDetailVo
>>
getDetailList
(
TEmployeeContractPreNewSearchVo
tEmployeeContractPreNew
);
R
<
TEmployeeContractInfo
>
getRenewContractByPreId
(
String
preId
);
R
pushWxConfrimMessage
();
void
pushDisConfrimContracts
();
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FascServiceImpl.java
View file @
ec3b01b2
...
...
@@ -59,6 +59,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
private
final
TFascTemplateService
tFascTemplateService
;
private
final
TFascTemplateDetailService
tFascTemplateDetailService
;
private
final
TEmployeeContractPreMapper
tEmployeeContractPreMapper
;
private
final
TEmployeeContractPreNewMapper
tEmployeeContractPreNewMapper
;
private
final
TEmployeeContractInfoMapper
tEmployeeContractInfoMapper
;
private
final
TEmployeeInfoMapper
tEmployeeInfoMapper
;
private
final
TEmpContactInfoMapper
tEmpContactInfoMapper
;
...
...
@@ -374,7 +375,67 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
return
requestInfo
;
}
@Override
public
R
<
String
>
submitContractRenew
(
String
id
)
throws
ApiException
{
// templateName 签署任务模板名称
TEmployeeContractPreNew
contract
=
tEmployeeContractPreNewMapper
.
selectById
(
id
);
if
(
contract
==
null
)
{
return
R
.
failed
(
FASC_NO_CONTRACT
);
}
TEmployeeContractInfo
empContract
=
tEmployeeContractInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
eq
(
TEmployeeContractInfo:
:
getPreId
,
id
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
String
empIdCard
=
contract
.
getEmpIdcard
();
if
(
Common
.
isEmpty
(
empIdCard
))
{
return
R
.
failed
(
"未找到身份证,请联系管理员"
);
}
if
(
empContract
==
null
)
{
return
R
.
failed
(
FASC_NO_EMP_CONTRACT
);
}
TEmployeeContractPrePushFascVo
empContactInfo
=
tEmpContactInfoMapper
.
getTEmpContactInfoOneByCard
(
empIdCard
);
TEmployeeContractPrePushFascVo
empInfo
=
tEmpContactInfoMapper
.
getTEmpInfoOneByCard
(
empIdCard
);
if
(
empContactInfo
!=
null
)
{
contract
.
setContactEmpName
(
empContactInfo
.
getContactEmpName
());
contract
.
setContactTel
(
empContactInfo
.
getContactTel
());
contract
.
setContactAddress
(
empContactInfo
.
getContactAddress
());
}
if
(
empInfo
!=
null
)
{
contract
.
setHuArea
(
empInfo
.
getHuArea
());
contract
.
setContactArea
(
empInfo
.
getContactArea
());
contract
.
setEmpEmail
(
empInfo
.
getEmpEmail
());
}
if
(
Common
.
isEmpty
(
contract
.
getFadadaTemplateId
()))
{
return
R
.
failed
(
"未找到合同模板ID,请联系管理员"
);
}
if
(
Common
.
isEmpty
(
contract
.
getSignType
()))
{
return
R
.
failed
(
"签署方式为空,请联系管理员"
);
}
else
if
(!
CommonConstants
.
ZERO_STRING
.
equals
(
contract
.
getSignType
()))
{
return
R
.
failed
(
"签署方式不是电子签,不可发起电子签署"
);
}
// 如果状态过多,可以改为这个:
// ArrayUtils.contains(forbidStatusArr, tGzOfferInfo.getOfferStatus())
if
(
Common
.
isNotNull
(
contract
.
getRequestId
()))
{
return
R
.
failed
(
"合同已发起,请勿重复发起!"
);
}
TFascTemplate
tFascTemplate
=
tFascTemplateService
.
getOne
(
Wrappers
.<
TFascTemplate
>
query
()
.
lambda
().
eq
(
TFascTemplate:
:
getSignTemplateId
,
contract
.
getFadadaTemplateId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
tFascTemplate
==
null
)
{
return
R
.
failed
(
FASC_NO_TEMPLATE
);
}
else
if
(!
"valid"
.
equals
(
tFascTemplate
.
getSignTemplateStatus
()))
{
return
R
.
failed
(
"法大大模版状态不是“启用”,不可发起电子签署"
);
}
List
<
TFascTemplateDetail
>
detailList
=
tFascTemplateDetailService
.
getTDetailListByFieldType
(
contract
.
getFadadaTemplateId
());
// - 判断是否入职超过1个月——接口入口做了
TFascCompany
company
=
tFascCompanyService
.
getById
(
tFascTemplate
.
getCompanyId
());
R
<
String
>
requestInfo
=
fascUtil
.
submitContract
(
contract
,
tFascPushLogService
,
tEmployeeContractPreNewMapper
,
tFascTemplate
,
detailList
,
company
);
return
requestInfo
;
}
/**
* @param id TEmployeeContractPre主键
* @Description: 撤销签署任务
...
...
@@ -399,7 +460,23 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
return
fascUtil
.
cancelTask
(
contract
,
tFascPushLogService
,
tEmployeeContractPreMapper
,
company
);
}
@Override
public
R
<
String
>
cancelTaskRenew
(
String
id
)
throws
ApiException
{
// templateName 签署任务模板名称
TEmployeeContractPreNew
contract
=
tEmployeeContractPreNewMapper
.
selectById
(
id
);
if
(
contract
==
null
)
{
return
R
.
failed
(
FASC_NO_CONTRACT
);
}
if
(
Common
.
isEmpty
(
contract
.
getRequestId
()))
{
return
R
.
failed
(
"无requestId,请检查数据"
);
}
TFascCompany
company
=
getTFascCompany
(
contract
);
if
(
company
==
null
)
{
return
R
.
failed
(
"无公司信息,请检查数据!"
);
}
return
fascUtil
.
cancelTask
(
contract
,
tFascPushLogService
,
tEmployeeContractPreNewMapper
,
company
);
}
private
TFascCompany
getTFascCompany
(
TEmployeeContractPre
contract
)
{
TFascCompany
company
=
null
;
if
(
Common
.
isNotNull
(
contract
.
getFadadaTemplateId
()))
{
...
...
@@ -413,6 +490,19 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
return
company
;
}
private
TFascCompany
getTFascCompany
(
TEmployeeContractPreNew
contract
)
{
TFascCompany
company
=
null
;
if
(
Common
.
isNotNull
(
contract
.
getFadadaTemplateId
()))
{
TFascTemplate
tFascTemplate
=
tFascTemplateService
.
getOne
(
Wrappers
.<
TFascTemplate
>
query
()
.
lambda
().
eq
(
TFascTemplate:
:
getSignTemplateId
,
contract
.
getFadadaTemplateId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
tFascTemplate
!=
null
&&
Common
.
isNotNull
(
tFascTemplate
.
getCompanyId
()))
{
company
=
tFascCompanyService
.
getById
(
tFascTemplate
.
getCompanyId
());
}
}
return
company
;
}
/**
* @param id TEmployeeContractPre主键
* @Description: 催办签署任务
...
...
@@ -439,6 +529,30 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
}
/**
* @Author fxj
* @Description 续签待办自动化:催办签署任务
* @Date 19:25 2026/2/10
**/
@Override
public
R
<
String
>
urgeTaskRenew
(
String
id
)
throws
ApiException
{
// templateName 签署任务模板名称
TEmployeeContractPreNew
contract
=
tEmployeeContractPreNewMapper
.
selectById
(
id
);
if
(
contract
==
null
)
{
return
R
.
failed
(
FASC_NO_CONTRACT
);
}
if
(
Common
.
isEmpty
(
contract
.
getRequestId
()))
{
return
R
.
failed
(
"无requestId,请检查数据"
);
}
TFascCompany
company
=
getTFascCompany
(
contract
);
if
(
company
==
null
)
{
return
R
.
failed
(
"无公司信息,请检查数据!"
);
}
return
fascUtil
.
urgeTask
(
contract
,
tFascPushLogService
,
tEmployeeContractPreNewMapper
,
company
);
}
/**
* @param id TEmployeeContractPre主键
* @Description: 获取附件
...
...
@@ -463,6 +577,22 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
}
return
fascUtil
.
getFileByRequestId
(
contract
,
tFascPushLogService
,
tAttaInfoMapper
,
ossUtil
,
company
);
}
@Override
public
boolean
getFileByRequestIdRenew
(
String
id
)
throws
ApiException
{
// templateName 签署任务模板名称
TEmployeeContractPreNew
contract
=
tEmployeeContractPreNewMapper
.
selectById
(
id
);
if
(
contract
==
null
)
{
return
false
;
}
if
(
Common
.
isEmpty
(
contract
.
getRequestId
()))
{
// return R.failed("无requestId,请检查数据")
return
false
;
}
TFascCompany
company
=
getTFascCompany
(
contract
);
if
(
company
==
null
)
{
return
false
;
}
return
fascUtil
.
getFileByRequestId
(
contract
,
tFascPushLogService
,
tAttaInfoMapper
,
ossUtil
,
company
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpContractAlertServiceImpl.java
View file @
ec3b01b2
...
...
@@ -31,6 +31,7 @@ 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.icbc.api.request.JftApiCommonOpenCardRequestV1
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig
;
...
...
@@ -66,6 +67,7 @@ import java.net.URLEncoder;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* 员工合同续签待办
...
...
@@ -95,8 +97,12 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
private
final
TSettleDomainService
tSettleDomainService
;
private
final
TEmployeeContractPreNewMapper
contractPreNewMapper
;
private
final
TEmployeeContractPreHistoryMapper
contractPreHistoryMapper
;
@Autowired
TAuto
ContractRuleInfoMapper
autoContractRuleInfo
Mapper
;
TAuto
MainRelMapper
autoMainRel
Mapper
;
@Autowired
private
UpmsDaprUtils
upmsDaprUtils
;
...
...
@@ -396,7 +402,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
// 获取所有未审核通过的合同数据
List
<
TEmployeeContractInfo
>
notAccessList
=
contractInfoMapper
.
selectList
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ZERO_STRING
)
.
or
().
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_STRING
))
.
or
().
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_STRING
)
.
or
().
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
FOUR_STRING
))
.
eq
(
TEmployeeContractInfo:
:
getWorkFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
Map
<
String
,
TEmpContractAlert
>
alertMap
=
new
HashMap
<>();
...
...
@@ -405,7 +412,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if
(
Common
.
isNotNull
(
alertList
))
{
List
<
TSettleDomain
>
projects
=
settleDomainMapper
.
selectList
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
List
<
TAuto
ContractRuleInfo
>
contractRuleInfos
=
autoContractRuleInfoMapper
.
selectList
(
Wrappers
.<
TAutoContractRuleInfo
>
query
().
lambda
());
List
<
TAuto
MainRel
>
ruleInfos
=
autoMainRelMapper
.
selectList
(
Wrappers
.<
TAutoMainRel
>
query
().
lambda
());
//判空、判重,处理重复键和null值
Map
<
String
,
TSettleDomain
>
projectMap
=
null
;
if
(
Common
.
isNotNull
(
projects
)){
...
...
@@ -420,26 +427,26 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
}
//判空、判重,处理重复键和null值
Map
<
String
,
TAuto
ContractRuleInfo
>
contractR
uleMap
=
null
;
if
(
Common
.
isNotNull
(
contractR
uleInfos
)){
contractRuleMap
=
contractR
uleInfos
.
stream
()
Map
<
String
,
TAuto
MainRel
>
r
uleMap
=
null
;
if
(
Common
.
isNotNull
(
r
uleInfos
)){
ruleMap
=
r
uleInfos
.
stream
()
.
filter
(
Objects:
:
nonNull
)
.
filter
(
rule
->
rule
.
getDeptNo
()
!=
null
)
.
collect
(
Collectors
.
toMap
(
TAuto
ContractRuleInfo
:
:
getDeptNo
,
TAuto
MainRel
:
:
getDeptNo
,
obj
->
obj
,
(
existing
,
replacement
)
->
existing
// 保留第一个遇到的值
));
}
Date
nowDate
=
new
Date
();
TAuto
ContractRuleInfo
ruleInfo
=
null
;
TAuto
MainRel
ruleInfo
=
null
;
TSettleDomain
project
=
null
;
for
(
TEmployeeContractInfo
contract:
alertList
){
if
(
Common
.
isNotNull
(
projectMap
)){
project
=
projectMap
.
get
(
contract
.
getDeptNo
());
}
if
(
Common
.
isNotNull
(
contractR
uleMap
)){
ruleInfo
=
contractR
uleMap
.
get
(
contract
.
getDeptNo
());
if
(
Common
.
isNotNull
(
r
uleMap
)){
ruleInfo
=
r
uleMap
.
get
(
contract
.
getDeptNo
());
}
extracted
(
nowDate
,
contract
,
alertMap
,
existMap
,
project
,
ruleInfo
);
}
...
...
@@ -458,6 +465,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if
(
Common
.
isNotNull
(
alertMap
)){
this
.
saveBatch
(
alertMap
.
values
());
}
//更新自动化的所有的合同办理状态
baseMapper
.
updateProcessStatus
();
return
R
.
ok
();
}
...
...
@@ -476,7 +485,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
Map
<
String
,
TEmpContractAlert
>
alertMap
,
Map
<
String
,
TEmpContractAlert
>
existMap
,
TSettleDomain
project
,
TAuto
ContractRuleInfo
contractR
ule
TAuto
MainRel
r
ule
)
{
TEmployeeInfo
employeeInfo
=
employeeInfoMapper
.
selectById
(
contract
.
getEmpId
());
if
(
Common
.
isNotNull
(
employeeInfo
)){
...
...
@@ -529,7 +538,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
//默认自动化为否
alert
.
setAutoFlag
(
CommonConstants
.
ONE_STRING
);
if
(
null
!=
contractR
ule
){
if
(
null
!=
r
ule
){
alert
.
setAutoFlag
(
CommonConstants
.
ZERO_STRING
);
}
FeedBackDetail
feedBackDetail1
=
feedbackDetailMapper
.
findByApplyNo
(
contract
.
getApplyNo
());
...
...
@@ -1077,7 +1086,11 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
* @return
*/
@Override
public
IPage
<
TEmpContractAlert
>
getTEmpContractAlertAutoPage
(
Page
<
TEmpContractAlert
>
page
,
ContractAlertSearchVo
tEmpContractAlert
){
public
IPage
<
ContractAlertAutoVo
>
getTEmpContractAlertAutoPage
(
Page
<
TEmpContractAlert
>
page
,
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
()));
}
//初始化客服的项目权限 ,管理员及SSC 全量
initSearchVo
(
tEmpContractAlert
);
return
baseMapper
.
getTEmpContractAlertAutoPage
(
page
,
tEmpContractAlert
);
...
...
@@ -1106,6 +1119,10 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
@Override
public
Integer
getTEmpContractAlertAutoCount
(
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
()));
}
//初始化客服的项目权限 ,管理员及SSC 全量
initSearchVo
(
tEmpContractAlert
);
return
baseMapper
.
getTEmpContractAlertAutoCount
(
tEmpContractAlert
);
...
...
@@ -1127,10 +1144,14 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if
(
Common
.
isNotNull
(
searchVo
.
getIds
())){
searchVo
.
setIdList
(
Arrays
.
asList
(
searchVo
.
getIds
().
split
(
CommonConstants
.
COMMA_STRING
)));
}
// 如果查询条件续签状态为空默认查询 非已完成 状态数据
if
(
Common
.
isNotNull
(
searchVo
.
getProcessStatusList
())){
searchVo
.
setProcessStatusList
(
Stream
.
of
(
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"10"
,
"11"
).
collect
(
Collectors
.
toList
()));
}
//默认导出自动化的合同续签待办
searchVo
.
setAutoFlag
(
CommonConstants
.
ZERO_STRING
);
initSearchVo
(
searchVo
);
String
fileName
=
ArchivesConstants
.
EMP_AUTO_RENEWAL_RECORD
+
LocalDateTime
.
now
()
+
CommonConstants
.
XLSX
;
String
fileName
=
ArchivesConstants
.
EMP_AUTO_RENEWAL_RECORD
+
DateUtil
.
getThisTime
()
+
CommonConstants
.
XLSX
;
//获取要导出的列表
List
<
TEmpContractAlertExportVo
>
list
=
new
ArrayList
<>();
ServletOutputStream
out
=
null
;
...
...
@@ -1213,17 +1234,67 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
TEmployeeContractInfo
contractInfo
=
contractInfoMapper
.
selectById
(
id
);
if
(
null
!=
contractInfo
){
vo
.
setDeptNo
(
contractInfo
.
getDeptNo
());
vo
.
setDepartName
(
contractInfo
.
get
DeptNo
());
vo
.
setDepartName
(
contractInfo
.
get
SubjectDepart
());
vo
.
setEmpIdcard
(
contractInfo
.
getEmpIdcard
());
vo
.
setEmpName
(
contractInfo
.
getEmpName
());
}
TEmployeeInfo
employeeInfo
=
employeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
contractInfo
.
getEmpIdcard
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
null
!=
employeeInfo
){
vo
.
setEmpPhone
(
employeeInfo
.
getEmpPhone
());
vo
.
setEmpNatrue
(
contractInfo
.
getEmpNatrue
());
vo
.
setContractInfo
(
contractInfo
);
TEmployeeInfo
employeeInfo
=
employeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
contractInfo
.
getEmpIdcard
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
null
!=
employeeInfo
){
vo
.
setEmpPhone
(
employeeInfo
.
getEmpPhone
());
}
TEmployeeContractPreNew
preNew
=
contractPreNewMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
lambdaQuery
()
.
eq
(
TEmployeeContractPreNew:
:
getContractId
,
contractInfo
.
getId
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
vo
.
setPreNew
(
preNew
);
TEmployeeContractPreHistory
pre
=
contractPreHistoryMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreHistory
>
lambdaQuery
()
.
eq
(
TEmployeeContractPreHistory:
:
getContractId
,
contractInfo
.
getId
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
vo
.
setPre
(
pre
);
}
return
vo
;
}
/**
* @Author fxj
* @Description 通过合同提醒ID查询合同提醒信息、确认接收信息、新增续签合同信息
* @Date 16:57 2026/2/11
**/
@Override
public
R
<
EmpContractRenewVO
>
getAllRenewInfoById
(
String
id
)
{
if
(!
Common
.
isNotNull
(
id
)){
return
R
.
failed
(
CommonConstants
.
PARAM_INFO_ERROR
);
}
EmpContractRenewVO
vo
=
new
EmpContractRenewVO
();
TEmpContractAlert
alert
=
this
.
getById
(
id
);
if
(
null
==
alert
){
return
R
.
failed
(
CommonConstants
.
PARAM_INFO_ERROR
);
}
vo
.
setEmpContractAlert
(
alert
);
if
(
Common
.
isNotNull
(
alert
.
getContractId
())){
TEmployeeContractPreNew
preNew
=
contractPreNewMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getContractId
,
alert
.
getContractId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
vo
.
setContractPreNew
(
preNew
);
if
(
null
!=
preNew
&&
Common
.
isNotNull
(
preNew
.
getId
())){
TEmployeeContractInfo
contractInfo
=
contractInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getPreId
,
preNew
.
getId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
vo
.
setContractInfo
(
contractInfo
);
}
}
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
()));
}
//初始化客服的项目权限 ,管理员及SSC 全量
initSearchVo
(
tEmpContractAlert
);
return
R
.
ok
(
baseMapper
.
getAutoRenewForConfirm
(
tEmpContractAlert
));
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractInfoServiceImpl.java
View file @
ec3b01b2
...
...
@@ -110,6 +110,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private
final
TEmployeeContractPreMapper
contractPreMapper
;
private
final
TEmployeeContractPreNewMapper
contractPreNewMapper
;
private
final
TEmpContractAlertMapper
contractAlertMapper
;
private
final
TGzOfferInfoMapper
gzOfferInfoMapper
;
private
final
LGuaziOfferRecordService
lGuaziOfferRecordService
;
...
...
@@ -577,6 +581,30 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractPreMapper
.
updateById
(
contractPre
);
}
}
//续签待办自动化状态更新
if
(
Common
.
isNotNull
(
tEmployeeContractInfo
.
getPreId
()))
{
TEmployeeContractPreNew
contractPreNew
=
contractPreNewMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getId
,
tEmployeeContractInfo
.
getPreId
())
.
in
(
TEmployeeContractPreNew:
:
getProcessStatus
,
Arrays
.
asList
(
"0"
,
"1"
,
"3"
,
"5"
,
"7"
,
"11"
))
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
contractPreNew
))
{
//合同状态初始为签署中
contractPreNew
.
setProcessStatus
(
"1"
.
equals
(
contractPreNew
.
getSignType
())
?
CommonConstants
.
TWO_STRING
:
CommonConstants
.
SIX_STRING
);
contractPreNew
.
setContractId
(
tEmployeeContractInfo
.
getId
());
contractPreNew
.
setErrorInfo
(
""
);
contractPreNew
.
setErrorTime
(
null
);
contractPreNew
.
setSignFlag
(
CommonConstants
.
ONE_STRING
);
contractPreNew
.
setRevokeReason
(
""
);
contractPreNewMapper
.
updateById
(
contractPreNew
);
//更新续签待办提醒的办理状态为处理中
LambdaUpdateWrapper
<
TEmpContractAlert
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmpContractAlert:
:
getContractId
,
contractPreNew
.
getContractId
())
.
set
(
TEmpContractAlert:
:
getHandleStatus
,
CommonConstants
.
ONE_STRING
);
contractAlertMapper
.
update
(
null
,
updateWrapper
);
}
}
// 瓜子项目编码:皖A694302
if
(
CommonConstants
.
GZ_DEPT_NO
.
equals
(
tEmployeeContractInfo
.
getDeptNo
()))
{
//合同申请瓜子合同状态更新成待签署
...
...
@@ -600,6 +628,26 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractPre
.
setSignFlag
(
CommonConstants
.
ONE_STRING
);
contractPreMapper
.
updateById
(
contractPre
);
}
//续签撤销签署重新提交的话判断有没有合同待签订数据,有的话更新状态 2026-02-10
TEmployeeContractPreNew
contractPreNew
=
contractPreNewMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getId
,
tEmployeeContractInfo
.
getPreId
())
.
eq
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
TEN_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
contractPreNew
))
{
if
(
tEmployeeContractInfo
.
getAuditStatus
()
==
CommonConstants
.
TWO_INT
)
{
contractPreNew
.
setProcessStatus
(
CommonConstants
.
FOUR_STRING
);
}
else
if
(
tEmployeeContractInfo
.
getAuditStatus
()
==
CommonConstants
.
ONE_INT
)
{
contractPreNew
.
setProcessStatus
(
CommonConstants
.
TWO_STRING
);
}
contractPreNew
.
setRevokeReason
(
""
);
contractPreNew
.
setSignFlag
(
CommonConstants
.
ONE_STRING
);
contractPreNewMapper
.
updateById
(
contractPreNew
);
//更新续签待办提醒的办理状态为处理中
LambdaUpdateWrapper
<
TEmpContractAlert
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmpContractAlert:
:
getContractId
,
contractPreNew
.
getContractId
())
.
set
(
TEmpContractAlert:
:
getHandleStatus
,
CommonConstants
.
ONE_STRING
);
contractAlertMapper
.
update
(
null
,
updateWrapper
);
}
baseMapper
.
updateById
(
tEmployeeContractInfo
);
...
...
@@ -963,6 +1011,15 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractPre
.
setProcessStatus
(
CommonConstants
.
FOUR_STRING
);
contractPreMapper
.
updateById
(
contractPre
);
}
//更新续签待办续签状态为4线下签待归档
TEmployeeContractPreNew
contractPreNew
=
contractPreNewMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getId
,
contractInfo
.
getPreId
())
.
eq
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
FOUR_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
contractPreNew
))
{
contractPreNew
.
setProcessStatus
(
CommonConstants
.
FOUR_STRING
);
contractPreNewMapper
.
updateById
(
contractPreNew
);
}
}
//瓜子项目编码:皖A694302
if
(
CommonConstants
.
GZ_DEPT_NO
.
equals
(
contractInfo
.
getDeptNo
()))
{
...
...
@@ -986,6 +1043,19 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractPre
.
setProcessStatus
(
CommonConstants
.
THREE_STRING
);
contractPreMapper
.
updateById
(
contractPre
);
}
//更新续签待办的续签状态为3线下签审核不通过
TEmployeeContractPreNew
contractPreNew
=
contractPreNewMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getId
,
contractInfo
.
getId
())
.
eq
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
TWO_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
contractPreNew
))
{
contractPreNew
.
setProcessStatus
(
CommonConstants
.
THREE_STRING
);
contractPreNewMapper
.
updateById
(
contractPreNew
);
//更新合同提醒办理状态
LambdaUpdateWrapper
<
TEmpContractAlert
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmpContractAlert:
:
getContractId
,
contractPreNew
.
getContractId
())
.
eq
(
TEmpContractAlert:
:
getHandleStatus
,
CommonConstants
.
ZERO_STRING
);
}
}
if
(
EmployeeConstants
.
SITUATION_SEVEN
.
equals
(
contractInfo
.
getSituation
()))
{
// 合同终止,通知离职待办变更状态
...
...
@@ -1120,6 +1190,41 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
}
//更新续签待办合同待签订数据状态为4线下签待归档 为已归档
TEmployeeContractPreNew
contractPreNew
=
contractPreNewMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getId
,
tEmployeeContractInfo
.
getPreId
())
.
eq
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
FOUR_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
contractPreNew
))
{
contractPreNew
.
setProcessStatus
(
CommonConstants
.
NINE_STRING
);
contractPreNewMapper
.
updateById
(
contractPreNew
);
//更新合同续签提醒办理状态为已完成
LambdaUpdateWrapper
<
TEmpContractAlert
>
updateWrapperAlert
=
new
LambdaUpdateWrapper
<>();
updateWrapperAlert
.
eq
(
TEmpContractAlert:
:
getContractId
,
contractPreNew
.
getContractId
())
.
eq
(
TEmpContractAlert:
:
getHandleStatus
,
CommonConstants
.
TWO_INT
);
contractAlertMapper
.
update
(
null
,
updateWrapperAlert
);
//把关联的其他附件置空
LambdaUpdateWrapper
<
TAttaInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
// 设置更新条件和新值
updateWrapper
.
eq
(
TAttaInfo:
:
getDomainId
,
contractPreNew
.
getId
())
.
set
(
TAttaInfo:
:
getDomainId
,
CommonConstants
.
EMPTY_STRING
);
// 执行更新操作,清空附件的ID
tAttaInfoService
.
update
(
updateWrapper
);
//附件同步
if
(
Common
.
isNotNull
(
tEmployeeContractInfo
.
getAttaList
())
&&
!
tEmployeeContractInfo
.
getAttaList
().
isEmpty
())
{
for
(
String
id
:
tEmployeeContractInfo
.
getAttaList
())
{
//附件赋值
TAttaInfo
attaInfo
=
tAttaInfoService
.
getById
(
id
);
if
(
attaInfo
!=
null
)
{
TAttaInfo
attaInfoPre
=
new
TAttaInfo
();
BeanUtils
.
copyProperties
(
attaInfo
,
attaInfoPre
);
attaInfoPre
.
setDomainId
(
contractPreNew
.
getId
());
attaInfoPre
.
setId
(
null
);
tAttaInfoService
.
save
(
attaInfoPre
);
}
}
}
}
//瓜子项目编码:皖A694302
if
(
CommonConstants
.
GZ_DEPT_NO
.
equals
(
tEmployeeContractInfo
.
getDeptNo
()))
{
//合同归档瓜子合同状态更新已归档
...
...
@@ -2148,6 +2253,15 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractPre
.
setProcessStatus
(
CommonConstants
.
FOUR_STRING
);
contractPreMapper
.
updateById
(
contractPre
);
}
//续签待办:更新续签状态为4线下签待归档
TEmployeeContractPreNew
contractPreNew
=
contractPreNewMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getId
,
contract
.
getPreId
())
.
eq
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
TWO_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
contractPreNew
))
{
contractPreNew
.
setProcessStatus
(
CommonConstants
.
FOUR_STRING
);
contractPreNewMapper
.
updateById
(
contractPreNew
);
}
//瓜子项目编码:皖A694302
if
(
CommonConstants
.
GZ_DEPT_NO
.
equals
(
contract
.
getDeptNo
()))
{
//审核通过瓜子合同状态更新成合同审核通过
...
...
@@ -2171,6 +2285,20 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if
(
EmployeeConstants
.
SITUATION_SEVEN
.
equals
(
contract
.
getSituation
()))
{
this
.
sendLeave
(
contract
.
getId
(),
CommonConstants
.
TEN_STRING
,
CommonConstants
.
ZERO_STRING
,
auditRemark
,
user
);
}
//续签待办:更新合同状态为3线下签审核不通过,合同续签提醒更新为待处理
TEmployeeContractPreNew
contractPreNew
=
contractPreNewMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getId
,
contract
.
getPreId
())
.
eq
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
TWO_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
contractPreNew
))
{
contractPreNew
.
setProcessStatus
(
CommonConstants
.
THREE_STRING
);
contractPreNewMapper
.
updateById
(
contractPreNew
);
//更新合同提醒办理状态为待处理
LambdaUpdateWrapper
<
TEmpContractAlert
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmpContractAlert:
:
getContractId
,
contractPreNew
.
getContractId
())
.
set
(
TEmpContractAlert:
:
getHandleStatus
,
CommonConstants
.
ZERO_INT
);
contractAlertMapper
.
update
(
null
,
updateWrapper
);
}
}
// 不是待提交,记录审核记录
this
.
setAuditInfo
(
tEmployeeContractInfo
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractPreNewServiceImpl.java
View file @
ec3b01b2
...
...
@@ -16,20 +16,41 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
com.alibaba.excel.util.DateUtils
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewVo
;
import
com.fasc.open.api.exception.ApiException
;
import
com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationBatchErrorVo
;
import
com.yifu.cloud.plus.v1.csp.vo.TEmployeeContractDateVo
;
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.service.*
;
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.archives.service.TEmployeeContractPreNewService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
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.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo
;
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
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewSearchVo
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.InputStream
;
import
java.util.List
;
import
java.time.LocalDate
;
import
java.time.ZoneId
;
import
java.util.*
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ArrayUtil
;
...
...
@@ -48,14 +69,15 @@ 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.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 合同续签预派单信息
...
...
@@ -64,8 +86,32 @@ import java.util.List;
* @date 2026-02-05 15:45:40
*/
@Log4j2
@RequiredArgsConstructor
@Service
public
class
TEmployeeContractPreNewServiceImpl
extends
ServiceImpl
<
TEmployeeContractPreNewMapper
,
TEmployeeContractPreNew
>
implements
TEmployeeContractPreNewService
{
@Autowired
private
TEmployeeContractInfoMapper
contractInfoMapper
;
@Autowired
private
TEmpContractAlertMapper
empContractAlertMapper
;
@Autowired
private
TContractAutoLogService
contractAutoLogService
;
@Autowired
private
TEmployeeContractInfoService
contractInfoService
;
private
final
FascService
fascService
;
private
final
TEmployeeContractAuditService
tEmployeeContractAuditService
;
@Autowired
private
WxConfig
wxConfig
;
@Autowired
private
UpmsDaprUtils
upmsDaprUtils
;
@Autowired
private
SocialDaprUtils
socialDaprUtils
;
/**
* 合同续签预派单信息简单分页查询
*
...
...
@@ -187,7 +233,46 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
**/
@Override
public
R
confirmRenewalContract
(
TEmployeeContractPreNewVo
preVo
)
{
return
null
;
if
(!
Common
.
isNotNull
(
preVo
)
||
!
Common
.
isNotNull
(
preVo
.
getContractId
()))
{
return
R
.
failed
(
CommonConstants
.
PARAM_INFO_ERROR
);
}
TEmployeeContractInfo
contract
=
contractInfoMapper
.
selectById
(
preVo
.
getContractId
());
if
(
contract
==
null
){
return
R
.
failed
(
EmployeeConstants
.
DATA_CAN_NOT_FOUND
);
}
////如果电子签是系统自动撤销对应的签署方式必须更新为 线下签
TEmployeeContractPreNew
preNew
=
null
;
if
(
Common
.
isNotNull
(
preVo
.
getId
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
preVo
.
getSignType
())){
preNew
=
baseMapper
.
selectById
(
preVo
.
getId
());
if
(
preNew
!=
null
&&
CommonConstants
.
ELEVEN_STRING
.
equals
(
preNew
.
getProcessStatus
())){
return
R
.
failed
(
EmployeeConstants
.
DATA_CONTRACT_CANCEL_MUST_OFFLINE_SIGN
);
}
}
//判断两个合同时间是否重合
if
(
LocalDateUtil
.
hasOverlap
(
contract
.
getContractStart
(),
contract
.
getContractEnd
(),
preVo
.
getContractStart
(),
preVo
.
getContractEnd
())){
return
R
.
failed
(
EmployeeConstants
.
DATA_CONTRACT_OVERLAP
);
}
TEmpContractAlert
alert
=
empContractAlertMapper
.
selectOne
(
Wrappers
.<
TEmpContractAlert
>
query
().
lambda
()
.
eq
(
TEmpContractAlert:
:
getContractId
,
preVo
.
getContractId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
TEmployeeContractPreNew
pre
=
new
TEmployeeContractPreNew
();
BeanCopyUtils
.
copyProperties
(
preVo
,
pre
);
pre
.
setProcessStatus
(
CommonConstants
.
ONE_STRING
);
if
(
null
!=
alert
){
pre
.
setCustomerUsername
(
alert
.
getCsName
());
pre
.
setCustomerUserLoginname
(
alert
.
getCsLoginName
());
}
int
res
=
-
1
;
if
(
Common
.
isNotNull
(
pre
.
getId
())){
res
=
baseMapper
.
updateById
(
pre
);
}
else
{
res
=
baseMapper
.
insert
(
pre
);
}
if
(
res
>=
0
){
return
R
.
ok
();
}
else
{
return
R
.
failed
(
CommonConstants
.
RESULT_DATA_FAIL
);
}
}
/**
* @Author fxj
...
...
@@ -198,6 +283,1231 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
**/
@Override
public
R
batchCconfirmRenewalContract
(
TEmployeeContractPreNewVo
preVo
)
{
return
null
;
if
(!
Common
.
isNotNull
(
preVo
)
||
!
Common
.
isNotNull
(
preVo
.
getContractIds
()))
{
return
R
.
failed
(
CommonConstants
.
PARAM_INFO_ERROR
);
}
List
<
String
>
contractIds
=
preVo
.
getContractIds
();
List
<
TEmployeeContractInfo
>
contractList
=
contractInfoMapper
.
selectBatchIds
(
contractIds
);
if
(
contractList
==
null
||
contractList
.
size
()
<=
0
){
return
R
.
failed
(
EmployeeConstants
.
DATA_CAN_NOT_FOUND
);
}
List
<
TEmpContractAlert
>
alertList
=
empContractAlertMapper
.
selectList
(
Wrappers
.<
TEmpContractAlert
>
query
().
lambda
()
.
in
(
TEmpContractAlert:
:
getContractId
,
contractIds
)
.
groupBy
(
TEmpContractAlert:
:
getContractId
));
Map
<
String
,
TEmpContractAlert
>
alertMap
=
new
HashMap
<>();
if
(
alertList
!=
null
){
alertList
.
stream
().
filter
(
v
->
v
.
getContractId
()
!=
null
)
.
collect
(
Collectors
.
toMap
(
TEmpContractAlert:
:
getContractId
,
v
->
v
));
}
TEmployeeContractPreNew
pre
=
null
;
List
<
TEmployeeContractPreNew
>
preList
=
new
ArrayList
<>();
List
<
TEmployeeAutoRegistCheckVo
>
errorList
=
new
ArrayList
<>();
TEmployeeAutoRegistCheckVo
checkVo
;
TEmpContractAlert
alert
=
null
;
TEmployeeContractDateVo
vo
=
null
;
TEmployeeContractPreNew
preNew
=
null
;
for
(
TEmployeeContractInfo
contract
:
contractList
){
//判断两个合同时间是否重合
if
(
LocalDateUtil
.
hasOverlap
(
contract
.
getContractStart
(),
contract
.
getContractEnd
(),
preVo
.
getContractStart
(),
preVo
.
getContractEnd
())){
checkVo
=
new
TEmployeeAutoRegistCheckVo
();
checkVo
.
setEmployeeName
(
contract
.
getEmpName
());
checkVo
.
setEmpIdcard
(
contract
.
getEmpIdcard
());
checkVo
.
setDeptName
(
preVo
.
getDeptName
());
checkVo
.
setDeptNo
(
preVo
.
getDeptNo
());
checkVo
.
setType
(
"合同"
);
checkVo
.
setErrorMsg
(
EmployeeConstants
.
DATA_CONTRACT_OVERLAP
);
errorList
.
add
(
checkVo
);
continue
;
}
//如果电子签是系统自动撤销对应的签署方式必须更新为 线下签,
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
preVo
.
getSignType
())){
preNew
=
baseMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getContractId
,
contract
.
getId
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
null
!=
preNew
&&
CommonConstants
.
ELEVEN_STRING
.
equals
(
preNew
.
getProcessStatus
())){
checkVo
=
new
TEmployeeAutoRegistCheckVo
();
checkVo
.
setEmployeeName
(
contract
.
getEmpName
());
checkVo
.
setEmpIdcard
(
contract
.
getEmpIdcard
());
checkVo
.
setDeptName
(
preVo
.
getDeptName
());
checkVo
.
setDeptNo
(
preVo
.
getDeptNo
());
checkVo
.
setType
(
"合同"
);
checkVo
.
setErrorMsg
(
EmployeeConstants
.
DATA_CONTRACT_CANCEL_MUST_OFFLINE_SIGN
);
errorList
.
add
(
checkVo
);
continue
;
}
}
pre
=
new
TEmployeeContractPreNew
();
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
());
}
//合同开始日期=上一份合同截止日期+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
));
}
preList
.
add
(
pre
);
}
boolean
res
=
false
;
if
(
preList
!=
null
&&
preList
.
size
()
>
0
){
res
=
this
.
saveBatch
(
preList
);
}
if
(
res
){
if
(!
errorList
.
isEmpty
())
{
EmployeeRegistrationBatchErrorVo
batchErrorVo
=
new
EmployeeRegistrationBatchErrorVo
();
batchErrorVo
.
setErrorList
(
errorList
);
return
R
.
other
(
CommonConstants
.
TWO_INT
,
null
,
batchErrorVo
);
}
else
{
return
R
.
ok
();
}
}
else
{
return
R
.
failed
(
CommonConstants
.
RESULT_DATA_FAIL
);
}
}
/**
* @Author fxj
* @Description 合同续签待签订信息单个/批量发起签署任务
* @Date 18:35 2026/2/9
* @param type 1 手动 2 自动
**/
@Override
public
R
dispatcherContract
(
List
<
String
>
idList
,
String
type
)
{
List
<
TEmployeeContractPreNew
>
contractPreList
;
List
<
String
>
processStatus
=
Arrays
.
asList
(
"0"
,
"1"
,
"3"
,
"5"
,
"7"
,
"11"
);
if
(
"2"
.
equals
(
type
))
{
//自动 待发起、发起失败、撤销签署-客服撤销、撤销签署-系统自动撤销、签署失败、审核不通过
contractPreList
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeContractPreNew
>
query
()
.
lambda
().
in
(
TEmployeeContractPreNew:
:
getId
,
idList
)
.
in
(
TEmployeeContractPreNew:
:
getProcessStatus
,
processStatus
));
}
else
{
//手动
contractPreList
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeContractPreNew
>
query
()
.
lambda
().
in
(
TEmployeeContractPreNew:
:
getId
,
idList
)
.
in
(
TEmployeeContractPreNew:
:
getProcessStatus
,
processStatus
));
}
// 如果没有找到任何未处理的合同待派单数据,返回失败消息
if
(
Common
.
isEmpty
(
contractPreList
))
{
return
R
.
failed
(
CommonConstants
.
NO_DATA_TO_HANDLE
);
}
// 创建一个Map映射preId到TEmployeeContractPre对象
Map
<
String
,
TEmployeeContractPreNew
>
preContractMap
=
contractPreList
.
stream
()
.
collect
(
Collectors
.
toMap
(
TEmployeeContractPreNew:
:
getId
,
pre
->
pre
));
Map
<
String
,
String
>
loginNameMap
=
new
HashMap
<>();
//发起派单
List
<
ErrorMessage
>
errorMessageListAll
=
new
ArrayList
<>();
List
<
EmployeeContractVO
>
excelVOList
=
baseMapper
.
getDisPatcherContractListRenew
(
idList
,
processStatus
,
type
);
// 拆分电子签和线下签
List
<
EmployeeContractVO
>
electronicSignList
=
new
ArrayList
<>();
List
<
EmployeeContractVO
>
offlineSignList
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
excelVOList
)
&&
!
excelVOList
.
isEmpty
())
{
for
(
EmployeeContractVO
contractVO
:
excelVOList
)
{
TEmployeeContractPreNew
contractPre
=
preContractMap
.
get
(
contractVO
.
getPreId
());
if
(
contractPre
!=
null
&&
"0"
.
equals
(
contractPre
.
getSignType
()))
{
// 电子签
electronicSignList
.
add
(
contractVO
);
}
else
{
// 线下签
offlineSignList
.
add
(
contractVO
);
}
}
}
// 按前端客服分组统计
Map
<
String
,
CustomerStatistics
>
customerStatisticsMap
=
new
HashMap
<>();
// 处理电子签合同
if
(!
electronicSignList
.
isEmpty
())
{
LocalDate
currentDate
=
LocalDate
.
now
();
for
(
EmployeeContractVO
contractVO
:
electronicSignList
)
{
TEmployeeContractPreNew
contractPre
=
preContractMap
.
get
(
contractVO
.
getPreId
());
if
(
contractPre
!=
null
&&
contractPre
.
getContractStart
()
!=
null
)
{
if
(
"2"
.
equals
(
type
)
&&
Common
.
isNotNull
(
contractPre
.
getCustomerUserLoginname
())
&&
null
==
loginNameMap
.
get
(
contractPre
.
getCustomerUserLoginname
()))
{
UUID
uuid
=
UUID
.
randomUUID
();
loginNameMap
.
put
(
contractPre
.
getCustomerUserLoginname
(),
uuid
.
toString
());
}
// 获取或创建客服统计信息
String
customerLoginName
=
contractPre
.
getCustomerUserLoginname
();
CustomerStatistics
customerStats
=
customerStatisticsMap
.
computeIfAbsent
(
customerLoginName
,
k
->
{
CustomerStatistics
stats
=
new
CustomerStatistics
();
stats
.
setCustomerUserLoginname
(
customerLoginName
);
stats
.
setCustomerUsername
(
contractPre
.
getCustomerUsername
());
return
stats
;
});
customerStats
.
setInitiatedCount
(
customerStats
.
getInitiatedCount
()
+
1
);
// 系统自动撤销状态的数据签订类型必须是线下签
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
contractPre
.
getSignType
())
&&
CommonConstants
.
ELEVEN_STRING
.
equals
(
contractPre
.
getProcessStatus
())){
customerStats
.
setFailedCount
(
customerStats
.
getFailedCount
()
+
1
);
customerStats
.
setElectronicSignFailedCount
(
customerStats
.
getElectronicSignFailedCount
()
+
1
);
// 更新processStatus为电子签发起失败
LambdaUpdateWrapper
<
TEmployeeContractPreNew
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmployeeContractPreNew:
:
getId
,
contractPre
.
getId
())
.
set
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
FIVE_STRING
)
.
set
(
TEmployeeContractPreNew:
:
getErrorInfo
,
"系统自动撤销签署须走线下签!"
);
this
.
update
(
updateWrapper
);
if
(
"2"
.
equals
(
type
))
{
//生成快照数据
TContractAutoLog
contractAutoLog
=
new
TContractAutoLog
();
contractAutoLog
.
setContractId
(
loginNameMap
.
get
(
contractPre
.
getCustomerUserLoginname
()));
contractAutoLog
.
setEmpName
(
contractPre
.
getEmployeeName
());
contractAutoLog
.
setEmpIdcard
(
contractPre
.
getEmpIdcard
());
contractAutoLog
.
setMainId
(
contractPre
.
getId
());
contractAutoLog
.
setErrorInfo
(
"系统自动撤销签署须走线下签!"
);
contractAutoLogService
.
save
(
contractAutoLog
);
}
// 添加错误信息
ErrorMessage
<
EmployeeContractVO
>
errorMessage
=
new
ErrorMessage
<>(
contractVO
.
getRowIndex
(),
"系统自动撤销签署须走线下签!"
);
errorMessage
.
setData
(
contractVO
);
errorMessageListAll
.
add
(
errorMessage
);
continue
;
}
LocalDate
localDate
=
contractPre
.
getContractStart
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toLocalDate
();
localDate
=
localDate
.
plusMonths
(
1
)
.
minusDays
(
1
);
// 判断是否超过合同开始日期一个月 20260210 和倩倩确认:超过合同开始日期一个月算电子签发起失败 自动转线下签
if
(
currentDate
.
isAfter
(
localDate
))
{
// 超过一个月,算电子签发起失败
customerStats
.
setFailedCount
(
customerStats
.
getFailedCount
()
+
1
);
customerStats
.
setElectronicSignFailedCount
(
customerStats
.
getElectronicSignFailedCount
()
+
1
);
// 更新processStatus为电子签发起失败
LambdaUpdateWrapper
<
TEmployeeContractPreNew
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
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:
:
getChangeTypeReason
,
"已超过合同开始日期一个月,自动转线下签"
)
.
set
(
TEmployeeContractPreNew:
:
getChangeTypeTime
,
LocalDateTimeUtils
.
convertLDToDate
(
LocalDate
.
now
()))
.
set
(
TEmployeeContractPreNew:
:
getSignType
,
CommonConstants
.
ONE_STRING
)
.
set
(
TEmployeeContractPreNew:
:
getErrorTime
,
LocalDateTimeUtils
.
convertLDToDate
(
LocalDate
.
now
()));
this
.
update
(
updateWrapper
);
if
(
"2"
.
equals
(
type
))
{
//生成快照数据
TContractAutoLog
contractAutoLog
=
new
TContractAutoLog
();
contractAutoLog
.
setContractId
(
loginNameMap
.
get
(
contractPre
.
getCustomerUserLoginname
()));
contractAutoLog
.
setEmpName
(
contractPre
.
getEmployeeName
());
contractAutoLog
.
setEmpIdcard
(
contractPre
.
getEmpIdcard
());
contractAutoLog
.
setMainId
(
contractPre
.
getId
());
contractAutoLog
.
setErrorInfo
(
"电子签发起失败:已超过合同开始日期一个月"
);
contractAutoLogService
.
save
(
contractAutoLog
);
}
// 添加错误信息
ErrorMessage
<
EmployeeContractVO
>
errorMessage
=
new
ErrorMessage
<>(
contractVO
.
getRowIndex
(),
"电子签发起失败:已超过合同开始日期一个月"
);
errorMessage
.
setData
(
contractVO
);
errorMessageListAll
.
add
(
errorMessage
);
}
else
{
// 未超过一个月,先调用contractInfoService.importContract方法创建合同
List
<
EmployeeContractVO
>
singleContractList
=
new
ArrayList
<>();
singleContractList
.
add
(
contractVO
);
List
<
ErrorMessage
>
singleErrorMessageList
=
new
ArrayList
<>();
// 调用合同导入方法
contractInfoService
.
importContract
(
singleContractList
,
singleErrorMessageList
);
// 检查合同创建是否成功
boolean
contractCreateSuccess
=
singleErrorMessageList
.
stream
()
.
allMatch
(
message
->
message
.
getMessage
().
equals
(
CommonConstants
.
SAVE_SUCCESS
));
if
(!
contractCreateSuccess
)
{
// 合同创建失败,统计错误并更新状态
customerStats
.
setFailedCount
(
customerStats
.
getFailedCount
()
+
1
);
customerStats
.
setElectronicSignFailedCount
(
customerStats
.
getElectronicSignFailedCount
()
+
1
);
String
errorMsg
=
singleErrorMessageList
.
isEmpty
()
?
"合同创建失败"
:
singleErrorMessageList
.
get
(
0
).
getMessage
();
// 更新processStatus为电子签发起失败
LambdaUpdateWrapper
<
TEmployeeContractPreNew
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmployeeContractPreNew:
:
getId
,
contractPre
.
getId
())
.
set
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
FIVE_STRING
)
.
set
(
TEmployeeContractPreNew:
:
getErrorInfo
,
errorMsg
)
.
set
(
TEmployeeContractPreNew:
:
getErrorTime
,
LocalDateTimeUtils
.
convertLDToDate
(
LocalDate
.
now
()));
this
.
update
(
updateWrapper
);
if
(
"2"
.
equals
(
type
))
{
//生成快照数据
TContractAutoLog
contractAutoLog
=
new
TContractAutoLog
();
contractAutoLog
.
setContractId
(
loginNameMap
.
get
(
contractPre
.
getCustomerUserLoginname
()));
contractAutoLog
.
setEmpName
(
contractPre
.
getEmployeeName
());
contractAutoLog
.
setEmpIdcard
(
contractPre
.
getEmpIdcard
());
contractAutoLog
.
setErrorInfo
(
errorMsg
);
contractAutoLog
.
setMainId
(
contractPre
.
getId
());
contractAutoLogService
.
save
(
contractAutoLog
);
}
// 添加错误信息
ErrorMessage
<
EmployeeContractVO
>
errorMessage
=
new
ErrorMessage
<>(
contractVO
.
getRowIndex
(),
errorMsg
);
errorMessage
.
setData
(
contractVO
);
errorMessageListAll
.
add
(
errorMessage
);
}
else
{
// 合同创建成功,继续调用FascService的submitContract方法
R
<
String
>
result
=
null
;
TEmployeeContractPreNew
contractPreTemp
=
baseMapper
.
selectById
(
contractPre
.
getId
());
// 复制一份快照
try
{
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
);
}
log
.
error
(
"法大大推送执行异常"
,
e
);
}
if
(
result
==
null
||
result
.
getCode
()
!=
CommonConstants
.
SUCCESS
)
{
customerStats
.
setFailedCount
(
customerStats
.
getFailedCount
()
+
1
);
customerStats
.
setElectronicSignFailedCount
(
customerStats
.
getElectronicSignFailedCount
()
+
1
);
String
errorMsg
=
result
!=
null
?
result
.
getMsg
()
:
"电子签发起失败"
;
// 更新processStatus为电子签发起失败
LambdaUpdateWrapper
<
TEmployeeContractPreNew
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmployeeContractPreNew:
:
getId
,
contractPreTemp
.
getId
())
.
set
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
FIVE_STRING
)
.
set
(
TEmployeeContractPreNew:
:
getErrorInfo
,
errorMsg
)
.
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
(
"2"
.
equals
(
type
))
{
//生成快照数据
TContractAutoLog
contractAutoLog
=
new
TContractAutoLog
();
contractAutoLog
.
setContractId
(
loginNameMap
.
get
(
contractPreTemp
.
getCustomerUserLoginname
()));
contractAutoLog
.
setEmpName
(
contractPreTemp
.
getEmployeeName
());
contractAutoLog
.
setEmpIdcard
(
contractPreTemp
.
getEmpIdcard
());
contractAutoLog
.
setErrorInfo
(
errorMsg
);
contractAutoLog
.
setMainId
(
contractPreTemp
.
getId
());
contractAutoLogService
.
save
(
contractAutoLog
);
}
// 添加错误信息
ErrorMessage
<
EmployeeContractVO
>
errorMessage
=
new
ErrorMessage
<>(
contractVO
.
getRowIndex
(),
errorMsg
);
errorMessage
.
setData
(
contractVO
);
errorMessageListAll
.
add
(
errorMessage
);
}
else
{
if
(
Common
.
isNotNull
(
contractPreTemp
.
getId
())
&&
Common
.
isNotNull
(
result
.
getData
()))
{
contractPreTemp
.
setRequestId
(
result
.
getData
());
baseMapper
.
updateById
(
contractPreTemp
);
}
if
(
Common
.
isNotNull
(
contractPreTemp
.
getContractId
()))
{
TEmployeeContractAudit
audit
=
new
TEmployeeContractAudit
();
audit
.
setRootName
(
"签署中"
);
audit
.
setLinkId
(
contractPreTemp
.
getContractId
());
audit
.
setLinkType
(
CommonConstants
.
ONE_INT
);
audit
.
setCreateName
(
"法大大电子签"
);
audit
.
setCreateBy
(
"1"
);
tEmployeeContractAuditService
.
save
(
audit
);
//更新合同的办理状态
updateEmpContractAlertHandleStatus
(
contractPre
.
getContractId
(),
CommonConstants
.
ONE_STRING
);
}
}
}
}
}
}
}
// 处理线下签合同(走原逻辑)
if
(!
offlineSignList
.
isEmpty
())
{
// 统计线下签的发起数量
for
(
EmployeeContractVO
contractVO
:
offlineSignList
)
{
TEmployeeContractPreNew
contractPre
=
preContractMap
.
get
(
contractVO
.
getPreId
());
if
(
contractPre
!=
null
)
{
String
customerLoginName
=
contractPre
.
getCustomerUserLoginname
();
CustomerStatistics
customerStats
=
customerStatisticsMap
.
computeIfAbsent
(
customerLoginName
,
k
->
{
CustomerStatistics
stats
=
new
CustomerStatistics
();
stats
.
setCustomerUserLoginname
(
customerLoginName
);
stats
.
setCustomerUsername
(
contractPre
.
getCustomerUsername
());
return
stats
;
});
customerStats
.
setInitiatedCount
(
customerStats
.
getInitiatedCount
()
+
1
);
}
}
List
<
EmployeeContractVO
>
disList
;
int
k
=
0
;
int
i
=
(
int
)
Math
.
ceil
((
double
)
offlineSignList
.
size
()
/
CommonConstants
.
INTEGER_HUNDRED
);
for
(
int
j
=
0
;
j
<
i
;
j
++)
{
if
(
j
==
i
-
1
)
{
disList
=
offlineSignList
.
subList
(
k
,
offlineSignList
.
size
());
}
else
{
disList
=
offlineSignList
.
subList
(
k
,
k
+
100
);
}
k
=
k
+
100
;
if
(
Common
.
isNotNull
(
disList
))
{
//调用批量派单接口100条处理一次,同原合同派单保持一致
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
contractInfoService
.
importContract
(
disList
,
errorMessageList
);
if
(!
errorMessageList
.
stream
().
allMatch
(
message
->
message
.
getMessage
().
equals
(
CommonConstants
.
SAVE_SUCCESS
)))
{
errorMessageListAll
.
addAll
(
errorMessageList
);
//更新合同状态为5发起失败
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
);
// 获取合同预签订信息以便统计
TEmployeeContractPreNew
contractPre
=
preContractMap
.
get
(
contractVO
.
getPreId
());
if
(
"2"
.
equals
(
type
)
&&
Common
.
isNotNull
(
contractPre
.
getCustomerUserLoginname
())
&&
null
==
loginNameMap
.
get
(
contractPre
.
getCustomerUserLoginname
()))
{
UUID
uuid
=
UUID
.
randomUUID
();
loginNameMap
.
put
(
contractPre
.
getCustomerUserLoginname
(),
uuid
.
toString
());
}
if
(
contractPre
!=
null
)
{
String
customerLoginName
=
contractPre
.
getCustomerUserLoginname
();
CustomerStatistics
customerStats
=
customerStatisticsMap
.
computeIfAbsent
(
customerLoginName
,
key
->
{
CustomerStatistics
stats
=
new
CustomerStatistics
();
stats
.
setCustomerUserLoginname
(
customerLoginName
);
stats
.
setCustomerUsername
(
contractPre
.
getCustomerUsername
());
return
stats
;
});
customerStats
.
setFailedCount
(
customerStats
.
getFailedCount
()
+
1
);
customerStats
.
setOfflineSignFailedCount
(
customerStats
.
getOfflineSignFailedCount
()
+
1
);
}
if
(
"2"
.
equals
(
type
))
{
//生成快照数据
TContractAutoLog
contractAutoLog
=
new
TContractAutoLog
();
contractAutoLog
.
setContractId
(
loginNameMap
.
get
(
contractPre
.
getCustomerUserLoginname
()));
contractAutoLog
.
setEmpName
(
contractPre
.
getEmployeeName
());
contractAutoLog
.
setEmpIdcard
(
contractPre
.
getEmpIdcard
());
contractAutoLog
.
setErrorInfo
(
errorMessage
.
getMessage
());
contractAutoLog
.
setMainId
(
contractPre
.
getId
());
contractAutoLogService
.
save
(
contractAutoLog
);
}
LambdaUpdateWrapper
<
TEmployeeContractPreNew
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
in
(
TEmployeeContractPreNew:
:
getId
,
contractVO
.
getPreId
())
.
in
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
contractDIsStatus
)
.
set
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
FIVE_STRING
)
.
set
(
TEmployeeContractPreNew:
:
getSignType
,
CommonConstants
.
ONE_STRING
)
.
set
(
TEmployeeContractPreNew:
:
getErrorInfo
,
errorMessage
.
getMessage
())
.
set
(
TEmployeeContractPreNew:
:
getErrorTime
,
LocalDateTimeUtils
.
convertLDToDate
(
LocalDate
.
now
()));
// 执行更新操作
errorMessage
.
setData
(
contractVO
);
this
.
update
(
updateWrapper
);
//线下签发起失败 更新合同提醒为待处理
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
);
}
}
}
}
}
}
//定时任务自动发起签合同失败消息
if
(
"2"
.
equals
(
type
))
{
// 为每个前端客服发送企微消息
for
(
Map
.
Entry
<
String
,
CustomerStatistics
>
entry
:
customerStatisticsMap
.
entrySet
())
{
CustomerStatistics
stats
=
entry
.
getValue
();
if
(
stats
.
getFailedCount
()
>
0
&&
Common
.
isNotNull
(
stats
.
getCustomerUserLoginname
()))
{
// 生成客服个人的汇总信息
String
customerSummaryInfo
=
String
.
format
(
"合同签署发起份数:%d份,失败份数:%d份;\n"
+
"电子签失败份数:%d份,线下签失败份数:%d份;"
,
stats
.
getInitiatedCount
(),
stats
.
getFailedCount
(),
stats
.
getElectronicSignFailedCount
(),
stats
.
getOfflineSignFailedCount
());
// 发送企微消息
sendFailueMessageToWx
(
stats
.
getCustomerUserLoginname
(),
customerSummaryInfo
,
loginNameMap
);
}
}
}
return
R
.
ok
(
errorMessageListAll
);
}
private
Date
addYearsMonths
(
TEmployeeContractDateVo
vo
)
{
if
(
vo
==
null
||
vo
.
getRegistDate
()
==
null
)
return
null
;
// 转换为LocalDate(自动处理时区)
LocalDate
localDate
=
vo
.
getRegistDate
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toLocalDate
();
// 添加年数和月数
if
(
vo
.
getMonthAfter
()
==
0
&&
vo
.
getYearAfter
()
==
0
)
{
// 转回Date类型
return
Date
.
from
(
localDate
.
atStartOfDay
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toInstant
());
}
else
{
localDate
=
localDate
.
plusYears
(
vo
.
getYearAfter
())
.
plusMonths
(
vo
.
getMonthAfter
())
.
minusDays
(
1
);
// 转回Date类型
return
Date
.
from
(
localDate
.
atStartOfDay
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toInstant
());
}
}
//发送企业微信待办
private
void
sendFailueMessageToWx
(
String
loginName
,
String
summary
,
Map
<
String
,
String
>
loginNameMap
)
{
//获取前端客服
SysUser
user
;
if
(
Common
.
isEmpty
(
loginName
))
{
return
;
}
R
<
SysUser
>
res
=
upmsDaprUtils
.
getSimpleUserByLoginName
(
loginName
);
if
(
Common
.
isNotNull
(
res
)
&&
Common
.
isNotNull
(
res
.
getData
()))
{
user
=
res
.
getData
();
}
else
{
return
;
}
StringBuilder
sendUser
=
null
;
if
(
Common
.
isNotKong
(
user
.
getWxMessage
()))
{
sendUser
=
new
StringBuilder
(
user
.
getWxMessage
());
}
if
(
sendUser
!=
null
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
Map
<
String
,
Object
>
requestMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
textcard
=
new
HashMap
<>();
String
id
=
loginNameMap
.
get
(
loginName
);
//按用户登录名称及时间查询详情数据
String
authUrl
=
String
.
format
(
SecurityConstants
.
WX_GET_MESSAGE_AUTH_URL
,
wxConfig
.
getCorpid
(),
wxConfig
.
getDomainName
()
+
"/auth/oauth/wxLogin"
,
"79"
+
id
);
StringBuilder
description
=
new
StringBuilder
();
String
title
=
"作业自动化——合同续签发起失败提醒"
;
description
.
append
(
summary
).
append
(
"<br>"
);
description
.
append
(
"请及时至HRO系统处理,以免耽误签署进度!"
).
append
(
"<br>"
);
textcard
.
put
(
"title"
,
title
);
textcard
.
put
(
"url"
,
authUrl
);
textcard
.
put
(
"description"
,
description
.
toString
());
requestMap
.
put
(
"touser"
,
sendUser
);
requestMap
.
put
(
"agentid"
,
wxConfig
.
getAgentid
());
requestMap
.
put
(
"msgtype"
,
"textcard"
);
requestMap
.
put
(
"textcard"
,
textcard
);
// 必须加上header说明
if
(!
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
))
{
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
);
}
}
}
/**
* @Author fxj
* @Description 合同待签订撤销签署
* @Date 11:55 2026/2/10
**/
@Override
public
R
revokeSign
(
List
<
TEmployeeAutoRegistRevokeVo
>
registRevokeVoList
)
{
if
(
Common
.
isNotNull
(
registRevokeVoList
))
{
List
<
String
>
idList
=
registRevokeVoList
.
stream
().
map
(
TEmployeeAutoRegistRevokeVo:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
TEmployeeContractPreNew
>
contractPreList
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeContractPreNew
>
query
()
.
lambda
().
in
(
TEmployeeContractPreNew:
:
getId
,
idList
)
.
ne
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
NINE_STRING
)
.
ne
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
FOUR_STRING
)
.
ne
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
TEN_STRING
)
.
ne
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
ELEVEN_STRING
)
.
ne
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
EIGHT_STRING
));
if
(
Common
.
isEmpty
(
contractPreList
))
{
return
R
.
failed
(
CommonConstants
.
NO_DATA_TO_HANDLE
);
}
TEmployeeContractPreNew
pre
;
TEmployeeContractInfo
contractInfo
;
R
<
String
>
result
;
for
(
TEmployeeAutoRegistRevokeVo
registRevokeVo
:
registRevokeVoList
)
{
pre
=
baseMapper
.
selectById
(
registRevokeVo
.
getId
());
if
(
pre
!=
null
)
{
if
(
Common
.
isNotNull
(
pre
.
getSignType
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
pre
.
getSignType
())
&&
Common
.
isNotNull
(
pre
.
getRequestId
()))
{
try
{
result
=
fascService
.
cancelTaskRenew
(
pre
.
getId
());
if
(!
R
.
isSuccess
(
result
))
{
// 产品暂未设计失败了怎么做
return
result
;
}
}
catch
(
ApiException
e
)
{
// 产品暂未设计失败了怎么做
return
R
.
failed
(
"推送法大大失败!"
+
e
.
getMessage
());
}
}
//电子待归档、线下签待归档、已完结的不能撤销签署
if
(
Common
.
isNotNull
(
pre
)
&&
!
CommonConstants
.
NINE_STRING
.
equals
(
pre
.
getProcessStatus
())
&&
!
CommonConstants
.
FOUR_STRING
.
equals
(
pre
.
getProcessStatus
())
&&
!
CommonConstants
.
EIGHT_STRING
.
equals
(
pre
.
getProcessStatus
()))
{
//如果不是待确认和待发起,需要记录操作记录
if
(!
CommonConstants
.
ZERO_STRING
.
equals
(
pre
.
getProcessStatus
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
pre
.
getProcessStatus
())
&&
Common
.
isNotNull
(
pre
.
getContractId
()))
{
TEmployeeContractAudit
audit
=
new
TEmployeeContractAudit
();
audit
.
setRootName
(
"撤销签署"
);
audit
.
setLinkId
(
pre
.
getContractId
());
audit
.
setLinkType
(
CommonConstants
.
ONE_INT
);
audit
.
setRemark
(
registRevokeVo
.
getReason
());
tEmployeeContractAuditService
.
save
(
audit
);
}
pre
.
setProcessStatus
(
CommonConstants
.
TEN_STRING
);
pre
.
setSignFlag
(
CommonConstants
.
ZERO_STRING
);
pre
.
setRevokeReason
(
registRevokeVo
.
getReason
());
pre
.
setRevokeTime
(
new
Date
());
baseMapper
.
updateById
(
pre
);
//更新合同续签待办提醒的办理状态为待办理
updateEmpContractAlertHandleStatus
(
pre
.
getContractId
(),
CommonConstants
.
ZERO_STRING
);
}
if
(
Common
.
isNotNull
(
pre
.
getContractId
()))
{
//如果存在合同申请审核数据,将状态更新成待提交
contractInfo
=
contractInfoService
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
eq
(
TEmployeeContractInfo:
:
getId
,
pre
.
getContractId
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
contractInfo
))
{
contractInfo
.
setAuditStatus
(
CommonConstants
.
FIVE_INT
);
contractInfo
.
setInUse
(
CommonConstants
.
ONE_STRING
);
contractInfoService
.
updateById
(
contractInfo
);
}
}
}
}
}
return
R
.
ok
();
}
/**
* @Author fxj
* @Description 每日晚23:00自动撤销超时电子签署任务(当前时间超出当前合同开始日期一个月的数据)
* @Date 18:38 2026/2/10
**/
@Override
public
R
autoRevokeElectronicSign
()
{
try
{
// 查询符合条件的合同:状态为"签署中"(6) 且 为电子签任务(signType=0) 且 合同开始日期到当日正好一个月
LocalDate
currentDate
=
LocalDate
.
now
();
LocalDate
oneMonthAgo
=
currentDate
.
minusMonths
(
1
).
plusDays
(
1
);
List
<
TEmployeeContractPreNew
>
contractsToRevoke
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeContractPreNew
>
query
()
.
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
SIX_STRING
)
// 签署中
.
eq
(
TEmployeeContractPreNew:
:
getSignType
,
CommonConstants
.
ZERO_STRING
)
// 电子签
.
eq
(
TEmployeeContractPreNew:
:
getContractStart
,
LocalDateTimeUtils
.
convertLDToDate
(
oneMonthAgo
))
// 合同开始日期正好一个月前
);
if
(
Common
.
isEmpty
(
contractsToRevoke
))
{
return
R
.
ok
(
"未找到需要撤销的超时电子签署任务"
);
}
for
(
TEmployeeContractPreNew
contractPre
:
contractsToRevoke
)
{
try
{
// 调用法大大撤销签署接口
R
<
String
>
revokeResult
=
fascService
.
cancelTaskRenew
(
contractPre
.
getId
());
if
(
revokeResult
.
getCode
()
==
200
)
{
// 撤销成功:状态更新为"待发起"(1) 且 签署方式变更为"线下签"(1)
LambdaUpdateWrapper
<
TEmployeeContractPreNew
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmployeeContractPreNew:
:
getId
,
contractPre
.
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
);
TEmployeeContractAudit
audit
=
new
TEmployeeContractAudit
();
audit
.
setRootName
(
"续签-撤销签署"
);
audit
.
setCreateName
(
"系统自动撤销"
);
audit
.
setLinkId
(
contractPre
.
getContractId
());
audit
.
setLinkType
(
CommonConstants
.
ONE_INT
);
audit
.
setRemark
(
"电子合同签署超过1个月未完成签署系统,自动撤销"
);
tEmployeeContractAuditService
.
save
(
audit
);
//更新合同续签待办提醒的办理状态为待办理
updateEmpContractAlertHandleStatus
(
contractPre
.
getContractId
(),
CommonConstants
.
ZERO_STRING
);
}
else
if
(
"已完成签署"
.
equals
(
revokeResult
.
getMsg
()))
{
// 撤销失败原因为已完成签署:更新为签署完成的"待归档"状态(8)
LambdaUpdateWrapper
<
TEmployeeContractPreNew
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmployeeContractPreNew:
:
getId
,
contractPre
.
getId
())
.
set
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
EIGHT_STRING
);
// 电子待归档
this
.
update
(
updateWrapper
);
//更新合同续签待办提醒的办理状态为办理中
updateEmpContractAlertHandleStatus
(
contractPre
.
getContractId
(),
CommonConstants
.
ONE_STRING
);
}
else
{
// 其他撤销失败原因
log
.
error
(
"合同ID:{},撤销失败,原因:{}"
,
contractPre
.
getId
(),
revokeResult
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"处理合同ID:{}时发生异常"
,
contractPre
.
getId
(),
e
);
}
}
return
R
.
ok
();
}
catch
(
Exception
e
)
{
log
.
error
(
"执行自动撤销超时电子签署任务时发生异常"
,
e
);
return
R
.
failed
(
"执行自动撤销超时电子签署任务时发生异常:"
+
e
.
getMessage
());
}
}
/**
* @Author fxj
* @Description 更新合同续签待办的处理状态
* @Date 19:01 2026/2/10
**/
private
void
updateEmpContractAlertHandleStatus
(
String
contractId
,
String
handleStatus
){
//更新合同续签待办提醒的办理状态为待办理
LambdaUpdateWrapper
<
TEmpContractAlert
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TEmpContractAlert:
:
getContractId
,
contractId
)
.
eq
(
TEmpContractAlert:
:
getHandleStatus
,
handleStatus
);
empContractAlertMapper
.
update
(
null
,
updateWrapper
);
}
/**
* @Author fxj
* @Description tEmployeeContractPreNewService
* @Date 18:43 2026/2/10
**/
@Override
public
R
notifyRevokedElectronicSign
()
{
try
{
// 通过审计表查询前一日的撤销记录
LocalDate
yesterday
=
LocalDate
.
now
().
minusDays
(
1
);
Date
yesterdayStart
=
LocalDateTimeUtils
.
convertLDToDate
(
yesterday
);
Date
yesterdayEnd
=
LocalDateTimeUtils
.
convertLDToDate
(
yesterday
.
plusDays
(
1
));
// 查询前一日的撤销审计记录
List
<
TEmployeeContractAudit
>
yesterdayAudits
=
tEmployeeContractAuditService
.
list
(
Wrappers
.<
TEmployeeContractAudit
>
query
()
.
lambda
()
.
eq
(
TEmployeeContractAudit:
:
getRootName
,
"续签-撤销签署"
)
.
eq
(
TEmployeeContractAudit:
:
getCreateName
,
"系统自动撤销"
)
.
eq
(
TEmployeeContractAudit:
:
getLinkType
,
CommonConstants
.
ONE_INT
)
.
ge
(
TEmployeeContractAudit:
:
getCreateTime
,
yesterdayStart
)
.
lt
(
TEmployeeContractAudit:
:
getCreateTime
,
yesterdayEnd
)
);
if
(
Common
.
isEmpty
(
yesterdayAudits
))
{
return
R
.
ok
(
"前一日未发现撤销的电子签署任务"
);
}
// 根据审计记录获取对应的合同ID列表
List
<
String
>
contractIds
=
yesterdayAudits
.
stream
()
.
map
(
TEmployeeContractAudit:
:
getLinkId
)
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
if
(
Common
.
isEmpty
(
contractIds
))
{
return
R
.
ok
(
"前一日撤销记录中未找到有效的合同ID"
);
}
// 根据合同ID查询对应的合同预签订记录
List
<
TEmployeeContractPreNew
>
revokedContracts
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeContractPreNew
>
query
()
.
lambda
()
.
in
(
TEmployeeContractPreNew:
:
getContractId
,
contractIds
)
.
eq
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
ELEVEN_STRING
)
// 撤销签署-系统自动撤销
.
eq
(
TEmployeeContractPreNew:
:
getSignType
,
CommonConstants
.
ONE_STRING
)
// 线下签
.
eq
(
TEmployeeContractPreNew:
:
getChangeTypeReason
,
"超时未签署自行变更为线下签"
)
);
if
(
Common
.
isEmpty
(
revokedContracts
))
{
return
R
.
ok
(
"前一日未发现撤销的电子签署任务"
);
}
// 按前端客服分组统计
Map
<
String
,
CustomerRevokeStatistics
>
customerStatsMap
=
new
HashMap
<>();
Map
<
String
,
String
>
loginNameMap
=
new
HashMap
<>();
for
(
TEmployeeContractPreNew
contract
:
revokedContracts
)
{
String
customerLoginName
=
contract
.
getCustomerUserLoginname
();
if
(
Common
.
isNotNull
(
customerLoginName
))
{
if
(
null
==
loginNameMap
.
get
(
customerLoginName
))
{
UUID
uuid
=
UUID
.
randomUUID
();
loginNameMap
.
put
(
customerLoginName
,
uuid
.
toString
());
}
CustomerRevokeStatistics
stats
=
customerStatsMap
.
computeIfAbsent
(
customerLoginName
,
k
->
{
CustomerRevokeStatistics
newStats
=
new
CustomerRevokeStatistics
();
newStats
.
setCustomerUserLoginname
(
customerLoginName
);
return
newStats
;
});
stats
.
setRevokedCount
(
stats
.
getRevokedCount
()
+
1
);
//生成快照数据
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
());
contractAutoLogService
.
save
(
contractAutoLog
);
}
}
// 为每个前端客服发送通知
for
(
Map
.
Entry
<
String
,
CustomerRevokeStatistics
>
entry
:
customerStatsMap
.
entrySet
())
{
CustomerRevokeStatistics
stats
=
entry
.
getValue
();
if
(
stats
.
getRevokedCount
()
>
0
&&
Common
.
isNotNull
(
stats
.
getCustomerUserLoginname
()))
{
// 生成通知内容
String
notificationContent
=
String
.
format
(
"距离合同开始日期已超过1个月,仍未完成合同签署(%d人),系统已自动撤回签署任务,点击可查看具体撤回清单"
,
stats
.
getRevokedCount
());
// 发送企微通知
sendRevokeNotificationToWx
(
stats
.
getCustomerUserLoginname
(),
notificationContent
,
loginNameMap
);
}
}
return
R
.
ok
();
}
catch
(
Exception
e
)
{
log
.
error
(
"执行通知前端客服撤销电子签署情况任务时发生异常"
,
e
);
return
R
.
failed
(
"执行通知前端客服撤销电子签署情况任务时发生异常:"
+
e
.
getMessage
());
}
}
/**
* 发送撤销通知到企微
* @param loginName 客服登录名
* @param content 通知内容
*/
private
void
sendRevokeNotificationToWx
(
String
loginName
,
String
content
,
Map
<
String
,
String
>
loginNameMap
)
{
//获取前端客服
SysUser
user
;
if
(
Common
.
isEmpty
(
loginName
))
{
return
;
}
R
<
SysUser
>
res
=
upmsDaprUtils
.
getSimpleUserByLoginName
(
loginName
);
if
(
Common
.
isNotNull
(
res
)
&&
Common
.
isNotNull
(
res
.
getData
()))
{
user
=
res
.
getData
();
}
else
{
return
;
}
StringBuilder
sendUser
=
null
;
if
(
Common
.
isNotKong
(
user
.
getWxMessage
()))
{
sendUser
=
new
StringBuilder
(
user
.
getWxMessage
());
}
if
(
sendUser
!=
null
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
Map
<
String
,
Object
>
requestMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
textcard
=
new
HashMap
<>();
String
authUrl
=
String
.
format
(
SecurityConstants
.
WX_GET_MESSAGE_AUTH_URL
,
wxConfig
.
getCorpid
()
,
wxConfig
.
getDomainName
()
+
"/auth/oauth/wxLogin"
,
"81"
+
loginNameMap
.
get
(
loginName
));
StringBuilder
description
=
new
StringBuilder
();
String
title
=
"作业自动化——电子合同续签超期自动撤回提醒"
;
description
.
append
(
content
).
append
(
"<br>"
);
description
.
append
(
"请及时进行线下签署,以免产生用工风险!"
).
append
(
"<br>"
);
textcard
.
put
(
"title"
,
title
);
textcard
.
put
(
"url"
,
authUrl
);
textcard
.
put
(
"description"
,
description
.
toString
());
requestMap
.
put
(
"touser"
,
sendUser
);
requestMap
.
put
(
"agentid"
,
wxConfig
.
getAgentid
());
requestMap
.
put
(
"msgtype"
,
"textcard"
);
requestMap
.
put
(
"textcard"
,
textcard
);
// 必须加上header说明
if
(!
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
))
{
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
);
}
}
}
/**
* @Author fxj
* @Description 每日早9点电子签合同即将超期提醒
* @Date 19:09 2026/2/10
**/
@Override
public
R
electronicSignExpiringReminder
()
{
try
{
LocalDate
today
=
LocalDate
.
now
();
if
(!
isWorkDay
(
today
)){
return
R
.
ok
(
"非工作日不执行"
);
}
// 查询所有状态为"签署中"(6)且为电子签(signType=0)的合同
List
<
TEmployeeContractPreNew
>
signingContracts
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeContractPreNew
>
query
()
.
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getProcessStatus
,
CommonConstants
.
SIX_STRING
)
// 签署中
.
eq
(
TEmployeeContractPreNew:
:
getSignType
,
CommonConstants
.
ZERO_STRING
)
// 电子签
);
if
(
Common
.
isEmpty
(
signingContracts
))
{
return
R
.
ok
(
"未找到签署中的电子签合同"
);
}
// 按前端客服分组统计需要提醒的合同
Map
<
String
,
CustomerExpiringStatistics
>
customerStatsMap
=
new
HashMap
<>();
Map
<
String
,
String
>
loginNameMap
=
new
HashMap
<>();
for
(
TEmployeeContractPreNew
contract
:
signingContracts
)
{
if
(
contract
.
getContractStart
()
!=
null
)
{
// 计算入职一个月的最后一天
LocalDate
localDate
=
contract
.
getContractStart
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toLocalDate
();
localDate
=
localDate
.
plusMonths
(
1
)
.
minusDays
(
1
);
// 计算往前3个工作日
List
<
LocalDate
>
reminderDates
=
calculateReminderWorkDays
(
localDate
,
3
);
// 判断今天是否是提醒日期之一
if
(
reminderDates
.
contains
(
today
))
{
String
customerLoginName
=
contract
.
getCustomerUserLoginname
();
if
(
Common
.
isNotNull
(
customerLoginName
))
{
if
(
null
==
loginNameMap
.
get
(
customerLoginName
))
{
UUID
uuid
=
UUID
.
randomUUID
();
loginNameMap
.
put
(
customerLoginName
,
uuid
.
toString
());
}
CustomerExpiringStatistics
stats
=
customerStatsMap
.
computeIfAbsent
(
customerLoginName
,
k
->
{
CustomerExpiringStatistics
newStats
=
new
CustomerExpiringStatistics
();
newStats
.
setCustomerUserLoginname
(
customerLoginName
);
return
newStats
;
});
stats
.
setExpiringCount
(
stats
.
getExpiringCount
()
+
1
);
//生成快照数据
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
());
contractAutoLogService
.
save
(
contractAutoLog
);
}
//更新催办和超期标识标识
contract
.
setOverFlag
(
CommonConstants
.
ZERO_STRING
);
}
}
}
// 为每个前端客服发送提醒
for
(
Map
.
Entry
<
String
,
CustomerExpiringStatistics
>
entry
:
customerStatsMap
.
entrySet
())
{
CustomerExpiringStatistics
stats
=
entry
.
getValue
();
if
(
stats
.
getExpiringCount
()
>
0
&&
Common
.
isNotNull
(
stats
.
getCustomerUserLoginname
()))
{
// 生成提醒内容
String
reminderContent
=
String
.
format
(
"距离合同开始日期1个月还剩3天,仍未签署合同的员工数:%d人"
,
stats
.
getExpiringCount
());
// 发送企微提醒
sendExpiringReminderToWx
(
stats
.
getCustomerUserLoginname
(),
reminderContent
,
loginNameMap
);
}
}
return
R
.
ok
();
}
catch
(
Exception
e
)
{
log
.
error
(
"执行续签待办电子签合同即将超期提醒任务时发生异常"
,
e
);
return
R
.
failed
(
"执行续签待办电子签合同即将超期提醒任务时发生异常:"
+
e
.
getMessage
());
}
}
/**
* 发送即将超期提醒到企微
* @param loginName 客服登录名
* @param content 提醒内容
*/
private
void
sendExpiringReminderToWx
(
String
loginName
,
String
content
,
Map
<
String
,
String
>
loginNameMap
)
{
//获取前端客服
SysUser
user
;
if
(
Common
.
isEmpty
(
loginName
))
{
return
;
}
R
<
SysUser
>
res
=
upmsDaprUtils
.
getSimpleUserByLoginName
(
loginName
);
if
(
Common
.
isNotNull
(
res
)
&&
Common
.
isNotNull
(
res
.
getData
()))
{
user
=
res
.
getData
();
}
else
{
return
;
}
StringBuilder
sendUser
=
null
;
if
(
Common
.
isNotKong
(
user
.
getWxMessage
()))
{
sendUser
=
new
StringBuilder
(
user
.
getWxMessage
());
}
if
(
sendUser
!=
null
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
Map
<
String
,
Object
>
requestMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
textcard
=
new
HashMap
<>();
String
authUrl
=
String
.
format
(
SecurityConstants
.
WX_GET_MESSAGE_AUTH_URL
,
wxConfig
.
getCorpid
()
,
wxConfig
.
getDomainName
()
+
"/auth/oauth/wxLogin"
,
"80"
+
loginNameMap
.
get
(
loginName
));
StringBuilder
description
=
new
StringBuilder
();
String
title
=
"作业自动化——合同续签超期提醒"
;
description
.
append
(
content
).
append
(
"<br>"
);
description
.
append
(
"请及时提醒员工,尽快完成法大大签署任务!"
).
append
(
"<br>"
);
textcard
.
put
(
"title"
,
title
);
textcard
.
put
(
"url"
,
authUrl
);
textcard
.
put
(
"description"
,
description
.
toString
());
requestMap
.
put
(
"touser"
,
sendUser
);
requestMap
.
put
(
"agentid"
,
wxConfig
.
getAgentid
());
requestMap
.
put
(
"msgtype"
,
"textcard"
);
requestMap
.
put
(
"textcard"
,
textcard
);
// 必须加上header说明
if
(!
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
))
{
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
);
}
}
}
/**
* 计算入职一个月最后一天往前count个工作日的日期列表
* @param lastDay 入职一个月的最后一天
* @return 3个工作日的日期列表
*/
private
List
<
LocalDate
>
calculateReminderWorkDays
(
LocalDate
lastDay
,
int
count
)
{
List
<
LocalDate
>
reminderDates
=
new
ArrayList
<>();
LocalDate
currentDate
=
lastDay
;
int
workDayCount
=
0
;
// 往前找3个工作日
while
(
workDayCount
<
count
)
{
// 检查当前日期是否为工作日
if
(
isWorkDay
(
currentDate
))
{
reminderDates
.
add
(
currentDate
);
workDayCount
++;
}
// 往前一天
currentDate
=
currentDate
.
minusDays
(
1
);
}
// 按日期正序排列(最早的日期在前)
Collections
.
reverse
(
reminderDates
);
return
reminderDates
;
}
/**
* 判断指定日期是否为工作日
* @param date 要检查的日期
* @return true-工作日,false-非工作日
*/
private
boolean
isWorkDay
(
LocalDate
date
)
{
TEmployeeInsuranceWorkDayVo
workDayVo
=
new
TEmployeeInsuranceWorkDayVo
();
workDayVo
.
setRegistDate
(
LocalDateTimeUtils
.
convertLDToDate
(
date
));
// 使用THolidayInfoService的checkIsWorkDay方法判断是否为假期
// 如果是假期则不是工作日,否则是工作日
R
<
Boolean
>
res
=
socialDaprUtils
.
checkIsWorkDay
(
workDayVo
);
return
!
res
.
getData
();
}
/**
* @Author fxj
* @Description 自动化合同续签:一键催办
* @Date 19:30 2026/2/10
**/
@Override
public
R
contractUrg
(
String
id
)
{
// 查询所有待催办的合同
List
<
TContractAutoLog
>
signingContracts
=
contractAutoLogService
.
list
(
Wrappers
.<
TContractAutoLog
>
query
()
.
lambda
()
.
eq
(
TContractAutoLog:
:
getContractId
,
id
)
);
if
(
Common
.
isNotNull
(
signingContracts
)
&&
signingContracts
.
size
()
>
0
)
{
try
{
for
(
TContractAutoLog
log
:
signingContracts
)
{
//查询合同待购买数据
TEmployeeContractPreNew
pre
=
baseMapper
.
selectById
(
log
.
getMainId
());
fascService
.
urgeTaskRenew
(
pre
.
getId
());
log
.
setIsUrg
(
CommonConstants
.
ZERO_STRING
);
contractAutoLogService
.
updateById
(
log
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"发送法大大催办时发生异常"
,
e
);
}
}
return
R
.
ok
();
}
/**
* @Author fxj
* @Description 通过preId查询合同续签已确认信息
* @Date 10:41 2026/2/11
**/
@Override
public
R
<
TEmployeeContractPreNew
>
getInfoByPreId
(
String
preId
)
{
return
R
.
ok
(
baseMapper
.
selectById
(
preId
));
}
@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
());
return
R
.
ok
(
baseMapper
.
getDetailList
(
tEmployeeContractPreNew
));
}
@Override
public
R
<
TEmployeeContractInfo
>
getRenewContractByPreId
(
String
preId
)
{
return
R
.
ok
(
contractInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
eq
(
TEmployeeContractInfo:
:
getPreId
,
preId
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)));
}
/**
* 续签确认提醒 9:00
* 续签确认提醒节点:
* 第一个时间:上一份合同截止日期前一个月往前找最近的工作日(若前一个月当天是工作日,那就取当日);
* 第二个时间:合同截止日期(若为节假日,往前找最近的一个工作日);
* 第三个时间:合同截止日期后一个月往前找第五个工作日(找不到就找第四、第三、第二、第一),都找不到,就不提醒
* 提醒至前端客服,点击提醒,提示:请至HRO系统及时进行合同确认,以免续签不及时!
* */
@Override
public
R
pushWxConfrimMessage
()
{
try
{
LocalDate
today
=
LocalDate
.
now
();
// 查询所有状态为自动化+待确认的合同提醒数据
List
<
ContractAlertAutoVo
>
confirmContracts
=
empContractAlertMapper
.
getPushWxConfrimInfos
();
if
(
Common
.
isEmpty
(
confirmContracts
))
{
return
R
.
ok
(
"未找到待确认的续签待办"
);
}
// 按前端客服分组统计需要提醒的合同
Map
<
String
,
CustomerExpiringStatistics
>
customerStatsMap
=
new
HashMap
<>();
Map
<
String
,
String
>
loginNameMap
=
new
HashMap
<>();
boolean
isSend
=
false
;
LocalDate
localDate
;
List
<
LocalDate
>
reminderDates
;
for
(
ContractAlertAutoVo
contract
:
confirmContracts
)
{
if
(
contract
.
getContractEnd
()
!=
null
)
{
isSend
=
false
;
//第一个时间:上一份合同截止日期前一个月往前找最近的工作日(若前一个月当天是工作日,那就取当日);
// 计算合同截止日期前一个月的最后一天 如 (截止2.5,前一个月1.4)
localDate
=
contract
.
getContractEnd
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
localDate
=
localDate
.
minusMonths
(
1
).
minusDays
(
1
);
// 计算往前1个工作日
reminderDates
=
calculateReminderWorkDays
(
localDate
,
1
);
isSend
=
reminderDates
.
contains
(
today
);
//第二个时间:合同截止日期(若为节假日,往前找最近的一个工作日);
if
(!
isSend
){
// 计算往前1个工作日
localDate
=
contract
.
getContractEnd
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
reminderDates
=
calculateReminderWorkDays
(
localDate
,
1
);
isSend
=
reminderDates
.
contains
(
today
);
}
//第三个时间:合同截止日期后一个月往前找第五个工作日(找不到就找第四、第三、第二、第一),都找不到,就不提醒
if
(!
isSend
){
// 计算合同截止日期后一个月的最后一天
localDate
=
contract
.
getContractEnd
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
();
localDate
=
localDate
.
plusMonths
(
1
).
minusDays
(
1
);
// 计算往前5个工作日
reminderDates
=
calculateReminderWorkDays
(
localDate
,
5
);
isSend
=
reminderDates
.
contains
(
today
);
}
// 判断今天是否是提醒日期之一
if
(
isSend
)
{
String
customerLoginName
=
contract
.
getCsLoginName
();
if
(
Common
.
isNotNull
(
customerLoginName
))
{
if
(
null
==
loginNameMap
.
get
(
customerLoginName
))
{
UUID
uuid
=
UUID
.
randomUUID
();
loginNameMap
.
put
(
customerLoginName
,
uuid
.
toString
());
}
}
}
}
}
// 为每个前端客服发送提醒
for
(
Map
.
Entry
<
String
,
String
>
entry
:
loginNameMap
.
entrySet
())
{
// 发送企微确认提醒
sendRenewConfirmInfoToWx
(
entry
.
getKey
());
}
return
R
.
ok
();
}
catch
(
Exception
e
)
{
log
.
error
(
"执行续签待办确认提醒任务时发生异常"
,
e
);
return
R
.
failed
(
"执行续签待办确认期提醒任务时发生异常:"
+
e
.
getMessage
());
}
}
/**
* 发送即将超期提醒到企微
* @param loginName 客服登录名
*/
private
void
sendRenewConfirmInfoToWx
(
String
loginName
)
{
//获取前端客服
SysUser
user
;
if
(
Common
.
isEmpty
(
loginName
))
{
return
;
}
R
<
SysUser
>
res
=
upmsDaprUtils
.
getSimpleUserByLoginName
(
loginName
);
if
(
Common
.
isNotNull
(
res
)
&&
Common
.
isNotNull
(
res
.
getData
()))
{
user
=
res
.
getData
();
}
else
{
return
;
}
StringBuilder
sendUser
=
null
;
if
(
Common
.
isNotKong
(
user
.
getWxMessage
()))
{
sendUser
=
new
StringBuilder
(
user
.
getWxMessage
());
}
if
(
sendUser
!=
null
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
Map
<
String
,
Object
>
requestMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
textcard
=
new
HashMap
<>();
String
authUrl
=
String
.
format
(
SecurityConstants
.
WX_GET_MESSAGE_AUTH_URL
,
wxConfig
.
getCorpid
()
,
wxConfig
.
getDomainName
()
+
"/auth/oauth/wxLogin"
,
"66"
+
loginName
);
StringBuilder
description
=
new
StringBuilder
();
String
title
=
"合同待续签确认"
;
description
.
append
(
"<br>"
);
description
.
append
(
"你有新的合同待续签,请及时确认!"
).
append
(
"<br>"
);
textcard
.
put
(
"title"
,
title
);
textcard
.
put
(
"url"
,
authUrl
);
textcard
.
put
(
"description"
,
description
.
toString
());
requestMap
.
put
(
"touser"
,
sendUser
);
requestMap
.
put
(
"agentid"
,
wxConfig
.
getAgentid
());
requestMap
.
put
(
"msgtype"
,
"textcard"
);
requestMap
.
put
(
"textcard"
,
textcard
);
// 必须加上header说明
if
(!
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
))
{
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
);
}
}
}
@Override
public
void
pushDisConfrimContracts
()
{
//非工作日直接跳过
LocalDate
today
=
LocalDate
.
now
();
if
(!
isWorkDay
(
today
)){
return
;
}
//获取所有待派单的数据
List
<
String
>
unDispatchList
=
baseMapper
.
getUnDispatchList
();
if
(
null
!=
unDispatchList
&&
!
unDispatchList
.
isEmpty
())
{
try
{
this
.
dispatcherContract
(
unDispatchList
,
"2"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"执行异常"
,
e
);
}
}
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TSettleDomainServiceImpl.java
View file @
ec3b01b2
...
...
@@ -29,6 +29,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo;
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.TSettleDomainMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.EmployeeRegistrationPreService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService
;
...
...
@@ -82,6 +83,9 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
@Autowired
private
InsuranceDaprUtil
insuranceDaprUtil
;
@Autowired
private
TEmpContractAlertMapper
empContractAlertMapper
;
@Autowired
@Lazy
private
TEmployeeContractPreService
employeeContractPreService
;
...
...
@@ -604,6 +608,13 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
employeeContractPreService
.
update
(
updateContractWrapper
);
//更新社保待购买的前端客服
socialDaprUtils
.
updateSocialPreCustomerName
(
updateVo
);
//更新合同续签待办提醒前端客服
LambdaUpdateWrapper
<
TEmpContractAlert
>
updateCtractWrapper
=
new
LambdaUpdateWrapper
<>();
updateCtractWrapper
.
eq
(
TEmpContractAlert:
:
getProjectNo
,
vo
.
getDepartNo
())
.
set
(
TEmpContractAlert:
:
getCsName
,
vo
.
getName
())
.
set
(
TEmpContractAlert:
:
getCsLoginName
,
vo
.
getLoginName
());
empContractAlertMapper
.
update
(
null
,
updateCtractWrapper
);
}
}
}
catch
(
Exception
e
){
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/utils/DoFascTask.java
View file @
ec3b01b2
...
...
@@ -37,6 +37,8 @@ public class DoFascTask {
@Autowired
private
TEmployeeContractPreService
tEmployeeContractPreService
;
@Autowired
private
TEmployeeContractPreNewService
tEmployeeContractPreNewService
;
@Autowired
private
TEmployeeContractPreHistoryService
tEmployeeContractPreHistoryService
;
@Autowired
private
TEmployeeContractInfoService
tEmployeeContractInfoService
;
...
...
@@ -68,10 +70,120 @@ public class DoFascTask {
// 根据requestId获取信息:
TEmployeeContractPre
pre
=
tEmployeeContractPreService
.
getOne
(
Wrappers
.<
TEmployeeContractPre
>
query
().
lambda
()
.
eq
(
TEmployeeContractPre:
:
getRequestId
,
signTaskId
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
TEmployeeContractPreNew
preNew
=
tEmployeeContractPreNewService
.
getOne
(
Wrappers
.<
TEmployeeContractPreNew
>
query
().
lambda
()
.
eq
(
TEmployeeContractPreNew:
:
getRequestId
,
signTaskId
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
YifuUser
user
=
getNewYifuUser
();
//自动化续签待办处理
if
(
preNew
!=
null
)
{
TEmployeeContractInfo
contractInfo
=
null
;
if
(
preNew
!=
null
){
contractInfo
=
tEmployeeContractInfoService
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
eq
(
TEmployeeContractInfo:
:
getPreId
,
preNew
.
getId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
if
(
contractInfo
!=
null
)
{
if
(
fddEvent
.
equals
(
"sign-task-finished"
))
{
if
(
Common
.
isNotNull
(
preNew
.
getProcessStatus
())
&&
!
preNew
.
getProcessStatus
().
equals
(
CommonConstants
.
dingleDigitStrArray
[
9
]))
{
// 1:签署任务完成事件
// 8电子待归档
preNew
.
setProcessStatus
(
CommonConstants
.
dingleDigitStrArray
[
8
]);
// 加日志
this
.
saveAuditLogSuccess
(
"签署成功"
,
contractInfo
.
getId
());
// 尝试获取归档文件
boolean
flag
=
fascService
.
getFileByRequestIdRenew
(
preNew
.
getId
());
contractInfo
.
setAuditStatus
(
CommonConstants
.
TWO_INT
);
// 传了false,就不要审核日志
tEmployeeContractInfoService
.
auditContract
(
contractInfo
,
user
,
false
);
if
(
flag
)
{
// 加日志
this
.
saveAuditLogSuccess
(
"归档成功"
,
contractInfo
.
getId
());
preNew
.
setProcessStatus
(
CommonConstants
.
dingleDigitStrArray
[
9
]);
contractInfo
.
setIsFile
(
CommonConstants
.
ZERO_STRING
);
contractInfo
.
setContractNo
(
preNew
.
getRequestId
());
tEmployeeContractInfoService
.
updateById
(
contractInfo
);
//瓜子项目编码:皖A694302
if
(
CommonConstants
.
GZ_DEPT_NO
.
equals
(
contractInfo
.
getDeptNo
()))
{
//合同归档瓜子合同状态更新已归档
tEmployeeContractInfoService
.
updateGzOfferStatus
(
contractInfo
,
CommonConstants
.
EIGHT_STRING
,
CommonConstants
.
NINETY_NINE
,
user
.
getId
(),
user
.
getNickname
());
}
}
tEmployeeContractPreNewService
.
updateById
(
preNew
);
pushLog
.
setReturnData
(
"签署任务完成事件:fddEvent:"
+
fddEvent
+
FASC_BIZ_CONTENT_STR
+
fddBizContent
);
}
}
else
if
(
fddEvent
.
equals
(
"sign-task-canceled"
)
||
fddEvent
.
equals
(
"sign-task-abolish"
))
{
// 2:签署任务撤销事件 || 4:签署任务作废事件
if
(
fddEvent
.
equals
(
"sign-task-canceled"
))
{
// 4:签署任务作废事件
pushLog
.
setReturnData
(
"签署任务撤销事件:fddEvent:"
+
fddEvent
+
FASC_BIZ_CONTENT_STR
+
fddBizContent
);
}
else
{
// 4:签署任务作废事件
pushLog
.
setReturnData
(
"签署任务作废事件:fddEvent:"
+
fddEvent
+
FASC_BIZ_CONTENT_STR
+
fddBizContent
);
}
//电子待归档、线下签待归档、已完结的不能撤销签署
if
(
Common
.
isNotNull
(
preNew
)
&&
!
CommonConstants
.
NINE_STRING
.
equals
(
preNew
.
getProcessStatus
())
&&
!
CommonConstants
.
FOUR_STRING
.
equals
(
preNew
.
getProcessStatus
())
&&
!
CommonConstants
.
EIGHT_STRING
.
equals
(
preNew
.
getProcessStatus
()))
{
//如果不是待确认和待发起,需要记录操作记录
if
(!
CommonConstants
.
ZERO_STRING
.
equals
(
preNew
.
getProcessStatus
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
preNew
.
getProcessStatus
())
&&
Common
.
isNotNull
(
preNew
.
getContractId
()))
{
// 加日志
this
.
saveAuditLogFail
(
"撤销签署成功"
,
terminationNote
,
contractInfo
.
getId
());
}
if
(!
CommonConstants
.
ELEVEN_STRING
.
equals
(
preNew
.
getProcessStatus
()))
{
preNew
.
setProcessStatus
(
CommonConstants
.
TEN_STRING
);
}
preNew
.
setSignFlag
(
CommonConstants
.
ZERO_STRING
);
preNew
.
setRevokeReason
(
terminationNote
);
tEmployeeContractPreNewService
.
updateById
(
preNew
);
}
//如果存在合同申请审核数据,将状态更新成5撤销签署
contractInfo
.
setAuditStatus
(
CommonConstants
.
FIVE_INT
);
contractInfo
.
setInUse
(
CommonConstants
.
ONE_STRING
);
tEmployeeContractInfoService
.
updateById
(
contractInfo
);
}
else
if
(
fddEvent
.
equals
(
"sign-task-sign-failed"
)
||
fddEvent
.
equals
(
"sign-task-sign-rejected"
)
||
fddEvent
.
equals
(
"sign-task-ignore"
)
||
fddEvent
.
equals
(
"sign-task-fill-rejected"
))
{
// 3:签署任务参与方签署失败事件
preNew
.
setProcessStatus
(
CommonConstants
.
dingleDigitStrArray
[
7
]);
preNew
.
setRequestId
(
""
);
tEmployeeContractPreNewService
.
updateById
(
preNew
);
//如果存在合同申请审核数据,将状态更新成6签署失败
contractInfo
.
setAuditStatus
(
CommonConstants
.
SIX_INT
);
contractInfo
.
setInUse
(
CommonConstants
.
ONE_STRING
);
tEmployeeContractInfoService
.
updateById
(
contractInfo
);
UUID
uuid
=
UUID
.
randomUUID
();
//生成快照数据
TContractAutoLog
contractAutoLog
=
new
TContractAutoLog
();
contractAutoLog
.
setContractId
(
uuid
.
toString
());
contractAutoLog
.
setEmpName
(
preNew
.
getEmployeeName
());
contractAutoLog
.
setEmpIdcard
(
preNew
.
getEmpIdcard
());
contractAutoLog
.
setPhone
(
preNew
.
getEmpPhone
());
contractAutoLog
.
setMainId
(
preNew
.
getId
());
contractAutoLog
.
setErrorInfo
(
null
==
terminationNote
?
"法大大签署失败"
:
terminationNote
);
contractAutoLogService
.
save
(
contractAutoLog
);
//签署失败发送企微消息
sendFddFalureInfoToWx
(
preNew
,
contractAutoLog
.
getId
());
// 加日志
this
.
saveAuditLogFail
(
"签署失败"
,
terminationNote
,
contractInfo
.
getId
());
pushLog
.
setReturnData
(
"签署任务参与方签署失败事件:fddEvent:"
+
fddEvent
+
FASC_BIZ_CONTENT_STR
+
fddBizContent
);
}
}
}
if
(
pre
!=
null
)
{
TEmployeeContractInfo
contractInfo
=
null
;
if
(
Common
.
isNotNull
(
pre
.
getContractId
()))
{
if
(
pre
!=
null
&&
Common
.
isNotNull
(
pre
.
getContractId
()))
{
//如果存在合同申请审核数据,将状态更新成待提交
contractInfo
=
tEmployeeContractInfoService
.
getById
(
pre
.
getContractId
());
}
...
...
@@ -260,7 +372,13 @@ public class DoFascTask {
this
.
saveAuditLogInfo
(
tEmployeeContractPre
.
getContractId
(),
rootName
,
null
);
}
}
// 自动化续签待办:加合同里的流程进展明细的日志——成功
public
void
saveAuditLogSuccess
(
String
rootName
,
String
contractId
)
{
// 加流程进展明细
if
(
Common
.
isNotNull
(
contractId
))
{
this
.
saveAuditLogInfo
(
contractId
,
rootName
,
null
);
}
}
// 加合同里的流程进展明细的日志——失败
public
void
saveAuditLogFail
(
TEmployeeContractPre
tEmployeeContractPre
,
String
rootName
,
String
remark
)
{
// 加流程进展明细
...
...
@@ -268,6 +386,13 @@ public class DoFascTask {
this
.
saveAuditLogInfo
(
tEmployeeContractPre
.
getContractId
(),
rootName
,
remark
);
}
}
// 自动化续签待办:加合同里的流程进展明细的日志——失败
public
void
saveAuditLogFail
(
String
rootName
,
String
remark
,
String
contractId
)
{
// 加流程进展明细
if
(
Common
.
isNotNull
(
contractId
))
{
this
.
saveAuditLogInfo
(
contractId
,
rootName
,
remark
);
}
}
// 加合同里的流程进展明细的日志
public
void
saveAuditLogInfo
(
String
contractId
,
String
rootName
,
String
remark
)
{
...
...
@@ -331,5 +456,49 @@ public class DoFascTask {
}
}
}
/**
* 自动化合同续签待办:发送法大大失败提醒通知到企微
*
* @param pre 合同待购买
*/
private
void
sendFddFalureInfoToWx
(
TEmployeeContractPreNew
pre
,
String
id
)
{
//获取前端客服
SysUser
user
;
if
(
Common
.
isEmpty
(
pre
.
getCustomerUserLoginname
()))
{
return
;
}
R
<
SysUser
>
res
=
upmsDaprUtils
.
getSimpleUserByLoginName
(
pre
.
getCustomerUserLoginname
());
if
(
Common
.
isNotNull
(
res
)
&&
Common
.
isNotNull
(
res
.
getData
()))
{
user
=
res
.
getData
();
}
else
{
return
;
}
StringBuilder
sendUser
=
null
;
if
(
Common
.
isNotKong
(
user
.
getWxMessage
()))
{
sendUser
=
new
StringBuilder
(
user
.
getWxMessage
());
}
if
(
sendUser
!=
null
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
Map
<
String
,
Object
>
requestMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
textcard
=
new
HashMap
<>();
String
authUrl
=
String
.
format
(
SecurityConstants
.
WX_GET_MESSAGE_AUTH_URL
,
wxConfig
.
getCorpid
()
,
wxConfig
.
getDomainName
()
+
"/auth/oauth/wxLogin"
,
"82"
+
id
);
StringBuilder
description
=
new
StringBuilder
();
String
title
=
"作业自动化——电子合同续签失败提醒"
;
description
.
append
(
pre
.
getEmployeeName
()
+
"-"
+
pre
.
getEmpIdcard
()
+
"-"
+
pre
.
getEmpPhone
()
+
",电子合同签署失败"
).
append
(
"<br>"
);
description
.
append
(
"请及时处理,以免产生用工风险!"
).
append
(
"<br>"
);
textcard
.
put
(
"title"
,
title
);
textcard
.
put
(
"url"
,
authUrl
);
textcard
.
put
(
"description"
,
description
.
toString
());
requestMap
.
put
(
"touser"
,
sendUser
);
requestMap
.
put
(
"agentid"
,
wxConfig
.
getAgentid
());
requestMap
.
put
(
"msgtype"
,
"textcard"
);
requestMap
.
put
(
"textcard"
,
textcard
);
// 必须加上header说明
if
(!
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
))
{
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
);
}
}
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/utils/FascUtil.java
View file @
ec3b01b2
...
...
@@ -20,6 +20,7 @@ import com.fasc.open.api.v5_1.res.template.*;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreNewMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TFascPushLogService
;
import
com.yifu.cloud.plus.v1.yifu.archives.util.IdCardUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
...
...
@@ -529,14 +530,92 @@ public class FascUtil {
return
R
.
failed
(
msg
);
}
// 自动化续签待办:发起合同签署任务
public
R
<
String
>
submitContract
(
TEmployeeContractPreNew
contract
,
TFascPushLogService
tFascPushLogService
,
TEmployeeContractPreNewMapper
tEmployeeContractPreMapper
,
TFascTemplate
tFascTemplate
,
List
<
TFascTemplateDetail
>
detailList
,
TFascCompany
company
)
throws
ApiException
{
OpenApiClient
openApiClient
=
new
OpenApiClient
(
company
.
getAppId
(),
company
.
getAppSecret
(),
company
.
getAppUrl
());
String
accessToken
=
this
.
getFascToken
(
openApiClient
,
company
);
OpenId
openId
=
new
OpenId
();
openId
.
setIdType
(
CacheConstants
.
FASC_ID_TYPE
);
openId
.
setOpenId
(
company
.
getOpenId
());
SignTaskClient
signTaskClient
=
new
SignTaskClient
(
openApiClient
);
CreateWithTemplateReq
createWithTemplateReq
=
new
CreateWithTemplateReq
();
createWithTemplateReq
.
setAccessToken
(
accessToken
);
createWithTemplateReq
.
setInitiator
(
openId
);
createWithTemplateReq
.
setSignTaskSubject
(
"签署合同-"
+
contract
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
DateUtil
.
getThisTime
());
createWithTemplateReq
.
setAutoStart
(
false
);
// 不要自动提交
createWithTemplateReq
.
setAutoFillFinalize
(
true
);
// 自动定稿
createWithTemplateReq
.
setAutoFinish
(
true
);
// 签署完成后自动结束
createWithTemplateReq
.
setCertCAOrg
(
"CFCA"
);
// 签署参与方使用的签章证书颁发机构,默认无要求。CFCA:要求使用CFCA(中国金融认证中心);EZCA:要求使用东方中讯CA
createWithTemplateReq
.
setSignTemplateId
(
contract
.
getFadadaTemplateId
());
if
(
Common
.
isNotNull
(
company
.
getBusinessId
()))
{
createWithTemplateReq
.
setBusinessId
(
company
.
getBusinessId
());
}
// 核心代码:设置参与方列表
createWithTemplateReq
.
setActors
(
this
.
buildActors
(
contract
,
company
,
tFascTemplate
));
// 新增推送日志
TFascPushLog
pushLog
=
new
TFascPushLog
();
pushLog
.
setTransReferenceId
(
company
.
getOpenId
());
pushLog
.
setPushData
(
JSON
.
toJSONString
(
createWithTemplateReq
,
features
));
pushLog
.
setTaskStatus
(
CommonConstants
.
ZERO_STRING
);
String
empIdCard
=
contract
.
getEmpIdcard
();
pushLog
.
setTypeKey
(
"发起合同签署任务,身份证:"
+
empIdCard
);
pushLog
.
setTypeName
(
"发起合同签署任务"
);
pushLog
.
setContractId
(
contract
.
getId
());
tFascPushLogService
.
save
(
pushLog
);
BaseRes
<
CreateSignTaskRes
>
res
=
signTaskClient
.
createWithTemplate
(
createWithTemplateReq
);
String
requestId
=
null
;
String
msg
=
"法大大第一步创建签署任务失败!"
;
if
(
res
!=
null
)
{
// 更新日志
pushLog
.
setReturnData
(
JSON
.
toJSONString
(
res
,
features
));
pushLog
.
setTaskStatus
(
res
.
isSuccess
()
?
CommonConstants
.
ONE_STRING
:
CommonConstants
.
TWO_STRING
);
if
(
res
.
isSuccess
()
&&
res
.
getData
()
!=
null
&&
res
.
getData
().
getSignTaskId
()
!=
null
)
{
requestId
=
res
.
getData
().
getSignTaskId
();
pushLog
.
setSignTaskId
(
requestId
);
}
tFascPushLogService
.
updateById
(
pushLog
);
if
(
Common
.
isNotNull
(
requestId
))
{
// 第二步:填写控件
R
<
String
>
sendValue
=
buildDocFieldValue
(
contract
,
requestId
,
openApiClient
,
accessToken
,
detailList
);
if
(
R
.
isSuccess
(
sendValue
))
{
// 第三步:提交任务
sendValue
=
submitTask
(
requestId
,
openApiClient
,
accessToken
);
if
(
R
.
isSuccess
(
sendValue
))
{
// 电子签签署中
this
.
doSuccessContract
(
contract
,
tEmployeeContractPreMapper
,
requestId
);
return
R
.
ok
(
requestId
);
}
else
{
msg
=
"第三步失败:提交任务失败:"
+
sendValue
.
getMsg
();
}
}
else
{
msg
=
"第二步失败:填写控件失败:"
+
sendValue
.
getMsg
();
}
}
else
{
msg
=
"第一步失败:"
+
res
.
getMsg
();
}
}
this
.
doFailContract
(
contract
,
tEmployeeContractPreMapper
,
msg
);
return
R
.
failed
(
msg
);
}
// 发起失败,更新合同状态
private
void
doFailContract
(
TEmployeeContractPre
contract
,
TEmployeeContractPreMapper
tEmployeeContractPreMapper
,
String
msg
)
{
contract
.
setProcessStatus
(
CommonConstants
.
dingleDigitStrArray
[
7
]);
contract
.
setRequestMsg
(
msg
);
tEmployeeContractPreMapper
.
updateById
(
contract
);
}
// 发起成功,更新合同状态
// 自动化续签待办:发起失败,更新合同状态
private
void
doFailContract
(
TEmployeeContractPreNew
contract
,
TEmployeeContractPreNewMapper
tEmployeeContractPreMapper
,
String
msg
)
{
contract
.
setProcessStatus
(
CommonConstants
.
dingleDigitStrArray
[
7
]);
contract
.
setRequestMsg
(
msg
);
tEmployeeContractPreMapper
.
updateById
(
contract
);
}
// 自动化续签待办:发起成功,更新合同状态
private
void
doSuccessContract
(
TEmployeeContractPre
contract
,
TEmployeeContractPreMapper
tEmployeeContractPreMapper
,
String
requestId
)
{
// 电子签签署中
contract
.
setProcessStatus
(
CommonConstants
.
dingleDigitStrArray
[
6
]);
...
...
@@ -544,7 +623,14 @@ public class FascUtil {
contract
.
setRequestMsg
(
""
);
tEmployeeContractPreMapper
.
updateById
(
contract
);
}
// 发起成功,更新合同状态
private
void
doSuccessContract
(
TEmployeeContractPreNew
contract
,
TEmployeeContractPreNewMapper
tEmployeeContractPreMapper
,
String
requestId
)
{
// 电子签签署中
contract
.
setProcessStatus
(
CommonConstants
.
dingleDigitStrArray
[
6
]);
contract
.
setRequestId
(
requestId
);
contract
.
setRequestMsg
(
""
);
tEmployeeContractPreMapper
.
updateById
(
contract
);
}
public
static
final
String
YEAR_MONTH_DATE_FORMAT
=
"yyyy年MM月"
;
// 第二步:填写控件
...
...
@@ -641,7 +727,100 @@ public class FascUtil {
}
return
R
.
failed
(
"res无返回"
);
}
// 第二步:填写控件
private
R
<
String
>
buildDocFieldValue
(
TEmployeeContractPreNew
contract
,
String
requestId
,
OpenApiClient
openApiClient
,
String
accessToken
,
List
<
TFascTemplateDetail
>
detailList
)
throws
ApiException
{
SignTaskClient
signTaskClient
=
new
SignTaskClient
(
openApiClient
);
FillFieldValuesReq
fillFieldValuesReq
=
new
FillFieldValuesReq
();
fillFieldValuesReq
.
setSignTaskId
(
requestId
);
List
<
DocFieldValueInfo
>
docFieldValues
=
new
ArrayList
<>();
if
(
detailList
!=
null
&&
!
detailList
.
isEmpty
())
{
DocFieldValueInfo
dfv
;
String
fieldValue
;
String
fieldName
;
// 字段中文名
String
fieldNameChinese
;
for
(
TFascTemplateDetail
detail
:
detailList
)
{
if
(
Common
.
isNotNull
(
detail
.
getHrFieldId
())
&&
Common
.
isNotNull
(
detail
.
getHrField
()))
{
fieldValue
=
null
;
dfv
=
new
DocFieldValueInfo
();
dfv
.
setDocId
(
detail
.
getFascDocId
());
dfv
.
setFieldId
(
detail
.
getFascFieldId
());
// 转化字段
fieldName
=
detail
.
getHrFieldId
();
fieldNameChinese
=
detail
.
getHrField
();
if
(
FascConstants
.
CONTRACT_DURATION
.
equals
(
fieldName
))
{
if
(
Common
.
isNotNull
(
contract
.
getContractDurationYear
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
contract
.
getContractDurationYear
()))
{
fieldValue
=
contract
.
getContractDurationYear
()
+
YEAR_STR
;
}
if
(
Common
.
isNotNull
(
contract
.
getContractDurationMonth
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
contract
.
getContractDurationMonth
()))
{
if
(
Common
.
isNotNull
(
fieldValue
))
{
fieldValue
+=
contract
.
getContractDurationMonth
()
+
MONTH_STR
;
}
else
{
fieldValue
=
contract
.
getContractDurationMonth
()
+
MONTH_STR
;
}
}
}
else
if
(
FascConstants
.
DISPATCH_PERIOD
.
equals
(
fieldName
))
{
fieldValue
=
contract
.
getDispatchPeriodYear
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
contract
.
getDispatchPeriodMonth
();
}
else
if
(
FascConstants
.
EMP_SEX
.
equals
(
fieldName
))
{
fieldValue
=
""
;
if
(
Common
.
isNotNull
(
contract
.
getEmpIdcard
())
&&
contract
.
getEmpIdcard
().
length
()
>
14
){
String
idCard
=
contract
.
getEmpIdcard
();
fieldValue
=
IdCardUtil
.
getSexName
(
idCard
);
}
}
else
if
(
FascConstants
.
EMP_BIRTHDAY_MONTH
.
equals
(
fieldName
))
{
fieldValue
=
contract
.
getEmpIdcard
();
if
(
Common
.
isNotNull
(
contract
.
getEmpIdcard
())
&&
contract
.
getEmpIdcard
().
length
()
>
14
){
String
idCard
=
contract
.
getEmpIdcard
();
if
(
Common
.
isNotNull
(
detail
.
getFieldValue
()))
{
fieldValue
=
IdCardUtil
.
getBirthdateByPatten
(
idCard
,
detail
.
getFieldValue
());
}
else
{
fieldValue
=
IdCardUtil
.
getBirthdateByPatten
(
idCard
,
YEAR_MONTH_DATE_FORMAT
);
}
}
}
else
{
if
(
Common
.
isNotNull
(
fieldNameChinese
))
{
// 0=已完成一定工作任务为期限,1=固定期限,2=无固定期限
// 针对一个模板,三种类型,有的要开始时间,有的不要,这里做区分:
if
(
fieldNameChinese
.
contains
(
"无固定-"
))
{
if
(
CommonConstants
.
TWO_STRING
.
equals
(
contract
.
getContractTerm
()))
{
fieldValue
=
this
.
getContractFieldValueByReflection
(
contract
,
fieldName
,
detail
.
getFieldType
(),
detail
.
getFieldValue
());
}
}
else
if
(
fieldNameChinese
.
contains
(
"固定-"
))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
contract
.
getContractTerm
()))
{
fieldValue
=
this
.
getContractFieldValueByReflection
(
contract
,
fieldName
,
detail
.
getFieldType
(),
detail
.
getFieldValue
());
}
}
else
if
(
fieldNameChinese
.
contains
(
"完成任务-"
))
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
contract
.
getContractTerm
()))
{
fieldValue
=
this
.
getContractFieldValueByReflection
(
contract
,
fieldName
,
detail
.
getFieldType
(),
detail
.
getFieldValue
());
}
}
else
{
fieldValue
=
this
.
getContractFieldValueByReflection
(
contract
,
fieldName
,
detail
.
getFieldType
(),
detail
.
getFieldValue
());
}
}
}
if
(
Common
.
isNotNull
(
fieldValue
))
{
dfv
.
setFieldValue
(
fieldValue
);
docFieldValues
.
add
(
dfv
);
}
}
}
}
fillFieldValuesReq
.
setDocFieldValues
(
docFieldValues
);
fillFieldValuesReq
.
setAccessToken
(
accessToken
);
BaseRes
<
Void
>
res
=
signTaskClient
.
fillFieldValues
(
fillFieldValuesReq
);
if
(
res
!=
null
)
{
if
(
res
.
isSuccess
())
{
return
R
.
ok
();
}
return
R
.
failed
(
res
.
getMsg
());
}
return
R
.
failed
(
"res无返回"
);
}
/**
* 使用反射根据字段名获取合同对象中对应字段的值
*
...
...
@@ -676,7 +855,33 @@ public class FascUtil {
}
}
}
private
String
getContractFieldValueByReflection
(
TEmployeeContractPreNew
contract
,
String
fieldName
,
String
fieldType
,
String
fieldValue
)
{
if
(
contract
==
null
||
fieldName
==
null
)
{
return
null
;
}
try
{
// 获取对应的getter方法名
String
getterMethodName
=
"get"
+
Character
.
toUpperCase
(
fieldName
.
charAt
(
0
))
+
fieldName
.
substring
(
1
);
// 获取方法并调用
java
.
lang
.
reflect
.
Method
method
=
contract
.
getClass
().
getMethod
(
getterMethodName
);
Object
value
=
method
.
invoke
(
contract
);
String
valueStr
=
String
.
valueOf
(
value
);
valueStr
=
this
.
getCoverValue
(
valueStr
,
fieldType
,
fieldValue
);
return
valueStr
;
}
catch
(
Exception
e
)
{
// 如果找不到对应的方法,尝试直接匹配字段名
try
{
java
.
lang
.
reflect
.
Field
field
=
contract
.
getClass
().
getDeclaredField
(
fieldName
);
field
.
setAccessible
(
true
);
Object
value
=
field
.
get
(
contract
);
return
value
!=
null
?
value
.
toString
()
:
null
;
}
catch
(
Exception
ex
)
{
return
null
;
}
}
}
// 翻译字典
private
String
getCoverValue
(
String
valueStr
,
String
fieldType
,
String
fieldValue
)
{
if
(
Common
.
isNotNull
(
valueStr
)
&&
(
Common
.
isNotNull
(
fieldType
)))
{
...
...
@@ -802,6 +1007,25 @@ public class FascUtil {
return
actors
;
}
/**
* 构建参与方列表
*/
private
List
<
AddActorsTempInfo
>
buildActors
(
TEmployeeContractPreNew
contract
,
TFascCompany
company
,
TFascTemplate
tFascTemplate
)
{
List
<
AddActorsTempInfo
>
actors
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
tFascTemplate
.
getCompanyActorId
()))
{
// 添加企业方(甲方)
actors
.
add
(
buildCompanyActor
(
company
,
tFascTemplate
.
getCompanyActorId
()));
}
if
(
Common
.
isNotNull
(
tFascTemplate
.
getPersonActorId
()))
{
// 添加企业方(甲方)
// 核心代码:添加员工方(乙方)
actors
.
add
(
buildEmployeeActor
(
contract
,
tFascTemplate
.
getPersonActorId
()));
}
return
actors
;
}
/**
* 构建企业方参与方
*/
...
...
@@ -871,7 +1095,33 @@ public class FascUtil {
return
employeeActor
;
}
/**
* 构建员工方参与方
*/
private
AddActorsTempInfo
buildEmployeeActor
(
TEmployeeContractPreNew
contract
,
String
actorId
)
{
AddActorsTempInfo
employeeActor
=
new
AddActorsTempInfo
();
Actor
actor
=
new
Actor
();
actor
.
setActorId
(
actorId
);
// 与模板中的参与方标识一致
actor
.
setActorType
(
CacheConstants
.
FASC_ID_TYPE_PERSON
);
actor
.
setActorName
(
contract
.
getEmployeeName
());
// 权限设置
actor
.
setPermissions
(
Collections
.
singletonList
(
"sign"
));
// 通知设置
actor
.
setSendNotification
(
true
);
if
(
Common
.
isNotNull
(
contract
.
getEmpPhone
()))
{
actor
.
setNotifyAddress
(
contract
.
getEmpPhone
());
}
actor
.
setNotifyType
(
Collections
.
singletonList
(
"start"
));
employeeActor
.
setActor
(
actor
);
return
employeeActor
;
}
// 撤销签署
public
R
<
String
>
cancelTask
(
TEmployeeContractPre
contract
,
TFascPushLogService
tFascPushLogService
...
...
@@ -917,7 +1167,50 @@ public class FascUtil {
}
return
R
.
failed
(
"res无返回"
);
}
// 自动化续签待办:撤销签署
public
R
<
String
>
cancelTask
(
TEmployeeContractPreNew
contract
,
TFascPushLogService
tFascPushLogService
,
TEmployeeContractPreNewMapper
tEmployeeContractPreNewMapper
,
TFascCompany
company
)
throws
ApiException
{
OpenApiClient
openApiClient
=
new
OpenApiClient
(
company
.
getAppId
(),
company
.
getAppSecret
(),
company
.
getAppUrl
());
String
accessToken
=
this
.
getFascToken
(
openApiClient
,
company
);
SignTaskClient
signTaskClient
=
new
SignTaskClient
(
openApiClient
);
SignTaskCancelReq
signTaskCancelReq
=
new
SignTaskCancelReq
();
signTaskCancelReq
.
setSignTaskId
(
contract
.
getRequestId
());
signTaskCancelReq
.
setAccessToken
(
accessToken
);
// 新增推送日志
TFascPushLog
pushLog
=
new
TFascPushLog
();
pushLog
.
setTransReferenceId
(
company
.
getOpenId
());
pushLog
.
setPushData
(
JSON
.
toJSONString
(
signTaskCancelReq
,
features
));
pushLog
.
setTaskStatus
(
CommonConstants
.
ZERO_STRING
);
String
empIdCard
=
contract
.
getEmpIdcard
();
pushLog
.
setTypeKey
(
"发起撤销签署任务,身份证:"
+
empIdCard
);
pushLog
.
setTypeName
(
"发起撤销签署任务"
);
pushLog
.
setContractId
(
contract
.
getId
());
tFascPushLogService
.
save
(
pushLog
);
BaseRes
<
Void
>
res
=
signTaskClient
.
cancel
(
signTaskCancelReq
);
if
(
res
!=
null
)
{
pushLog
.
setReturnData
(
JSON
.
toJSONString
(
res
,
features
));
pushLog
.
setTaskStatus
(
res
.
isSuccess
()
?
CommonConstants
.
ONE_STRING
:
CommonConstants
.
TWO_STRING
);
tFascPushLogService
.
updateById
(
pushLog
);
if
(
res
.
isSuccess
())
{
contract
.
setProcessStatus
(
CommonConstants
.
dingleDigitStrArray
[
1
]);
contract
.
setSignType
(
CommonConstants
.
dingleDigitStrArray
[
1
]);
contract
.
setRequestMsg
(
""
);
tEmployeeContractPreNewMapper
.
updateById
(
contract
);
return
R
.
ok
();
}
else
{
// 撤销签署失败原因为 已完成签署(处理的同时员工完成签署公司免验证签完成),则更新为签署完成的“待归档”状态。
if
(
Common
.
isNotNull
(
res
.
getMsg
())
&&
FascConstants
.
FIELD_REASON
.
equals
(
res
.
getMsg
()))
{
contract
.
setProcessStatus
(
CommonConstants
.
dingleDigitStrArray
[
8
]);
contract
.
setRevokeReason
(
FascConstants
.
TIME_OUT_REASON
);
}
contract
.
setRequestMsg
(
res
.
getMsg
());
tEmployeeContractPreNewMapper
.
updateById
(
contract
);
return
R
.
failed
(
res
.
getMsg
());
}
}
return
R
.
failed
(
"res无返回"
);
}
// 催办
public
R
<
String
>
urgeTask
(
TEmployeeContractPre
contract
,
TFascPushLogService
tFascPushLogService
...
...
@@ -956,7 +1249,42 @@ public class FascUtil {
}
return
R
.
failed
(
"res无返回"
);
}
public
R
<
String
>
urgeTask
(
TEmployeeContractPreNew
contract
,
TFascPushLogService
tFascPushLogService
,
TEmployeeContractPreNewMapper
tEmployeeContractPreNewMapper
,
TFascCompany
company
)
throws
ApiException
{
OpenApiClient
openApiClient
=
new
OpenApiClient
(
company
.
getAppId
(),
company
.
getAppSecret
(),
company
.
getAppUrl
());
String
accessToken
=
this
.
getFascToken
(
openApiClient
,
company
);
SignTaskClient
signTaskClient
=
new
SignTaskClient
(
openApiClient
);
SignTaskBaseReq
signTaskBaseReq
=
new
SignTaskBaseReq
();
signTaskBaseReq
.
setSignTaskId
(
contract
.
getRequestId
());
signTaskBaseReq
.
setAccessToken
(
accessToken
);
// 新增推送日志
TFascPushLog
pushLog
=
new
TFascPushLog
();
pushLog
.
setTransReferenceId
(
company
.
getOpenId
());
pushLog
.
setPushData
(
JSON
.
toJSONString
(
signTaskClient
,
features
));
pushLog
.
setTaskStatus
(
CommonConstants
.
ZERO_STRING
);
String
empIdCard
=
contract
.
getEmpIdcard
();
pushLog
.
setTypeKey
(
"发起催办任务,身份证:"
+
empIdCard
);
pushLog
.
setTypeName
(
"发起催办任务"
);
pushLog
.
setContractId
(
contract
.
getId
());
tFascPushLogService
.
save
(
pushLog
);
BaseRes
<
Void
>
res
=
signTaskClient
.
signTaskUrge
(
signTaskBaseReq
);
if
(
res
!=
null
)
{
pushLog
.
setReturnData
(
JSON
.
toJSONString
(
res
,
features
));
pushLog
.
setTaskStatus
(
res
.
isSuccess
()
?
CommonConstants
.
ONE_STRING
:
CommonConstants
.
TWO_STRING
);
tFascPushLogService
.
updateById
(
pushLog
);
if
(
res
.
isSuccess
())
{
return
R
.
ok
();
}
else
{
contract
.
setRequestMsg
(
res
.
getMsg
());
tEmployeeContractPreNewMapper
.
updateById
(
contract
);
return
R
.
failed
(
res
.
getMsg
());
}
}
return
R
.
failed
(
"res无返回"
);
}
// 获取模板详情预览链接
public
R
<
String
>
getTemplateDetailUrl
(
String
signTemplateId
,
TFascPushLogService
tFascPushLogService
,
TFascCompany
company
)
throws
ApiException
{
...
...
@@ -1039,7 +1367,51 @@ public class FascUtil {
}
return
false
;
}
// 自动化续签待办:获取附件
public
boolean
getFileByRequestId
(
TEmployeeContractPreNew
contract
,
TFascPushLogService
tFascPushLogService
,
TAttaInfoMapper
tAttaInfoMapper
,
OSSUtil
ossUtil
,
TFascCompany
company
)
throws
ApiException
{
OpenApiClient
openApiClient
=
new
OpenApiClient
(
company
.
getAppId
(),
company
.
getAppSecret
(),
company
.
getAppUrl
());
String
accessToken
=
this
.
getFascToken
(
openApiClient
,
company
);
SignTaskClient
signTaskClient
=
new
SignTaskClient
(
openApiClient
);
SignTaskGetFileReq
signTaskGetFileReq
=
new
SignTaskGetFileReq
();
signTaskGetFileReq
.
setSignTaskId
(
contract
.
getRequestId
());
signTaskGetFileReq
.
setAccessToken
(
accessToken
);
// 新增推送日志
TFascPushLog
pushLog
=
new
TFascPushLog
();
pushLog
.
setTransReferenceId
(
company
.
getOpenId
());
pushLog
.
setPushData
(
JSON
.
toJSONString
(
signTaskClient
,
features
));
pushLog
.
setTaskStatus
(
CommonConstants
.
ZERO_STRING
);
String
empIdCard
=
contract
.
getEmpIdcard
();
pushLog
.
setTypeKey
(
"获取附件,身份证:"
+
empIdCard
);
pushLog
.
setTypeName
(
"获取附件"
);
pushLog
.
setContractId
(
contract
.
getId
());
pushLog
.
setSignTaskId
(
contract
.
getRequestId
());
tFascPushLogService
.
save
(
pushLog
);
BaseRes
<
SignTaskGetFileRes
>
res
=
signTaskClient
.
signTaskGetFile
(
signTaskGetFileReq
);
if
(
res
!=
null
)
{
pushLog
.
setReturnData
(
JSON
.
toJSONString
(
res
,
features
));
pushLog
.
setTaskStatus
(
res
.
isSuccess
()
?
CommonConstants
.
ONE_STRING
:
CommonConstants
.
TWO_STRING
);
tFascPushLogService
.
updateById
(
pushLog
);
if
(
res
.
isSuccess
())
{
if
(
Common
.
isNotNull
(
res
.
getData
())
&&
Common
.
isNotNull
(
res
.
getData
().
getDocs
()))
{
for
(
SignTaskGetFileRes
.
DocFileInfo
doc
:
res
.
getData
().
getDocs
())
{
if
(
Common
.
isNotNull
(
doc
.
getFddFileUrl
()))
{
// 存储文档
// 将法大大回传的url字符串转化为流,存储到阿里云
this
.
streamUpload
(
doc
.
getFddFileUrl
(),
ossUtil
,
tAttaInfoMapper
,
contract
.
getContractId
(),
doc
.
getDocName
());
}
}
}
return
true
;
}
else
{
return
false
;
}
}
return
false
;
}
public
void
streamUpload
(
String
fileUrl
,
OSSUtil
ossUtil
,
TAttaInfoMapper
tAttaInfoMapper
,
String
domainId
,
String
fileName
)
{
InputStream
inputStream
=
null
;
HttpURLConnection
connection
=
null
;
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TContractAutoLogMapper.xml
View file @
ec3b01b2
...
...
@@ -9,6 +9,7 @@
<result
property=
"empName"
column=
"EMP_NAME"
/>
<result
property=
"empIdcard"
column=
"EMP_IDCARD"
/>
<result
property=
"joinLeaveDate"
column=
"JOIN_LEAVE_DATE"
/>
<result
property=
"contractStartDate"
column=
"CONTRACT_START_DATE"
/>
<result
property=
"phone"
column=
"PHONE"
/>
<result
property=
"errorInfo"
column=
"ERROR_INFO"
/>
<result
property=
"createBy"
column=
"CREATE_BY"
/>
...
...
@@ -31,7 +32,7 @@
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME,
a.CREATE_TIME,a.CONTRACT_ID,a.MAIN_ID,a.is_urg
a.CREATE_TIME,a.CONTRACT_ID,a.MAIN_ID,a.is_urg
,a.CONTRACT_START_DATE
</sql>
<sql
id=
"tContractAutoLog_where"
>
<if
test=
"tContractAutoLog != null"
>
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmpContractAlertMapper.xml
View file @
ec3b01b2
...
...
@@ -57,14 +57,59 @@
<result
property=
"applyNo"
column=
"APPLY_NO"
/>
<result
property=
"workingHours"
column=
"WORKING_HOURS"
/>
<result
property=
"post"
column=
"POST"
/>
<!-- 合同自动化新增字段
-->
<!-- 合同自动化新增字段
<result property="expectedCollectionTime" column="EXPECTED_COLLECTION_TIME"/>
<result property="signType" column="SIGN_TYPE"/>
<result
property=
"processStatus"
column=
"PROCESS_STATUS"
/>
<result property="processStatus" column="PROCESS_STATUS"/>
-->
<result
property=
"csName"
column=
"CS_NAME"
/>
<result
property=
"csLoginName"
column=
"CS_LOGIN_NAME"
/>
<result
property=
"autoFlag"
column=
"AUTO_FLAG"
/>
</resultMap>
<resultMap
id=
"tEmpContractAlertAutoMap"
type=
"com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertAutoVo"
>
<id
property=
"id"
column=
"ID"
/>
<result
property=
"empName"
column=
"EMP_NAME"
/>
<result
property=
"empId"
column=
"EMP_ID"
/>
<result
property=
"project"
column=
"PROJECT"
/>
<result
property=
"projectNo"
column=
"PROJECT_NO"
/>
<result
property=
"empIdcard"
column=
"EMP_IDCARD"
/>
<result
property=
"empCode"
column=
"EMP_CODE"
/>
<result
property=
"contractStart"
column=
"CONTRACT_START"
/>
<result
property=
"contractEnd"
column=
"CONTRACT_END"
/>
<result
property=
"fileProvince"
column=
"FILE_PROVINCE"
/>
<result
property=
"fileCity"
column=
"FILE_CITY"
/>
<result
property=
"fileTown"
column=
"FILE_TOWN"
/>
<result
property=
"empType"
column=
"EMP_TYPE"
/>
<result
property=
"contractType"
column=
"CONTRACT_TYPE"
/>
<result
property=
"contractTerm"
column=
"CONTRACT_TERM"
/>
<result
property=
"daysDue"
column=
"DAYS_DUE"
/>
<result
property=
"dueFlag"
column=
"DUE_FLAG"
/>
<result
property=
"daysOver"
column=
"DAYS_OVER"
/>
<result
property=
"firstAlertTime"
column=
"FIRST_ALERT_TIME"
/>
<result
property=
"alertPerson"
column=
"ALERT_PERSON"
/>
<result
property=
"handleStatus"
column=
"HANDLE_STATUS"
/>
<result
property=
"createBy"
column=
"CREATE_BY"
/>
<result
property=
"updateBy"
column=
"UPDATE_BY"
/>
<result
property=
"createName"
column=
"CREATE_NAME"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
/>
<result
property=
"isFeedback"
column=
"IS_FEEDBACK"
/>
<result
property=
"feedbackReason"
column=
"FEEDBACK_REASON"
/>
<result
property=
"feedbackDetail"
column=
"FEEDBACK_DATAIL"
/>
<result
property=
"contractId"
column=
"CONTRACT_ID"
/>
<result
property=
"applyNo"
column=
"APPLY_NO"
/>
<result
property=
"workingHours"
column=
"WORKING_HOURS"
/>
<result
property=
"post"
column=
"POST"
/>
<!-- 合同自动化新增字段 -->
<result
property=
"expectedCollectionTime"
column=
"EXPECTED_COLLECTION_TIME"
/>
<result
property=
"signType"
column=
"SIGN_TYPE"
/>
<result
property=
"processStatus"
column=
"PROCESS_STATUS"
/>
<result
property=
"csName"
column=
"CS_NAME"
/>
<result
property=
"csLoginName"
column=
"CS_LOGIN_NAME"
/>
<result
property=
"autoFlag"
column=
"AUTO_FLAG"
/>
<result
property=
"errorInfo"
column=
"ERROR_INFO"
/>
<result
property=
"errorTime"
column=
"ERROR_TIME"
/>
<result
property=
"preId"
column=
"preId"
/>
</resultMap>
<update
id=
"truncate"
>
TRUNCATE t_emp_contract_alert
</update>
...
...
@@ -136,9 +181,6 @@
a.APPLY_NO,
a.POST,
a.WORKING_HOURS,
a.EXPECTED_COLLECTION_TIME,
a.SIGN_TYPE,
a.PROCESS_STATUS,
a.CS_NAME,
a.CS_LOGIN_NAME,
a.AUTO_FLAG
...
...
@@ -281,17 +323,17 @@
AND a.WORKING_HOURS = #{tEmpContractAlert.workingHours}
</if>
<if
test=
"tEmpContractAlert.expectedCollectionTime != null"
>
AND
a
.EXPECTED_COLLECTION_TIME = #{tEmpContractAlert.expectedCollectionTime}
AND
b
.EXPECTED_COLLECTION_TIME = #{tEmpContractAlert.expectedCollectionTime}
</if>
<if
test=
"tEmpContractAlert.signType != null
and tEmpContractAlert.signType.trim() != ''
"
>
AND
a
.SIGN_TYPE = #{tEmpContractAlert.signType}
<if
test=
"tEmpContractAlert.signType != null"
>
AND
b
.SIGN_TYPE = #{tEmpContractAlert.signType}
</if>
<if
test=
"tEmpContractAlert.processStatus != null and tEmpContractAlert.processStatus.trim() != ''"
>
AND
a.PROCESS_STATUS
= #{tEmpContractAlert.processStatus}
AND
IFNULL(b.PROCESS_STATUS,'0')
= #{tEmpContractAlert.processStatus}
</if>
<if
test=
"tEmpContractAlert.processStatusList != null and tEmpContractAlert.processStatusList.
length
>0"
>
AND
a.PROCESS_STATUS
IN
<if
test=
"tEmpContractAlert.processStatusList != null and tEmpContractAlert.processStatusList.
size
>0"
>
AND
IFNULL(b.PROCESS_STATUS,'0')
IN
<foreach
collection=
"tEmpContractAlert.processStatusList"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
...
...
@@ -300,10 +342,10 @@
AND a.CS_NAME like CONCAT('%',#{tEmpContractAlert.csName},'%')
</if>
<if
test=
"tEmpContractAlert.expectedCollectionTimeStart != null"
>
AND
a
.EXPECTED_COLLECTION_TIME
<![CDATA[ >= ]]>
#{tEmpContractAlert.expectedCollectionTimeStart}
AND
b
.EXPECTED_COLLECTION_TIME
<![CDATA[ >= ]]>
#{tEmpContractAlert.expectedCollectionTimeStart}
</if>
<if
test=
"tEmpContractAlert.expectedCollectionTimeEnd != null"
>
AND
a
.EXPECTED_COLLECTION_TIME
<![CDATA[ <= ]]>
#{tEmpContractAlert.expectedCollectionTimeEnd}
AND
b
.EXPECTED_COLLECTION_TIME
<![CDATA[ <= ]]>
#{tEmpContractAlert.expectedCollectionTimeEnd}
</if>
<if
test=
"tEmpContractAlert.csLoginName != null and tEmpContractAlert.csLoginName.trim() != ''"
>
AND a.CS_LOGIN_NAME = #{tEmpContractAlert.csLoginName}
...
...
@@ -314,10 +356,17 @@
</if>
</sql>
<!--tEmpContractAlert简单分页查询-->
<select
id=
"getTEmpContractAlertAutoPage"
resultMap=
"tEmpContractAlertMap"
>
<select
id=
"getTEmpContractAlertAutoPage"
resultMap=
"tEmpContractAlert
Auto
Map"
>
SELECT
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
,
b.EXPECTED_COLLECTION_TIME,
b.SIGN_TYPE,
IFNULL(b.PROCESS_STATUS,'0') PROCESS_STATUS,
b.ERROR_INFO,
b.ERROR_TIME,
IFNULL(b.id,null) as 'preId'
FROM t_emp_contract_alert a
LEFT JOIN t_employee_contract_pre_new b on a.CONTRACT_ID = b.contract_id
<where>
1=1
<include
refid=
"tEmpContractAlert_where"
/>
...
...
@@ -328,6 +377,7 @@
SELECT
count(1)
FROM t_emp_contract_alert a
LEFT JOIN t_employee_contract_pre_new b on a.CONTRACT_ID = b.contract_id
<where>
1=1
<include
refid=
"tEmpContractAlert_where"
/>
...
...
@@ -337,8 +387,12 @@
<!--tEmpContractAlert简单分页查询-->
<select
id=
"listExport"
resultType=
"com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAlertExportVo"
>
SELECT
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
,
b.EXPECTED_COLLECTION_TIME,
b.SIGN_TYPE,
IFNULL(b.PROCESS_STATUS,'0') PROCESS_STATUS
FROM t_emp_contract_alert a
LEFT JOIN t_employee_contract_pre_new b on a.CONTRACT_ID = b.contract_id
<where>
1=1
<include
refid=
"tEmpContractAlert_where"
/>
...
...
@@ -349,4 +403,55 @@
</if>
</where>
</select>
<update
id=
"updateProcessStatus"
>
UPDATE t_emp_contract_alert a
JOIN t_employee_contract_pre_new b ON a.CONTRACT_ID = b.contract_id
SET a.HANDLE_STATUS =
CASE
WHEN b.process_status = '9' THEN '2'
WHEN b.process_status IN ('6', '8', '2', '4') THEN '1'
ELSE a.HANDLE_STATUS -- 保持不变
END
WHERE a.AUTO_FLAG = '0'
AND b.process_status IN ('9', '6', '8', '2', '4') -- 只处理这些状态
</update>
<!--tEmpContractAlert简单分页查询-->
<select
id=
"getAutoRenewForConfirm"
resultType=
"com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertConfirmVo"
>
SELECT
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_TYPE,
a.CONTRACT_TYPE,
a.CONTRACT_START,
a.CONTRACT_END,
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,
c.EMP_PHONE
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
<where>
1=1
<include
refid=
"tEmpContractAlert_where"
/>
</where>
limit 2000
</select>
<!--tEmpContractAlert简单分页查询-->
<select
id=
"getPushWxConfrimInfos"
resultMap=
"tEmpContractAlertAutoMap"
>
SELECT a.CONTRACT_END, a.CS_LOGIN_NAME
FROM t_emp_contract_alert a
WHERE a.AUTO_FLAG = '0'
AND a.CS_LOGIN_NAME IS NOT NULL
AND a.CONTRACT_END BETWEEN CURDATE() - INTERVAL 1 MONTH - INTERVAL 15 DAY
AND CURDATE() + INTERVAL 1 MONTH + INTERVAL 15 DAY
AND NOT EXISTS (
SELECT 1
FROM t_employee_contract_pre_new b
WHERE b.contract_id = a.CONTRACT_ID
)
</select>
</mapper>
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeContractPreNewMapper.xml
View file @
ec3b01b2
...
...
@@ -61,10 +61,6 @@
<result
property=
"defaultAmount"
column=
"default_amount"
/>
<result
property=
"contractDurationYear"
column=
"contract_duration_year"
/>
<result
property=
"contractDurationMonth"
column=
"contract_duration_month"
/>
<result
property=
"tryPeriodStart"
column=
"try_period_start"
/>
<result
property=
"tryPeriodEnd"
column=
"try_period_end"
/>
<result
property=
"tryPeriodType"
column=
"try_period_type"
/>
<result
property=
"tryPeriod"
column=
"try_period"
/>
<result
property=
"laborCost"
column=
"labor_cost"
/>
<result
property=
"riskBuyDesc"
column=
"risk_buy_desc"
/>
<result
property=
"salaryStandardPerHour"
column=
"salary_standard_per_hour"
/>
...
...
@@ -90,6 +86,7 @@
<result
property=
"errorInfo"
column=
"error_info"
/>
<result
property=
"contractId"
column=
"contract_id"
/>
<result
property=
"revokeReason"
column=
"revoke_reason"
/>
<result
property=
"revokeTime"
column=
"revoke_time"
/>
<result
property=
"errorTime"
column=
"error_time"
/>
<result
property=
"contractEndType"
column=
"contract_end_type"
/>
<result
property=
"confirmEmpSelect"
column=
"confirm_emp_select"
/>
...
...
@@ -258,6 +255,12 @@
<if
test=
"tEmployeeContractPreNew.processStatus != null and tEmployeeContractPreNew.processStatus.trim() != ''"
>
AND a.process_status = #{tEmployeeContractPreNew.processStatus}
</if>
<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.configName != null and tEmployeeContractPreNew.configName.trim() != ''"
>
AND a.config_name = #{tEmployeeContractPreNew.configName}
</if>
...
...
@@ -318,18 +321,6 @@
<if
test=
"tEmployeeContractPreNew.contractDurationMonth != null and tEmployeeContractPreNew.contractDurationMonth.trim() != ''"
>
AND a.contract_duration_month = #{tEmployeeContractPreNew.contractDurationMonth}
</if>
<if
test=
"tEmployeeContractPreNew.tryPeriodStart != null"
>
AND a.try_period_start = #{tEmployeeContractPreNew.tryPeriodStart}
</if>
<if
test=
"tEmployeeContractPreNew.tryPeriodEnd != null"
>
AND a.try_period_end = #{tEmployeeContractPreNew.tryPeriodEnd}
</if>
<if
test=
"tEmployeeContractPreNew.tryPeriodType != null and tEmployeeContractPreNew.tryPeriodType.trim() != ''"
>
AND a.try_period_type = #{tEmployeeContractPreNew.tryPeriodType}
</if>
<if
test=
"tEmployeeContractPreNew.tryPeriod != null and tEmployeeContractPreNew.tryPeriod.trim() != ''"
>
AND a.try_period = #{tEmployeeContractPreNew.tryPeriod}
</if>
<if
test=
"tEmployeeContractPreNew.laborCost != null and tEmployeeContractPreNew.laborCost.trim() != ''"
>
AND a.labor_cost = #{tEmployeeContractPreNew.laborCost}
</if>
...
...
@@ -486,4 +477,52 @@
<include
refid=
"tEmployeeContractPreNew_where"
/>
</where>
</select>
<select
id=
"getDisPatcherContractListRenew"
resultType=
"com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractVO"
>
SELECT
(@i :=@i+1) as rowIndex,
a.employee_name empName,
a.emp_idcard empIdcard,
a.dept_no deptNo,
a.situation,
a.contract_type contractName,
a.CONTRACT_SUB_NAME contractSubName,
null reason,
a.signatory contractParty,
if(a.CONTRACT_TERM = '' or a.CONTRACT_TERM is null,'2',a.CONTRACT_TERM) contractType,
a.CONTRACT_START as contractStart,
if(a.contract_type = '实习协议',a.CONTRACT_END,if(a.CONTRACT_TERM ='1' ,a.CONTRACT_END,null)) as contractEnd,
a.post,
if(a.working_hours = '' or a.working_hours is null,'4',a.working_hours) as workingHours,
null contractNo,
null fileCabinetNo,
null leaveDate,
null reduceReason,
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,
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>
1=1
AND a.id in
<foreach
item=
"idStr"
index=
"index"
collection=
"idList"
open=
"("
separator=
","
close=
")"
>
#{idStr}
</foreach>
AND a.process_status in
<foreach
item=
"status"
index=
"index"
collection=
"statusList"
open=
"("
separator=
","
close=
")"
>
#{status}
</foreach>
</where>
</select>
<!--tEmployeeContractPreNew简单分页查询-->
<select
id=
"getUnDispatchList"
resultType=
"java.lang.String"
>
SELECT
a.id
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>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment