| | |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.zy.core.model.protocol.StationProtocol; |
| | | import com.zy.core.task.MainProcessLane; |
| | | import com.zy.core.task.MainProcessTaskSubmitter; |
| | | import com.zy.core.thread.StationThread; |
| | | import com.zy.core.utils.StationOperateProcessUtils; |
| | | import com.zy.core.utils.WmsOperateUtils; |
| | |
| | | private WmsOperateUtils wmsOperateUtils; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private MainProcessTaskSubmitter mainProcessTaskSubmitter; |
| | | |
| | | /** |
| | | * 保留当前按站点 lane 并发的能力,同时用一个简单计数避免并发生成把站点任务数顶穿上限。 |
| | |
| | | } |
| | | } |
| | | |
| | | public void submitGenerateStoreTask(StoreInTaskPolicy policy, |
| | | BasDevp basDevp, |
| | | StationObjModel stationObjModel, |
| | | long minIntervalMs, |
| | | Runnable task) { |
| | | submitGenerateStoreTask(policy, basDevp, stationObjModel, MainProcessLane.GENERATE_STORE, minIntervalMs, task); |
| | | } |
| | | |
| | | public void submitGenerateStoreTask(StoreInTaskPolicy policy, |
| | | BasDevp basDevp, |
| | | StationObjModel stationObjModel, |
| | | MainProcessLane lane, |
| | | long minIntervalMs, |
| | | Runnable task) { |
| | | Integer stationId = stationObjModel == null ? null : stationObjModel.getStationId(); |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | | lane, |
| | | stationId, |
| | | "generateStoreWrkFile", |
| | | minIntervalMs, |
| | | task |
| | | ); |
| | | } |
| | | |
| | | private void generateByStation(StoreInTaskPolicy policy, BasDevp basDevp, StationObjModel stationObjModel, |
| | | HashMap<String, String> systemConfigMap) { |
| | | StoreInTaskContext context = buildContext(basDevp, stationObjModel); |
| | |
| | | return; |
| | | } |
| | | |
| | | if (hasCreatedTask(context.getStationProtocol().getBarcode())) { |
| | | long count = wrkMastService.count(new QueryWrapper<WrkMast>().eq("barcode", context.getStationProtocol().getBarcode())); |
| | | if (count > 0) { |
| | | policy.setSystemWarning(context, "系统任务已存在"); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | return new StoreInTaskContext(basDevp, stationThread, stationObjModel, stationProtocol); |
| | | } |
| | | |
| | | private boolean hasCreatedTask(String barcode) { |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>().eq("barcode", barcode)); |
| | | return !wrkMasts.isEmpty(); |
| | | } |
| | | |
| | | private void handleSyncApplyResponse(StoreInTaskPolicy policy, StoreInTaskContext context, InTaskApplyRequest request, |