From 8af52b048a4ddaadb07346b4bcc08f671fcc05ea Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期三, 06 九月 2023 10:03:03 +0800 Subject: [PATCH] #基础地图更新 --- src/main/java/com/zy/asrs/controller/ShuttleController.java | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/ShuttleController.java b/src/main/java/com/zy/asrs/controller/ShuttleController.java index ce4aa87..dcc006d 100644 --- a/src/main/java/com/zy/asrs/controller/ShuttleController.java +++ b/src/main/java/com/zy/asrs/controller/ShuttleController.java @@ -1,6 +1,7 @@ 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; @@ -65,7 +66,7 @@ @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) { // 鑾峰彇鍥涘悜绌挎杞︿俊鎭� @@ -77,7 +78,19 @@ 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); } -- Gitblit v1.9.1