From ce9c9af4a3710d17e17814bab629ab4ef474f3f1 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期三, 09 七月 2025 11:16:51 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java | 12 + src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java | 42 +++-- src/main/java/com/zy/asrs/controller/ConsoleController.java | 59 -------- src/main/java/com/zy/asrs/utils/Utils.java | 35 +++- src/main/java/com/zy/common/utils/ShuttleOperaUtils.java | 16 + src/main/java/com/zy/asrs/controller/OpenController.java | 21 +- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 66 +++++--- src/main/java/com/zy/common/utils/ForkLiftUtils.java | 10 + src/main/webapp/views/console.html | 25 --- src/main/java/com/zy/asrs/task/NotifyScheduler.java | 18 + src/main/java/com/zy/asrs/controller/ForkLiftController.java | 43 +++-- src/main/java/com/zy/common/utils/NavigateMapData.java | 14 + 12 files changed, 174 insertions(+), 187 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/ConsoleController.java b/src/main/java/com/zy/asrs/controller/ConsoleController.java index 821fb46..c3e061d 100644 --- a/src/main/java/com/zy/asrs/controller/ConsoleController.java +++ b/src/main/java/com/zy/asrs/controller/ConsoleController.java @@ -7,24 +7,13 @@ import com.core.common.R; import com.zy.asrs.domain.param.SystemSwitchParam; import com.zy.asrs.entity.BasMap; -import com.zy.asrs.entity.WrkMast; import com.zy.asrs.service.BasMapService; -import com.zy.asrs.service.WrkMastService; import com.zy.common.model.MapNode; import com.zy.common.model.enums.NavigationMapType; import com.zy.common.utils.NavigateMapData; import com.zy.common.utils.RedisUtil; -import com.zy.core.cache.SlaveConnection; import com.zy.core.enums.RedisKeyType; -import com.zy.core.enums.SlaveType; -import com.zy.core.model.ForkLiftSlave; -import com.zy.core.model.ShuttleSlave; -import com.zy.core.model.protocol.ForkLiftProtocol; -import com.zy.core.model.protocol.ShuttleProtocol; -import com.zy.core.properties.SlaveProperties; import com.zy.core.properties.SystemProperties; -import com.zy.core.thread.ForkLiftThread; -import com.zy.core.thread.ShuttleThread; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -47,10 +36,6 @@ private RedisUtil redisUtil; @Autowired private NavigateMapData navigateMapData; - @Autowired - private WrkMastService wrkMastService; - @Autowired - private SlaveProperties slaveProperties; @PostMapping("/system/running/status") @ManagerAuth(memo = "绯荤粺杩愯鐘舵��") @@ -128,50 +113,6 @@ @ManagerAuth(memo = "閲嶇疆Redis鍦板浘") public R resetMapToRedisByLev(@PathVariable Integer lev, HttpServletRequest request) { redisUtil.del(RedisKeyType.MAP.key + lev); - return R.ok(); - } - - /** - * 浠诲姟妫�娴� - */ - @GetMapping("/checkTask") - @ManagerAuth(memo = "浠诲姟妫�娴�") - public R checkTask() { - List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<>()); - if (!wrkMasts.isEmpty()) { - return R.error("瀛樺湪鏈粨鏉熶换鍔�"); - } - - for (ShuttleSlave slave : slaveProperties.getShuttle()) { - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); - if (shuttleThread == null) { - continue; - } - ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); - if (shuttleProtocol == null) { - continue; - } - - if (shuttleProtocol.getTaskNo() > 0) { - return R.error(slave.getId() + "鍙峰皬杞﹀瓨鍦ㄥ伐浣滃彿"); - } - } - - for (ForkLiftSlave slave : slaveProperties.getForkLift()) { - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, slave.getId()); - if (forkLiftThread == null) { - continue; - } - ForkLiftProtocol forkLiftProtocol = forkLiftThread.getStatus(); - if (forkLiftProtocol == null) { - continue; - } - - if (forkLiftProtocol.getTaskNo() > 0) { - return R.error(slave.getId() + "鍙疯揣鍙夋彁鍗囨満瀛樺湪宸ヤ綔鍙�"); - } - } - return R.ok(); } diff --git a/src/main/java/com/zy/asrs/controller/ForkLiftController.java b/src/main/java/com/zy/asrs/controller/ForkLiftController.java index 747abf8..17c02b2 100644 --- a/src/main/java/com/zy/asrs/controller/ForkLiftController.java +++ b/src/main/java/com/zy/asrs/controller/ForkLiftController.java @@ -2,6 +2,7 @@ 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; import com.core.common.Cools; @@ -10,7 +11,9 @@ import com.zy.asrs.domain.param.LiftOperatorParam; import com.zy.asrs.domain.vo.*; import com.zy.asrs.entity.BasLift; +import com.zy.asrs.entity.DeviceConfig; import com.zy.asrs.service.BasLiftService; +import com.zy.asrs.service.DeviceConfigService; import com.zy.common.service.CommonService; import com.zy.common.utils.RedisUtil; import com.zy.core.action.ForkLiftAction; @@ -41,25 +44,27 @@ @Autowired private CommonService commonService; @Autowired - private SlaveProperties slaveProperties; - @Autowired private BasLiftService basLiftService; @Autowired private RedisUtil redisUtil; @Autowired private ForkLiftAction forkLiftAction; + @Autowired + private DeviceConfigService deviceConfigService; @PostMapping("/table/lift/state") @ManagerAuth(memo = "鎻愬崌鏈轰俊鎭〃") public R liftStateTable(){ ArrayList<JSONObject> list = new ArrayList<>(); - for (ForkLiftSlave slave : slaveProperties.getForkLift()) { + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkliftList) { // 琛ㄦ牸琛� JSONObject baseObj = new JSONObject(); - baseObj.put("shuttleNo", slave.getId()); + baseObj.put("shuttleNo", device.getDeviceNo()); list.add(baseObj); // 鑾峰彇鎻愬崌鏈轰俊鎭� - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, slave.getId()); + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); if (forkLiftThread == null) { continue; } @@ -79,13 +84,15 @@ @ManagerAuth(memo = "鎻愬崌鏈烘暟鎹〃") public R liftMsgTable(){ List<LiftMsgTableVo> list = new ArrayList<>(); - for (ForkLiftSlave slave : slaveProperties.getForkLift()) { + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkliftList) { // 琛ㄦ牸琛� LiftMsgTableVo vo = new LiftMsgTableVo(); - vo.setLiftNo(slave.getId()); // 鎻愬崌鏈哄彿 + vo.setLiftNo(device.getDeviceNo()); // 鎻愬崌鏈哄彿 list.add(vo); // 鑾峰彇鎻愬崌鏈轰俊鎭� - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, slave.getId()); + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); if (forkLiftThread == null) { continue; } @@ -117,10 +124,12 @@ @GetMapping("/detl/{liftNo}") public R liftDetl(@PathVariable("liftNo") Integer liftNo){ LiftDataVo vo = new LiftDataVo(); - for (ForkLiftSlave liftSlave : slaveProperties.getForkLift()) { - if (liftNo.equals(liftSlave.getId())) { - vo.setLiftNo(liftSlave.getId()); - BasLift basLift = basLiftService.selectById(liftSlave.getId()); + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkliftList) { + if (liftNo.equals(device.getDeviceNo())) { + vo.setLiftNo(device.getDeviceNo()); + BasLift basLift = basLiftService.selectById(device.getDeviceNo()); if (!Cools.isEmpty(basLift)) { vo.setWorkNo(basLift.getWrkNo()); vo.setPakMk(basLift.getPakMk()); @@ -134,11 +143,13 @@ @GetMapping("/sensor/detl/{liftNo}") public R liftSensorDetl(@PathVariable("liftNo") Integer liftNo){ LiftSensorDataVo vo = new LiftSensorDataVo(); - for (ForkLiftSlave liftSlave : slaveProperties.getForkLift()) { - if (liftNo.equals(liftSlave.getId())) { - vo.setLiftNo(liftSlave.getId()); + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkliftList) { + if (liftNo.equals(device.getDeviceNo())) { + vo.setLiftNo(device.getDeviceNo()); // 鑾峰彇鎻愬崌鏈轰俊鎭� - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, liftSlave.getId()); + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); if (forkLiftThread == null) { return R.error("璁惧涓嶅湪绾�"); } diff --git a/src/main/java/com/zy/asrs/controller/OpenController.java b/src/main/java/com/zy/asrs/controller/OpenController.java index de31363..a207073 100644 --- a/src/main/java/com/zy/asrs/controller/OpenController.java +++ b/src/main/java/com/zy/asrs/controller/OpenController.java @@ -7,9 +7,11 @@ import com.zy.asrs.domain.enums.NotifyMsgType; import com.zy.asrs.domain.param.*; import com.zy.asrs.entity.ApiLog; +import com.zy.asrs.entity.DeviceConfig; import com.zy.asrs.entity.LocMast; import com.zy.asrs.entity.WrkMast; import com.zy.asrs.service.ApiLogService; +import com.zy.asrs.service.DeviceConfigService; import com.zy.asrs.service.LocMastService; import com.zy.asrs.service.WrkMastService; import com.zy.asrs.utils.NotifyUtils; @@ -19,11 +21,8 @@ import com.zy.core.dispatcher.ShuttleDispatchUtils; import com.zy.core.enums.SlaveType; import com.zy.core.enums.WrkIoType; -import com.zy.core.model.ForkLiftSlave; -import com.zy.core.model.ShuttleSlave; import com.zy.core.model.protocol.ForkLiftProtocol; import com.zy.core.model.protocol.ShuttleProtocol; -import com.zy.core.properties.SlaveProperties; import com.zy.core.thread.ForkLiftThread; import com.zy.core.thread.ShuttleThread; import lombok.extern.slf4j.Slf4j; @@ -47,13 +46,13 @@ @Autowired private NotifyUtils notifyUtils; @Autowired - private SlaveProperties slaveProperties; - @Autowired private ApiLogService apiLogService; @Autowired private LocMastService locMastService; @Autowired private WrkMastService wrkMastService; + @Autowired + private DeviceConfigService deviceConfigService; @PostMapping("/createMoveTask") @OpenApiLog(memo = "灏忚溅绉诲姩浠诲姟") @@ -238,8 +237,10 @@ HashMap<String, Object> map = new HashMap<>(); //鑾峰彇灏忚溅鏁版嵁 ArrayList<ShuttleProtocol> shuttleProtocols = new ArrayList<>(); - for (ShuttleSlave slave : slaveProperties.getShuttle()) { - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); if (shuttleThread == null) { continue; } @@ -253,8 +254,10 @@ //鑾峰彇璐у弶鎻愬崌鏈烘暟鎹� ArrayList<ForkLiftProtocol> forkLiftProtocols = new ArrayList<>(); - for (ForkLiftSlave slave : slaveProperties.getForkLift()) { - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, slave.getId()); + List<DeviceConfig> forkLiftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkLiftList) { + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); if (forkLiftThread == null) { continue; } diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java index 93ba72d..80f3170 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -76,6 +76,8 @@ private NotifyUtils notifyUtils; @Autowired private BasShuttleChargeService basShuttleChargeService; + @Autowired + private DeviceConfigService deviceConfigService; /** * 鍒濆鍖栧疄鏃跺湴鍥� @@ -438,9 +440,11 @@ */ public synchronized void shuttleFinished() { try { - for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { //鑾峰彇鍥涘悜绌挎杞︿俊鎭� - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); if (shuttleProtocol == null) { continue; @@ -919,9 +923,11 @@ */ public synchronized void forkLiftFinished() { try { - for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) { + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkliftList) { //鑾峰彇鎻愬崌鏈轰俊鎭� - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, forkLiftSlave.getId()); + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); ForkLiftProtocol forkLiftProtocol = forkLiftThread.getStatus(); if (forkLiftProtocol == null) { continue; @@ -991,9 +997,11 @@ */ private void recShuttleErr() { Date now = new Date(); - for (ShuttleSlave shuttleSlave : slaveProperties.getShuttle()) { + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { // 鑾峰彇鍥涘悜绌挎杞︿俊鎭� - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleSlave.getId()); + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); if (shuttleThread == null) { continue; } @@ -1004,7 +1012,7 @@ if (shuttleProtocol.getTaskNo() != 0) { //鏈変换鍔� - BasShuttleErrLog latest = basShuttleErrLogService.findLatestByTaskNo(shuttleSlave.getId(), shuttleProtocol.getTaskNo()); + BasShuttleErrLog latest = basShuttleErrLogService.findLatestByTaskNo(device.getDeviceNo(), shuttleProtocol.getTaskNo()); // 鏈夊紓甯� if (latest == null) { if (shuttleProtocol.getErrorCode() != null && Integer.parseInt(shuttleProtocol.getErrorCode()) != 0) { @@ -1022,7 +1030,7 @@ null, // 缁撴潫鏃堕棿 wrkMast.getWrkSts(), // 宸ヤ綔鐘舵�� wrkMast.getIoType(), // 鍏ュ嚭搴撶被鍨� - shuttleSlave.getId(), // 鍥涘悜绌挎杞� + device.getDeviceNo(), // 鍥涘悜绌挎杞� null, // plc wrkMast.getLocNo(), // 鐩爣搴撲綅 wrkMast.getStaNo(), // 鐩爣绔� @@ -1040,7 +1048,7 @@ JSON.toJSONString(shuttleProtocol) // 绯荤粺鐘舵�佹暟鎹� ); if (!basShuttleErrLogService.insert(basShuttleErrLog)) { - News.error("鍥涘悜绌挎杞lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", shuttleSlave.getId(), errName); + News.error("鍥涘悜绌挎杞lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", device.getDeviceNo(), errName); } } } else { @@ -1050,7 +1058,7 @@ latest.setUpdateTime(now); latest.setStatus(2); if (!basShuttleErrLogService.updateById(latest)) { - News.error("鍥涘悜绌挎杞lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", shuttleSlave.getId(), latest.getId()); + News.error("鍥涘悜绌挎杞lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", device.getDeviceNo(), latest.getId()); } } } @@ -1063,9 +1071,11 @@ */ private void recLiftErr() { Date now = new Date(); - for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) { + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkliftList) { // 鑾峰彇鎻愬崌鏈轰俊鎭� - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, forkLiftSlave.getId()); + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); if (forkLiftThread == null) { continue; } @@ -1076,7 +1086,7 @@ if (forkLiftProtocol.getTaskNo() != 0) { //鏈変换鍔� - BasLiftErrLog latest = basLiftErrLogService.findLatestByTaskNo(forkLiftSlave.getId(), forkLiftProtocol.getTaskNo()); + BasLiftErrLog latest = basLiftErrLogService.findLatestByTaskNo(device.getDeviceNo(), forkLiftProtocol.getTaskNo()); // 鏈夊紓甯� if (latest == null) { if (forkLiftProtocol.getErrorCode() != null && forkLiftProtocol.getErrorCode() != 0) { @@ -1095,7 +1105,7 @@ null, // 缁撴潫鏃堕棿 wrkMast.getWrkSts(), // 宸ヤ綔鐘舵�� wrkMast.getIoType(), // 鍏ュ嚭搴撶被鍨� - forkLiftSlave.getId(), // 鎻愬崌鏈� + device.getDeviceNo(), // 鎻愬崌鏈� null, // plc wrkMast.getLocNo(), // 鐩爣搴撲綅 wrkMast.getStaNo(), // 鐩爣绔� @@ -1113,7 +1123,7 @@ JSON.toJSONString(forkLiftProtocol) // 绯荤粺鐘舵�佹暟鎹� ); if (!basLiftErrLogService.insert(basLiftErrLog)) { - News.error("鎻愬崌鏈簆lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", forkLiftSlave.getId(), errName); + News.error("鎻愬崌鏈簆lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", device.getDeviceNo(), errName); } } } else { @@ -1123,7 +1133,7 @@ latest.setUpdateTime(now); latest.setStatus(2); if (!basLiftErrLogService.updateById(latest)) { - News.error("鎻愬崌鏈簆lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", forkLiftSlave.getId(), latest.getId()); + News.error("鎻愬崌鏈簆lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", device.getDeviceNo(), latest.getId()); } } } @@ -1142,9 +1152,11 @@ return;//鏃犲厖鐢垫々 } - for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { //鑾峰彇鍥涘悜绌挎杞︾嚎绋� - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); if (shuttleProtocol == null) { continue; @@ -1217,15 +1229,15 @@ wrkMast.setIoType(WrkIoType.SHUTTLE_CHARGE.id);//300.鍏呯數 wrkMast.setIoPri((double) 999); wrkMast.setLocNo(chargeLocNo); - wrkMast.setShuttleNo(shuttle.getId()); + wrkMast.setShuttleNo(device.getDeviceNo()); wrkMast.setMemo("charge"); wrkMast.setAppeTime(new Date()); if (!wrkMastService.insert(wrkMast)) { - News.error("淇濆瓨{}鍙峰洓鍚戠┛姊溅鍏呯數浠诲姟澶辫触!!!", shuttle.getId()); + News.error("淇濆瓨{}鍙峰洓鍚戠┛姊溅鍏呯數浠诲姟澶辫触!!!", device.getDeviceNo()); continue; } - News.info("淇濆瓨{}鍙峰洓鍚戠┛姊溅鍏呯數浠诲姟鎴愬姛!!!", shuttle.getId()); + News.info("淇濆瓨{}鍙峰洓鍚戠┛姊溅鍏呯數浠诲姟鎴愬姛!!!", device.getDeviceNo()); } } catch (Exception e) { e.printStackTrace(); @@ -1238,8 +1250,10 @@ public synchronized void executeShuttleCharge() { try { //鏌ヨ灏忚溅鍏呯數浠诲姟 - for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { - WrkMast wrkMast = wrkMastService.selectChargeWorking(shuttle.getId()); + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { + WrkMast wrkMast = wrkMastService.selectChargeWorking(device.getDeviceNo()); if(wrkMast == null) { continue; } @@ -1909,8 +1923,10 @@ //鑷姩鍒囨崲鍑哄叆搴撴ā寮� public void autoSwitchForkLiftIOMode() { - for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) { - Integer liftNo = forkLiftSlave.getId(); + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkliftList) { + Integer liftNo = device.getDeviceNo(); ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, liftNo); if (forkLiftThread == null) { continue; diff --git a/src/main/java/com/zy/asrs/task/NotifyScheduler.java b/src/main/java/com/zy/asrs/task/NotifyScheduler.java index 43fe4f9..eb022e4 100644 --- a/src/main/java/com/zy/asrs/task/NotifyScheduler.java +++ b/src/main/java/com/zy/asrs/task/NotifyScheduler.java @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.zy.asrs.domain.NotifyDto; +import com.zy.asrs.entity.DeviceConfig; import com.zy.asrs.entity.HttpRequestLog; +import com.zy.asrs.service.DeviceConfigService; import com.zy.asrs.service.HttpRequestLogService; import com.zy.asrs.utils.NotifyUtils; import com.zy.common.utils.HttpHandler; @@ -32,23 +34,27 @@ @Autowired private NotifyUtils notifyUtils; @Autowired - private SlaveProperties slaveProperties; - @Autowired private ConfigService configService; @Autowired private HttpRequestLogService httpRequestLogService; + @Autowired + private DeviceConfigService deviceConfigService; @Scheduled(cron = "0/3 * * * * ? ") public synchronized void notifyShuttle(){ - for (ShuttleSlave slave : slaveProperties.getShuttle()) { - notifyMsg(String.valueOf(SlaveType.Shuttle), slave.getId()); + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { + notifyMsg(String.valueOf(SlaveType.Shuttle), device.getDeviceNo()); } } @Scheduled(cron = "0/3 * * * * ? ") public synchronized void notifyForkLift(){ - for (ForkLiftSlave slave : slaveProperties.getForkLift()) { - notifyMsg(String.valueOf(SlaveType.ForkLift), slave.getId()); + List<DeviceConfig> forkLiftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkLiftList) { + notifyMsg(String.valueOf(SlaveType.ForkLift), device.getDeviceNo()); } } diff --git a/src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java b/src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java index e6bcffd..deedfc0 100644 --- a/src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java +++ b/src/main/java/com/zy/asrs/task/ShuttlePowerEarlyWarning.java @@ -3,12 +3,13 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.zy.asrs.entity.DeviceConfig; +import com.zy.asrs.service.DeviceConfigService; import com.zy.common.utils.HttpHandler; import com.zy.core.cache.SlaveConnection; import com.zy.core.enums.SlaveType; import com.zy.core.model.ShuttleSlave; import com.zy.core.model.protocol.ShuttleProtocol; -import com.zy.core.properties.SlaveProperties; import com.zy.core.thread.ShuttleThread; import com.zy.system.entity.Config; import com.zy.system.service.ConfigService; @@ -18,6 +19,7 @@ import org.springframework.stereotype.Component; import java.util.HashMap; +import java.util.List; /** * 灏忚溅鐢甸噺棰勮妫�娴� => 寮哄埗棰勮 @@ -29,7 +31,7 @@ @Autowired private ConfigService configService; @Autowired - private SlaveProperties slaveProperties; + private DeviceConfigService deviceConfigService; /** * 灏忚溅鐢甸噺棰勮妫�娴� => 寮哄埗棰勮 @@ -57,8 +59,10 @@ buffer.append("銆愰�氱煡銆戝洓鍚戝簱\n");//娑堟伅鏍囬 boolean hasReport = false;//鏄惁鏈夐渶瑕佹姤鍛婄殑鏁版嵁 - for (ShuttleSlave slave : slaveProperties.getShuttle()) { - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); if (shuttleThread == null) { continue; } diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java index bf3ea83..09350ec 100644 --- a/src/main/java/com/zy/asrs/utils/Utils.java +++ b/src/main/java/com/zy/asrs/utils/Utils.java @@ -4,8 +4,10 @@ import com.core.common.Arith; import com.core.common.Cools; import com.core.common.SpringUtils; +import com.zy.asrs.entity.DeviceConfig; import com.zy.asrs.entity.LocMast; import com.zy.asrs.entity.WrkMast; +import com.zy.asrs.service.DeviceConfigService; import com.zy.asrs.service.LocMastService; import com.zy.asrs.service.WrkMastService; import com.zy.common.model.NavigateNode; @@ -109,15 +111,18 @@ //鑾峰彇闄ょ櫧鍚嶅崟澶栫殑鎸囧畾妤煎眰鍏ㄩ儴绌挎杞y鍧愭爣鐐� public static List<int[]> getShuttlePoints(Integer whiteShuttle, Integer lev) { - SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class); + DeviceConfigService deviceConfigService = SpringUtils.getBean(DeviceConfigService.class); ArrayList<int[]> list = new ArrayList<>(); - for (ShuttleSlave slave : slaveProperties.getShuttle()) { - if (slave.getId().intValue() == whiteShuttle) { + + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { + if (device.getDeviceNo().intValue() == whiteShuttle) { continue;//璺宠繃鐧藉悕鍗� } //鑾峰彇绌挎杞︽墍鍦ㄨ妭鐐逛綅缃� - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); if (shuttleThread == null) { continue; } @@ -146,11 +151,14 @@ //妫�娴嬫ゼ灞傛槸鍚︽湁鍙敤绌挎杞� public static boolean checkLevHasShuttle(Integer lev) { - SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class); + DeviceConfigService deviceConfigService = SpringUtils.getBean(DeviceConfigService.class); WrkMastService wrkMastService = SpringUtils.getBean(WrkMastService.class); - for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { + + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { //鑾峰彇鍥涘悜绌挎杞︾嚎绋� - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); if (shuttleThread == null) { continue; } @@ -197,14 +205,17 @@ return null; } - SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class); - if (slaveProperties == null) { + DeviceConfigService deviceConfigService = SpringUtils.getBean(DeviceConfigService.class); + if (deviceConfigService == null) { return null; } + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (String loc : groupLoc) { - for (ShuttleSlave slave : slaveProperties.getShuttle()) { - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); + for (DeviceConfig device : shuttleList) { + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); if (shuttleThread == null) { continue; } @@ -220,7 +231,7 @@ if (shuttleProtocol.getCurrentLocNo().equals(loc)) { //瀛樺湪灏忚溅 - return slave.getId(); + return device.getDeviceNo(); } } } diff --git a/src/main/java/com/zy/common/utils/ForkLiftUtils.java b/src/main/java/com/zy/common/utils/ForkLiftUtils.java index a7dbe75..bae7288 100644 --- a/src/main/java/com/zy/common/utils/ForkLiftUtils.java +++ b/src/main/java/com/zy/common/utils/ForkLiftUtils.java @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.core.common.SpringUtils; +import com.zy.asrs.entity.DeviceConfig; +import com.zy.asrs.service.DeviceConfigService; import com.zy.asrs.utils.Utils; import com.zy.common.model.NavigateNode; import com.zy.core.cache.SlaveConnection; @@ -68,9 +70,11 @@ //鑾峰彇鎻愬崌鏈虹珯鐐� public static ForkLiftStaProtocol getLiftStaByStaNo(Integer staNo) { - SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class); - for (ForkLiftSlave liftSlave : slaveProperties.getForkLift()) { - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, liftSlave.getId()); + DeviceConfigService deviceConfigService = SpringUtils.getBean(DeviceConfigService.class); + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkliftList) { + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); if (forkLiftThread == null) { return null; } diff --git a/src/main/java/com/zy/common/utils/NavigateMapData.java b/src/main/java/com/zy/common/utils/NavigateMapData.java index 0d92ea3..f0b5cb9 100644 --- a/src/main/java/com/zy/common/utils/NavigateMapData.java +++ b/src/main/java/com/zy/common/utils/NavigateMapData.java @@ -1,10 +1,13 @@ package com.zy.common.utils; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.core.common.SpringUtils; import com.zy.asrs.entity.BasMap; +import com.zy.asrs.entity.DeviceConfig; import com.zy.asrs.entity.LocMast; import com.zy.asrs.service.BasMapService; +import com.zy.asrs.service.DeviceConfigService; import com.zy.asrs.service.LocMastService; import com.zy.asrs.utils.Utils; import com.zy.common.model.MapNode; @@ -13,14 +16,11 @@ import com.zy.core.enums.MapNodeType; import com.zy.core.enums.RedisKeyType; import com.zy.core.enums.SlaveType; -import com.zy.core.model.ForkLiftSlave; import com.zy.core.model.protocol.ForkLiftStaProtocol; -import com.zy.core.properties.SlaveProperties; import com.zy.core.thread.ForkLiftThread; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.io.*; import java.util.ArrayList; import java.util.List; @@ -31,7 +31,7 @@ public class NavigateMapData { @Autowired - private SlaveProperties slaveProperties; + private DeviceConfigService deviceConfigService; @Autowired private BasMapService basMapService; @@ -286,8 +286,10 @@ public List<List<MapNode>> loadForkLift(List<List<MapNode>> lists, Integer mapType, Integer lev) { try { //鍔犺浇璐у弶鎻愬崌鏈烘斁璐х偣浣嶆暟鎹� - for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) { - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, forkLiftSlave.getId()); + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + for (DeviceConfig device : forkliftList) { + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); if (forkLiftThread == null) { continue; } diff --git a/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java b/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java index 45f6a71..b9d252e 100644 --- a/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java +++ b/src/main/java/com/zy/common/utils/ShuttleOperaUtils.java @@ -4,7 +4,9 @@ import com.core.common.SpringUtils; import com.core.exception.CoolException; import com.zy.asrs.entity.BasShuttle; +import com.zy.asrs.entity.DeviceConfig; import com.zy.asrs.service.BasShuttleService; +import com.zy.asrs.service.DeviceConfigService; import com.zy.asrs.utils.Utils; import com.zy.common.model.MapNode; import com.zy.common.model.NavigateNode; @@ -18,7 +20,6 @@ import com.zy.core.model.command.ShuttleAssignCommand; import com.zy.core.model.command.ShuttleCommand; import com.zy.core.model.protocol.ShuttleProtocol; -import com.zy.core.properties.SlaveProperties; import com.zy.core.thread.ShuttleThread; import com.zy.system.entity.Config; import com.zy.system.service.ConfigService; @@ -45,9 +46,9 @@ @Autowired private ConfigService configService; @Autowired - private SlaveProperties slaveProperties; - @Autowired private ShuttleDispatchUtils shuttleDispatchUtils; + @Autowired + private DeviceConfigService deviceConfigService; public synchronized List<ShuttleCommand> getStartToTargetCommands(String startLocNo, String endLocNo, Integer mapType, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread) { return getStartToTargetCommands(startLocNo, endLocNo, mapType, null, assignCommand, shuttleThread); @@ -285,8 +286,11 @@ private HashMap<String, Integer> findCarMap() { HashMap<String, Integer> carMap = new HashMap<>(); - for (ShuttleSlave slave : slaveProperties.getShuttle()) { - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); + + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); if (shuttleThread == null) { continue; } @@ -299,7 +303,7 @@ continue; } - carMap.put(currentLocNo, slave.getId()); + carMap.put(currentLocNo, device.getDeviceNo()); } return carMap; } diff --git a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java index 5e0d93c..d0a2602 100644 --- a/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java +++ b/src/main/java/com/zy/core/dispatcher/ShuttleDispatchUtils.java @@ -7,8 +7,10 @@ import com.zy.asrs.domain.ShuttleGatherResult; import com.zy.asrs.domain.param.ShuttleGatherParam; import com.zy.asrs.entity.BasShuttle; +import com.zy.asrs.entity.DeviceConfig; import com.zy.asrs.entity.WrkMast; import com.zy.asrs.service.BasShuttleService; +import com.zy.asrs.service.DeviceConfigService; import com.zy.asrs.service.WrkMastService; import com.zy.asrs.utils.Utils; import com.zy.common.model.NavigateNode; @@ -24,7 +26,6 @@ import com.zy.core.model.ForkLiftSlave; import com.zy.core.model.ShuttleSlave; import com.zy.core.model.protocol.*; -import com.zy.core.properties.SlaveProperties; import com.zy.core.thread.ForkLiftThread; import com.zy.core.thread.ShuttleThread; import com.zy.system.entity.Config; @@ -42,8 +43,6 @@ public class ShuttleDispatchUtils { @Autowired - private SlaveProperties slaveProperties; - @Autowired private WrkMastService wrkMastService; @Autowired private CommonService commonService; @@ -53,6 +52,8 @@ private ConfigService configService; @Autowired private BasShuttleService basShuttleService; + @Autowired + private DeviceConfigService deviceConfigService; /** * 璋冨害杞﹁締-璋冨害鎸囧畾绌挎杞� @@ -68,15 +69,17 @@ ArrayList<ShuttleThread> sameLev = new ArrayList<>();//鐩稿悓妤煎眰鐨勭┛姊溅 ArrayList<ShuttleThread> diffLev = new ArrayList<>();//涓嶅悓妤煎眰鐨勭┛姊溅 - for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); + for (DeviceConfig device : shuttleList) { //鑾峰彇鍥涘悜绌挎杞︾嚎绋� - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) { continue; } - if (checkChargeWrk(shuttle.getId())) { + if (checkChargeWrk(device.getDeviceNo())) { continue;//瀛樺湪鍏呯數浠诲姟锛岃繃婊ゅ皬杞� } @@ -84,7 +87,7 @@ continue;//灏忚溅蹇欑涓� } - BasShuttle basShuttle = basShuttleService.selectOne(new EntityWrapper<BasShuttle>().eq("shuttle_no", shuttle.getId())); + BasShuttle basShuttle = basShuttleService.selectOne(new EntityWrapper<BasShuttle>().eq("shuttle_no", device.getDeviceNo())); if (basShuttle != null) { if (basShuttle.getStatus() == 0) { continue;//灏忚溅琚鐢� @@ -341,10 +344,12 @@ return false; } + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); int levCount = 0;//鐩爣妤煎眰杞﹁締鏁伴噺 - for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { + for (DeviceConfig device : shuttleList) { //鑾峰彇鍥涘悜绌挎杞︾嚎绋� - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) { continue; @@ -410,11 +415,14 @@ return null; } + List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.ForkLift))); + //鑾峰彇灏忚溅鍚屼竴妤煎眰鐨勭珯鐐� ArrayList<ForkLiftStaProtocol> list = new ArrayList<>(); int lev = Utils.getLev(shuttleProtocol.getCurrentLocNo());//灏忚溅妤煎眰 - for (ForkLiftSlave slave : slaveProperties.getForkLift()) { - ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, slave.getId()); + for (DeviceConfig device : forkliftList) { + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); if (forkLiftThread == null) { continue; } @@ -426,7 +434,7 @@ continue; } - ForkLiftStaProtocol forkLiftStaProtocol = ForkLiftUtils.getLiftStaByLev(slave.getId(), lev); + ForkLiftStaProtocol forkLiftStaProtocol = ForkLiftUtils.getLiftStaByLev(device.getDeviceNo(), lev); if (forkLiftStaProtocol == null) { continue; } @@ -441,7 +449,7 @@ } //鍒ゆ柇鐩爣妤煎眰绔欑偣鏄惁鏃犳墭鐩� - ForkLiftStaProtocol targetLiftStaProtocol = ForkLiftUtils.getLiftStaByLev(slave.getId(), targetLev); + ForkLiftStaProtocol targetLiftStaProtocol = ForkLiftUtils.getLiftStaByLev(device.getDeviceNo(), targetLev); if (targetLiftStaProtocol == null) { continue; } @@ -501,10 +509,12 @@ * 鑾峰彇妤煎眰鍙敤灏忚溅鏁伴噺 */ public int getShuttleCountByLev(int lev) { + List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() + .eq("device_type", String.valueOf(SlaveType.Shuttle))); int count = 0; - for (ShuttleSlave slave : slaveProperties.getShuttle()) { + for (DeviceConfig device : shuttleList) { //鑾峰彇鍥涘悜绌挎杞︾嚎绋� - ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); + ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); if (shuttleThread == null) { continue; } @@ -514,7 +524,7 @@ continue; } - if (checkChargeWrk(slave.getId())) { + if (checkChargeWrk(device.getDeviceNo())) { continue;//瀛樺湪鍏呯數浠诲姟锛岃繃婊ゅ皬杞� } diff --git a/src/main/webapp/views/console.html b/src/main/webapp/views/console.html index 8e4316f..1da3dbe 100644 --- a/src/main/webapp/views/console.html +++ b/src/main/webapp/views/console.html @@ -78,7 +78,6 @@ <div> <!-- <el-button @click="testMove()">娴嬭瘯绉诲姩杞�</el-button>--> <el-button @click="resetMap()">閲嶇疆鍦板浘</el-button> - <el-button @click="checkTask()">浠诲姟妫�娴�</el-button> <!-- <el-button @click="initLoc()">鍒濆鍖栧簱浣�</el-button>--> </div> </div> @@ -662,30 +661,6 @@ message: that.currentLev + '灞傚湴鍥鹃噸缃畬鎴�', type: 'success' }); - } - }) - }, - checkTask() { - let that = this - $.ajax({ - url:baseUrl+"/console/checkTask", - headers:{ - 'token': localStorage.getItem('token') - }, - data:{}, - method:'get', - success:function (res) { - if (res.code === 200) { - that.$message({ - message: res.msg, - type: 'success' - }); - } else { - that.$message({ - message: res.msg, - type: 'error' - }); - } } }) }, -- Gitblit v1.9.1