#
zjj
9 小时以前 15b5002fd412a5d33be5d5c6deb63b3d02c77c41
#
6个文件已修改
73 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/action/LiftAction.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/enums/RedisKeyType.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/command/LiftCommand.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/impl/NyLiftThread.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/impl/NyShuttleThread.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -1666,7 +1666,13 @@
            int targetLev = Utils.getLev(shuttleProtocol.getCurrentLocNo());
            if (object == null || liftProtocol.getLev() != targetLev) {
                //获取提升机命令
                LiftCommand liftCommand = liftThread.getMoveCommand(wrkMast.getWrkNo(), liftProtocol.getLev(), targetLev);
                LiftStaProtocol startSta = LiftUtils.getLiftStaByLev(liftProtocol.getLiftNo(), liftProtocol.getLev());
                LiftStaProtocol targetSta = LiftUtils.getLiftStaByLev(liftProtocol.getLiftNo(), targetLev);
                if (startSta == null || targetSta == null) {
                    News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号提升机,站点数据不存在", wrkMast.getWrkNo(), wrkMast.getLiftNo());
                    return false;
                }
                LiftCommand liftCommand = liftThread.getMoveCommand(commonService.getWorkNo(WrkIoType.PREVIEW_LIFT_MOVE.id), startSta.getSiteId(), targetSta.getSiteId());
                ArrayList<LiftCommand> commands = new ArrayList<>();
                commands.add(liftCommand);
@@ -1680,6 +1686,12 @@
                liftAction.assignWork(wrkMast.getLiftNo(), assignCommand);
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号提升机在{}层,提升机不在小车层,调度移动中", wrkMast.getWrkNo(), liftProtocol.getLev(), wrkMast.getLiftNo());
                redisUtil.set(RedisKeyType.LIFT_MOVE_TO_SHUTTLE_LIMIT.key + wrkMast.getWrkNo(), "lift_moving", 60 * 3);
                redisUtil.set(RedisKeyType.TASK_RUN_LIMIT.key + wrkMast.getWrkNo(), "lock", 8);
                return false;
            }
            Object limitObj = redisUtil.get(RedisKeyType.TASK_RUN_LIMIT.key + wrkMast.getWrkNo());
            if (limitObj != null) {
                return false;
            }
@@ -1756,7 +1768,7 @@
            }
            //获取提升机命令
            LiftCommand liftCommand = liftThread.getShuttleSwitchCommand(wrkMast.getWrkNo(), sourceLiftSta.getLev(), liftSta.getLev());
            LiftCommand liftCommand = liftThread.getShuttleSwitchCommand(wrkMast.getWrkNo(), sourceLiftSta.getSiteId(), liftSta.getSiteId());
            ArrayList<LiftCommand> commands = new ArrayList<>();
            commands.add(liftCommand);
