| | |
| | | * 充电 回待机位任务 |
| | | */ |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) // although there is a Transactional here that the lock is isolated, but we can't join the caller's Transactional |
| | | public boolean buildMinorTask(Agv agv, AgvDetail agvDetail, TaskTypeType taskType, String destination) { |
| | | public boolean buildMinorTask(Agv agv, TaskTypeType taskType, String destination, Jam jam) { |
| | | if (Cools.isEmpty(agv, taskType)) { return false; } |
| | | try { |
| | | if (null == agvDetail) { |
| | | agvDetail = agvDetailService.selectByAgvId(agv.getId()); |
| | | } |
| | | AgvDetail agvDetail = agvDetailService.selectByAgvId(agv.getId()); |
| | | if (!agvService.judgeEnable(agv.getId())) { |
| | | return false; |
| | | } |
| | |
| | | } |
| | | if (!segmentService.save(next)) { |
| | | throw new BusinessException("segment failed to save"); |
| | | } else { |
| | | if (null != jam && i == 0) { |
| | | jam.setAvoSeg(next.getId()); |
| | | } |
| | | } |
| | | } |
| | | |