yangys
2025-09-13 3ffe33aaa24386337e3638558eca731c62f25521
blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/FlowCommonService.java
@@ -13,6 +13,7 @@
import org.springblade.mdm.basesetting.machine.entity.Machine;
import org.springblade.mdm.basesetting.producedivision.entity.ProduceDivision;
import org.springblade.mdm.basesetting.producedivision.service.ProduceDivisionService;
import org.springblade.mdm.commons.service.UserCommonService;
import org.springblade.mdm.flow.constants.FlowContants;
import org.springblade.mdm.flow.constants.FlowVariableContants;
import org.springblade.mdm.program.entity.NcNode;
@@ -32,7 +33,7 @@
   private final ProduceDivisionService produceDivisionService;
   private final NodeDeptQueryService nodeDeptQueryService;
   private final MachineService machineService;
   private final IUserClient userClient;
   private final UserCommonService userCommonService;
   /**
    * 根据流程实例id获取definitionKey
    * @param processInstanceId
@@ -80,6 +81,11 @@
      return programProperties;
   }
   /**
    * 从map中赋值流程便利到vo
    * @param programProperties vo
    * @param vars 变量map
    */
   void copyFlowPropertiesFromMap(FlowProgramProperties programProperties,Map<String, Object> vars){
      programProperties.setTitle(String.valueOf(vars.get(FlowContants.TITLE)));
@@ -115,7 +121,12 @@
      programProperties.setCheckerId(Func.toLong(vars.get(FlowContants.CHECKER)));
      programProperties.setSeniorId(Func.toLong(vars.get(FlowContants.SENIOR)));
      programProperties.setProgramNo(programProperties.getDrawingNo()+"-"+programProperties.getProcessNo()+"-"+programProperties.getProcessEdition());
      programProperties.setActProgrammerId(Func.toLong(vars.get(FlowVariableContants.ACT_PROGRAMMER)));
      programProperties.setActCheckerId(Func.toLong(vars.get(FlowVariableContants.ACT_CHECKER)));
      programProperties.setActSeniorId(Func.toLong(vars.get(FlowVariableContants.ACT_SENIOR)));
      programProperties.setProgrammerName(Func.toStr(vars.get("programmerName")));
   }
   /**
    * 流程是否在进行
@@ -178,10 +189,7 @@
         vars.put(FlowContants.ASSIGNEE, defaultAssignee);//第一个审批用户:组长
      }
      R<User> programmerResult = userClient.userInfoById(div.getProgrammerId());
      if(programmerResult.isSuccess()) {
         vars.put(FlowContants.PROGRAMMER_NAME, programmerResult.getData().getName());
      }
      vars.put(FlowContants.PROGRAMMER_NAME, userCommonService.getUserNameById(div.getProgrammerId()));
      return div;
   }