yangys
2025-09-15 7bc1d0f521c1d59246f29bcadcc4343f88ceef1c
blade-service/blade-mdm/src/main/java/org/springblade/mdm/statreport/service/ConfirmTablePrintService.java
@@ -19,6 +19,7 @@
import org.springblade.mdm.commons.contants.DictBizConstants;
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.entity.FlowProgramFile;
import org.springblade.mdm.flow.entity.TaskDispatch;
import org.springblade.mdm.flow.service.ApproveInfoQueryService;
@@ -28,6 +29,8 @@
import org.springblade.mdm.flow.vo.ApproveTableInfo;
import org.springblade.mdm.flow.vo.FlowVO;
import org.springblade.mdm.program.entity.NcNode;
import org.springblade.mdm.program.entity.NcNodeHis;
import org.springblade.mdm.program.service.NcNodeHisService;
import org.springblade.mdm.program.service.NcNodeService;
import org.springblade.mdm.statreport.utils.WordReplaceUtil;
import org.springblade.system.feign.IDictBizClient;
@@ -47,13 +50,14 @@
@Service
@AllArgsConstructor
public class ConfirmTablePrintService {
   private final RuntimeService runtimeService;
   private final IDictBizClient dictBizClient;
   private final HistoryService historyService;
   private final FlowProgramFileService flowProgramFileService;
   private ApproveInfoQueryService approveInfoQueryService;
   private final MachineService machineService;
   private final NcNodeService nodeService;
   private final NcNodeHisService nodeHisService;
   private final ParamService paramService;
   private final TaskDispatchService taskDispatchService;
   private final OssTemplate ossTemplate;
@@ -84,10 +88,15 @@
      machine = machineService.getByCode(machineCode);
      Map<String, String> dataMap = new HashMap<>();
      NcNode node = this.nodeService.getById(props.getNodeId());
      //NcNode node = this.nodeService.getById(props.getNodeId());
      NcNodeHis node = nodeHisService.getById(props.getNodeId());
      TaskDispatch dispatch = taskDispatchService.getByProgramNo(node.getProgramNo());
      dataMap.put("bh",node.getProgramNo());//编号,就是数控程序编号
      if(dispatch == null){
         //防止老数据报错
         dispatch = new TaskDispatch();
      }
      dataMap.put("bh",props.getProgramNo());//编号,就是数控程序编号
      dataMap.put("drawingNo", props.getDrawingNo());
      dataMap.put("processNo", props.getProcessNo());
@@ -121,7 +130,7 @@
      }else{
         dataMap.put("czz", "");
      }
      dataMap.put("programNo",dispatch.getProgramNo());
      dataMap.put("programNo",props.getProgramNo());
      if(StringUtils.isNotBlank(dispatch.getInspector())) {
         dataMap.put("jyy",dispatch.getInspector()+"/"+formatTimeForTable(dispatch.getCheckTime()));//实际检验员和检验时间
@@ -163,7 +172,7 @@
      //固化里路村官
      HistoricProcessInstanceQuery query = this.historyService.createHistoricProcessInstanceQuery().finished().processDefinitionKey(FlowContants.CURE_PROCESS_KEY).includeProcessVariables();
         //.finished() // 只查询已完成的流程.unfinished() // 查询未完成的流程
      query.variableNotExists(FlowContants.EXCEPTION);//非异常流程
      query.variableNotExists(FlowVariableContants.EXCEPTION);//非异常流程
      if(createTimeBegin!=null) {
         query.startedAfter(DateUtil.toDate(createTimeBegin));
      }
@@ -172,7 +181,7 @@
      }
      if(Func.isNotEmpty(drawingNo)) {
         String likeVal = "%" + drawingNo + "%";
         query.variableValueLike(FlowContants.DRAWING_NO,likeVal);
         query.variableValueLike(FlowVariableContants.DRAWING_NO,likeVal);
      }