| | |
| | | // 存在进行中/在途任务(2,3,12,13,14)则不下发出库,避免冲突(排除当前任务) |
| | | // 2 待执行(入库) |
| | | // 3 设备执行中(入库) |
| | | // 4 入库完成 |
| | | // 12 设备执行中(出库) |
| | | // 13 出库到站点上 |
| | | // 14 出库等待确认 |
| | | int activeCount = wrkMastService.selectCount(new EntityWrapper<WrkMast>() |
| | | .in("wrk_sts", 2, 3, 12, 13, 14) |
| | | .in("wrk_sts", 2, 3,4, 12, 13, 14) |
| | | .ne("wrk_no", wrkMast.getWrkNo())); |
| | | if (activeCount > 0) { |
| | | return; |
| | | } |
| | | // 存在5秒内的 5状态,不下发新的出库任务 |
| | | Date modiTimeThreshold = new Date(System.currentTimeMillis() - 5000L); |
| | | int recentStatus15Count = wrkMastService.selectCount(new EntityWrapper<WrkMast>() |
| | | .in("wrk_sts", 5) |
| | | .gt("modi_time", modiTimeThreshold) |
| | | .ne("wrk_no", wrkMast.getWrkNo())); |
| | | if (recentStatus15Count > 0) { |
| | | return; |
| | | } |
| | | |
| | | Integer sourceStaNo = Utils.getStaNoByLocNo(wrkMast.getSourceLocNo()); |
| | | |