yangys
2025-08-24 4f118b548e5bc741e372fdcc035bb23f9e0ce0bb
blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/execute/TryFlowCompleteService.java
@@ -42,7 +42,7 @@
      String operateResult = this.getApproveResult(variables);
      if(task.getTaskDefinitionKey().equals("programmingTask")) {//编制节点
         flowProgramFileService.checkProgramFiles(processInstanceId,"Y".equals(operateResult));
         flowProgramFileService.checkProgramFiles(processInstanceId,FlowContants.Y.equals(operateResult));
      }
      if (StringUtil.isNoneBlank(processInstanceId, comment)) {
         taskService.addComment(taskId, processInstanceId, comment);
@@ -59,6 +59,7 @@
      addApproveRecord(taskId,comment,variables);
      //在编制任务时,创建节点(没有节点则创建,有就直接使用
      /*
      if(task.getTaskDefinitionKey().equals("programmingTask") && FlowContants.Y.equals(operateResult)) {
         FlowProgramProperties progProperties = flowCommonService.getProgramProperties(processInstanceId);
         ncNodeAutoCreateService.createNodeTreeWithProgram(progProperties);
@@ -71,26 +72,28 @@
            curedProgramPackage.setIsLastEdition(0);
            curedProgramPackage.setIsLocked(1);
            ncNodeService.updateById(curedProgramPackage);
         }
      }*/
      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)) {
            if(FlowContants.N.equals(progProperties.getIsProcessEditionSame())) {
               //确认程序可用 且 工序版次不一致,进入校对。这里需要升级程序的版本号
               Long curedNodeId = progProperties.getCuredNodeId();
               ncNodeService.upgradeVersionNumber(curedNodeId);
            }
         if(FlowContants.Y.equals(operateResult) && FlowContants.N.equals(progProperties.getIsProcessEditionSame())) {
            //确认程序可用 且 工序版次不一致,进入校对。这里需要升级程序的版本号
            Long curedNodeId = progProperties.getCuredNodeId();
            ncNodeService.upgradeVersionNumber(curedNodeId);
         }
      }
      taskService.complete(taskId, variables);
   }
}