自动化立体仓库 - WCS系统
#
zjj
2024-10-31 3f8c15b54e32b04dc78659c3b45f759eade78e12
src/main/java/com/zy/common/model/LocTypeDto.java
@@ -19,18 +19,22 @@
    // 轻重类型{0:未知,1:轻库位,2:重库位}
    private Short locType3;
    private Integer siteId;
    public LocTypeDto() {
    }
    public LocTypeDto(Short locType1, Short locType2, Short locType3) {
        this.locType1 = locType1;
        this.locType2 = locType2;
        this.locType3 = locType3;
    }
    public LocTypeDto(StaProtocol staProtocol) {
        if (staProtocol.isHigh() == staProtocol.isLow()) {
        if (staProtocol.locType.id.shortValue()!=1 && staProtocol.locType.id.shortValue()!=2 && staProtocol.locType.id.shortValue()!=3) {
            throw new CoolException("plc高低检测异常");
        }
        if (staProtocol.isLow()) {
            this.locType1 = 1; // 低库位
        } else {
            this.locType1 = 2; // 高库位
        }
        this.locType1 = staProtocol.locType.id.shortValue();
    }
    /**
@@ -38,14 +42,14 @@
     */
    public static LocTypeDto process(StaProtocol staProtocol) {
        LocTypeDto dto = new LocTypeDto();
        if (staProtocol.isHigh() == staProtocol.isLow()) {
            throw new CoolException("plc高低检测异常");
        }
        if (staProtocol.isLow()) {
            dto.setLocType1((short) 1); // 低库位
        } else {
            dto.setLocType1((short) 2); // 高库位
        }
//        if (staProtocol.isHigh() == staProtocol.isLow()) {
//            throw new CoolException("plc高低检测异常");
//        }
//        if (staProtocol.isLow()) {
//            dto.setLocType1((short) 1); // 低库位
//        } else {
//            dto.setLocType1((short) 2); // 高库位
//        }
        return dto;
    }