自动化立体仓库 - WMS系统
#
zjj
2025-04-03 15c63539d835441e2a3face40c108650f6103829
src/main/java/com/zy/asrs/utils/Utils.java
@@ -16,10 +16,7 @@
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.*;
/**
 * Created by vincent on 2020/8/27
@@ -27,6 +24,24 @@
public class Utils {
    private static final DecimalFormat fmt = new DecimalFormat("##0.00");
    public static String getStaName(Integer sta){
        HashMap<Integer, String> map = new HashMap<>();
        map.put(113,"Ctu库102");map.put(115,"Ctu库101");
        map.put(204,"Ctu库201");map.put(304,"Ctu库301");
        map.put(31001,"四向库101");
        map.put(1024,"堆垛机库北1号出库口");map.put(1028,"堆垛机库北2号出库口");
        map.put(1040,"堆垛机库南1号入库口");map.put(1042,"堆垛机库南1号出库口");
        map.put(2000,"堆垛机库北2楼出入库口");map.put(2002,"堆垛机库北二楼出库口");
        map.put(2010,"堆垛机库南二楼出入库口");map.put(2012,"堆垛机库南二楼出库口");
        map.put(3010,"堆垛机库南三楼出入库口");map.put(3012,"堆垛机库南三楼出库口");
        return map.get(sta)==null?sta.toString():map.get(sta);
    }
    public static boolean isNorth(Integer sourceStaNo){
        if ((sourceStaNo>1000 && sourceStaNo < 1040) || (sourceStaNo>2000 && sourceStaNo > 2010)|| (sourceStaNo > 3000 && sourceStaNo < 3010)){
@@ -150,10 +165,10 @@
        int row = getRow(shallowLoc);
        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int targetRow;
        if (remainder == 2) {
            targetRow = row - 1;
        } else if (remainder == 3) {
        if (remainder == 0  ) {
            targetRow = row + 1;
        } else if (remainder == 3) {
            targetRow = row - 1;
        } else {
            throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙");
        }
@@ -340,6 +355,10 @@
                }
            }
        }
        //堆垛机库位从14排开始
        necessaryParameters[1] = necessaryParameters[1]+13;    //curRow   最深库位排
        necessaryParameters[3] = necessaryParameters[3]+13;    //nearRow  最浅库位排
        return necessaryParameters;
    }
@@ -514,22 +533,22 @@
            case 1:
                necessaryParameters[1] = 4;    //curRow   最深库位排
                necessaryParameters[2] = sCrnNo;     //crnNo     堆垛机号
                necessaryParameters[3] = 7;    //nearRow  最浅库位排
                necessaryParameters[3] = 3;    //nearRow  最浅库位排
                break;
            case 4:
                necessaryParameters[1] = 9;    //curRow   最深库位排
                necessaryParameters[1] = 5;    //curRow   最深库位排
                necessaryParameters[2] = sCrnNo;     //crnNo     堆垛机号
                necessaryParameters[3] = 12;    //nearRow  最浅库位排
                necessaryParameters[3] = 6;    //nearRow  最浅库位排
                break;
            case 9:
                necessaryParameters[1] = 14;    //curRow   最深库位排
            case 5:
                necessaryParameters[1] = 8;    //curRow   最深库位排
                necessaryParameters[2] = sCrnNo;     //crnNo     堆垛机号
                necessaryParameters[3] = 14;    //nearRow  最浅库位排
                necessaryParameters[3] = 8;    //nearRow  最浅库位排
                break;
            case 14:
            case 8:
                necessaryParameters[1] = 1;    //curRow   最深库位排
                necessaryParameters[2] = sCrnNo;     //crnNo     堆垛机号
                necessaryParameters[3] = 2;    //nearRow  最浅库位排
                necessaryParameters[3] = 1;    //nearRow  最浅库位排
                break;
            default:
                throw new CoolException("库位排号异常:排号:" + curRow);