1
zhang
1 天以前 3fa7cdec6ce44f07a0dc7e1910511ead606990f3
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/LocServiceImpl.java
@@ -44,7 +44,7 @@
    }
    @Override
    public void taskCallBack(Task task) {
    public void taskCallBackOtbin(Task task) {
        if (null == task) {
            return;
        }
@@ -54,9 +54,7 @@
        Date now = new Date();
        // loc status
        Loc oriLoc = null;
        Loc destLoc = null;
        Sta oriSta = null;
        Sta destSta = null;
        switch (Objects.requireNonNull(TaskTypeType.get(task.getTaskTypeEl()))) {
            case LOC_TO_LOC:
                oriLoc = this.getById(task.getOriLoc());
@@ -68,14 +66,6 @@
                    }
                }
                destLoc = this.getById(task.getDestLoc());
                if (destLoc.getLocSts().equals(LocStsType.PAKIN.val())) {
                    destLoc.setLocSts(LocStsType.STOCK.val());
                    destLoc.setUpdateTime(now);
                    if (!this.updateById(destLoc)) {
                        log.error("Loc [{}] 库位修改状态失败", task.getDestLoc$());
                    }
                }
                break;
            case LOC_TO_STA:
                oriLoc = this.getById(task.getOriLoc());
@@ -87,14 +77,6 @@
                    }
                }
                destSta = staService.getById(task.getDestSta());
                if (destSta.getStaSts().equals(StaStsType.READY_RELEASE.val())) {
                    destSta.setStaSts(StaStsType.STOCK.val());
                    destSta.setUpdateTime(now);
                    if (!staService.updateById(destSta)) {
                        log.error("Sta [{}] 站点修改状态失败", task.getDestSta$());
                    }
                }
                break;
            case STA_TO_LOC:
                oriSta = staService.getById(task.getOriSta());
@@ -106,14 +88,6 @@
                    }
                }
                destLoc = this.getById(task.getDestLoc());
                if (destLoc.getLocSts().equals(LocStsType.PAKIN.val())) {
                    destLoc.setLocSts(LocStsType.STOCK.val());
                    destLoc.setUpdateTime(now);
                    if (!this.updateById(destLoc)) {
                        log.error("Loc [{}] 库位修改状态失败", task.getDestLoc$());
                    }
                }
                break;
            case STA_TO_STA:
                oriSta = staService.getById(task.getOriSta());
@@ -125,6 +99,61 @@
                    }
                }
                break;
            case TO_CHARGE:
            case TO_STANDBY:
            case MOVE:
                break;
            default:
                break;
        }
    }
    @Override
    public void taskCallBackEnd(Task task) {
        if (null == task) {
            return;
        }
        if (!task.getTaskSts().equals(TaskStsType.PROGRESS.val())) {
            return;
        }
        Date now = new Date();
        // loc status
        Loc destLoc = null;
        Sta destSta = null;
        switch (Objects.requireNonNull(TaskTypeType.get(task.getTaskTypeEl()))) {
            case LOC_TO_LOC:
                destLoc = this.getById(task.getDestLoc());
                if (destLoc.getLocSts().equals(LocStsType.PAKIN.val())) {
                    destLoc.setLocSts(LocStsType.STOCK.val());
                    destLoc.setUpdateTime(now);
                    if (!this.updateById(destLoc)) {
                        log.error("Loc [{}] 库位修改状态失败", task.getDestLoc$());
                    }
                }
                break;
            case LOC_TO_STA:
                destSta = staService.getById(task.getDestSta());
                if (destSta.getStaSts().equals(StaStsType.READY_RELEASE.val())) {
                    destSta.setStaSts(StaStsType.STOCK.val());
                    destSta.setUpdateTime(now);
                    if (!staService.updateById(destSta)) {
                        log.error("Sta [{}] 站点修改状态失败", task.getDestSta$());
                    }
                }
                break;
            case STA_TO_LOC:
                destLoc = this.getById(task.getDestLoc());
                if (destLoc.getLocSts().equals(LocStsType.PAKIN.val())) {
                    destLoc.setLocSts(LocStsType.STOCK.val());
                    destLoc.setUpdateTime(now);
                    if (!this.updateById(destLoc)) {
                        log.error("Loc [{}] 库位修改状态失败", task.getDestLoc$());
                    }
                }
                break;
            case STA_TO_STA:
                destSta = staService.getById(task.getDestSta());
                if (destSta.getStaSts().equals(StaStsType.READY_RELEASE.val())) {
                    destSta.setStaSts(StaStsType.STOCK.val());