| | |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private synchronized void autoPubTasks() { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().in("wrk_sts", Arrays.asList(1L, 11L)).orderBy("io_pri",false).orderBy("appe_time", true)); |
| | | for (int i = 1 ;i<=4;i++){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no",i).in("wrk_sts", 1L, 11L).orderBy("io_pri",false).orderBy("appe_time", true)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | continue; |
| | | } |
| | | Collections.shuffle(wrkMasts); |
| | | // Collections.shuffle(wrkMasts); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | try { |
| | | //查看下发任务是否为冻结库位,是冻结库位则跳过下发任务 |
| | |
| | | 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))); |
| | | List<WrkMast> wrkMasts1 = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).in("wrk_sts", 12L,13L,14L)); |
| | | if (!wrkMasts1.isEmpty()) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private boolean isSuccess(R r) { |
| | | return r != null && "200".equals(String.valueOf(r.get("code"))); |
| | | } |