| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.ss.usermodel.DateUtil; |
| | | import org.flowable.engine.HistoryService; |
| | | import org.flowable.engine.RuntimeService; |
| | | import org.flowable.engine.history.HistoricProcessInstance; |
| | | import org.flowable.engine.runtime.ProcessInstance; |
| | | import org.flowable.variable.api.event.FlowableVariableEvent; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.mdm.basesetting.machine.entity.Machine; |
| | | import org.springblade.mdm.basesetting.machine.service.MachineService; |
| | | import org.springblade.mdm.commons.service.ParamService; |
| | | 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.flow.entity.TaskDispatch; |
| | | import org.springblade.mdm.flow.service.ApproveInfoQueryService; |
| | | import org.springblade.mdm.flow.service.FlowProgramProperties; |
| | |
| | | @Autowired |
| | | private MachineService machineService; |
| | | @Autowired |
| | | private TaskDispatchService taskDispatchService; |
| | | |
| | | private HistoryService historyService; |
| | | @Autowired |
| | | private RuntimeService runtimeService; |
| | | @Autowired |
| | | private TaskDispatchStatMapper taskDispatchStatMapper; |
| | | |
| | |
| | | |
| | | IPage<TaskDispatchStatVO> voPage = taskDispatchStatMapper.pageQuery(Condition.getPage(queryVO),queryVO); |
| | | |
| | | voPage.getRecords().forEach(vo -> |
| | | { |
| | | HistoricProcessInstance hisInst = historyService.createHistoricProcessInstanceQuery().processInstanceId(vo.getProcessInstanceId()).singleResult(); |
| | | if(hisInst != null){ |
| | | vo.setProgrammerName(userCommonService.getUserNameById(Func.toLong(hisInst.getProcessVariables().get(FlowVariableContants.PROGRAMMER)))); |
| | | } |
| | | |
| | | |
| | | if(vo.getCureTime() == null){ |
| | | ProcessInstance runInst = runtimeService.createProcessInstanceQuery().processInstanceId(vo.getProcessInstanceId()).singleResult(); |
| | | if(runInst == null || runInst.isEnded()){ |
| | | vo.setStatus(2);//固化中 |
| | | }else{ |
| | | vo.setStatus(1);//试切中 |
| | | } |
| | | }else{ |
| | | vo.setStatus(3);//已固化 |
| | | } |
| | | }); |
| | | return voPage; |
| | | } |
| | | } |