| | |
| | | * @date 2026/1/10 14:42 |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void autoPubTasks() { |
| | | private synchronized void autoPubTasks() { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().in("wrk_sts", Arrays.asList(1L, 11L))); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | |
| | | .eq("b_loc_no", wrkMast.getLocNo()) |
| | | .eq("freeze", 1)); |
| | | if (Cools.isEmpty(locAroundBind)) { |
| | | locAroundBind = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>() |
| | | .eq("b_loc_no", wrkMast.getSourceLocNo()) |
| | | .eq("freeze", 1)); |
| | | if (!Cools.isEmpty(locAroundBind)) { |
| | | markPublishError(wrkMast.getWrkNo(), String.valueOf("源库位被冻结")); |
| | | continue; |
| | | } |
| | | } else { |
| | | markPublishError(wrkMast.getWrkNo(), String.valueOf("目标库位被冻结")); |
| | | continue; |
| | | } |
| | | locAroundBind = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>() |
| | | .eq("b_loc_no", wrkMast.getSourceLocNo()) |
| | | .eq("freeze", 1)); |
| | | if (!Cools.isEmpty(locAroundBind)) { |
| | | markPublishError(wrkMast.getWrkNo(), String.valueOf("源库位被冻结")); |
| | | continue; |
| | | } |
| | | Integer crnNo = wrkMast.getCrnNo(); |
| | | //该堆垛机已经下发任务给wcs后不再下发新的搬运任务 |
| | | List<WrkMast> wrkMasts1 = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).in("wrk_sts", Arrays.asList(12L))); |
| | | if (!wrkMasts1.isEmpty()) { |
| | | continue; |
| | | } |
| | | //如果任务是移库任务时:该堆垛机已经下发任务给wcs后不再下发新的搬运任务 |
| | | if(wrkMast.getIoType()==101&&!Cools.isEmpty(wrkMast.getLocNo())){ |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("crn_no", crnNo).eq("loc_no", wrkMast.getLocNo())); |
| | | if (!Cools.isEmpty(locMast)) { |
| | | List<WrkMast> wrkMasts1 = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).in("wrk_sts", Arrays.asList(12L,13L,14L))); |
| | | if (!wrkMasts1.isEmpty()) { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //源库位为冻结库位时禁止下发搬运任务给堆垛机 |
| | | if (!Cools.isEmpty(wrkMast.getSourceLocNo())) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |