Junjie
9 小时以前 f305e5244e059c5e43566412f69b180e2e790026
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;
@@ -29,14 +29,24 @@
    public Integer alarm;
    /**
     * 工位1任务号
     * WCS工位1任务号
     */
    public Integer taskNo = 0;
    /**
     * 工位2任务号
     * WCS工位2任务号
     */
    public Integer taskNoTwo = 0;
    /**
     * 设备工位1任务号
     */
    public Integer deviceTaskNo = 0;
    /**
     * 设备工位2任务号
     */
    public Integer deviceTaskNoTwo = 0;
    /**
     * 工位1当前状态
@@ -146,6 +156,10 @@
    public Integer taskReceiveTwo;
    public Integer taskSend;
    public Integer taskSendTwo;
    private Integer temp1;
    private Integer temp2;
@@ -157,37 +171,37 @@
    /**
     * X行走线速度m/min
     */
    private Integer xSpeed;
    private Double xSpeed;
    /**
     * Y行走线速度m/min
     */
    private Integer ySpeed;
    private Double ySpeed;
    /**
     * Z行走线速度m/min
     */
    private Integer zSpeed;
    private Double zSpeed;
    /**
     * 堆垛机累计走行距离km
     */
    public Integer xDistance;
    public Double xDistance;
    /**
     * 堆垛机累计升降距离km
     */
    public Integer yDistance;
    public Double yDistance;
    /**
     * 堆垛机累计走行时长h
     */
    public Integer xDuration;
    public Double xDuration;
    /**
     * 堆垛机累计升降时长h
     */
    public Integer yDuration;
    public Double yDuration;
    //货物类型
    private Integer goodsType;
@@ -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;
    }
}