| | |
| | | |
| | | // 靠近摆放规则 --- 空托 |
| | | if (staDescId == 10) { |
| | | //先判断工作档,查找主档IOType=1, wrkSts < 10的工作明细,料号相同的明细库位 |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("io_type",10)); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | LocMast locMast0 = locMastService.findNearloc(wrkMast.getLocNo()); |
| | | if (null != locMast0) { |
| | | // 浅库位符合尺寸检测 |
| | | if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) { |
| | | locMast = locMast0; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (Cools.isEmpty(locMast)){ |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D")); |
| | | if (locMasts.size() > 0) { |
| | |
| | | locMast = locMast0; |
| | | break; |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | List<String> groupInsideLoc = Utils.getGroupInsideLoc(peakLoc.getLocNo()); |
| | | if (!Cools.isEmpty(groupInsideLoc)){ |
| | | if (!locMastService.checkAllLocEmpty(groupInsideLoc)) continue; |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", groupInsideLoc.get(0))); |
| | | locMast = peakLoc; |
| | | break; |
| | | }else { |
| | | locMast=peakLoc; |
| | |
| | | |
| | | // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 |
| | | if (Cools.isEmpty(locMast)) { |
| | | List<LocMast> peakLocs = locMastService.selectAllPeakLoc(); |
| | | for (LocMast peakLoc : peakLocs) { |
| | | List<String> groupOuterLoc = Utils.getGroupInsideLoc(peakLoc.getLocNo()); |
| | | if (!Cools.isEmpty(groupOuterLoc)){ |
| | | if (!locMastService.checkAllLocEmpty(groupOuterLoc)) continue; |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", groupOuterLoc.get(0))); |
| | | }else { |
| | | locMast = peakLoc; |
| | | } |
| | | |
| | | } |
| | | if (Cools.isEmpty(locMast)) { |
| | | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | | } |
| | | String locNo = locMast.getLocNo(); |
| | | |