123
ZY
2025-05-10 a56259ffabbdd3dba89d60e4da2c06a1b88e6220
src/main/java/com/zy/asrs/utils/Utils.java
@@ -87,11 +87,11 @@
     */
    public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) {
        int row = getRow(deepLoc);
        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int shallowRow = remainder == 1 ? (row + 1) : (row - 1);
        if(row==9 ||  row==15 ){
//        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int shallowRow ;
        if(row==31){
            shallowRow = row + 1;
        }else if(row==12 ||  row==18 ){
        }else if(row==34){
            shallowRow = row - 1;
        }else {
            return null;
@@ -112,14 +112,16 @@
     */
    public static String getDeepLoc(SlaveProperties slaveProperties, String shallowLoc) {
        int row = getRow(shallowLoc);
        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int targetRow;
        if (remainder == 2) {
            targetRow = row - 1;
        } else if (remainder == 3) {
            targetRow = row + 1;
        } else {
            throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙");
        switch (row){
            case 32:
                targetRow = 31;
                break;
            case 33:
                targetRow = 34;
                break;
            default:
                throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙");
        }
        return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2);
    }
@@ -128,11 +130,11 @@
     * 获取 浅库位排对应的深库位排
     */
    public static Integer getDeepRow(SlaveProperties slaveProperties, Integer shallowRow) {
        int remainder = (int) Arith.remainder(shallowRow, slaveProperties.getGroupCount());
//        int remainder = (int) Arith.remainder(shallowRow, slaveProperties.getGroupCount());
        int targetRow;
        if (remainder == 2) {
        if (shallowRow == 32) {
            targetRow = shallowRow - 1;
        } else if (remainder == 3) {
        } else if (shallowRow == 33) {
            targetRow = shallowRow + 1;
        } else {
            throw new RuntimeException(shallowRow + "不是浅库位排,系统繁忙");
@@ -171,6 +173,9 @@
    public static void main(String[] args) {
        SlaveProperties slaveProperties = new SlaveProperties();
        slaveProperties.setDoubleDeep(true);
        String aa = getDeepLoc(slaveProperties,"1604402");
        List<Integer> list = new ArrayList<>();
        list.add(1);list.add(4);list.add(5);list.add(8);list.add(9);list.add(12);
        slaveProperties.setDoubleLocs(list);