| | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.flowable.engine.delegate.DelegateExecution; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.mdm.flow.excution.dispatch.FinishDataHandler; |
| | | import org.springblade.mdm.flow.excution.events.CureFinishedEvent; |
| | | import org.springblade.mdm.flow.service.FlowCommonService; |
| | | import org.springblade.mdm.flow.service.FlowProgramFileService; |
| | | import org.springblade.mdm.flow.service.FlowProgramProperties; |
| | | import org.springblade.mdm.program.entity.NcNode; |
| | | import org.springblade.mdm.program.service.NcNodeAutoCreateService; |
| | | import org.springblade.mdm.program.service.NcNodeHisService; |
| | | import org.springblade.mdm.program.service.NcNodeService; |
| | | import org.springblade.system.feign.ISysClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | log.info("执行固化程序任务服务,流程实例id={}", execution.getProcessInstanceId()); |
| | | Date time = DateUtil.now(); |
| | | //固化程序检查有效期, |
| | | dealWithNode(execution.getProcessInstanceId()); |
| | | NcNode node = dealWithNode(execution.getProcessInstanceId()); |
| | | |
| | | nodeHisService.mergeNodeToHisGeTime(time); |
| | | |
| | | publishEvent(node.getProgramNo()); |
| | | |
| | | } |
| | | |
| | | void publishEvent(String programNo) { |
| | | //TaskDispatch dispatch = taskDispatchService.getByProgramNo(programNo); |
| | | CureFinishedEvent event = new CureFinishedEvent("curefinish",programNo); |
| | | SpringUtil.publishEvent(event); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param processInstanceId 流程实例id |
| | | */ |
| | | void dealWithNode(String processInstanceId) throws IOException { |
| | | NcNode dealWithNode(String processInstanceId) throws IOException { |
| | | //程序包节点和下属程序节点(包括历史节点非最新版本的)从试切挪到固化下面 |
| | | //程序包节点 设置未已固化 |
| | | NcNode pkgNode = nodeService.lambdaQuery().eq(NcNode::getProcessInstanceId, processInstanceId).one(); |
| | | FlowProgramProperties flowProps = flowCommonService.getProgramProperties(processInstanceId); |
| | | getDataHandler(pkgNode).handleData(flowProps); |
| | | |
| | | return pkgNode; |
| | | } |
| | | |
| | | /** |