From a5f944c2bc0107e5df936937f1c33e5e03eb8fed Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 06 九月 2025 19:15:48 +0800
Subject: [PATCH] 解锁增加解锁原因和展示

---
 blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/excution/StartDispatcher.java |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/excution/StartDispatcher.java b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/excution/StartDispatcher.java
index 55b0648..a3b8bf8 100644
--- a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/excution/StartDispatcher.java
+++ b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/excution/StartDispatcher.java
@@ -1,6 +1,5 @@
 package org.springblade.mdm.flow.excution;
 
-import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
 import org.flowable.engine.IdentityService;
@@ -8,7 +7,6 @@
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.mdm.basesetting.producedivision.entity.ProduceDivision;
-import org.springblade.mdm.basesetting.producedivision.service.ProduceDivisionService;
 import org.springblade.mdm.flow.constants.FlowContants;
 import org.springblade.mdm.flow.entity.FlowProgramFile;
 import org.springblade.mdm.flow.service.FlowCommonService;
@@ -23,7 +21,6 @@
 import org.springframework.stereotype.Service;
 import org.flowable.engine.RuntimeService;
 import org.springframework.transaction.annotation.Transactional;
-
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -31,16 +28,13 @@
 @AllArgsConstructor
 @Service("startDispatcher")
 public class StartDispatcher  {
-
 	private final RuntimeService runtimeService;
-	private final AutoAssignUsersService autoAssignUsersService;
 
 	private final IdentityService identityService;
 	private final NcNodeService ncNodeService;
 
 	private final FlowProgramFileService flowProgramFileService;
 	private final NodeDeptQueryService nodeDeptQueryService;
-	private final ProduceDivisionService produceDivisionService;
 	private final FlowCommonService flowCommonService;
 
 	/**
@@ -86,13 +80,15 @@
 		NcNode curedProgramPackage = null;
 		if(!startVO.isTemporaryFlow() && !startVO.isDeviationFlow()) {
 			//姝e父娴佺▼(闈炰复鏃舵祦绋�) 涓斾笉鏄� 鍋忕鍗�,鎵嶅尮閰嶅浐鍖栫▼搴�
-			curedProgramPackage = ncNodeService.getCuredProgramPackage(programPkgName,startVO.getProcessEdition(), startVO.getMachineCode());
+			curedProgramPackage = ncNodeService.getLastCuredProgramPackageWithoutProcessEdition(programPkgName,startVO.getMachineCode());
 			//璁剧疆鏄惁鏈夊浐鍖栫▼搴忔爣璁�
 			vars.put(FlowContants.HAS_CURED_PROGRAM, curedProgramPackage != null ? FlowContants.Y : FlowContants.N);
 			//宸ュ簭鐗堟鏄惁涓�鑷达紝鏄惁鍦ㄦ湁鏁堟湡鍐�
-			if (curedProgramPackage != null && Func.isBlank(startVO.getDeviation())) {//鍋忕鍗曚紭鍏堬紝濡傛灉鏈夊亸绂诲崟锛岄偅涔堟壘鍒板浐鍖栫▼搴忕殑涔熶笉绠楀浐鍖栦簡
+			if (curedProgramPackage != null) {
 				vars.put(FlowContants.CURED_NODE_ID, curedProgramPackage.getId());
-				vars.put(FlowContants.IS_PROCESS_EDITION_SAME, StringUtils.equals(curedProgramPackage.getProcessEdition(), startVO.getProcessEdition()) ? "Y" : "N");
+				vars.put(FlowContants.CURED_LOCKED, curedProgramPackage.hasLocked()?FlowContants.Y:FlowContants.N);
+				vars.put(FlowContants.IS_PROCESS_EDITION_SAME, StringUtils.equals(curedProgramPackage.getProcessEdition(), startVO.getProcessEdition()) ? FlowContants.Y : FlowContants.N);
+				vars.put("curedProcessEdition", curedProgramPackage.getProcessEdition());
 				vars.put(FlowContants.VALIDITY_PERIOD, curedProgramPackage.withinValidityPeriod() ? FlowContants.Y : FlowContants.N);
 			} else {
 				vars.put(FlowContants.IS_PROCESS_EDITION_SAME, FlowContants.Y);
@@ -100,7 +96,7 @@
 			}
 
 		}else{
-			//涓存椂娴佺▼锛屼笉绠″浐鍖�
+			//涓存椂娴佺▼/鍋忕鍗曪紝涓嶅尮閰嶅浐鍖栫▼搴�
 			vars.put(FlowContants.HAS_CURED_PROGRAM,FlowContants.N);
 		}
 		String myProcessName = "璇曞垏涓嬪彂娴佺▼";
@@ -129,7 +125,6 @@
 			curedProgramPackage.setProcessInstanceId(inst.getProcessInstanceId());
 			ncNodeService.updateById(curedProgramPackage);
 		}
-
 
 		return inst.getProcessInstanceId();
 	}

--
Gitblit v1.9.3