| | |
| | | private AvoidWaveCalculator avoidWaveCalculator; |
| | | @Autowired |
| | | private PatrolService patrolService; |
| | | @Autowired |
| | | private StaReserveService staReserveService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:agv:update')") |
| | | @OperationLog("Locate All Agv") |
| | |
| | | if (null == destSta) { |
| | | return R.error(); |
| | | } |
| | | if (!destSta.getStaSts().equals(StaStsType.IDLE.val())) { |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " 不是无货状态"); |
| | | } |
| | | destSta.setStaSts(StaStsType.READY_RELEASE.val()); |
| | | destSta.setUpdateTime(now); |
| | | if (!staService.updateById(destSta)) { |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " 修改站点状态失败"); |
| | | if (null == staReserveService.reserveStaIn(destSta, task, 1)) { |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " 预约失败"); |
| | | } |
| | | |
| | | // task |
| | |
| | | if (null == oriSta) { |
| | | return R.error(); |
| | | } |
| | | if (!oriSta.getStaSts().equals(StaStsType.STOCK.val())) { |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 不是有货状态"); |
| | | } |
| | | oriSta.setStaSts(StaStsType.READY_TAKE.val()); |
| | | oriSta.setUpdateTime(now); |
| | | if (!staService.updateById(oriSta)) { |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 修改站点状态失败"); |
| | | if (null == staReserveService.reserveStaOut(oriSta, task, 1)) { |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 预约失败"); |
| | | } |
| | | |
| | | // destLoc |
| | |
| | | if (null == oriSta) { |
| | | return R.error(); |
| | | } |
| | | if (!oriSta.getStaSts().equals(StaStsType.STOCK.val())) { |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 不是有货状态"); |
| | | } |
| | | oriSta.setStaSts(StaStsType.READY_TAKE.val()); |
| | | oriSta.setUpdateTime(now); |
| | | if (!staService.updateById(oriSta)) { |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 修改站点状态失败"); |
| | | if (null == staReserveService.reserveStaOut(oriSta, task, 1)) { |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 预约失败"); |
| | | } |
| | | |
| | | // destSta |
| | |
| | | if (null == destSta) { |
| | | return R.error(); |
| | | } |
| | | if (!destSta.getStaSts().equals(StaStsType.IDLE.val())) { |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " 不是无货状态"); |
| | | } |
| | | destSta.setStaSts(StaStsType.READY_RELEASE.val()); |
| | | destSta.setUpdateTime(now); |
| | | if (!staService.updateById(destSta)) { |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " 修改站点状态失败"); |
| | | if (null == staReserveService.reserveStaIn(destSta, task, 1)) { |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " 预约失败"); |
| | | } |
| | | |
| | | // task |