yangys
2025-08-14 a049dda2f63d59f5092994b44387fe0aa889d375
blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/service/ProgramFlowStatusQueryService.java
@@ -4,20 +4,8 @@
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.springblade.core.mp.base.BizServiceImpl;
import org.springblade.core.tool.utils.Func;
import org.springblade.mdm.flow.entity.ApproveRecord;
import org.springblade.mdm.flow.service.ApproveRecordService;
import org.springblade.mdm.program.entity.NcNode;
import org.springblade.mdm.program.mapper.NcNodeMapper;
import org.springblade.mdm.program.vo.NcNodeVO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * 程序节点
 *
@@ -27,20 +15,12 @@
@Service
@AllArgsConstructor
public class ProgramFlowStatusQueryService {
   private final RuntimeService runtimeService;
   private final ApproveRecordService approveRecordService;
   private final HistoryService historyService;
   public int queryFlowStatus(Long ncPogramId) {
      List<ApproveRecord> records = approveRecordService.lambdaQuery().eq(ApproveRecord::getNcProgramId, ncPogramId).orderByDesc(ApproveRecord::getCreateTime).last("limit 1").list();
      if(records.isEmpty()){
   public int queryFlowStatus(String processInstanceId) {
      if(processInstanceId == null){
         return 0;
      }
      String processInstanceId = records.get(0).getProcessInstanceId();
      int status = 0;
      int status;
      HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
         .processInstanceId(processInstanceId)
         .singleResult();