Commit 81727284 authored by huyuchen's avatar huyuchen

huych-合同自动化代码提交

parent 1e321e22
......@@ -537,6 +537,16 @@ public class TEmployeeContractInfo extends BaseEntity {
@TableField(exist = false)
private int limitEnd;
@Schema(description = "合同待签订列表preId")
@TableField(exist = false)
private String preId;
/**
* preName
*/
@ExcelAttribute(name = "preName")
@ExcelProperty(value ="preName")
private String preName;
/**
* 试用期(单位月)
......@@ -545,4 +555,6 @@ public class TEmployeeContractInfo extends BaseEntity {
@ExcelProperty(value ="试用期")
private String tryPeriod;
}
......@@ -80,9 +80,12 @@ public class TEmployeeContractPre extends BaseEntity {
@Schema(description = "撤销签署原因")
private String revokeReason;
@Schema(description = "异常原因")
@Schema(description = "发起失败原因")
private String errorInfo;
@Schema(description = "发起失败时间")
private Date errorTime;
@Schema(description = "法大大模版名称")
private String fadadaTemplate;
......
......@@ -227,7 +227,14 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
/**
* id
*/
@ExcelAttribute(name = "id")
@ExcelProperty(value ="id")
private String id;
@ExcelAttribute(name = "preId")
@ExcelProperty(value ="preId")
private String preId;
/**
* preName
*/
@ExcelAttribute(name = "preName")
@ExcelProperty(value ="preName")
private String preName;
}
......@@ -76,8 +76,8 @@ public class TEmployeeContractPreController {
* @return
*/
@Operation(description = "不分页查询")
@GetMapping("/noPage")
public R<List<TEmployeeContractPre>> getTEmployeeContractPreNoPage(TEmployeeContractPreSearchVo tEmployeeContractPre) {
@PostMapping("/noPage")
public R<List<TEmployeeContractPre>> getTEmployeeContractPreNoPage(@RequestBody TEmployeeContractPreSearchVo tEmployeeContractPre) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tEmployeeContractPre);
return new R<>(tEmployeeContractPreService.getTEmployeeContractPreNoPage(tEmployeeContractPre));
......@@ -89,8 +89,8 @@ public class TEmployeeContractPreController {
* @return
*/
@Operation(description = "合同待签订数量查询")
@GetMapping("/getListCount")
public R getListCount(TEmployeeContractPreSearchVo tEmployeeContractPre) {
@PostMapping("/getListCount")
public R getListCount(@RequestBody TEmployeeContractPreSearchVo tEmployeeContractPre) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tEmployeeContractPre);
return R.ok(tEmployeeContractPreService.getTEmployeeContractCount(tEmployeeContractPre));
......@@ -113,7 +113,7 @@ public class TEmployeeContractPreController {
@Operation(description = "合同待签订信息单个/批量发起签署任务")
@PostMapping("/dispatcherContract")
public R dispatcherContract(@RequestBody List<String> idList) {
return tEmployeeContractPreService.dispatcherContract(idList);
return tEmployeeContractPreService.dispatcherContract(idList,"1");
}
/**
......
......@@ -60,9 +60,10 @@ public interface TEmployeeContractPreService extends IService<TEmployeeContractP
/**
* 合同待签订信息单个/批量发起签署任务
* @param idList id集合
* @param type 1 手动 2 自动
* @return
*/
R dispatcherContract(List<String> idList);
R dispatcherContract(List<String> idList,String type);
/**
* 合同待签订撤销签署
......
......@@ -34,10 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeContractConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpMainMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
......@@ -102,6 +99,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 缓存信息
private final CacheManager cacheManager;
private final TEmployeeContractPreMapper contractPreMapper;
/**
* 员工合同信息表简单分页查询
*
......@@ -481,6 +480,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
String code = this.getCode(true);
tEmployeeContractInfo.setApplyNo(code);
}
//自动化派单创建人赋值
if (Common.isNotNull(tEmployeeContractInfo.getPreName())) {
tEmployeeContractInfo.setCreateName(tEmployeeContractInfo.getPreName());
tEmployeeContractInfo.setCreateBy("1");
}
baseMapper.insert(tEmployeeContractInfo);
// 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过
......@@ -511,6 +515,19 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(tEmployeeContractInfo.getAttaList()) && Common.isNotNull(tEmployeeContractInfo.getId())) {
this.updateFileMainId(tEmployeeContractInfo);
}
//派单成功更新合同待签订列表数据
//更新合同状态为2线下签待审核
if (Common.isNotNull(tEmployeeContractInfo.getPreId())) {
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getId, tEmployeeContractInfo.getPreId())
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.TWO_STRING);
contractPre.setContractId(tEmployeeContractInfo.getId());
contractPreMapper.updateById(contractPre);
}
}
} else {
// 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过
this.judgeAuditStatus(tEmployeeContractInfo, user);
......@@ -595,6 +612,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TEmployeeContractAudit audit = new TEmployeeContractAudit();
if (CommonConstants.ONE_INT == tEmployeeContractInfo.getAuditStatus()) {
audit.setRootName("提交申请");
if (Common.isNotNull(tEmployeeContractInfo.getPreName())) {
audit.setCreateName(tEmployeeContractInfo.getPreName());
audit.setCreateBy("1");
}
}
if (CommonConstants.dingleDigitIntArray[2] == tEmployeeContractInfo.getAuditStatus()) {
audit.setRootName("合同审核");
......@@ -718,7 +739,6 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return R.failed("不是待审核状态!");
}
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[2]) {
// 非作废、终止,本条变为在用
if (Common.isEmpty(contractInfo.getSituation())
|| (!EmployeeConstants.SITUATION_SIX.equals(contractInfo.getSituation())
......@@ -842,6 +862,26 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
}
//更新合同状态为4线下签待归档
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, contractInfo.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.FOUR_STRING);
contractPreMapper.updateById(contractPre);
}
}
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[3]) {
//更新合同状态为3线下签审核不通过
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, contractInfo.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.THREE_STRING);
contractPreMapper.updateById(contractPre);
}
}
tEmployeeContractInfo.setAuditUserName(user.getNickname());
tEmployeeContractInfo.setContractNo(contractInfo.getContractNo());
......@@ -942,6 +982,15 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeContractInfo.setIsFile(CommonConstants.ONE_STRING);
}
this.updateById(tEmployeeContractInfo);
//更新合同状态为4线下签待归档
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, tEmployeeContractInfo.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.FOUR_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.NINE_STRING);
contractPreMapper.updateById(contractPre);
}
return R.ok();
}
return R.failed("参数不可为空");
......@@ -1870,6 +1919,26 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
}
//更新合同状态为4线下签待归档
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, contract.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.FOUR_STRING);
contractPreMapper.updateById(contractPre);
}
}
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[3]) {
//更新合同状态为3线下签审核不通过
TEmployeeContractPre contractPre = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getContractId, contract.getId())
.eq(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(contractPre)) {
contractPre.setProcessStatus(CommonConstants.THREE_STRING);
contractPreMapper.updateById(contractPre);
}
}
// 不是待提交,记录审核记录
this.setAuditInfo(tEmployeeContractInfo);
......
......@@ -36,10 +36,8 @@ import org.springframework.web.client.RestTemplate;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
......@@ -257,7 +255,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
}
@Override
public R dispatcherContract(List<String> idList) {
public R dispatcherContract(List<String> idList,String type) {
List<TEmployeeContractPre> contractPreList = baseMapper.selectList(Wrappers.<TEmployeeContractPre>query()
.lambda().in(TEmployeeContractPre::getId, idList)
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus));
......@@ -283,24 +281,22 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
//调用批量派单接口100条处理一次,同原合同派单保持一致
List<ErrorMessage> errorMessageList = new ArrayList<>();
contractInfoService.importContract(disList, errorMessageList);
List<String> idUpdList = disList.stream().map(EmployeeContractVO::getId).collect(Collectors.toList());
if (errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) {
//更新合同状态为2线下签待审核
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TEmployeeContractPre::getId, idUpdList)
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus)
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.TWO_STRING);
// 执行更新操作
this.update(updateWrapper);
} else {
if (!errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) {
errorMessageListAll.addAll(errorMessageList);
//更新合同状态为5发起失败
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TEmployeeContractPre::getId, idUpdList)
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus)
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.FIVE_STRING);
// 执行更新操作
this.update(updateWrapper);
for (ErrorMessage errorMessage : errorMessageList) {
if (!errorMessage.getMessage().equals(CommonConstants.SAVE_SUCCESS)) {
EmployeeContractVO contractVO = disList.stream().filter(vo -> Objects.equals(vo.getRowIndex(), errorMessage.getLineNum())).collect(Collectors.toList()).get(0);
LambdaUpdateWrapper<TEmployeeContractPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TEmployeeContractPre::getId, contractVO.getPreId())
.in(TEmployeeContractPre::getProcessStatus, CommonConstants.socialInfoStatus)
.set(TEmployeeContractPre::getProcessStatus, CommonConstants.FIVE_STRING)
.set(TEmployeeContractPre::getErrorInfo, errorMessage.getMessage())
.set(TEmployeeContractPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
// 执行更新操作
this.update(updateWrapper);
}
}
}
}
}
......@@ -406,7 +402,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
List<String> unConfirmList = baseMapper.getAllUnDisData();
if (null != unConfirmList && !unConfirmList.isEmpty()) {
try {
this.dispatcherContract(unConfirmList);
this.dispatcherContract(unConfirmList,"2");
} catch (Exception e) {
log.error("执行异常", e);
}
......
......@@ -264,7 +264,7 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
public R sendOfferAlert(TGzOfferInfoVo tGzOfferInfo) {
//获取所有满足条件的未发送offer提醒的数据
if (Common.isNotNull(tGzOfferInfo)) {
tGzOfferInfo.setOfferSendStatus(CommonConstants.ONE_STRING);
tGzOfferInfo.setOfferStatus(CommonConstants.FOUR_STRING);
List<TGzOfferInfoVo> offerList = baseMapper.getTGzOfferInfoSendAlertList(tGzOfferInfo);
if (Common.isNotNull(offerList) && !offerList.isEmpty()) {
if (Common.isNotNull(offerList) && offerList.size() >200) {
......
......@@ -22,6 +22,7 @@
<result property="signType" column="sign_type"/>
<result property="signFlag" column="sign_flag"/>
<result property="errorInfo" column="error_info"/>
<result property="errorTime" column="error_time"/>
<result property="fadadaTemplate" column="fadada_template"/>
<result property="dataSource" column="data_source"/>
<result property="expectedCollectionTime" column="expected_collection_time"/>
......@@ -145,7 +146,7 @@
a.create_name,
a.create_time,
a.update_by,a.contract_term,a.sign_flag,a.error_info,a.contract_id,a.revoke_reason,
a.working_hours,a.working_reward,a.DISPATCH_PERIOD_YEAR,a.DISPATCH_PERIOD_MONTH
a.working_hours,a.working_reward,a.DISPATCH_PERIOD_YEAR,a.DISPATCH_PERIOD_MONTH,a.error_time
</sql>
<sql id="tEmployeeContractPre_where">
<if test="tEmployeeContractPre != null">
......@@ -452,7 +453,8 @@
null remark,
null changeContractAndEmployee,
a.TRY_PERIOD tryPeriod,
a.id
a.id preId,
if(#{type} = '1',concat('手动签署-',a.customer_username),concat('自动化签署-',a.customer_username)) preName
FROM t_employee_contract_pre a,(select @i:=0) as itable
<where>
1=1
......
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