自动化立体仓库 - WMS系统
luxiaotao1123
2020-07-30 e1f2618f03b150b5a60231501dd10f7e6e599baf
src/main/java/com/zy/common/service/CommonService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.core.common.Arith;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
@@ -34,6 +35,8 @@
    private BasDevpService basDevpService;
    @Autowired
    private LocMastService locMastService;
    @Autowired
    private LocDetlService locDetlService;
    /**
     * 生成工作号
@@ -96,6 +99,26 @@
            int eRow = rowLastno.geteRow();
            int crn_qty = rowLastno.getCrnQty();
            int rowCount = eRow - sRow + 1;
            // 同一天同规格货物靠近摆法规则 todo
            List<String> locNos = locDetlService.getSameDetlToday("X004073XX");
            for (String locNo : locNos) {
                // 获取排
                int row = Integer.parseInt(locNo.substring(0, 2));
                // 判断是否为深库位
                double remainder = Arith.remainder(row, rowCount / crn_qty);
                if (remainder == 1) {
                    // 得到当前库位的外围库位
                } else if (remainder == 0) {
                    // 得到当前库位的内围库位
                } else {
                    continue;
                }
            }
            // 获取目标站所在货架排号
            Shelves shelves = new Shelves(rowCount, crn_qty);
            curRow = shelves.start(curRow);
@@ -141,10 +164,29 @@
                startupDto.setStaNo(staNo.getDevNo());
                startupDto.setLocNo(locNo);
            } else {
                throw new CoolException("目标站不可用");
                throw new CoolException("目标站"+staDesc.getCrnStn()+"不可用");
            }
        } else {
            throw new CoolException(rowLastno.getWhsType()+"号库位排号分配规则不可用");
        }
        return startupDto;
    }
    public static void main(String[] args) {
        System.out.println(Arith.remainder(1, 4));
        System.out.println("0200201".substring(0, 2));
        String locNo = "0100201";
        int row = Integer.parseInt(locNo.substring(0, 2));
        double remainder = Arith.remainder(row, 4);
        if (remainder == 1) {
            // 得到当前库位的外围库位
            int targetRow =  row + 1;
        } else if (remainder == 0) {
            // 得到当前库位的内围库位
        } else {
        }
    }
}