From eb70c6896aa6ed1b045cefd17baf3486f25e6806 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期五, 20 十月 2023 16:50:46 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/controller/ShuttleController.java | 34 ++++++++++++++++++++++------------ 1 files changed, 22 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 2135798..7ed35f3 100644 --- a/src/main/java/com/zy/asrs/controller/ShuttleController.java +++ b/src/main/java/com/zy/asrs/controller/ShuttleController.java @@ -17,6 +17,7 @@ import com.zy.asrs.service.WrkMastService; import com.zy.asrs.utils.Utils; import com.zy.common.model.NyShuttleOperaResult; +import com.zy.common.model.enums.NavigationMapType; import com.zy.common.service.CommonService; import com.zy.common.utils.NyHttpUtils; import com.zy.common.utils.NyShuttleOperaUtils; @@ -70,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; } @@ -81,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; } @@ -96,7 +100,7 @@ } } - list.add(shuttleData); + baseObj.putAll(shuttleData); } return R.ok().add(list); } @@ -105,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; } @@ -146,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); } @@ -299,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()); + 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