| | |
| | | @Override |
| | | public CommandResponse sendCommand(DualCrnCommand command) { |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_SEND_COMMAND_LOCK.key + deviceConfig.getDeviceNo(), "lock", 5); |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_SEND_COMMAND_LOCK.key + deviceConfig.getDeviceNo(), "lock", 10); |
| | | CommandResponse response = new CommandResponse(false); |
| | | try { |
| | | if (null == command) { |
| | |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), command.getCrnNo(), JSON.toJSON(command))); |
| | | response.setResult(true); |
| | | response.setMessage("命令下发成功"); |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_SEND_COMMAND_LOCK.key + deviceConfig.getDeviceNo(), "lock", 5); |
| | | } else { |
| | | News.error("双工位堆垛机写入堆垛机plc数据失败 ===>> [id:{}]", command.getCrnNo()); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】写入堆垛机plc数据失败 ===>> [id:{1}]", DateUtils.convert(new Date()), command.getCrnNo())); |