更新合同:模板实例ID更新为null

This commit is contained in:
guojunyun
2025-10-30 16:12:55 +08:00
parent 172fa2be8e
commit 3b41c22f8a

View File

@@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.service.contract;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
@@ -921,6 +922,12 @@ public class ContractServiceImpl implements ContractService {
// 更新合同主信息
contractMainMapper.updateById(newContractMainDO);
// 模板实例ID更新为null
if (newContractMainDO.getInstanceId() == null) {
contractMainMapper.update(new LambdaUpdateWrapper<>(ContractMainDO.class)
.set(ContractMainDO::getInstanceId, null)
.eq(ContractMainDO::getId, newContractMainDO.getId()));
}
if (DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(newContractMainDO.getStatus())) {
// 执行中合同重新提交erp