Commit 3d222678 authored by hongguangwu's avatar hongguangwu

MVP1.7.16-优化代码

parent 5ae55522
......@@ -8,6 +8,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.fasc.open.api.exception.ApiException;
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.entity.*;
......@@ -592,37 +593,51 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
}
TEmployeeContractPre pre;
TEmployeeContractInfo contractInfo;
R<String> result;
for (TEmployeeAutoRegistRevokeVo registRevokeVo : registRevokeVoList) {
pre = baseMapper.selectById(registRevokeVo.getId());
//电子待归档、线下签待归档、已完结的不能撤销签署
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);
tEmployeeContractAuditService.save(audit);
if (pre != null) {
if (Common.isNotNull(pre.getSignType()) && CommonConstants.ZERO_STRING.equals(pre.getSignType())
&& Common.isNotNull(pre.getRequestId())) {
try {
result = fascService.cancelTask(pre.getRequestId());
if (!R.isSuccess(result)) {
// 产品暂未设计失败了怎么做
}
} catch (ApiException e) {
// 产品暂未设计失败了怎么做
}
}
pre.setProcessStatus(CommonConstants.TEN_STRING);
pre.setSignFlag(CommonConstants.ZERO_STRING);
pre.setRevokeReason(registRevokeVo.getReason());
baseMapper.updateById(pre);
}
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.ZERO_INT);
contractInfo.setInUse(CommonConstants.ONE_STRING);
contractInfoService.updateById(contractInfo);
//电子待归档、线下签待归档、已完结的不能撤销签署
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);
tEmployeeContractAuditService.save(audit);
}
pre.setProcessStatus(CommonConstants.TEN_STRING);
pre.setSignFlag(CommonConstants.ZERO_STRING);
pre.setRevokeReason(registRevokeVo.getReason());
baseMapper.updateById(pre);
}
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.ZERO_INT);
contractInfo.setInUse(CommonConstants.ONE_STRING);
contractInfoService.updateById(contractInfo);
}
}
}
}
......
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