Commit 3d222678 authored by hongguangwu's avatar hongguangwu

MVP1.7.16-优化代码

parent 5ae55522
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig; import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
...@@ -592,37 +593,51 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -592,37 +593,51 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
} }
TEmployeeContractPre pre; TEmployeeContractPre pre;
TEmployeeContractInfo contractInfo; TEmployeeContractInfo contractInfo;
R<String> result;
for (TEmployeeAutoRegistRevokeVo registRevokeVo : registRevokeVoList) { for (TEmployeeAutoRegistRevokeVo registRevokeVo : registRevokeVoList) {
pre = baseMapper.selectById(registRevokeVo.getId()); pre = baseMapper.selectById(registRevokeVo.getId());
//电子待归档、线下签待归档、已完结的不能撤销签署 if (pre != null) {
if (Common.isNotNull(pre) && !CommonConstants.NINE_STRING.equals(pre.getProcessStatus()) && if (Common.isNotNull(pre.getSignType()) && CommonConstants.ZERO_STRING.equals(pre.getSignType())
!CommonConstants.FOUR_STRING.equals(pre.getProcessStatus()) && && Common.isNotNull(pre.getRequestId())) {
!CommonConstants.EIGHT_STRING.equals(pre.getProcessStatus())) { try {
//如果不是待确认和待发起,需要记录操作记录 result = fascService.cancelTask(pre.getRequestId());
if (!CommonConstants.ZERO_STRING.equals(pre.getProcessStatus()) && if (!R.isSuccess(result)) {
!CommonConstants.ONE_STRING.equals(pre.getProcessStatus()) && // 产品暂未设计失败了怎么做
Common.isNotNull(pre.getContractId())) { }
TEmployeeContractAudit audit = new TEmployeeContractAudit(); } catch (ApiException e) {
audit.setRootName("撤销签署"); // 产品暂未设计失败了怎么做
audit.setLinkId(pre.getContractId()); }
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
} }
pre.setProcessStatus(CommonConstants.TEN_STRING); //电子待归档、线下签待归档、已完结的不能撤销签署
pre.setSignFlag(CommonConstants.ZERO_STRING); if (Common.isNotNull(pre) && !CommonConstants.NINE_STRING.equals(pre.getProcessStatus()) &&
pre.setRevokeReason(registRevokeVo.getReason()); !CommonConstants.FOUR_STRING.equals(pre.getProcessStatus()) &&
baseMapper.updateById(pre); !CommonConstants.EIGHT_STRING.equals(pre.getProcessStatus())) {
} //如果不是待确认和待发起,需要记录操作记录
if (Common.isNotNull(pre.getContractId())) { if (!CommonConstants.ZERO_STRING.equals(pre.getProcessStatus()) &&
//如果存在合同申请审核数据,将状态更新成待提交 !CommonConstants.ONE_STRING.equals(pre.getProcessStatus()) &&
contractInfo = contractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query() Common.isNotNull(pre.getContractId())) {
.lambda().eq(TEmployeeContractInfo::getId, pre.getContractId()) TEmployeeContractAudit audit = new TEmployeeContractAudit();
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT) audit.setRootName("撤销签署");
.last(CommonConstants.LAST_ONE_SQL)); audit.setLinkId(pre.getContractId());
if (Common.isNotNull(contractInfo)) { audit.setLinkType(CommonConstants.ONE_INT);
contractInfo.setAuditStatus(CommonConstants.ZERO_INT); tEmployeeContractAuditService.save(audit);
contractInfo.setInUse(CommonConstants.ONE_STRING); }
contractInfoService.updateById(contractInfo); 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