| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | |
| | | @PostMapping("/table/shuttle/state") |
| | | @ManagerAuth(memo = "四向穿梭车信息表") |
| | | public R shuttleStateTable(){ |
| | | ArrayList<NyShuttleProtocol> list = new ArrayList<>(); |
| | | ArrayList<JSONObject> list = new ArrayList<>(); |
| | | List<BasShuttle> shuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().orderBy("shuttle_no")); |
| | | for (BasShuttle basShuttle : shuttles) { |
| | | // 获取四向穿梭车信息 |
| | |
| | | if (shuttleProtocol == null || shuttleProtocol.getShuttleNo()==null) { |
| | | continue; |
| | | } |
| | | list.add(shuttleProtocol); |
| | | JSONObject shuttleData = JSON.parseObject(JSON.toJSONString(shuttleProtocol)); |
| | | |
| | | shuttleData.put("moveAdvancePath", null);//穿梭车预计路径 |
| | | if (shuttleProtocol.getTaskNo() != 0) { |
| | | //存在任务,获取指令 |
| | | Object object = redisUtil.get("shuttle_wrk_no_" + shuttleProtocol.getTaskNo()); |
| | | if (object != null) { |
| | | ShuttleRedisCommand redisCommand = JSON.parseObject(object.toString(), ShuttleRedisCommand.class); |
| | | shuttleData.put("moveAdvancePath", redisCommand.getAssignCommand().getNodes());//穿梭车预计路径 |
| | | } |
| | | } |
| | | |
| | | list.add(shuttleData); |
| | | } |
| | | return R.ok().add(list); |
| | | } |