| | |
| | | map.put("commands", commandList); |
| | | map.put("idx", 1); |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_.key + command.getTaskNo(), JSON.toJSONString(map, SerializerFeature.DisableCircularReferenceDetect), 60 * 60 * 24); |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_STATION_TASK_NO.key + crnProtocol.getCrnNo() + "_" + command.getStation(), command.getTaskNo(), 60 * 60 * 24); |
| | | sendCommand(command); |
| | | } else if (step == 3) { |
| | | sendCommand((DualCrnCommand) task.getData()); |
| | |
| | | } |
| | | } |
| | | |
| | | if(crnProtocol.getTaskNo() > 0 && crnProtocol.getStatus().equals(DualCrnStatusType.FETCH_COMPLETE.id)) { |
| | | Integer taskNo = crnProtocol.getTaskNo(); |
| | | if(crnProtocol.getTaskNo() == 0 && crnProtocol.getStatus().equals(DualCrnStatusType.FETCH_COMPLETE.id)) { |
| | | Integer taskNo = null; |
| | | Object stationObj = redisUtil.get(RedisKeyType.DUAL_CRN_COMMAND_STATION_TASK_NO.key + crnProtocol.getCrnNo() + "_" + 1); |
| | | if(stationObj != null) { |
| | | taskNo = Integer.parseInt(String.valueOf(stationObj)); |
| | | } |
| | | |
| | | if (taskNo == null) { |
| | | News.error("双工位堆垛机,工位1空闲等待下发命令,但未找到工作号。堆垛机号={}", crnProtocol.getCrnNo()); |
| | | continue; |
| | | } |
| | | |
| | | Object commandObj = redisUtil.get(RedisKeyType.DUAL_CRN_COMMAND_.key + taskNo); |
| | | if (commandObj == null) { |
| | | News.error("双工位堆垛机,工位1空闲等待下发命令,但未找到命令。堆垛机号={},工作号={}", crnProtocol.getCrnNo(), taskNo); |
| | |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_.key + taskNo, commandMap.toJSONString(), 60 * 60 * 24); |
| | | } |
| | | |
| | | if(crnProtocol.getTaskNoTwo() > 0 && crnProtocol.getStatusTwo() == DualCrnStatusType.IDLE.id) { |
| | | Integer taskNo = crnProtocol.getTaskNoTwo(); |
| | | if(crnProtocol.getTaskNoTwo() == 0 && crnProtocol.getStatusTwo().equals(DualCrnStatusType.FETCH_COMPLETE.id)) { |
| | | Integer taskNo = null; |
| | | Object stationObj = redisUtil.get(RedisKeyType.DUAL_CRN_COMMAND_STATION_TASK_NO.key + crnProtocol.getCrnNo() + "_" + 2); |
| | | if(stationObj != null) { |
| | | taskNo = Integer.parseInt(String.valueOf(stationObj)); |
| | | } |
| | | |
| | | if (taskNo == null) { |
| | | News.error("双工位堆垛机,工位1空闲等待下发命令,但未找到工作号。堆垛机号={}", crnProtocol.getCrnNo()); |
| | | continue; |
| | | } |
| | | |
| | | Object commandObj = redisUtil.get(RedisKeyType.DUAL_CRN_COMMAND_.key + taskNo); |
| | | if (commandObj == null) { |
| | | News.error("双工位堆垛机,工位2空闲等待下发命令,但未找到命令。堆垛机号={},工作号={}", crnProtocol.getCrnNo(), taskNo); |