| | |
| | | shuttleData.put("moveAdvancePath", null);//穿梭车预计路径 |
| | | if (shuttleProtocol.getTaskNo() != 0) { |
| | | //存在任务,获取指令 |
| | | Object object = redisUtil.get(RedisKeyType.SHUTTLE.key + shuttleProtocol.getTaskNo()); |
| | | Object object = redisUtil.get(RedisKeyType.SHUTTLE_WORK_FLAG.key + shuttleProtocol.getTaskNo()); |
| | | if (object != null) { |
| | | ShuttleRedisCommand redisCommand = JSON.parseObject(object.toString(), ShuttleRedisCommand.class); |
| | | shuttleData.put("moveAdvancePath", redisCommand.getAssignCommand().getNodes());//穿梭车预计路径 |
| | |
| | | |
| | | @RequestMapping(value = "/command/query") |
| | | public R shuttleCommandQuery(@RequestParam("wrkNo") Integer wrkNo) { |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE.key + wrkNo); |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo); |
| | | if (o == null) { |
| | | return R.error(); |
| | | } |
| | |
| | | @RequestMapping(value = "/command/rollback") |
| | | public R shuttleCommandRollback(@RequestParam("wrkNo") Integer wrkNo |
| | | , @RequestParam("commandStep") Integer commandStep) { |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE.key + wrkNo); |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo); |
| | | if (o == null) { |
| | | return R.error(); |
| | | } |
| | | ShuttleRedisCommand redisCommand = JSON.parseObject(o.toString(), ShuttleRedisCommand.class); |
| | | redisCommand.setCommandStep(commandStep); |
| | | redisUtil.set(RedisKeyType.SHUTTLE.key + wrkNo, JSON.toJSONString(redisCommand)); |
| | | redisUtil.set(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo, JSON.toJSONString(redisCommand)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | public R shuttleCommandCompleteSwitch(@RequestParam("wrkNo") Integer wrkNo |
| | | , @RequestParam("commandStep") Integer commandStep |
| | | , @RequestParam("complete") Integer complete) { |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE.key + wrkNo); |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo); |
| | | if (o == null) { |
| | | return R.error(); |
| | | } |
| | |
| | | List<ShuttleCommand> commands = assignCommand.getCommands(); |
| | | ShuttleCommand command = commands.get(commandStep); |
| | | command.setComplete(complete != 0); |
| | | redisUtil.set(RedisKeyType.SHUTTLE.key + wrkNo, JSON.toJSONString(redisCommand)); |
| | | redisUtil.set(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo, JSON.toJSONString(redisCommand)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | //重启任务(命令) |
| | | @RequestMapping(value = "/command/restart") |
| | | public R shuttleCommandCompleteSwitch(@RequestParam("wrkNo") Integer wrkNo) { |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE.key + wrkNo); |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo); |
| | | if (o == null) { |
| | | return R.error(); |
| | | } |
| | |
| | | //删除任务(命令) |
| | | @RequestMapping(value = "/command/del") |
| | | public R liftCommandDel(@RequestParam("wrkNo") Integer wrkNo) { |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE.key + wrkNo); |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo); |
| | | if (o == null) { |
| | | return R.error(); |
| | | } |
| | | redisUtil.del(RedisKeyType.SHUTTLE.key + wrkNo); |
| | | redisUtil.del(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo); |
| | | return R.ok(); |
| | | } |
| | | |