From a3a9933cf1b49006edf470615236f94ebdaa4cb9 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期三, 03 九月 2025 17:04:24 +0800
Subject: [PATCH] 增加车床程序处理;退回改为实际编程员
---
blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/execute/TryFlowCompleteService.java | 59 +++++++++++++++++++++++++++++++++++------------------------
1 files changed, 35 insertions(+), 24 deletions(-)
diff --git a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/execute/TryFlowCompleteService.java b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/execute/TryFlowCompleteService.java
index 6d00bcc..0884332 100644
--- a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/execute/TryFlowCompleteService.java
+++ b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/execute/TryFlowCompleteService.java
@@ -4,17 +4,17 @@
import org.flowable.task.api.Task;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
-import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.mdm.basesetting.machine.entity.Machine;
+import org.springblade.mdm.basesetting.machine.service.MachineService;
+import org.springblade.mdm.commons.service.ParamService;
import org.springblade.mdm.flow.constants.FlowContants;
+import org.springblade.mdm.flow.constants.FlowVariableContants;
import org.springblade.mdm.flow.service.FlowCommonService;
import org.springblade.mdm.flow.service.FlowProgramFileService;
import org.springblade.mdm.flow.service.FlowProgramProperties;
-import org.springblade.mdm.program.entity.NcNode;
-import org.springblade.mdm.program.service.NcNodeAutoCreateService;
-import org.springblade.mdm.program.service.NcNodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -28,12 +28,13 @@
public class TryFlowCompleteService extends AbstractFlowCompleteService {
@Autowired
private FlowProgramFileService flowProgramFileService;
+
@Autowired
- private NcNodeService ncNodeService;
- @Autowired
- private NcNodeAutoCreateService ncNodeAutoCreateService;
+ private ParamService paramService;
@Autowired
private FlowCommonService flowCommonService;
+ @Autowired
+ private MachineService machineService;
@Transactional
@Override
@@ -41,8 +42,18 @@
Task task = currentTask(taskId);
String operateResult = this.getApproveResult(variables);
- if(task.getTaskDefinitionKey().equals("programmingTask")) {//缂栧埗鑺傜偣
- flowProgramFileService.checkProgramFiles(processInstanceId,FlowContants.Y.equals(operateResult));
+ FlowProgramProperties props = flowCommonService.getProgramProperties(processInstanceId);
+ if(!variables.containsKey("assignee")) {
+ throw new ServiceException("璇锋寚瀹氭祦绋嬩笅涓�姝ュ鐞嗕汉");
+ }
+
+ if(task.getTaskDefinitionKey().equals("programmingTask") ) {//缂栧埗鑺傜偣
+ //璁板綍瀹為檯缂栫▼鍛�
+ variables.put(FlowVariableContants.ACT_PROGRAMMER,Func.toStr(AuthUtil.getUserId()));
+
+ if(this.needUploadProgramFile(props.getMachineCode())) {
+ flowProgramFileService.checkProgramFiles(processInstanceId, FlowContants.Y.equals(operateResult));
+ }
}
if (StringUtil.isNoneBlank(processInstanceId, comment)) {
taskService.addComment(taskId, processInstanceId, comment);
@@ -53,30 +64,30 @@
}
variables.put(FlowContants.LAST_STEP_USER_NICKNAME, AuthUtil.getNickName());
- if(!variables.containsKey("assignee")) {
- throw new ServiceException("璇锋寚瀹氭祦绋嬩笅涓�姝ュ鐞嗕汉");
- }
+
addApproveRecord(taskId,comment,variables);
- if(task.getTaskDefinitionKey().equals("approveTask") && FlowContants.Y.equals(operateResult)) {
- //璇曞垏娴佺▼锛屾垨鑰� 鍋忕娴佺▼ 楂樺笀閫氳繃鐨勬椂鍊欏垱寤鸿妭鐐�
- //createProgramNodes(processInstanceId);
- }
variables.remove(FlowContants.PROCESS_EDITION);//涓嶈鍗囩増浜�
- //if(!"confirmIsUseableTask".equals(task.getTaskDefinitionKey())){
+
if("confirmIsUseableTask".equals(task.getTaskDefinitionKey())){
- //宸ュ簭鐗堟涓嶄竴鑷达紝骞朵笖瀹℃牳閫氳繃锛堝彲鐢級鏄紝鎵嶆洿鏂颁负鏂扮殑versionNumber
- //FlowProgramProperties progProperties = flowCommonService.getProgramProperties(processInstanceId);
+
variables.put(FlowContants.CURE_PROGRAM_USEABLE,operateResult);
- //if(FlowContants.Y.equals(operateResult) && FlowContants.N.equals(progProperties.getIsProcessEditionSame())) {
- //纭绋嬪簭鍙敤 涓� 宸ュ簭鐗堟涓嶄竴鑷达紝杩涘叆鏍″銆傝繖閲岄渶瑕佸崌绾х▼搴忕殑鐗堟湰鍙�
- // Long curedNodeId = progProperties.getCuredNodeId();
- // ncNodeService.upgradeVersionNumber(curedNodeId);
- //}
}
taskService.complete(taskId, variables);
}
+ /**
+ * 鏄惁闇�瑕佷笂浼犳枃浠讹紙杞﹀簥涓嶉渶瑕侊級
+ * @param machineCode 鏈哄簥缂栫爜
+ * @return 鏄惁闇�瑕佷笂浼�
+ */
+ boolean needUploadProgramFile(String machineCode){
+ boolean need;
+ Machine machine = machineService.getByCode(machineCode);
+ String turning = paramService.turninngValue();
+ need = !StringUtils.equals(turning,machine.getMachineSpec());
+ return need;
+ }
}
--
Gitblit v1.9.3