| | |
| | | stationOperateProcessUtils.stationInExecute(); |
| | | //执行输送站点出库任务 |
| | | stationOperateProcessUtils.stationOutExecute(); |
| | | //检测出库任务到达目的地 |
| | | stationOperateProcessUtils.arriveAtTheDestination(); |
| | | //检测输送站点出库任务执行完成 |
| | | stationOperateProcessUtils.stationOutExecuteFinish(); |
| | | |
| | |
| | | if (stationProtocol == null) { |
| | | continue; |
| | | } |
| | | String barcode = stationProtocol.getBarcode(); |
| | | |
| | | // 满足自动、有物、有工作号,生成入库数据 |
| | | if (stationProtocol.isAutoing() |
| | | && stationProtocol.isLoading() |
| | | && stationProtocol.getTaskNo() > 0) { |
| | | && stationProtocol.getTaskNo() == 0) { |
| | | if (Cools.isEmpty(stationProtocol.getBarcode())) { |
| | | continue; |
| | | } |
| | | //是否报警 |
| | | if (stationProtocol.getError()>0){ |
| | | StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, |
| | | 9991, 1015, 1013, 0); |
| | | stationProtocol.setSystemWarning(stationProtocol.getErrorMsg()); |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | continue; |
| | | } |
| | | |
| | | String[] split = barcode.split(","); |
| | | String bar = split[0]; |
| | | // 检测任务是否生成 |
| | | List<WrkMast> wrkMasts = wrkMastService |
| | | .selectList(new EntityWrapper<WrkMast>().eq("barcode", stationProtocol.getBarcode())); |
| | | .selectList(new EntityWrapper<WrkMast>().eq("barcode", bar)); |
| | | if (!wrkMasts.isEmpty()) { |
| | | continue; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | String barcode = stationProtocol.getBarcode(); |
| | | |
| | | Integer stationIdVal = stationProtocol.getStationId(); |
| | | |
| | | // 1. 首先查询是否有已完成的异步响应 |
| | |
| | | News.error("WMS入库请求失败,重新发起请求,barcode={},stationId={},response={}", barcode, |
| | | stationIdVal, response); |
| | | wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal, |
| | | stationProtocol.getPalletHeight()); |
| | | stationProtocol.getPalletHeight(),stationProtocol.getWeight()); |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2); |
| | | // stationProtocol.setSys |
| | | continue; |
| | | } |
| | | |
| | |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | CreateInTaskParam taskParam = new CreateInTaskParam(); |
| | | taskParam.setTaskNo(dto.getTaskNo()); |
| | | taskParam.setTaskNo(String.valueOf(dto.getTaskNo())); |
| | | taskParam.setLocNo(dto.getLocNo()); |
| | | taskParam.setTaskPri(dto.getTaskPri()); |
| | | taskParam.setBarcode(barcode); |
| | | taskParam.setBarcode(dto.getBarcode()); |
| | | taskParam.setSourceStaNo(String.valueOf(dto.getSourceStaNo())); |
| | | taskParam.setStaNo(String.valueOf(dto.getStaNo())); |
| | | taskParam.setCrnNo(dto.getCrnNo()); |
| | | WrkMast wrkMast = commonService.createInTask(taskParam); |
| | | |
| | | StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, |
| | | wrkMast.getWrkNo(), stationId, stationId, 0); |
| | | wrkMast.getWrkNo(), dto.getSourceStaNo(), dto.getStaNo(), 0); |
| | | if (command == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败"); |
| | | continue; |
| | | } |
| | | stationProtocol.setSystemWarning(""); |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | } else { |
| | | |
| | | stationProtocol.setSystemWarning(jsonObject.getString("msg")); |
| | | StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, |
| | | 9991, 1015, 1013, 0); |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | // 接口返回非200,重新发起请求 |
| | | News.error("WMS入库接口返回非200,重新发起请求,barcode={},stationId={},response={}", barcode, |
| | | stationIdVal, response); |
| | | wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal, |
| | | stationProtocol.getPalletHeight()); |
| | | stationProtocol.getPalletHeight(),stationProtocol.getWeight()); |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2); |
| | | } |
| | | } else { |
| | |
| | | // 没有请求进行中,发起新的异步请求 |
| | | News.info("发起异步WMS入库请求,barcode={},stationId={}", barcode, stationIdVal); |
| | | wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal, |
| | | stationProtocol.getPalletHeight()); |
| | | stationProtocol.getPalletHeight(),stationProtocol.getWeight()); |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2); |
| | | } |
| | | // 如果有请求进行中,等待下次循环再检查 |