#
vincentlu
37 分钟以前 6cbb420754e6e29fa134a6afca4514b8dfd62918
zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java
@@ -171,7 +171,7 @@
        task.setPriority(999);
        task.setIoTime(now);
        task.setStartTime(now);
        task.setMemo("HANDLE");
        task.setMemo("AUTO");
        if (!taskService.save(task)) {
            throw new BusinessException(task.getSeqNum() + "任务保存失败");
        }
@@ -196,6 +196,7 @@
                if (!taskService.removeById(task.getId())) {
                    throw new BusinessException("failed to remove task");
                }
                task = null;
                if (!mainLockWrapService.buildMinorTask(agv.getId(), param.getTaskMode(), endCode.getData(), null)) {
                    return R.error();
                }
@@ -205,6 +206,7 @@
                if (!taskService.removeById(task.getId())) {
                    throw new BusinessException("failed to remove task");
                }
                task = null;
                if (!mainLockWrapService.buildMinorTask(agv.getId(), param.getTaskMode(), null, null)) {
                    return R.error();
                }
@@ -287,12 +289,13 @@
                if (null == staReserveService.reserveStaIn(destSta, task, 1)) {
                    throw new BusinessException("destSta:" + destSta.getStaNo() + " 预约失败");
                }
                // task
                task.setOriLoc(oriLoc.getId());
                task.setOriCode(oriLoc.getCode());
                task.setDestSta(destSta.getId());
                task.setDestCode(destSta.getCode());
                staReserveService.allocateCallBack(task, agv.getId());
                break;
            case STA_TO_LOC:
                // oriSta
@@ -333,6 +336,8 @@
                task.setOriCode(oriSta.getCode());
                task.setDestLoc(destLoc.getId());
                task.setDestCode(destLoc.getCode());
                staReserveService.allocateCallBack(task, agv.getId());
                break;
            case STA_TO_STA:
                // oriSta
@@ -348,6 +353,7 @@
                if (null == staReserveService.reserveStaOut(oriSta, task, 1)) {
                    throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 预约失败");
                }
                // destSta
                if (!Cools.isEmpty(param.getEndStaNo())) {
@@ -368,13 +374,17 @@
                task.setOriCode(oriSta.getCode());
                task.setDestSta(destSta.getId());
                task.setDestCode(destSta.getCode());
                staReserveService.allocateCallBack(task, agv.getId());
                break;
            default:
                break;
        }
        if (!taskService.updateById(task)) {
            throw new BusinessException("任务更新失败");
        if (null != task) {
            if (!taskService.updateById(task)) {
                throw new BusinessException("任务更新失败");
            }
        }
        return R.ok();
    }