From 3b41c22f8ad3c5a2e88bdb466b1fb9cee2ef07d2 Mon Sep 17 00:00:00 2001 From: guojunyun Date: Thu, 30 Oct 2025 16:12:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=90=88=E5=90=8C=EF=BC=9A?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AE=9E=E4=BE=8BID=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=BAnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/contract/ContractServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractServiceImpl.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractServiceImpl.java index f620cf0..f02f2c7 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractServiceImpl.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractServiceImpl.java @@ -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