From 2722343bfb3528b96c0c41860eb37079a073d2c5 Mon Sep 17 00:00:00 2001 From: lsh <lsh@163.com> Date: 星期二, 10 九月 2024 09:43:11 +0800 Subject: [PATCH] #fs --- src/main/java/com/zy/asrs/controller/RgvController.java | 33 +++++++++++++++++++++++++-------- 1 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/RgvController.java b/src/main/java/com/zy/asrs/controller/RgvController.java index e7c212b..1a2b995 100644 --- a/src/main/java/com/zy/asrs/controller/RgvController.java +++ b/src/main/java/com/zy/asrs/controller/RgvController.java @@ -10,10 +10,8 @@ import com.zy.asrs.entity.*; import com.zy.asrs.mapper.BasRgvErrMapper; import com.zy.asrs.service.BasRgvService; -import com.zy.asrs.service.LocMastService; import com.zy.asrs.service.WrkMastService; import com.zy.asrs.service.impl.MainServiceImpl; -import com.zy.asrs.utils.VersionUtils; import com.zy.core.cache.MessageQueue; import com.zy.core.cache.OutputQueue; import com.zy.core.cache.SlaveConnection; @@ -28,7 +26,6 @@ import com.zy.core.thread.RgvThread; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -57,8 +54,6 @@ private BasRgvService basRgvService; @Autowired private MainServiceImpl mainService; - @Autowired - private LocMastService locMastService; @PostMapping("/table/rgv/state") @ManagerAuth(memo = "RGV淇℃伅琛�") @@ -88,7 +83,7 @@ vo.setWalkPos(rgvProtocol.getWalkPos()==1?"涓嶅湪瀹氫綅":"鍦ㄥ畾浣�"); vo.setWorkNo2(rgvProtocol.getTaskNo2()); // 宸ヤ綅2浠诲姟鍙� vo.setStatus2(rgvProtocol.getStatusType2().desc); // 宸ヤ綅2鐘舵�� - vo.setLoading2(rgvProtocol.getLoaded2()==1?"鏈夌墿":"鏃犵墿"); // 宸ヤ綅2鏈夌墿 + vo.setLoading2(rgvProtocol.getLoaded2()==0?"鏃犵墿":"鏈夌墿"); // 宸ヤ綅2鏈夌墿 vo.setWarnCode(String.valueOf(rgvProtocol.getAlarm())); if (rgvProtocol.getAlarm() > 0) { @@ -110,7 +105,7 @@ vo.setRgvNo(basRgv.getRgvNo()); // RGV鍙� list.add(vo); // 鑾峰彇RGV淇℃伅 - RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Crn, basRgv.getRgvNo()); + RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, basRgv.getRgvNo()); if (rgvThread == null) { continue; } @@ -119,7 +114,7 @@ continue; } - vo.setWorkNo1(rgvProtocol.getTaskNo1()); // 浠诲姟鍙� + vo.setWorkNo(rgvProtocol.getTaskNo1()); // 浠诲姟鍙� if (rgvProtocol.getTaskNo1()>0) { WrkMast wrkMast = wrkMastService.selectById(rgvProtocol.getTaskNo1()); if (wrkMast != null) { @@ -321,4 +316,26 @@ return false; } + @PostMapping("/console/rgv/site/data") + @ManagerAuth(memo = "灏忚溅瀹炴椂浣嶇疆") + public R scaleLatestData(){ + List<Map> result = new ArrayList<>(); + for (RgvSlave rgv : slaveProperties.getRgv()) { + // 鑾峰彇RGV淇℃伅 + RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgv.getId()); + if (rgvThread == null) { + throw new CoolException("RGV涓嶅湪绾�"); + } + RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); + if (rgvProtocol == null) { + throw new CoolException("RGV涓嶅湪绾�"); + } + Map<String, Object> rgvMap = new HashMap<>(); + rgvMap.put("title", rgvProtocol.getRgvPosI()); + rgvMap.put("id", rgvProtocol.getRgvNo()); + result.add(rgvMap); + } + return R.ok().add(result); + } + } \ No newline at end of file -- Gitblit v1.9.1