| | |
| | | } |
| | | |
| | | /** |
| | | * 当回源库位不在本巷道时,出库至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) { |
| | |
| | | detl = wrkDetl.get(0); |
| | | } |
| | | String matnr = detl == null ? null : detl.getMatnr(); |
| | | int[] candidates = wrkMast.getCrnNo() != null && wrkMast.getCrnNo() < 3 ? new int[]{1, 2} : new int[]{1, 2, 3, 4}; |
| | | Integer sourceCrnNo = null; |
| | | if (moveCrnNo != null && moveCrnNo != 0) { |
| | | sourceCrnNo = moveCrnNo; |
| | | } else if (wrkMast != null && !Cools.isEmpty(wrkMast.getSourceLocNo())) { |
| | | LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (!Cools.isEmpty(sourceLoc) && sourceLoc.getCrnNo() != null) { |
| | | sourceCrnNo = sourceLoc.getCrnNo(); |
| | | } |
| | | } else if (wrkMast != null && wrkMast.getCrnNo() != null) { |
| | | sourceCrnNo = wrkMast.getCrnNo(); |
| | | } |
| | | int[] candidates = sourceCrnNo != null && sourceCrnNo < 3 ? new int[]{1, 2} : new int[]{1, 2, 3, 4}; |
| | | Integer chosenCrnNo = null; |
| | | Integer chosenCount = null; |
| | | for (int candidate : candidates) { |
| | | if (sourceCrnNo != null && candidate == sourceCrnNo) { |
| | | continue; |
| | | } |
| | | //判断该巷道是否存在空位 |
| | | LocMast candidateLoc = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("crn_no", candidate) |
| | |
| | | if (anyLoc == null || anyLoc.getCrnNo() == null) { |
| | | continue; |
| | | } |
| | | if (sourceCrnNo != null && sourceCrnNo.equals(anyLoc.getCrnNo())) { |
| | | continue; |
| | | } |
| | | if (!basCrnpService.checkSiteError(anyLoc.getCrnNo(), true)) { |
| | | continue; |
| | | } |