自动化立体仓库 - WMS系统
zyx
2024-03-26 83ff02860cfc3cbe63cda138c638b6fd4ad51da1
src/main/java/com/zy/asrs/service/impl/AgvLocMastServiceImpl.java
@@ -32,22 +32,9 @@
    }
    public void initLocFloor3() {
        //3楼 1-33排 1-14列 8层 ------>  1-33排 1-17列 8层
//        this.insertBatch(getLocMastList(1, 33, 1, 17, 1, 8, 3));
//
//        //3楼 1-27排 15-34列 8层 ------>  1-26排 18-25列 8层
//        this.insertBatch(getLocMastList(1, 27, 18, 25, 1, 8, 3));
//
//        //3楼 1-25排 35-46列 8层 ------>  1-25排 26-35列 8层
//        this.insertBatch(getLocMastList(1, 25, 26, 35, 1, 8, 3));
//
//        //3楼 3-25排 47-60列 8层 ------>  1-23排 36-70列 8层
//        this.insertBatch(getLocMastList(1, 23, 36, 70, 1, 8, 3));
        //3楼 3-23排 71-72列 8层
        this.insertBatch(getLocMastList(3, 23, 71, 72, 1, 8, 3));
    public void initLocFloor2() {
        //2楼 1-25排 1-33列 1层
        this.insertBatch(getLocMastList(1, 25, 1, 33, 1, 1, 2));
    }
    //根据排列层获取AGV库位列表
@@ -58,20 +45,9 @@
            for (int bay = bayIndex; bay <= bayMax; bay++) {
                for (int lev = levIndex; lev <= levMax; lev++) {
                    if(!checkLocExist(row,bay,floor)){
                    if(!checkLocExistFloor2(row,bay)){
                        continue;
                    }
//                    if(floor == 1 && (row == 8 || row == 9)){
//                        if((bay >=8 && bay <=11)
//                                || (bay >= 20 && bay <=23)
//                                || (bay>=37 && bay <=39)
//                                || (bay>=50 && bay <=52)
//                                || (bay>=63 && bay <=64)
//                                || (bay>=79 && bay <=80)){
//                            continue;
//                        }
//                    }
                    AgvLocMast loc = new AgvLocMast();
                    String locRow = row < 10 ? "-00" + row : "-0" + row;
@@ -87,6 +63,7 @@
                    loc.setModiTime(now);
                    loc.setFirstTime(now);
                    loc.setAppeTime(now);
                    loc.setLocType1(initLocMastSts(row,bay));
                    agvLocMastList.add(loc);
                }
            }
@@ -95,6 +72,51 @@
        return  agvLocMastList;
    }
    private boolean checkLocExistFloor2(int row, int bay){
        if(row <= 4 && bay >= 17){
            return false;
        }
        if(row <= 7 && bay >= 26){
            return false;
        }
        if(row >= 24 && bay >= 29){
            return false;
        }
        if((row != 20 && row != 25) && (bay ==8 || bay ==22)){
            return  false;
        }
        if((row == 3 || row == 12 || row == 16 || row == 21) && (bay ==4 || bay ==9 || bay == 14 || bay == 20 || bay == 25 || bay ==30 || bay == 31)){
            return false;
        }
        if(row == 21 && bay == 15){
            return false;
        }
        return true;
    }
    private short initLocMastSts(int row, int bay){
        if(row <= 11 && bay <= 14){
            return 1;
        }
        if(row <= 7){
            return 1;
        }
        if(row >= 21){
            return 3;
        }
        return 2;
    }
    private boolean checkLocExist(int row, int bay, int floor){
        //if(floor == 1 && (row == 2)){
        //    if((bay >=8 && bay <=11)