| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public R shuttleCommandQuery(@RequestParam("wrkNo") Integer wrkNo) { |
| | | Object o = redisUtil.get(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo); |
| | | if (o == null) { |
| | | return R.error(); |
| | | return R.error("指令不存在"); |
| | | } |
| | | ShuttleRedisCommand redisCommand = JSON.parseObject(o.toString(), ShuttleRedisCommand.class); |
| | | return R.ok().add(redisCommand); |
| | | ShuttleAssignCommand assignCommand = redisCommand.getAssignCommand(); |
| | | List<ShuttleCommand> commands = assignCommand.getCommands(); |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("commands", commands); |
| | | map.put("shuttleNo", redisCommand.getShuttleNo()); |
| | | map.put("commandStep", redisCommand.getCommandStep()); |
| | | map.put("wrkNo", redisCommand.getWrkNo()); |
| | | |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | //回退命令 |
| | |
| | | return R.error("plc已掉线"); |
| | | } |
| | | if (workNo != null) { |
| | | shuttleThread.setTaskNo(workNo); |
| | | shuttleThread.setSyncTaskNo(workNo); |
| | | } |
| | | if (pakMk != null) { |
| | | shuttleThread.setPakMk(pakMk.equals("Y")); |