#
Administrator
2026-04-27 007ee7bc1b63aa381b3a414952bbf41aeebed60e
src/main/java/com/zy/core/model/protocol/DualCrnProtocol.java
@@ -1,9 +1,9 @@
package com.zy.core.model.protocol;
import com.zy.core.enums.DualCrnForkPosType;
import com.zy.core.enums.DualCrnLiftPosType;
import com.zy.core.enums.DualCrnModeType;
import com.zy.core.enums.DualCrnStatusType;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.zy.common.utils.RedisUtil;
import com.zy.core.enums.*;
import lombok.Data;
@@ -12,31 +12,41 @@
@Data
public class DualCrnProtocol {
    private Integer crnNo;
    private volatile Integer crnNo;
    /**
     * 1 = 手动模式
     * 2 = 自动模式
     * 3 = 电脑模式
     */
    public Integer mode;
    public volatile Integer mode;
    public DualCrnModeType modeType;
    public volatile DualCrnModeType modeType;
    /**
     * 异常码
     */
    public Integer alarm;
    public volatile Integer alarm;
    /**
     * 工位1任务号
     * WCS工位1任务号
     */
    public Integer taskNo = 0;
    public volatile Integer taskNo = 0;
    /**
     * 工位2任务号
     * WCS工位2任务号
     */
    public Integer taskNoTwo = 0;
    public volatile Integer taskNoTwo = 0;
    /**
     * 设备工位1任务号
     */
    public volatile Integer deviceTaskNo = 0;
    /**
     * 设备工位2任务号
     */
    public volatile Integer deviceTaskNoTwo = 0;
    /**
     * 工位1当前状态
@@ -51,42 +61,42 @@
     * 90:任务完成等待WCS确认
     * 99:报警
     */
    public Integer status;
    public volatile Integer status;
    /**
     * 工位2当前状态
     */
    public Integer statusTwo;
    public volatile Integer statusTwo;
    /**
     * 工位1状态枚举
     */
    public DualCrnStatusType statusType;
    public volatile DualCrnStatusType statusType;
    /**
     * 工位2状态枚举
     */
    public DualCrnStatusType statusTypeTwo;
    public volatile DualCrnStatusType statusTypeTwo;
    /**
     * 工位1堆垛机当前列号
     */
    public Integer bay;
    public volatile Integer bay;
    /**
     * 工位2堆垛机当前列号
     */
    public Integer bayTwo;
    public volatile Integer bayTwo;
    /**
     * 工位1堆垛机当前层号
     */
    public Integer level;
    public volatile Integer level;
    /**
     * 工位2堆垛机当前层号
     */
    public Integer levelTwo;
    public volatile Integer levelTwo;
    /**
     * 工位1当前货叉位置
@@ -94,7 +104,7 @@
     * 1 = 货叉在左侧
     * 2 = 货叉在右侧
     */
    public Integer forkPos;
    public volatile Integer forkPos;
    /**
     * 工位2当前货叉位置
@@ -102,51 +112,55 @@
     * 1 = 货叉在左侧
     * 2 = 货叉在右侧
     */
    public Integer forkPosTwo;
    public volatile Integer forkPosTwo;
    public DualCrnForkPosType forkPosType;
    public volatile DualCrnForkPosType forkPosType;
    public DualCrnForkPosType forkPosTypeTwo;
    public volatile DualCrnForkPosType forkPosTypeTwo;
    /**
     * 当前载货台位置
     * 0 = 下定位
     * 1 = 上定位
     */
    public Integer liftPos;
    public volatile Integer liftPos;
    public Integer liftPosTwo;
    public volatile Integer liftPosTwo;
    public DualCrnLiftPosType liftPosType;
    public volatile DualCrnLiftPosType liftPosType;
    public DualCrnLiftPosType liftPosTypeTwo;
    public volatile DualCrnLiftPosType liftPosTypeTwo;
    /**
     * 走行在定位
     * 0 = 在定位
     * 1 = 不在定位
     */
    public Integer walkPos;
    public volatile Integer walkPos;
    public Integer walkPosTwo;
    public volatile Integer walkPosTwo;
    /**
     * 载货台有物
     */
    public Integer loaded;
    public volatile  Integer loaded;
    public Integer loadedTwo;
    public volatile Integer loadedTwo;
    /**
     * 任务接收状态
     * 0 = 未接收
     * 1 = 已接收
     */
    public Integer taskReceive;
    public volatile Integer taskReceive;
    public Integer taskReceiveTwo;
    public volatile Integer taskReceiveTwo;
    private Integer temp1;
    public volatile Integer taskSend;
    public volatile Integer taskSendTwo;
    private volatile Integer temp1;
    private Integer temp2;
@@ -292,4 +306,32 @@
        this.statusTwo = DualCrnStatusType.get(type).id;
    }
    public Integer getTaskNo() {
        RedisUtil redisUtil = null;
        try {
            redisUtil = SpringUtils.getBean(RedisUtil.class);
        }catch (Exception e) {}
        if (null != redisUtil) {
            Object o = redisUtil.get(RedisKeyType.DUAL_CRN_STATION1_FLAG.key + this.crnNo);
            if (!Cools.isEmpty(o)) {
                this.taskNo = Integer.parseInt(String.valueOf(o));
            }
        }
        return this.taskNo == null ? 0 : this.taskNo;
    }
    public Integer getTaskNoTwo() {
        RedisUtil redisUtil = null;
        try {
            redisUtil = SpringUtils.getBean(RedisUtil.class);
        }catch (Exception e) {}
        if (null != redisUtil) {
            Object o = redisUtil.get(RedisKeyType.DUAL_CRN_STATION2_FLAG.key + this.crnNo);
            if (!Cools.isEmpty(o)) {
                this.taskNoTwo = Integer.parseInt(String.valueOf(o));
            }
        }
        return this.taskNoTwo == null ? 0 : this.taskNoTwo;
    }
}