自动化立体仓库 - WCS系统
#
Junjie
2023-09-19 ff1be9fa2dba6eaffc449d09e62998348ea3b830
src/main/java/com/zy/common/model/LocTypeDto.java
@@ -1,6 +1,5 @@
package com.zy.common.model;
import com.core.exception.CoolException;
import com.zy.core.model.protocol.StaProtocol;
import lombok.Data;
@@ -23,14 +22,14 @@
    }
    public LocTypeDto(StaProtocol staProtocol) {
        if (staProtocol.isHigh() == staProtocol.isLow()) {
            throw new CoolException("plc高低检测异常");
        }
        if (staProtocol.isLow()) {
            this.locType1 = 1; // 低库位
        } else {
            this.locType1 = 2; // 高库位
        }
//        if (staProtocol.isHigh() == staProtocol.isLow()) {
//            throw new CoolException("plc高低检测异常");
//        }
//        if (staProtocol.isLow()) {
//            this.locType1 = 1; // 低库位
//        } else {
//            this.locType1 = 2; // 高库位
//        }
    }
    /**
@@ -38,14 +37,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;
    }