| | |
| | | if (Cools.isEmpty(sourceLoc) || Cools.isEmpty(sourceLoc.getBarcode())) { |
| | | return null; |
| | | } |
| | | Integer sourceCrnNo = sourceLoc.getCrnNo(); |
| | | if (sourceCrnNo == null) { |
| | | return null; |
| | | } |
| | | |
| | | Integer runningCount = wrkMastService.selectCount(new EntityWrapper<WrkMast>() |
| | | .eq("barcode", sourceLoc.getBarcode()) |
| | |
| | | Integer targetCrnNo = null; |
| | | Integer targetEmptyCount = null; |
| | | for (int candidate = 1; candidate < 5; candidate++) { |
| | | if (candidate == crnNo) { |
| | | if (candidate == sourceCrnNo) { |
| | | continue; |
| | | } |
| | | Integer runingCount = wrkMastService.selectCount(new EntityWrapper<WrkMast>() |
| | | .eq("io_type", 101).eq("crn_no",candidate) |
| | | .in("wrk_sts", Arrays.asList(2L, 3L, 4L, 11L, 12L))); |
| | | if(runingCount != null && runingCount > 5) {continue;} |
| | | Integer candidateEmpty = locMastService.selectCount(new EntityWrapper<LocMast>() |
| | | .eq("crn_no", candidate) |
| | | .eq("loc_sts", "O") |
| | |
| | | if (Cools.isEmpty(targetLoc)) { |
| | | return null; |
| | | } |
| | | if (sourceCrnNo.equals(targetLoc.getCrnNo())) { |
| | | return null; |
| | | } |
| | | |
| | | List<Integer> sourceStaNos = staDescService.queryOutStaNosByLocNo(sourceLoc.getLocNo(), 101); |
| | | if (Cools.isEmpty(sourceStaNos)) { |
| | |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(11L); |
| | | wrkMast.setIoType(101); |
| | | wrkMast.setIoPri(10D); |
| | | wrkMast.setIoPri(13D); |
| | | wrkMast.setCrnNo(sourceLoc.getCrnNo()); |
| | | wrkMast.setSourceLocNo(sourceLoc.getLocNo()); |
| | | wrkMast.setLocNo(targetLoc.getLocNo()); |