From 0d9a7c8974add02c61d2471642e4e5a04013ab7b Mon Sep 17 00:00:00 2001 From: vince <757871790@qq.com> Date: 星期三, 04 六月 2025 11:37:07 +0800 Subject: [PATCH] 优化粮温检测 --- src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java b/src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java index 6df640e..49357f3 100644 --- a/src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java +++ b/src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java @@ -17,6 +17,8 @@ public static Map<String, GatewayRemoteService> remoteMap = new HashMap<>(); + public static Map<String, GatewayDeviceReportService> reportMap = new HashMap<>(); + public static Map<String, GatewaySyncGranService> syncGrain = new HashMap<>(); public static Map<String, GatewaySyncIdCardService> syncIdCard = new HashMap<>(); @@ -26,6 +28,8 @@ public static Map<String, GatewaySyncLprService> syncLpr = new HashMap<>(); public static Map<String, GatewaySyncWeightService> syncWeight = new HashMap<>(); + + public static Map<String, GatewayDeviceTestService> testMap = new HashMap<>(); @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { @@ -58,6 +62,16 @@ Map<String, GatewaySyncWeightService> serviceMap6 = applicationContext.getBeansOfType(GatewaySyncWeightService.class); for (String key : serviceMap6.keySet()) { syncWeight.put(serviceMap6.get(key).getWeightProtocol(), serviceMap6.get(key)); + } + + Map<String, GatewayDeviceReportService> serviceMap7 = applicationContext.getBeansOfType(GatewayDeviceReportService.class); + for (String key : serviceMap7.keySet()) { + reportMap.put(serviceMap7.get(key).getProtocol(), serviceMap7.get(key)); + } + + Map<String, GatewayDeviceTestService> serviceMap8 = applicationContext.getBeansOfType(GatewayDeviceTestService.class); + for (String key : serviceMap8.keySet()) { + testMap.put(serviceMap8.get(key).getProtocol(), serviceMap8.get(key)); } } @@ -123,4 +137,23 @@ return syncWeight.get(protocol); } + /** + * 鏍规嵁瀹炵幇鍗忚鑾峰彇褰撳墠瀹炵幇鏂规硶 + * + * @param protocol + * @return + */ + public GatewayDeviceReportService getDeviceReportService(String protocol) { + return reportMap.get(protocol); + } + + + /** + * @param protocol + * @return + */ + public GatewayDeviceTestService getGatewayTestService(String protocol) { + return testMap.get(protocol); + } + } -- Gitblit v1.9.3