自动化立体仓库 - WMS系统
zyx
2024-03-27 b5768fb9a6bf4216aba11d7f784e8cefc8fdaf9b
src/main/java/com/zy/asrs/service/impl/AgvLocMastServiceImpl.java
@@ -27,27 +27,14 @@
    public void initLocFloor1() {
        //1楼 13排 86列 12层
        List<AgvLocMast> agvLocMastList = getLocMastList(1,33,1,45,1,1,1);
        List<AgvLocMast> agvLocMastList = getLocMastList(1,45,1,33,1,1,1);
        this.insertBatch(agvLocMastList);
    }
    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,12 +63,58 @@
                    loc.setModiTime(now);
                    loc.setFirstTime(now);
                    loc.setAppeTime(now);
                    loc.setLocType1(initLocMastSts(row,bay));
                    agvLocMastList.add(loc);
                }
            }
        }
        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){
@@ -120,15 +142,15 @@
                    return false;
                }
            } else if (row == 6) {
                if (bay < 20 || bay == 25 || bay == 30) {
                if (bay < 20 || bay == 26 || bay == 30) {
                    return false;
                }
            } else if (row == 7) {
                if (bay < 4 || bay == 25) {
                if (bay < 4 || bay == 26) {
                    return false;
                }
            } else if (row == 9 || row ==10 ) {
                if (bay < 4 || bay == 12 || bay == 25) {
                if (bay < 4 || bay == 12 || bay == 26) {
                    return false;
                }
            } else if (row == 12) {
@@ -190,10 +212,11 @@
        this.baseMapper.updateLocType2(locType2,locRule.getRowBeg(),locRule.getRowEnd(),locRule.getBayBeg(),locRule.getBayEnd(),locRule.getLevBeg(),locRule.getLevEnd(),locRule.getFloor());
    }
    public void updateLocStsByLocNo(String locNo, String locSts, String barcode) {
    public void updateLocStsByLocNo(String locNo, String locSts, String barcode,Short containerType) {
        AgvLocMast agvLocMast = this.selectById(locNo);
        agvLocMast.setLocSts(locSts);
        agvLocMast.setBarcode(barcode);
        agvLocMast.setLocType2(containerType);
        this.updateById(agvLocMast);
    }
@@ -208,4 +231,11 @@
        //return this.agvLocMastMapper.selectLocByLevAndFloor(lev,floor);
    }
    @Override
    public AgvLocMast selectEmptyZpallet(int type) {
        return this.selectOne(new EntityWrapper<AgvLocMast>().eq("loc_sts","D").eq("loc_type2",type));
    }
}