| | |
| | | import com.zy.core.News; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.dispatch.StationCommandDispatcher; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.zy.core.model.Task; |
| | |
| | | private DualCrnOperateProcessUtils dualCrnOperateProcessUtils; |
| | | @Autowired |
| | | private StoreInTaskGenerationService storeInTaskGenerationService; |
| | | @Autowired |
| | | private StationCommandDispatcher stationCommandDispatcher; |
| | | |
| | | /** |
| | | * 带超时保护执行方法 |
| | |
| | | StationCommand command = stationThread.getCommand(StationCommandType.MOVE, |
| | | commonService.getWorkNo(WrkIoType.FAKE_TASK_NO.id), stationId, |
| | | entity.getBarcodeStation().getStationId(), 0); |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | stationCommandDispatcher.dispatch(basDevp.getDevpNo(), command, "fake-process", "fake-enable-in"); |
| | | redisUtil.set(RedisKeyType.GENERATE_FAKE_IN_STATION_DATA_LIMIT.key + stationId, "lock", 5); |
| | | } |
| | | } |
| | |
| | | News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败"); |
| | | continue; |
| | | } |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | stationCommandDispatcher.dispatch(basDevp.getDevpNo(), command, "fake-process", "fake-in-task"); |
| | | redisUtil.set(RedisKeyType.GENERATE_FAKE_IN_TASK_LIMIT.key + stationId, "lock", 5); |
| | | } |
| | | } |
| | |
| | | News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败"); |
| | | return; |
| | | } |
| | | MessageQueue.offer(SlaveType.Devp, context.getBasDevp().getDevpNo(), new Task(2, command)); |
| | | stationCommandDispatcher.dispatch(context.getBasDevp().getDevpNo(), command, "fake-process", "write-info"); |
| | | } |
| | | |
| | | // 计算所有站点停留时间 |
| | |
| | | continue; |
| | | } |
| | | |
| | | MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command)); |
| | | stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "out-station-reset"); |
| | | redisUtil.set( |
| | | RedisKeyType.CHECK_OUT_STATION_STAY_TIME_OUT_LIMIT.key + stationObjModel.getStationId(), |
| | | "lock", 10); |
| | |
| | | |
| | | WrkMast wrkMast = wrkMastService.selectByWorkNo(stationProtocol.getTaskNo()); |
| | | if (wrkMast == null) { |
| | | MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command)); |
| | | stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "in-station-reset-task-over"); |
| | | redisUtil.set( |
| | | RedisKeyType.CHECK_IN_STATION_STAY_TIME_OUT_LIMIT.key + stationObjModel.getStationId(), |
| | | "lock", 10); |
| | |
| | | continue; |
| | | } |
| | | |
| | | MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command)); |
| | | stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "in-station-reset-crn-fetch"); |
| | | redisUtil.set(RedisKeyType.CHECK_IN_STATION_STAY_TIME_OUT_LIMIT.key |
| | | + stationObjModel.getStationId(), "lock", 10); |
| | | News.info("输送站点重置命令下发成功(crn_fetch),站点号={},命令数据={}", stationObjModel.getStationId(), |
| | |
| | | continue; |
| | | } |
| | | |
| | | MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command)); |
| | | stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "in-station-reset-dual-crn-fetch"); |
| | | redisUtil.set(RedisKeyType.CHECK_IN_STATION_STAY_TIME_OUT_LIMIT.key |
| | | + stationObjModel.getStationId(), "lock", 10); |
| | | News.info("输送站点重置命令下发成功(crn_fetch),站点号={},命令数据={}", stationObjModel.getStationId(), |
| | |
| | | // 生成仿真站点数据 |
| | | StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, 9998, |
| | | wrkMast.getSourceStaNo(), 0, 0); |
| | | MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command)); |
| | | stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "crn-out-complete-write-info"); |
| | | redisUtil.set(RedisKeyType.CRN_OUT_TASK_COMPLETE_STATION_INFO.key + wrkMast.getWrkNo(), JSON.toJSONString(stationObjModel, SerializerFeature.DisableCircularReferenceDetect), 60 * 60 * 24); |
| | | } |
| | | } else if (wrkMast.getWrkSts() == WrkStsType.LOC_MOVE_RUN.sts) { |
| | | updateWrkSts = WrkStsType.COMPLETE_LOC_MOVE.sts; |
| | | } else if (wrkMast.getWrkSts() == WrkStsType.CRN_MOVE_RUN.sts) { |
| | | updateWrkSts = WrkStsType.COMPLETE_CRN_MOVE.sts; |
| | | } else { |
| | | News.error("堆垛机处于等待确认且任务完成状态,但工作状态异常。堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | | continue; |