|  |  |  | 
|---|
|  |  |  | @PostMapping("/table/lift/msg") | 
|---|
|  |  |  | @ManagerAuth(memo = "提升机数据表") | 
|---|
|  |  |  | public R liftMsgTable(){ | 
|---|
|  |  |  | List<LiftMsgTableVo> list = new ArrayList<>(); | 
|---|
|  |  |  | List<ForkLiftMsgTableVo> list = new ArrayList<>(); | 
|---|
|  |  |  | List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() | 
|---|
|  |  |  | .eq("device_type", String.valueOf(SlaveType.ForkLift))); | 
|---|
|  |  |  | for (DeviceConfig device : forkliftList) { | 
|---|
|  |  |  | // 表格行 | 
|---|
|  |  |  | LiftMsgTableVo vo = new LiftMsgTableVo(); | 
|---|
|  |  |  | ForkLiftMsgTableVo vo = new ForkLiftMsgTableVo(); | 
|---|
|  |  |  | vo.setLiftNo(device.getDeviceNo());   //  提升机号 | 
|---|
|  |  |  | list.add(vo); | 
|---|
|  |  |  | // 获取提升机信息 | 
|---|
|  |  |  | 
|---|
|  |  |  | if (o == null) { | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LiftRedisCommand redisCommand = JSON.parseObject(o.toString(), LiftRedisCommand.class); | 
|---|
|  |  |  | ForkLiftRedisCommand redisCommand = JSON.parseObject(o.toString(), ForkLiftRedisCommand.class); | 
|---|
|  |  |  | return R.ok().add(redisCommand); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if (o == null) { | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LiftRedisCommand redisCommand = JSON.parseObject(o.toString(), LiftRedisCommand.class); | 
|---|
|  |  |  | ForkLiftRedisCommand redisCommand = JSON.parseObject(o.toString(), ForkLiftRedisCommand.class); | 
|---|
|  |  |  | redisCommand.setCommandStep(commandStep); | 
|---|
|  |  |  | redisUtil.set(RedisKeyType.FORK_LIFT_WORK_FLAG.key + wrkNo, JSON.toJSONString(redisCommand)); | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (o == null) { | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LiftRedisCommand redisCommand = JSON.parseObject(o.toString(), LiftRedisCommand.class); | 
|---|
|  |  |  | LiftAssignCommand assignCommand = redisCommand.getAssignCommand(); | 
|---|
|  |  |  | ForkLiftRedisCommand redisCommand = JSON.parseObject(o.toString(), ForkLiftRedisCommand.class); | 
|---|
|  |  |  | ForkLiftAssignCommand assignCommand = redisCommand.getAssignCommand(); | 
|---|
|  |  |  | List<ForkLiftCommand> commands = assignCommand.getCommands(); | 
|---|
|  |  |  | ForkLiftCommand command = commands.get(commandStep); | 
|---|
|  |  |  | command.setComplete(complete != 0); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (o == null) { | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LiftRedisCommand redisCommand = JSON.parseObject(o.toString(), LiftRedisCommand.class); | 
|---|
|  |  |  | Short liftNo = redisCommand.getLiftNo(); | 
|---|
|  |  |  | ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, liftNo.intValue()); | 
|---|
|  |  |  | ForkLiftRedisCommand redisCommand = JSON.parseObject(o.toString(), ForkLiftRedisCommand.class); | 
|---|
|  |  |  | Integer liftNo = redisCommand.getLiftNo(); | 
|---|
|  |  |  | ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, liftNo); | 
|---|
|  |  |  | if (forkLiftThread == null) { | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //提升机处于空闲状态,进行任务的恢复 | 
|---|
|  |  |  | forkLiftThread.setSyncTaskNo(redisCommand.getWrkNo().intValue());//将提升机线程分配任务号 | 
|---|
|  |  |  | forkLiftThread.setSyncTaskNo(redisCommand.getWrkNo());//将提升机线程分配任务号 | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | commands.add(liftCommand); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //提交到线程去工作 | 
|---|
|  |  |  | LiftAssignCommand assignCommand = new LiftAssignCommand(); | 
|---|
|  |  |  | ForkLiftAssignCommand assignCommand = new ForkLiftAssignCommand(); | 
|---|
|  |  |  | assignCommand.setCommands(commands); | 
|---|
|  |  |  | assignCommand.setLiftNo(forkLiftProtocol.getLiftNo().shortValue()); | 
|---|
|  |  |  | assignCommand.setTaskNo((short) workNo); | 
|---|
|  |  |  | assignCommand.setLiftNo(forkLiftProtocol.getLiftNo()); | 
|---|
|  |  |  | assignCommand.setTaskNo(workNo); | 
|---|
|  |  |  | assignCommand.setAuto(false);//手动模式 | 
|---|
|  |  |  | assignCommand.setTaskMode(ForkLiftTaskModeType.SHUTTLE_SWITCH.id.shortValue()); | 
|---|
|  |  |  | assignCommand.setTaskMode(ForkLiftTaskModeType.SHUTTLE_SWITCH.id); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | forkLiftAction.assignWork(forkLiftProtocol.getLiftNo(), assignCommand); | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | 
|---|
|  |  |  | commands.add(liftCommand); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //提交到线程去工作 | 
|---|
|  |  |  | LiftAssignCommand assignCommand = new LiftAssignCommand(); | 
|---|
|  |  |  | ForkLiftAssignCommand assignCommand = new ForkLiftAssignCommand(); | 
|---|
|  |  |  | assignCommand.setCommands(commands); | 
|---|
|  |  |  | assignCommand.setLiftNo(forkLiftProtocol.getLiftNo().shortValue()); | 
|---|
|  |  |  | assignCommand.setTaskNo((short) workNo); | 
|---|
|  |  |  | assignCommand.setLiftNo(forkLiftProtocol.getLiftNo()); | 
|---|
|  |  |  | assignCommand.setTaskNo(workNo); | 
|---|
|  |  |  | assignCommand.setAuto(false);//手动模式 | 
|---|
|  |  |  | assignCommand.setTaskMode(ForkLiftTaskModeType.PICK_PUT.id.shortValue()); | 
|---|
|  |  |  | assignCommand.setTaskMode(ForkLiftTaskModeType.PICK_PUT.id); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | forkLiftAction.assignWork(forkLiftProtocol.getLiftNo(), assignCommand); | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | 
|---|
|  |  |  | commands.add(liftCommand); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //提交到线程去工作 | 
|---|
|  |  |  | LiftAssignCommand assignCommand = new LiftAssignCommand(); | 
|---|
|  |  |  | ForkLiftAssignCommand assignCommand = new ForkLiftAssignCommand(); | 
|---|
|  |  |  | assignCommand.setCommands(commands); | 
|---|
|  |  |  | assignCommand.setLiftNo(forkLiftProtocol.getLiftNo().shortValue()); | 
|---|
|  |  |  | assignCommand.setTaskNo((short) workNo); | 
|---|
|  |  |  | assignCommand.setLiftNo(forkLiftProtocol.getLiftNo()); | 
|---|
|  |  |  | assignCommand.setTaskNo(workNo); | 
|---|
|  |  |  | assignCommand.setAuto(false);//手动模式 | 
|---|
|  |  |  | assignCommand.setTaskMode(ForkLiftTaskModeType.MOVE.id.shortValue()); | 
|---|
|  |  |  | assignCommand.setTaskMode(ForkLiftTaskModeType.MOVE.id); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | forkLiftAction.assignWork(forkLiftProtocol.getLiftNo(), assignCommand); | 
|---|
|  |  |  | return R.ok(); | 
|---|