#
luxiaotao1123
2024-04-07 bda52da89628d1587ab804510f9995c671a318ca
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/ShuttleProtocol.java
@@ -16,6 +16,8 @@
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import java.util.HashMap;
/**
 * 四向穿梭车
 */
@@ -27,7 +29,7 @@
    /**
     * 四向穿梭车号
     */
    private String shuttleNo;
    private Integer shuttleNo;
    /**
     * 任务号
@@ -87,6 +89,11 @@
     * 是否顶升
     */
    private Boolean hasLift;
    /**
     * 是否有托盘
     */
    private Boolean hasPallet;
    /**
     * 行驶方向
@@ -161,6 +168,11 @@
    private Device device;
    /**
     * 扩展字段
     */
    private Object extend;
    /**
     * 设置小车状态
     */
    public void setProtocolStatus(Integer status) {
@@ -220,12 +232,20 @@
    public Integer getTaskNo() {
        RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
        if (null != redisUtil) {
            Object o = redisUtil.get(DeviceRedisConstant.SHUTTLE_FLAG + this.taskNo);
            Object o = redisUtil.get(DeviceRedisConstant.SHUTTLE_FLAG + this.shuttleNo);
            if (!Cools.isEmpty(o)) {
                this.taskNo = Integer.parseInt(String.valueOf(o));
            }
        }
        return this.taskNo == null ? 0 : this.taskNo;
    }
    public void setTaskNo(Integer taskNo) {
        RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
        if (null != redisUtil) {
            redisUtil.set(DeviceRedisConstant.SHUTTLE_FLAG + this.shuttleNo, taskNo);
            this.taskNo = taskNo;
        }
    }
    //通过当前二维码获取当前库位号
@@ -239,9 +259,10 @@
        }
        //源库位(小车当前位置)
        Loc currentLoc = locService.getOne(new LambdaQueryWrapper<Loc>()
        LambdaQueryWrapper<Loc> wrapper = new LambdaQueryWrapper<Loc>()
                .eq(Loc::getCode, this.currentCode)
                .eq(Loc::getHostId, this.device.getHostId()));
                .eq(Loc::getHostId, this.device.getHostId());
        Loc currentLoc = locService.getOne(wrapper);
        if (currentLoc == null) {
            return null;
        }