| | |
| | | @Transactional |
| | | public StartupDto getLocNoV2(Integer staDescId, Integer sourceStaNo, WrkMast wrkMast, LocTypeDto locTypeDto) { |
| | | try { |
| | | Integer whsType = Utils.GetWhsType(sourceStaNo); |
| | | Integer whsType = 1; |
| | | RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | RowLastnoType rowLastnoType = rowLastnoTypeService.selectById(rowLastno.getTypeId()); |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 当回源库位不在本巷道时,出库至1070重新检索巷道根据1,2巷道之间分配,3,4巷道全局分配规则 |
| | | * 当回源库位不在本巷道时,重新检索巷道根据1,2巷道之间分配,3,4巷道全局分配规则 |
| | | */ |
| | | @Transactional |
| | | public StartupDto getLocNoRunV2(Integer whsType, Integer staDescId, Integer sourceStaNo, WrkMast wrkMast, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { |
| | |
| | | Integer chosenCrnNo = null; |
| | | Integer chosenCount = null; |
| | | for (int candidate : candidates) { |
| | | if (!basCrnpService.checkSiteError(candidate, true)) { |
| | | continue; |
| | | } |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | | .eq("stn_no", sourceStaNo) |
| | | .eq("crn_no", candidate)); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | continue; |
| | | } |
| | | //判断该巷道是否存在空位 |
| | | LocMast candidateLoc = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("crn_no", candidate) |
| | |
| | | chosenCount = count; |
| | | } |
| | | } |
| | | 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")); |
| | | } |
| | | 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(staDesc) || Cools.isEmpty(locMast)) { |
| | | if (Cools.isEmpty(locMast)) { |
| | | List<LocMast> anyLocs = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "O") |
| | | .eq("frozen", 0) |
| | |
| | | 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("入库路径不存在"); |
| | | } |
| | | |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | |
| | | int workNo = getWorkNo(0); |
| | | startupDto.setWorkNo(workNo); |
| | | startupDto.setCrnNo(chosenCrnNo); |
| | | startupDto.setSourceStaNo(sourceStaNo); |
| | | startupDto.setLocNo(locNo); |
| | | startupDto.setStaNo(staDesc.getCrnStn()); |
| | | return startupDto; |
| | | } |
| | | |