| | |
| | | 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 { |
| | |
| | | } |
| | | } |
| | | |
| | | if (locMast == null) { |
| | | log.error("入库请求库位不足,剩余库位不足/不满足入库条件"); |
| | | throw new CoolException("入库请求库位不足,剩余数量不足/不满足入库条件"); |
| | | } |
| | | |
| | | return locMast; |
| | | } |
| | | |