自动化立体仓库 - WMS系统
#
lsh
2024-02-16 7c077bec6a5912b39262e5aa65c1eba174e10e7a
src/main/java/com/zy/asrs/utils/Utils.java
@@ -218,15 +218,36 @@
//        System.out.println(deepRow);
//    }
    public static boolean BooleanWhsTypeSta(Integer whsType) {
    public static Integer GetWhsType(Integer sourceStaNo) {
        switch (sourceStaNo){
            case 104:
            case 173:
            case 174:
            case 175:
            case 130:
            case 125:
                return 5;
            default:
                return 0;
        }
    }
    public static boolean BooleanWhsTypeStaIoType(Integer whsType) {
        if (whsType == 1) {
            return true;
        }
        return false;
    }
    public static boolean BooleanWhsTypeSta(Integer whsType) {
        if (whsType == 1 || whsType == 5) {
            return true;
        }
        return false;
    }
    public static boolean BooleanWhsTypeSta(Integer whsType, Integer staDescId) {
        if (whsType == 1 && staDescId != 11 && staDescId != 111) {
        if ((whsType == 1 || whsType == 5) && staDescId != 11 && staDescId != 111) {
            return true;
        }
        return false;
@@ -252,7 +273,15 @@
    public static int[] LocNecessaryParameters(Integer whsType, Integer curRow, Integer crnNumber) {
        switch (whsType){
            case 1://经典双伸库位
                return LocNecessaryParametersDoubleExtension(whsType, curRow, crnNumber);
                return LocNecessaryParametersDoubleExtension(whsType, curRow, crnNumber); //已完善
//            case 2://经典单伸库位
//                return LocNecessaryParametersDoubleExtension1(whsType, curRow, crnNumber); //未完善
//            case 3://经典单双伸库位  左单右双
//                return LocNecessaryParametersDoubleExtension2(whsType, curRow, crnNumber); //未完善
//            case 4://经典单双伸库位  左双右单
//                return LocNecessaryParametersDoubleExtension3(whsType, curRow, crnNumber); //未完善
            case 5://双工位单伸库位
                return LocNecessaryParametersDoubleExtension5(whsType, curRow, crnNumber); //未完善
            default:
                return LocNecessaryParametersMove(whsType, curRow, crnNumber);//moveCrnNo
        }
@@ -309,6 +338,41 @@
        return necessaryParameters;
    }
    //双工位单伸库位
    public static int[] LocNecessaryParametersDoubleExtension5(Integer whsType, Integer curRow, Integer crnNumber) {
        int[] necessaryParameters = new int[]{0, 0, 0, 0};
        if (BooleanWhsTypeSta(whsType)) {
            necessaryParameters[0] = crnNumber; // 轮询次数
            //满板正常入库
            if (curRow.equals(crnNumber * 4)) {
                necessaryParameters[1] = 1;    //curRow   最深库位排
                necessaryParameters[2] = 1;     //crnNo     堆垛机号
                necessaryParameters[3] = 2;    //nearRow  最浅库位排
            } else if (curRow.equals(crnNumber * 4 - 3)) {
                necessaryParameters[1] = 4;    //curRow   最深库位排
                necessaryParameters[2] = 1;     //crnNo     堆垛机号
                necessaryParameters[3] = 3;    //nearRow  最浅库位排
            } else {
                curRow = curRow + 4;
                if (curRow < 1 || curRow > (crnNumber * 4)) {
                    throw new CoolException("库位排号异常:排号:" + curRow);
                }
                if ((curRow - 1) % 4 == 0) {
                    necessaryParameters[1] = curRow;    //curRow   最深库位排
                    necessaryParameters[2] = (curRow + 3) / 4;     //crnNo     堆垛机号
                    necessaryParameters[3] = curRow + 1;    //nearRow  最浅库位排
                } else if (curRow % 4 == 0) {
                    necessaryParameters[1] = curRow;    //curRow   最深库位排
                    necessaryParameters[2] = curRow / 4;     //crnNo     堆垛机号
                    necessaryParameters[3] = curRow - 1;    //nearRow  最浅库位排
                } else {
                    throw new CoolException("库位排号异常:排号:" + curRow);
                }
            }
        }
        return necessaryParameters;
    }
    public static void main(String[] args) {
        List<LocMast> locS = new ArrayList<LocMast>();