| | |
| | | chosenCount = count; |
| | | } |
| | | } |
| | | if (chosenCrnNo == null) { |
| | | throw new CoolException("没有空库位"); |
| | | StaDesc staDesc = null; |
| | | LocMast locMast = null; |
| | | if (chosenCrnNo != null) { |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | | .eq("stn_no", sourceStaNo) |
| | | .eq("crn_no", chosenCrnNo)); |
| | | if (!Cools.isEmpty(staDesc)) { |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("crn_no", chosenCrnNo) |
| | | .eq("loc_sts", "O") |
| | | .eq("frozen", 0) |
| | | .eq("deleted", 0) |
| | | .eq("whs_type", 1) |
| | | .orderBy("lev1,bay1")); |
| | | } |
| | | } |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | | .eq("stn_no", sourceStaNo) |
| | | .eq("crn_no", chosenCrnNo)); |
| | | if (Cools.isEmpty(staDesc) || Cools.isEmpty(locMast)) { |
| | | List<LocMast> anyLocs = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "O") |
| | | .eq("frozen", 0) |
| | | .eq("deleted", 0) |
| | | .eq("whs_type", 1) |
| | | .orderBy("lev1,bay1")); |
| | | if (!Cools.isEmpty(anyLocs)) { |
| | | for (LocMast anyLoc : anyLocs) { |
| | | if (anyLoc == null || anyLoc.getCrnNo() == null) { |
| | | continue; |
| | | } |
| | | if (!basCrnpService.checkSiteError(anyLoc.getCrnNo(), true)) { |
| | | continue; |
| | | } |
| | | StaDesc anyStaDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | | .eq("stn_no", sourceStaNo) |
| | | .eq("crn_no", anyLoc.getCrnNo())); |
| | | if (Cools.isEmpty(anyStaDesc)) { |
| | | continue; |
| | | } |
| | | chosenCrnNo = anyLoc.getCrnNo(); |
| | | staDesc = anyStaDesc; |
| | | locMast = anyLoc; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (Cools.isEmpty(staDesc)) { |
| | | throw new CoolException("入库路径不存在"); |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("crn_no", chosenCrnNo) |
| | | .eq("loc_sts", "O") |
| | | .eq("frozen", 0) |
| | | .eq("deleted", 0) |
| | | .eq("whs_type", 1) |
| | | .orderBy("lev1,bay1")); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("没有空库位"); |
| | | } |