#
Junjie
2025-04-03 ac09ee9c9f39cb9d452b57504e5c79321e0371eb
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java
@@ -286,20 +286,16 @@
        }
        LiftDispatcher liftDispatcher = SpringUtils.getBean(LiftDispatcher.class);
        Integer lev = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), liftProtocol.getLev());
        if (null == lev){
            News.error("提升机获取当前层为空");
            response.setMessage("提升机获取当前层为空");
            return response;
        Integer origin = command.getOriginLev();
        Integer target = command.getTargetLev();
        if (command.getMode() == 2) {
            origin = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), liftProtocol.getLev());
            target = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), command.getTargetLev());
        }
        array[1] = lev.shortValue();
        Integer targetLev = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), command.getTargetLev());
        if (null == targetLev){
            News.error("提升机获取目标层为空");
            response.setMessage("提升机获取目标层为空");
            return response;
        }
        array[2] = targetLev.shortValue();
        array[1] = origin.shortValue();
        array[2] = target.shortValue();
        OperateResult result = siemensS7Net.Write("DB83.0", array);
        if (result != null && result.IsSuccess) {
@@ -413,12 +409,16 @@
    public List<LiftCommand> getMoveCommand(Integer taskNo, Integer sourceLev, Integer targetLev, LiftCommandModeType mode) {
        /**
         * 任务类型
         * 1=移托盘;升降机将源站台托盘移到目标站台
         * 2=移小车,升降机移到目标层,等待
         1=移托盘;升降机将源站台托盘移到目标站台
         2=换层,升降机移到目标层,等待
         3=入库托盘,升降机将源站台托盘移到目标层数;
         4=出库托盘,升降机将源站台托盘移到目标站台
         */
        short taskMode = 2;
        if (mode.equals(LiftCommandModeType.PALLET_INOUT)) {
            taskMode = 1;
        if (mode.equals(LiftCommandModeType.PALLET_IN)) {
            taskMode = 3;
        } else if (mode.equals(LiftCommandModeType.PALLET_OUT)) {
            taskMode = 4;
        }
        // 开始任务
@@ -435,7 +435,7 @@
        LiftCommand command = new LiftCommand();
        command.setLiftNo(Integer.valueOf(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(array));
        command.setMode(LiftCommandModeType.MOVE.id);
        command.setMode(mode.id);
        command.setOriginLev(sourceLev);
        command.setTargetLev(targetLev);