自动化立体仓库 - WCS系统
#
Junjie
2024-03-16 429bc159b230ed31092aed3b8c4893c20e52f5c6
src/main/java/com/zy/common/model/LocTypeDto.java
@@ -23,14 +23,10 @@
    }
    public LocTypeDto(StaProtocol staProtocol) {
        if (staProtocol.isHigh() == staProtocol.isLow()) {
        if (staProtocol.getLocType1() == null || staProtocol.getLocType1() == 0) {
            throw new CoolException("plc高低检测异常");
        }
        if (staProtocol.isLow()) {
            this.locType1 = 1; // 低库位
        } else {
            this.locType1 = 2; // 高库位
        }
        this.locType1 = staProtocol.getLocType1();
    }
    /**
@@ -38,14 +34,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;
    }