| | |
| | | array = tmp; |
| | | } |
| | | |
| | | try { |
| | | Thread.sleep(1000);//命令下发前休眠1s |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | OperateResult result = modbusTcpNet.Write("41088", array);; |
| | | if (result != null && result.IsSuccess) { |
| | | News.info("提升机命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); |
| | |
| | | News.info("提升机命令下发成功,提升机号={},任务数据={}", command.getLiftNo(), JSON.toJSON(command)); |
| | | liftProtocol.setWrkTime(new Date());//更新工作时间 |
| | | |
| | | //保存数据到数据库做流水 |
| | | BasLiftOptService liftOptService = SpringUtils.getBean(BasLiftOptService.class); |
| | | if (liftOptService != null) { |
| | | BasLiftOpt opt = new BasLiftOpt( |
| | | redisCommand.getWrkNo().intValue(), |
| | | redisCommand.getLiftNo().intValue(), |
| | | new Date(), |
| | | null, |
| | | null, |
| | | null, |
| | | JSON.toJSONString(command) |
| | | ); |
| | | liftOptService.insert(opt); |
| | | } |
| | | |
| | | try { |
| | | Thread.sleep(1000);//命令下发完成后休眠1s |
| | | } catch (InterruptedException e) { |
| | |
| | | redisUtil.set("lift_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand)); |
| | | }else { |
| | | //已执行完成 |
| | | //保存数据到数据库做流水 |
| | | BasLiftOptService liftOptService = SpringUtils.getBean(BasLiftOptService.class); |
| | | if (liftOptService != null) { |
| | | BasLiftOpt opt = new BasLiftOpt( |
| | | redisCommand.getWrkNo().intValue(), |
| | | redisCommand.getLiftNo().intValue(), |
| | | new Date(), |
| | | null, |
| | | null, |
| | | null, |
| | | JSON.toJSONString(assignCommand) |
| | | ); |
| | | liftOptService.insert(opt); |
| | | } |
| | | //删除redis |
| | | redisUtil.del("lift_wrk_no_" + redisCommand.getWrkNo()); |
| | | |
| | |
| | | //指令结束位 |
| | | array[16] = command.getCommandEnd(); |
| | | |
| | | try { |
| | | Thread.sleep(1000);//命令下发前休眠1s |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | OperateResult result = modbusTcpNet.Write("0", array);; |
| | | if (result != null && result.IsSuccess) { |
| | | News.info("四向穿梭车命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //下发命令 |
| | | if (!write(command)) { |
| | | News.error("四向穿梭车命令下发失败,穿梭车号={},任务数据={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command)); |
| | |
| | | } else { |
| | | News.info("四向穿梭车命令下发成功,穿梭车号={},任务数据={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command)); |
| | | |
| | | try { |
| | | Thread.sleep(1000);//命令下发完后休眠1s |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | //判断数据是否执行完成 |
| | | if (commandStep < size - 1) { |
| | | //更新redis数据 |
| | | //步序增加 |
| | | commandStep++; |
| | | redisCommand.setCommandStep(commandStep); |
| | | //任务数据保存到redis |
| | | redisUtil.set("shuttle_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand)); |
| | | }else { |
| | | //已执行完成 |
| | | //保存数据到数据库做流水 |
| | | BasShuttleOptService shuttleOptService = SpringUtils.getBean(BasShuttleOptService.class); |
| | | if (shuttleOptService != null) { |
| | |
| | | null, |
| | | null, |
| | | null, |
| | | JSON.toJSONString(assignCommand) |
| | | JSON.toJSONString(command) |
| | | ); |
| | | shuttleOptService.insert(opt); |
| | | } |
| | | |
| | | //判断数据是否执行完成 |
| | | if (commandStep < size - 1) { |
| | | //更新redis数据 |
| | | //步序增加 |
| | | commandStep++; |
| | | redisCommand.setCommandStep(commandStep); |
| | | //任务数据保存到redis |
| | | redisUtil.set("shuttle_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand)); |
| | | }else { |
| | | //已执行完成 |
| | | |
| | | if (redisCommand.getLiftSecurityMk()) { |
| | | //曾锁定过提升机,需要进行解锁 |
| | | if (liftProtocol != null) { |