| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.engine.HistoryService; |
| | | import org.flowable.engine.history.HistoricProcessInstance; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BizServiceImpl; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.mdm.basesetting.machine.service.MachineService; |
| | | import org.springblade.mdm.basesetting.machine.entity.Machine; |
| | | import org.springblade.mdm.flow.constants.FlowContants; |
| | | import org.springblade.mdm.flow.entity.FlowProgramFile; |
| | | import org.springblade.mdm.flow.service.FlowProgramFileService; |
| | | import org.springblade.mdm.program.entity.NcNode; |
| | |
| | | private final NcNodeHisService ncNodeHisService; |
| | | private final OssTemplate ossTemplate; |
| | | private final FlowProgramFileService flowProgramFileService; |
| | | private final ProgramAnnotationService programAnnotationService; |
| | | private final HistoryService historyService; |
| | | |
| | | private final MachineAnnotationConfig annotationConfig; |
| | | /** |
| | |
| | | |
| | | approved.setStatus(NcProgramApproved.STATUS_EXPORTED); |
| | | approvedService.updateById(approved); |
| | | |
| | | NcNode pkgNode = this.ncNodeService.getById(approved.getNcNodeId()); |
| | | if(pkgNode.isDeviationProgram()){ |
| | | //偏离单的程序,如果审批导出记录是解锁形成的,还是需要锁定;普通试切过的,不锁定 |
| | | HistoricProcessInstance hisInst = historyService.createHistoricProcessInstanceQuery().processInstanceId(approved.getProcessInstanceId()).singleResult(); |
| | | if(hisInst != null && hisInst.getProcessDefinitionKey().equals(FlowContants.UNLOCK_PROCESS_KEY)){ |
| | | pkgNode.lock("下发导出锁定"); |
| | | ncNodeService.updateById(pkgNode); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }catch(Exception e){ |