src/main/java/com/zy/core/action/LiftAction.java
@@ -129,15 +129,15 @@
            LiftCommand lastCommand = commands.get(commandStep - 1);
            if (lastCommand.getMode() == LiftTaskModeType.PICK_PUT.id) {
                if (liftProtocol.getLev() == lastCommand.getPut()) {
                if (liftProtocol.getLev() == lastCommand.getPutLev()) {
                    lastCommand.setComplete(true);
                }
            } else if (lastCommand.getMode() == LiftTaskModeType.SHUTTLE_SWITCH.id) {
                if (liftProtocol.getLev() == lastCommand.getPut()) {
                if (liftProtocol.getLev() == lastCommand.getPutLev()) {
                    lastCommand.setComplete(true);
                }
            } else if (lastCommand.getMode() == LiftTaskModeType.MOVE.id) {
                if (liftProtocol.getLev() == lastCommand.getPut()) {
                if (liftProtocol.getLev() == lastCommand.getPutLev()) {
                    lastCommand.setComplete(true);
                }
            }
src/main/java/com/zy/core/enums/RedisKeyType.java
@@ -24,6 +24,8 @@
    //提升机移动至小车层频率
    LIFT_MOVE_TO_SHUTTLE_LIMIT("lift_move_to_shuttle_LIMIT_"),
    //任务运行限制
    TASK_RUN_LIMIT("task_run_limit_"),
    //交管信息
    TRAFFIC_CONTROL_MAP("traffic_control_map"),
src/main/java/com/zy/core/model/command/LiftCommand.java
@@ -30,11 +30,21 @@
    private Integer pick;
    /**
     * 取货层
     */
    private Integer pickLev;
    /**
     * 放货数据
     */
    private Integer put;
    /**
     * 放货层
     */
    private Integer putLev;
    /**
     * 命令是否完成,默认false未完成
     */
    private Boolean complete = false;
src/main/java/com/zy/core/thread/impl/NyLiftThread.java
@@ -3,13 +3,10 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.DateUtils;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasLift;
import com.zy.asrs.entity.DeviceConfig;
import com.zy.asrs.entity.DeviceDataLog;
import com.zy.asrs.service.BasLiftService;
import com.zy.asrs.service.DeviceDataLogService;
import com.zy.asrs.utils.Utils;
import com.zy.common.ExecuteSupport;
@@ -395,6 +392,7 @@
                || this.liftProtocol.getPlcTaskNo() == null
                || this.liftProtocol.getProtocolStatus() == null
                || this.liftProtocol.getModel() == null
                || this.liftProtocol.getDeviceStatus() == null
                || this.liftProtocol.getErrorCode() == null
                || this.liftProtocol.getExtend() == null
        ) {
@@ -407,6 +405,7 @@
//                && this.liftProtocol.getPlcTaskNo() == 0
                && this.liftProtocol.getTaskNo() == 0
                && this.liftProtocol.getModel() == 2
                && this.liftProtocol.getDeviceStatus() == LiftDeviceStatusType.IDLE.id
                && this.liftProtocol.getErrorCode() == 0
                && !extend.getFrontOverrun()
                && !extend.getBackOverrun()
@@ -434,6 +433,7 @@
        if (this.liftProtocol.getProtocolStatus() == null
                || this.liftProtocol.getModel() == null
                || this.liftProtocol.getDeviceStatus() == null
                || this.liftProtocol.getErrorCode() == null
                || this.liftProtocol.getExtend() == null
        ) {
@@ -444,6 +444,7 @@
        boolean res = this.liftProtocol.getProtocolStatus() == LiftProtocolStatusType.IDLE.id
                && this.liftProtocol.getModel() == 2
                && this.liftProtocol.getDeviceStatus() == LiftDeviceStatusType.IDLE.id
                && this.liftProtocol.getErrorCode() == 0
                && !extend.getFrontOverrun()
                && !extend.getBackOverrun()
@@ -495,6 +496,10 @@
        command.setPick(pick);
        command.setPut(put);
        LiftStaProtocol pickSta = findSta(pick);
        LiftStaProtocol putSta = findSta(put);
        command.setPickLev(pickSta.getLev());
        command.setPutLev(putSta.getLev());
        return command;
    }
@@ -507,6 +512,10 @@
        command.setPick(pick);
        command.setPut(put);
        LiftStaProtocol pickSta = findSta(pick);
        LiftStaProtocol putSta = findSta(put);
        command.setPickLev(pickSta.getLev());
        command.setPutLev(putSta.getLev());
        return command;
    }
@@ -519,6 +528,10 @@
        command.setPick(pick);
        command.setPut(put);
        LiftStaProtocol pickSta = findSta(pick);
        LiftStaProtocol putSta = findSta(put);
        command.setPickLev(pickSta.getLev());
        command.setPutLev(putSta.getLev());
        return command;
    }
@@ -643,6 +656,15 @@
        }
    }
    private LiftStaProtocol findSta(Integer staNo) {
        for (LiftStaProtocol liftStaProtocol : this.liftStaProtocols) {
            if (liftStaProtocol.getSiteId().equals(staNo)) {
                return liftStaProtocol;
            }
        }
        return null;
    }
    /**
     * 扩展字段
     */
src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
@@ -1055,11 +1055,12 @@
        Integer taskId = getTaskId();
        HashMap<String, Object> body = new HashMap<>();
        if (moveIn) {
            body.put("requestType", "intoLift");//进提升机
        } else {
            body.put("requestType", "outLift");//出提升机
        }
//        if (moveIn) {
//            body.put("requestType", "intoLift");//进提升机
//        } else {
//            body.put("requestType", "outLift");//出提升机
//        }
        body.put("requestType", "move");//移动命令
        body.put("taskId", taskId);//TaskID需要随机
        body.put("path", path);
        request.setBody(body);