| | |
| | | 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; |
| | | |
| | | /** |
| | | * 程序节点 |
| | | * |
| | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ProgramFlowStatusQueryService { |
| | | private final RuntimeService runtimeService; |
| | | |
| | | private final ApproveRecordService approveRecordService; |
| | | private final HistoryService historyService; |
| | | public int queryFlowStatus(String processInstanceId) { |
| | | |
| | | //List<ApproveRecord> records = approveRecordService.lambdaQuery().eq(ApproveRecord::getNcProgramId, ncPogramId).orderByDesc(ApproveRecord::getCreateTime).last("limit 1").list(); |
| | | |
| | | if(processInstanceId == null){ |
| | | return 0; |
| | | } |
| | | //String processInstanceId = records.get(0).getProcessInstanceId(); |
| | | |
| | | int status = 0; |
| | | int status; |
| | | HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() |
| | | .processInstanceId(processInstanceId) |
| | | .singleResult(); |