自动化立体仓库 - WMS系统
#
whycq
2024-04-23 071f3021f4ba872c572a4c59dd8ce9ea2d3c9106
src/main/java/com/zy/asrs/service/impl/AgvLocMastServiceImpl.java
@@ -36,6 +36,10 @@
        //2楼 1-25排 1-33列 1层
        this.insertBatch(getLocMastList(1, 25, 1, 33, 1, 1, 2));
    }
    public void initLocFloor3() {
        //2楼 1-25排 1-33列 1层
        this.insertBatch(getLocMastList(1, 26, 1, 34, 1, 1, 3));
    }
    //根据排列层获取AGV库位列表
    private List<AgvLocMast> getLocMastList(int rowIndex, int rowMax, int bayIndex, int bayMax, int levIndex, int levMax, int floor){
@@ -45,7 +49,7 @@
            for (int bay = bayIndex; bay <= bayMax; bay++) {
                for (int lev = levIndex; lev <= levMax; lev++) {
                    if(!checkLocExistFloor2(row,bay)){
                    if(!checkLocExistFloor3(row,bay)){
                        continue;
                    }
@@ -63,7 +67,7 @@
                    loc.setModiTime(now);
                    loc.setFirstTime(now);
                    loc.setAppeTime(now);
                    loc.setLocType1(initLocMastSts(row,bay));
                    loc.setLocType1(initLocMastSts3(row,bay));
                    agvLocMastList.add(loc);
                }
            }
@@ -120,6 +124,79 @@
        return 2;
    }
    private boolean checkLocExistFloor3(int row, int bay){
        if(row == 1 && (bay <= 15 || bay >= 30)){
            return false;
        }
        if(row <= 6 && bay >= 29){
            return false;
        }
        if((row >= 9 && row <= 16) && (bay <= 4 || bay >= 33)){
            return false;
        }
        if(row == 17 && (bay <= 3 || bay >= 33)){
            return false;
        }
        if(row <= 21 && bay >= 33){
            return false;
        }
        if(row <= 24 && bay >= 34){
            return false;
        }
        if(row <= 26 && bay >= 29){
            return false;
        }
        if((row != 8 && row != 21  && row != 23 && row != 24 && row != 25 && row != 26) && bay == 15){
            return  false;
        }
        if((row != 22 && row != 23  && row != 24 && row != 25 ) && bay == 16){
            return  false;
        }
        if (row == 4 && (bay == 3 || bay == 4 || bay == 9 || bay == 14 || bay == 19 || bay == 20 || bay == 25)) {
            return  false;
        }
        if ((row == 13 || row == 17) && (bay == 8 || bay == 14 || bay == 19 || bay == 24 )) {
            return  false;
        }
        if (row == 22 && (bay == 4 || bay == 9 || bay == 14 || bay == 20 || bay == 25 )) {
            return  false;
        }
        return true;
    }
    private short initLocMastSts3(int row, int bay){
        if(row <= 8){
            return 1;
        }
        if(row <= 17){
            return 2;
        }
        if(row <= 18 && bay <= 8){
            return 2;
        }
        if(row <= 21){
            return 4;
        }
        if(row >= 22){
            return 3;
        }
        return 2;
    }
    private boolean checkLocExist(int row, int bay, int floor){
        //if(floor == 1 && (row == 2)){