#
vincentlu
17 小时以前 43412c20ac444392471ea8ea8bc4a93af39efe87
zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java
@@ -75,6 +75,8 @@
    private PatrolService patrolService;
    @Autowired
    private StaReserveService staReserveService;
    @Autowired
    private AgvAreaDispatcher agvAreaDispatcher;
    @PreAuthorize("hasAuthority('manager:agv:update')")
    @OperationLog("Locate All Agv")
@@ -193,6 +195,9 @@
                if (null == endCode) {
                    return R.error();
                }
                if (!agvAreaDispatcher.match(agv.getId(), endCode.getId())) {
                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + endCode.getData());
                }
                if (!taskService.removeById(task.getId())) {
                    throw new BusinessException("failed to remove task");
                }
@@ -222,6 +227,10 @@
                if (null == oriLoc) {
                    return R.error();
                }
                if (!agvAreaDispatcher.match(agv.getId(), oriLoc.getCode())) {
//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + oriLoc.getCode$());
                    throw new BusinessException("AGV【" + agv.getUuid() + "】无法到达起始库位【" + oriLoc.getLocNo() + "】");
                }
                if (!oriLoc.getLocSts().equals(LocStsType.STOCK.val())) {
                    throw new BusinessException("oriLoc:" + oriLoc.getLocNo() + " 不是在库状态");
                }
@@ -240,6 +249,10 @@
                }
                if (null == destLoc) {
                    return R.error();
                }
                if (!agvAreaDispatcher.match(agv.getId(), destLoc.getCode())) {
//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + destLoc.getCode$());
                    throw new BusinessException("AGV【" + agv.getUuid() + "】无法到达目标库位【" + destLoc.getLocNo() + "】");
                }
                if (!destLoc.getLocSts().equals(LocStsType.IDLE.val())) {
                    throw new BusinessException("destLoc:" + destLoc.getLocNo() + " 不是空闲状态");
@@ -267,6 +280,10 @@
                if (null == oriLoc) {
                    return R.error();
                }
                if (!agvAreaDispatcher.match(agv.getId(), oriLoc.getCode())) {
//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + oriLoc.getCode$());
                    throw new BusinessException("AGV【" + agv.getUuid() + "】无法到达起始库位【" + oriLoc.getLocNo() + "】");
                }
                if (!oriLoc.getLocSts().equals(LocStsType.STOCK.val())) {
                    throw new BusinessException("oriLoc:" + oriLoc.getLocNo() + " 不是在库状态");
                }
@@ -285,6 +302,10 @@
                }
                if (null == destSta) {
                    return R.error();
                }
                if (!agvAreaDispatcher.match(agv.getId(), destSta.getCode())) {
//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + destSta.getCode$());
                    throw new BusinessException("AGV【" + agv.getUuid() + "】无法到达目标站点【" + destSta.getStaNo() + "】");
                }
                if (null == staReserveService.reserveStaIn(destSta, task, 1)) {
                    throw new BusinessException("destSta:" + destSta.getStaNo() + " 预约失败");
@@ -308,6 +329,10 @@
                if (null == oriSta) {
                    return R.error();
                }
                if (!agvAreaDispatcher.match(agv.getId(), oriSta.getCode())) {
//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + oriSta.getCode$());
                    throw new BusinessException("AGV【" + agv.getUuid() + "】无法到达起始站点【" + oriSta.getStaNo() + "】");
                }
                if (null == staReserveService.reserveStaOut(oriSta, task, 1)) {
                    throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 预约失败");
                }
@@ -321,6 +346,10 @@
                }
                if (null == destLoc) {
                    return R.error();
                }
                if (!agvAreaDispatcher.match(agv.getId(), destLoc.getCode())) {
//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + destLoc.getCode$());
                    throw new BusinessException("AGV【" + agv.getUuid() + "】无法到达目标库位【" + destLoc.getLocNo() + "】");
                }
                if (!destLoc.getLocSts().equals(LocStsType.IDLE.val())) {
                    throw new BusinessException("destLoc:" + destLoc.getLocNo() + " 不是空闲状态");
@@ -350,6 +379,10 @@
                if (null == oriSta) {
                    return R.error();
                }
                if (!agvAreaDispatcher.match(agv.getId(), oriSta.getCode())) {
//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + oriSta.getCode$());
                    throw new BusinessException("AGV【" + agv.getUuid() + "】无法到达起始站点【" + oriSta.getStaNo() + "】");
                }
                if (null == staReserveService.reserveStaOut(oriSta, task, 1)) {
                    throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 预约失败");
                }
@@ -365,6 +398,10 @@
                if (null == destSta) {
                    return R.error();
                }
                if (!agvAreaDispatcher.match(agv.getId(), destSta.getCode())) {
//                    throw new BusinessException("AGV " + agv.getUuid() + " failed to reach target code " + destSta.getCode$());
                    throw new BusinessException("AGV【" + agv.getUuid() + "】无法到达目标站点【" + destSta.getStaNo() + "】");
                }
                if (null == staReserveService.reserveStaIn(destSta, task, 1)) {
                    throw new BusinessException("destSta:" + destSta.getStaNo() + " 预约失败");
                }