From 45387d35f22ad15d6920eaa5c8fc27c8296f0a03 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 12 十月 2023 09:08:22 +0800
Subject: [PATCH] #
---
src/main/webapp/views/shuttle2.html | 2 +-
src/main/java/com/zy/asrs/controller/ShuttleController.java | 8 ++++++--
src/main/webapp/views/shuttle.html | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/ShuttleController.java b/src/main/java/com/zy/asrs/controller/ShuttleController.java
index ce01db0..509ed36 100644
--- a/src/main/java/com/zy/asrs/controller/ShuttleController.java
+++ b/src/main/java/com/zy/asrs/controller/ShuttleController.java
@@ -73,6 +73,10 @@
ArrayList<JSONObject> list = new ArrayList<>();
List<BasShuttle> shuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().orderBy("shuttle_no"));
for (BasShuttle basShuttle : shuttles) {
+ // 琛ㄦ牸琛�
+ JSONObject baseObj = new JSONObject();
+ baseObj.put("shuttleNo", basShuttle.getShuttleNo());
+ list.add(baseObj);
// 鑾峰彇鍥涘悜绌挎杞︿俊鎭�
NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, basShuttle.getShuttleNo());
if (shuttleThread == null) {
@@ -82,7 +86,7 @@
JSONObject shuttleData = JSON.parseObject(JSON.toJSONString(shuttleProtocol));
if (shuttleProtocol == null || shuttleProtocol.getShuttleNo()==null) {
if (shuttleData != null) {
- list.add(shuttleData);
+ baseObj.putAll(shuttleData);
}
continue;
}
@@ -97,7 +101,7 @@
}
}
- list.add(shuttleData);
+ baseObj.putAll(shuttleData);
}
return R.ok().add(list);
}
diff --git a/src/main/webapp/views/shuttle.html b/src/main/webapp/views/shuttle.html
index 42de2ae..e038a00 100644
--- a/src/main/webapp/views/shuttle.html
+++ b/src/main/webapp/views/shuttle.html
@@ -354,7 +354,7 @@
setVal(tr.children("td").eq(7), table[i-1].chargeCycleTimes);
setVal(tr.children("td").eq(8), table[i-1].surplusQuantity);
setVal(tr.children("td").eq(9), table[i-1].countQuantity);
- setVal(tr.children("td").eq(10), table[i-1].statusSum.mileage);
+ setVal(tr.children("td").eq(10), table[i-1].statusSum ? table[i - 1].statusSum.mileage : '');
setVal(tr.children("td").eq(11), table[i-1].pakMk$);
setVal(tr.children("td").eq(12), table[i-1].currentLocNo);
setVal(tr.children("td").eq(13), table[i-1].token);
diff --git a/src/main/webapp/views/shuttle2.html b/src/main/webapp/views/shuttle2.html
index c571991..7ca9591 100644
--- a/src/main/webapp/views/shuttle2.html
+++ b/src/main/webapp/views/shuttle2.html
@@ -385,7 +385,7 @@
setVal(tr.children("td").eq(7), table[i-1].chargeCycleTimes);
setVal(tr.children("td").eq(8), table[i-1].surplusQuantity);
setVal(tr.children("td").eq(9), table[i-1].countQuantity);
- setVal(tr.children("td").eq(10), table[i-1].statusSum.mileage);
+ setVal(tr.children("td").eq(10), table[i-1].statusSum ? table[i - 1].statusSum.mileage : '');
setVal(tr.children("td").eq(11), table[i-1].pakMk$);
setVal(tr.children("td").eq(12), table[i-1].currentLocNo);
setVal(tr.children("td").eq(13), table[i-1].token);
--
Gitblit v1.9.1