自动化立体仓库 - WMS系统
Administrator
2 天以前 936eec28271690fe40fd85cba87bcd8274bb11b3
src/main/java/com/zy/common/service/CommonService.java
@@ -175,21 +175,35 @@
                .gt("bay1",columnNum));
        // 深库位没有则搜索浅库位
        if (locMasts.isEmpty()) {
            locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
//        if (locMasts.isEmpty()) {
            List<LocMast> locMasts2 = locMastService.selectList(new EntityWrapper<LocMast>()
                    .eq("loc_sts","O").in("crn_no",crnNoList).in("row1","2,3,6,7,10,11,14,15,18,19,22,23").orderBy("lev1,bay1,row1")
                    .gt("bay1",columnNum));
        }
            if(!locMasts2.isEmpty()) {
                locMasts.addAll(locMasts2);
            }
//        }
        if (locMasts.isEmpty()) {
            throw new CoolException("没有可用库位");
        }
        // 浅库位
        String[] split = "02,03,06,07,10,11,14,15,18,19,22,23".split(",");
        // 记录堆垛机是否查询过,避免重复查询
        Map<Integer,Boolean> crnMap = new HashMap<>();
        for (LocMast mast : locMasts) {
            if (crnMap.get(mast.getCrnNo()) == null) {
                //预留空库位
                if (locMastService.checkEmptyCount(mast, 10)) {
                    Integer row1 = mast.getRow1();
                    if(slaveProperties.getDoubleLocs().contains(row1)){
                        // 取浅库位
                        String s = split[slaveProperties.getDoubleLocs().indexOf(row1)];
                        LocMast locMast1 = locMastService.selectById(s + mast.getLocNo().substring(2));
                        if(locMast1 != null && !locMast1.getLocSts().equals("O")) {
                            log.warn("入库分配库位:{},对应浅库位{}不为空:{}",mast.getLocNo(),locMast1.getLocNo(),locMast1.getLocSts());
                            continue;
                        }
                    }
                    locMast = mast;
                    break;
                } else {
@@ -198,6 +212,11 @@
            }
        }
        if (locMast == null) {
            log.error("入库请求库位不足,剩余库位不足/不满足入库条件");
            throw new CoolException("入库请求库位不足,剩余数量不足/不满足入库条件");
        }
        return locMast;
    }