From ea9b2ddb6c523088b4800337478ffa0bac880766 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 26 十月 2023 15:50:03 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/controller/ShuttleController.java | 33 +++++++++++++++++++++------------
1 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/ShuttleController.java b/src/main/java/com/zy/asrs/controller/ShuttleController.java
index dcf22ca..7ed35f3 100644
--- a/src/main/java/com/zy/asrs/controller/ShuttleController.java
+++ b/src/main/java/com/zy/asrs/controller/ShuttleController.java
@@ -71,10 +71,13 @@
@ManagerAuth(memo = "鍥涘悜绌挎杞︿俊鎭〃")
public R shuttleStateTable(){
ArrayList<JSONObject> list = new ArrayList<>();
- List<BasShuttle> shuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().orderBy("shuttle_no"));
- for (BasShuttle basShuttle : shuttles) {
+ for (ShuttleSlave slave : slaveProperties.getShuttle()) {
+ // 琛ㄦ牸琛�
+ JSONObject baseObj = new JSONObject();
+ baseObj.put("shuttleNo", slave.getId());
+ list.add(baseObj);
// 鑾峰彇鍥涘悜绌挎杞︿俊鎭�
- NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, basShuttle.getShuttleNo());
+ NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
if (shuttleThread == null) {
continue;
}
@@ -82,7 +85,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 +100,7 @@
}
}
- list.add(shuttleData);
+ baseObj.putAll(shuttleData);
}
return R.ok().add(list);
}
@@ -106,14 +109,13 @@
@ManagerAuth(memo = "鍥涘悜绌挎杞︽暟鎹〃")
public R steMsgTable(){
List<ShuttleMsgTableVo> list = new ArrayList<>();
- List<BasShuttle> shuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().orderBy("shuttle_no"));
- for (BasShuttle basShuttle : shuttles) {
+ for (ShuttleSlave slave : slaveProperties.getShuttle()) {
// 琛ㄦ牸琛�
ShuttleMsgTableVo vo = new ShuttleMsgTableVo();
- vo.setShuttleNo(basShuttle.getShuttleNo()); // 鍥涘悜绌挎杞﹀彿
+ vo.setShuttleNo(slave.getId()); // 鍥涘悜绌挎杞﹀彿
list.add(vo);
// 鑾峰彇绌挎杞︿俊鎭�
- ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, basShuttle.getShuttleNo());
+ ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
if (shuttleThread == null) {
continue;
}
@@ -147,8 +149,11 @@
vo.setPakMk(shuttleProtocol.getPakMk()?"Y" : "N"); // 浣滀笟鏍囪
vo.setLocNo(shuttleProtocol.getLocNo());//鍥涘悜绌挎杞﹀綋鍓嶅簱浣嶅彿
vo.setLev(shuttleProtocol.getLocNo() == null ? 0 : Utils.getLev(shuttleProtocol.getLocNo()));//鍥涘悜绌挎杞﹀綋鍓嶅眰楂�
-// vo.setRunSpeed(basShuttle.getRunSpeed());//鍥涘悜绌挎杞﹁繍琛岄�熷害(璁剧疆)
- vo.setChargeLine(basShuttle.getChargeLine());//鍏呯數闃堝��
+
+ BasShuttle basShuttle = basShuttleService.selectById(slave.getId());
+ if (basShuttle != null) {
+ vo.setChargeLine(basShuttle.getChargeLine());//鍏呯數闃堝��
+ }
}
return R.ok().add(list);
}
@@ -300,7 +305,11 @@
assignCommand.setNodes(result.getNodes());
} else if (shuttleTaskModeType == ShuttleTaskModeType.MOVE_LOC_NO) {
//绉诲姩鍒扮洰鏍囧簱浣�
- NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleSlave.getId(), assignCommand.getTaskNo().intValue(), shuttleProtocol.getCurrentLocNo(), param.getDistLocNo(), NavigationMapType.NORMAL.id);
+ Integer mapType = NavigationMapType.NORMAL.id;
+ if (shuttleProtocol.getLiftPosition() == 2) {
+ mapType = NavigationMapType.DFX.id;
+ }
+ NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleSlave.getId(), assignCommand.getTaskNo().intValue(), shuttleProtocol.getCurrentLocNo(), param.getDistLocNo(), mapType);
if (result == null) {
throw new CoolException("璺緞璁$畻澶辫触");
}
--
Gitblit v1.9.1