自动化立体仓库 - WCS系统
Junjie
2023-05-10 11b28c7a6c5f0882b8385a370b20919c6246fc1d
src/main/java/com/zy/core/model/protocol/ShuttleProtocol.java
@@ -1,8 +1,10 @@
package com.zy.core.model.protocol;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.entity.BasShuttleErr;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.service.BasDevpService;
import com.zy.asrs.service.BasShuttleErrService;
import com.zy.asrs.service.BasShuttleService;
import com.zy.asrs.service.LocMastService;
@@ -40,12 +42,6 @@
     * 当前小车状态(内部自我维护)
     */
    private Integer protocolStatus;
//    /**
//     * 小车当前是否有货
//     * true:有货,false:无货
//     */
//    private Boolean loading = false;
    /**
     * 当前小车状态枚举
@@ -281,6 +277,10 @@
    // 是否满足充电状态
    public Boolean isRequireCharge() {
        if (this.busyStatusType == null || this.pakMk == null || this.errorCodeType == null || this.taskNo == null) {
            return false;
        }
        boolean res = this.busyStatusType.equals(ShuttleStatusType.IDLE)
                && this.pakMk.equals(true)
                && this.errorCodeType.equals(ShuttleErrorCodeType.NORMAL)
@@ -323,4 +323,24 @@
        return basShuttleErr.getErrName();
    }
    public void setCurrentCode(Short currentCode) {
        this.currentCode = currentCode;
        LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
        if (locMastService != null) {
            LocMast locMast = locMastService.queryByQrCode(currentCode.toString());
            if (locMast == null) {
                //查不到库位号,查询是否为站点
                BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
                if (basDevpService != null) {
                    BasDevp basDevp = basDevpService.queryByLocNo(currentCode.toString());
                    if (basDevp != null) {
                        this.locNo = basDevp.getLocNo();
                    }
                }
            }else{
                this.locNo = locMast.getLocNo();
            }
        }
    }
}