Commit e5372798 authored by huyuchen's avatar huyuchen

huych-合同自动化代码提交

parent 261a1d26
......@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreVo;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -125,7 +124,7 @@ public class EmployeeRegistrationPre extends BaseEntity {
@Schema(description = "合同待派单信息")
@TableField(exist = false)
private TEmployeeContractPreVo employeeContractPreVo;
private TEmployeeContractPre employeeContractPre;
@Schema(description = "附件集合")
@TableField(exist = false)
......
package com.yifu.cloud.plus.v1.yifu.archives.entity;
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.fasterxml.jackson.annotation.JsonFormat;
......@@ -12,6 +13,7 @@ import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/**
* 合同待签订任务记录表
......@@ -59,7 +61,7 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "合同类型,标准合同/劳务协议/实习协议/劳务派遣合同/非全日制/其他合同")
private String contractType;
@Schema(description = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9已完结")
@Schema(description = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9已完结10撤销签署")
private String processStatus;
@Schema(description = "签署甲方")
......@@ -266,4 +268,23 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "入离职登记主表id")
private String registerId;
@Schema(description = "是否已签署合同 0是1否")
private String contractFlag;
@Schema(description = "新合同发起时间 入职日期 0、入职3天后 3、入职1周后 7、入职2周后 14、入职3周后 21")
@TableField(exist = false)
private int registType;
@Schema(description = "试用期月份数字 1、2、3、4...")
@TableField(exist = false)
private String tryPeriodNum;
@Schema(description = "实习期限月数 0、1、2、3...")
@TableField(exist = false)
private String internshipPeriodNum;
@Schema(description = "附件集合")
@TableField(exist = false)
private List<TAttaInfo> attaList;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
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.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -109,10 +108,10 @@ public class TEmployeeContractPreVo extends RowIndex implements Serializable {
/**
* 状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档
*/
@Length(max = 1, message = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档 不能超过1 个字符")
@ExcelAttribute(name = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档", maxLength = 1)
@Schema(description = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档")
@ExcelProperty("状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档")
@Length(max = 2, message = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档 不能超过2 个字符")
@ExcelAttribute(name = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9已完结10撤销签署", maxLength = 2)
@Schema(description = "状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9已完结10撤销签署")
@ExcelProperty("状态,0待确认,1待发起,2线下签待审核,3线下签审核不通过4线下签待归档5发起失败6签署中7签署失败8电子待归档9已完结10撤销签署")
private String processStatus;
/**
* 签署甲方
......@@ -162,21 +161,12 @@ public class TEmployeeContractPreVo extends RowIndex implements Serializable {
@Schema(description = "数据来源1客户端 2客服端")
@ExcelProperty("数据来源1客户端 2客服端")
private String dataSource;
/**
* 预计确认时间
*/
@ExcelAttribute(name = "预计确认时间", isDate = true)
@Schema(description = "预计确认时间")
@ExcelProperty("预计确认时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
private Date confirmTime;
/**
* 预计发起时间
*/
@ExcelAttribute(name = "预计发起时间", isDate = true)
@Schema(description = "预计发起时间")
@ExcelProperty("预计发起时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
private Date expectedCollectionTime;
/**
* 确认人
......
......@@ -656,8 +656,8 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
.eq(TEmployeeContractPre::getRegisterId,employeeRegistrationPre.getId())
.last(CommonConstants.LAST_ONE_SQL));
//1.9.12合同自动化校验逻辑
if (employeeRegistrationPre.getServerItem().contains("合同") && null != employeeRegistrationPre.getEmployeeContractPreVo()) {
TEmployeeContractPreVo employeeContractPreVo = employeeRegistrationPre.getEmployeeContractPreVo();
if (employeeRegistrationPre.getServerItem().contains("合同") && null != employeeRegistrationPre.getEmployeeContractPre()) {
TEmployeeContractPre employeeContractPreVo = employeeRegistrationPre.getEmployeeContractPre();
//根据身份证号码和项目编号查询合同
boolean flag = contractInfoMapper.selectCount(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, employeeRegistrationPre.getEmpIdcard())
......@@ -809,7 +809,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
/**
* 初始化合同
*/
private void initContractPreInfo(EmployeeRegistrationPre registration, TEmployeeContractPreVo employeeContractPreVo,
private void initContractPreInfo(EmployeeRegistrationPre registration, TEmployeeContractPre employeeContractPreVo,
YifuUser user, String id) {
employeeContractPreVo.setProcessStatus(CommonConstants.ZERO_STRING);
employeeContractPreVo.setSituation("正常签订");
......@@ -846,15 +846,6 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
//是否撤销签署
employeeContractPreVo.setSignFlag(CommonConstants.ONE_STRING);
employeeContractPreVo.setRevokeReason(CommonConstants.EMPTY_STRING);
// 预计提醒时间、预计合同发起时间
try {
employeeContractPreVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
employeeContractPreVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 9:00", DateUtil.DATETIME_PATTERN_MINUTE));
employeeContractPreVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString(
employeeContractPreVo.getExpectedConfirmTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 8:30", DateUtil.DATETIME_PATTERN_MINUTE));
} catch (Exception e) {
log.error("合同自动化赋值报错", e);
}
}
/**
......@@ -1325,6 +1316,26 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
}
pre.setInsurancePreList(oldList);
}
List<TAttaInfo> attaInfoAll = new ArrayList<>();
//获取合同待签订数据
TEmployeeContractPre contract = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId,id)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contract)) {
pre.setEmployeeContractPre(contract);
//附件赋值
List<TAttaInfo> attaContractInfo = attaInfoService.list(Wrappers.<TAttaInfo>query().lambda()
.eq(TAttaInfo::getDomainId, contract.getId()));
// 如果附件信息非空,则为每个附件生成可访问的URL,并将其添加到员工注册信息中
if (attaContractInfo != null && !attaContractInfo.isEmpty()) {
URL url;
for (TAttaInfo a: attaContractInfo) {
url = ossUtil.getObjectUrl(null, a.getAttaSrc());
a.setAttaUrl(null != url ? url.toString(): "");
}
attaInfoAll.addAll(attaContractInfo);
}
}
// 查询与员工相关的附件信息
List<TAttaInfo> attaInfo = attaInfoService.list(Wrappers.<TAttaInfo>query().lambda().eq(TAttaInfo::getDomainId, id));
......@@ -1335,9 +1346,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
url = ossUtil.getObjectUrl(null, a.getAttaSrc());
a.setAttaUrl(null != url ? url.toString(): "");
}
pre.setAttaList(attaInfo);
attaInfoAll.addAll(attaInfo);
}
if (!attaInfoAll.isEmpty()) {
pre.setAttaList(attaInfoAll);
}
}
return pre;
}
......
......@@ -49,6 +49,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.Cache;
......@@ -993,12 +994,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
this.updateFileMainId(tEmployeeContractInfo);
this.setFileInfo(tEmployeeContractInfo.getId(), "");
tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING);
} else {
this.setFileInfo(tEmployeeContractInfo.getId(), "");
tEmployeeContractInfo.setIsFile(CommonConstants.ONE_STRING);
}
this.updateById(tEmployeeContractInfo);
//更新合同状态为4线下签待归档
//更新合同待签订数据状态为4线下签待归档
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, tEmployeeContractInfo.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.FOUR_STRING)
......@@ -1006,12 +1002,30 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.NINE_STRING);
contractPreMapper.updateById(contractPre);
//附件同步
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(contractPre.getId());
tAttaInfoService.save(attaInfoPre);
}
}
}
}
//瓜子项目编码:皖A694302
if (CommonConstants.GZ_DEPT_NO.equals(tEmployeeContractInfo.getDeptNo())) {
//合同归档瓜子合同状态更新已归档
updateGzOfferStatus(tEmployeeContractInfo,CommonConstants.EIGHT_STRING,CommonConstants.NINETY_NINE,"0","系统自动触发");
}
} else {
this.setFileInfo(tEmployeeContractInfo.getId(), "");
tEmployeeContractInfo.setIsFile(CommonConstants.ONE_STRING);
}
this.updateById(tEmployeeContractInfo);
return R.ok();
}
return R.failed("参数不可为空");
......
......@@ -313,6 +313,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
.lambda().in(TEmployeeContractPre::getId, idList)
.ne(TEmployeeContractPre::getProcessStatus, CommonConstants.NINE_STRING)
.ne(TEmployeeContractPre::getProcessStatus, CommonConstants.FOUR_STRING)
.ne(TEmployeeContractPre::getProcessStatus, CommonConstants.TEN_STRING)
.ne(TEmployeeContractPre::getProcessStatus, CommonConstants.EIGHT_STRING));
if (Common.isEmpty(contractPreList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
......@@ -335,7 +336,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
}
pre.setProcessStatus(CommonConstants.NINE_STRING);
pre.setProcessStatus(CommonConstants.TEN_STRING);
pre.setSignFlag(CommonConstants.ZERO_STRING);
pre.setRevokeReason(registRevokeVo.getReason());
baseMapper.updateById(pre);
......@@ -417,6 +418,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
.eq(TEmployeeContractPre::getEmpIdcard, vo.getEmpIdcard())
.eq(TEmployeeContractPre::getDeptNo, vo.getDeptNo())
.ne(TEmployeeContractPre::getProcessStatus, CommonConstants.NINE_STRING)
.ne(TEmployeeContractPre::getProcessStatus, CommonConstants.TEN_STRING)
.last(CommonConstants.LAST_ONE_SQL)) > 0;
}
......
......@@ -32,6 +32,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeePreLogMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogDetailService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeePreLogSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
......@@ -44,6 +45,7 @@ import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
......@@ -291,8 +293,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
}
}
boolean isModifyContract =false;
if (contractOld != null && newInfo.getEmployeeContractPreVo() != null) {
differenceContractKey = HrEquator.comparisonValueIgnoreField(contractOld, newInfo.getEmployeeContractPreVo(), CONTRACT_IGNORE_FIELD);
if (contractOld != null && newInfo.getEmployeeContractPre() != null) {
differenceContractKey = HrEquator.comparisonValueIgnoreField(contractOld, newInfo.getEmployeeContractPre(), CONTRACT_IGNORE_FIELD);
if (null != differenceContractKey) {
isModifyContract = true;
}
......@@ -329,8 +331,10 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
tEmployeePreLogDetailService.saveBatch(detailList);
}
//保存合同待签订数据
if (contractOld != null && newInfo.getEmployeeContractPreVo() != null) {
contractPreService.saveContractPreInfo(newInfo.getEmployeeContractPreVo());
if (contractOld != null && newInfo.getEmployeeContractPre() != null) {
TEmployeeContractPreVo preVo = new TEmployeeContractPreVo();
BeanUtils.copyProperties(newInfo.getEmployeeContractPre(),preVo);
contractPreService.saveContractPreInfo(preVo);
}
}
if (!saveOrUpdateList.isEmpty()) {
......
......@@ -63,7 +63,8 @@
<result property="dispatchPeriodYear" column="DISPATCH_PERIOD_YEAR"/>
<result property="dispatchPeriodMonth" column="DISPATCH_PERIOD_MONTH"/>
<result property="dispatchPeriodStart" column="DISPATCH_PERIOD_START"/>
<result property="registerId" column="register_id"/>
<result property="registerId" column="contract_flag"/>
<result property="contractFlag" column="register_id"/>
<result property="revokeReason" column="revoke_reason"/>
<result property="dispatchPeriodEnd" column="DISPATCH_PERIOD_END"/>
<result property="workType" column="WORK_TYPE"/>
......@@ -168,7 +169,7 @@
,update_by
,TASK
,TASK_TYPE
,TASK_END_STANDARD
,TASK_END_STANDARD,contract_flag
</sql>
<sql id="tEmployeeContractPre_where">
<if test="tEmployeeContractPre != null">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment