| | |
| | | } |
| | | } |
| | | if (nearRow == 0) { |
| | | throw new CoolException("无可用堆垛机"); |
| | | if (locTypeDto.getLocType2() == 2) { |
| | | //尝试找1号弯轨堆垛机库位 |
| | | crnNo = 1; |
| | | if (basCrnpService.checkSiteError(crnNo, true)) { |
| | | List<Integer> nearRowList = new ArrayList<Integer>(){{add(3);add(4);add(1);add(6);}}; |
| | | for (Integer near : nearRowList) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("row1", near) |
| | | .eq("loc_sts", "O") |
| | | .eq("whs_type", rowLastnoType.getType().longValue()) |
| | | .eq("loc_type1", locTypeDto.getLocType1()) |
| | | .eq("loc_type2", locTypeDto.getLocType2()) |
| | | ); |
| | | int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100)); |
| | | if (locMasts.size() - crnCountO <= 2) { |
| | | log.error(crnNo + "号堆垛机没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | }else { |
| | | nearRow = near; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (nearRow == 0) { |
| | | throw new CoolException("无可用堆垛机"); |
| | | } |
| | | }else { |
| | | throw new CoolException("无可用堆垛机"); |
| | | } |
| | | } |
| | | |
| | | boolean signRule1 = false; |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (crnNo == 1) { |
| | | if (locMast1.getRow1() == 1 || locMast1.getRow1() == 6) { |
| | | locMast = locMast1;//单深库位直接使用 |
| | | break; |
| | | } |
| | | |
| | | //获取目标库位所在巷道最浅非空库位 |
| | | List<LocMast> locMastList = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("whs_type", rowLastnoType.getType().longValue()) |
| | | .eq("crn_no", locMast1.getCrnNo()) |
| | | .eq("bay1", locMast1.getBay1()) |
| | | .notIn("loc_sts", "O") |
| | | .orderBy("row1", true) |
| | | ); |
| | | if (locMastList.isEmpty()) { |
| | | locMast = locMast1; |
| | | break; |
| | | } |
| | | |
| | | LocMast locMastF = locMastList.get(0); |
| | | if (!slaveProperties.getDoubleLocs().contains(locMastF.getRow1())) { |
| | | continue; |
| | | } |
| | | |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMastF.getLocNo())); |
| | | if (!Cools.isEmpty(locDetl) && findLocNoAttributeVo.beSimilar(locDetl)) { |
| | | String shallowLoc = Utils.getShallowLoc(slaveProperties, locMastF.getLocNo()); |
| | | LocMast shallowLocMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", shallowLoc) |
| | | .eq("loc_sts", "O") |
| | | ); |
| | | if(shallowLocMast != null) { |
| | | locMast = shallowLocMast; |
| | | break; |
| | | } |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | //获取目标库位所在巷道最浅非空库位 |
| | | LocMast locMastF = locMastService.selectLocByLocStsPakInF(curRow, nearRow, locMast1, rowLastnoType.getType().longValue()); |
| | | if (!Cools.isEmpty(locMastF) && locMastF.getLocSts().equals("F")) { |