From da8d77142f64de334c69ad0f86b3b1a1266c53a3 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Sat, 7 Mar 2026 10:09:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E4=BA=A7=E6=97=A5=E6=9C=9F=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ErfExpApplyServiceImpl.java | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/xujie/sys/modules/erf/service/impl/ErfExpApplyServiceImpl.java b/src/main/java/com/xujie/sys/modules/erf/service/impl/ErfExpApplyServiceImpl.java index 2ea87db7..1ca17c12 100644 --- a/src/main/java/com/xujie/sys/modules/erf/service/impl/ErfExpApplyServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/erf/service/impl/ErfExpApplyServiceImpl.java @@ -544,50 +544,49 @@ public class ErfExpApplyServiceImpl extends ServiceImpl() - .eq("apply_no", nodeInstance.getApplyNo()) - .eq("node_code", nodeInstance.getNodeCode()) - .eq("attempt_no", nodeInstance.getAttemptNo())); - - // 将同一申请单"计划员排产"节点中其他仍处于待审核的节点标记为已跳过 - // (多计划员场景:任意一人排产后,其余人不可再排产) - List otherPendingNodes = erfFlowNodeInstanceMapper.selectList( - new QueryWrapper() - .eq("apply_no", data.getApplyNo()) - .eq("node_code", "计划员排产") - .eq("status", "待审核") - ); - for (ErfFlowNodeInstance other : otherPendingNodes) { - other.setStatus("已跳过"); - other.setComment("其他计划员已完成排产,本任务自动跳过"); - other.setCompleteTime(new Date()); - erfFlowNodeInstanceMapper.update(other, new QueryWrapper() - .eq("apply_no", other.getApplyNo()) - .eq("node_code", other.getNodeCode()) - .eq("attempt_no", other.getAttemptNo())); - } - if (!otherPendingNodes.isEmpty()) { - log.info("已将 {} 个其他计划员排产节点标记为已跳过", otherPendingNodes.size()); - } + nodeInstance.setStatus("已完成"); + nodeInstance.setAssigneeUserId(data.getPlannerUserId()); + nodeInstance.setAssigneeName(data.getPlannerName()); + nodeInstance.setComment("排产完成"); + nodeInstance.setCompleteTime(new Date()); - // 调用流程引擎自动流转到下一节点 - erfFlowEngineService.moveToNextNode(data.getApplyNo(), "计划员排产", null); - log.info("排产完成,已自动流转到下一节点"); - } + // 使用联合主键更新 + erfFlowNodeInstanceMapper.update(nodeInstance, new QueryWrapper() + .eq("apply_no", nodeInstance.getApplyNo()) + .eq("node_code", nodeInstance.getNodeCode()) + .eq("attempt_no", nodeInstance.getAttemptNo())); + + // 将同一申请单"计划员排产"节点中其他仍处于待审核的节点标记为已跳过 + // (多计划员场景:任意一人排产后,其余人不可再排产) + List otherPendingNodes = erfFlowNodeInstanceMapper.selectList( + new QueryWrapper() + .eq("apply_no", data.getApplyNo()) + .eq("node_code", "计划员排产") + .eq("status", "待审核") + ); + for (ErfFlowNodeInstance other : otherPendingNodes) { + other.setStatus("已跳过"); + other.setComment("其他计划员已完成排产,本任务自动跳过"); + other.setCompleteTime(new Date()); + erfFlowNodeInstanceMapper.update(other, new QueryWrapper() + .eq("apply_no", other.getApplyNo()) + .eq("node_code", other.getNodeCode()) + .eq("attempt_no", other.getAttemptNo())); + } + if (!otherPendingNodes.isEmpty()) { + log.info("已将 {} 个其他计划员排产节点标记为已跳过", otherPendingNodes.size()); + } + + // 调用流程引擎自动流转到下一节点 + erfFlowEngineService.moveToNextNode(data.getApplyNo(), "计划员排产", null); + log.info("排产完成,已自动流转到下一节点"); log.info("计划员排产完成"); }