From 360c3ba125ff14aaaf7424e89caee56b1ec8884a Mon Sep 17 00:00:00 2001 From: yinq Date: Thu, 25 Jun 2026 16:42:03 +0800 Subject: [PATCH] =?UTF-8?q?1.1.75=20=E5=90=88=E5=90=8C=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=8F=91=E8=B5=B7=E5=AE=A1=E6=89=B9=E6=B5=81=E7=A8=8B=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/service/impl/ErpContractInfoServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ErpContractInfoServiceImpl.java b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ErpContractInfoServiceImpl.java index 28cf855c..e55cefc9 100644 --- a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ErpContractInfoServiceImpl.java +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ErpContractInfoServiceImpl.java @@ -813,7 +813,7 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService { } /** - * 审批已通过且合同未激活,删除已结束流程实例,清空状态以便重新发起。 + * 审批已通过(可用/已激活)且流程已结束,删除已结束流程实例,清空状态以便重新发起。 */ private boolean resetFinishedContractFlowForResubmit(ErpContractInfoBo bo) { if (bo == null || bo.getContractId() == null) { @@ -823,15 +823,15 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService { if (current == null) { return false; } - if (!OAStatusEnum.COMPLETED.getStatus().equals(current.getContractStatus())) { - return false; - } String wfStatus = remoteWorkflowService.getBusinessStatus(String.valueOf(bo.getContractId())); if (!BusinessStatusEnum.FINISH.getStatus().equals(wfStatus)) { return false; } log.info("合同[{}]重新发起审批:删除已结束流程实例后重新发起", bo.getContractId()); - remoteWorkflowService.deleteInstance(Collections.singletonList(bo.getContractId())); + boolean deleted = remoteWorkflowService.deleteInstance(Collections.singletonList(bo.getContractId())); + if (!deleted) { + throw new ServiceException("清理已完成合同审批流程失败,请稍后重试"); + } bo.setContractStatus(null); bo.setFlowStatus(null); return true;