From 233c0e20548cadafb77efdcb3418f38c6658bbad Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期四, 26 十月 2023 14:20:57 +0800 Subject: [PATCH] 四川省网关接口相关7 --- src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java | 100 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 92 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java b/src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java index 9e475a6..b90a996 100644 --- a/src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java +++ b/src/main/java/com/fzzy/gateway/api/GatewayRemoteManager.java @@ -9,29 +9,63 @@ import java.util.Map; +/** + * 鎺ュ彛灏佽 + */ @Component public class GatewayRemoteManager implements ApplicationContextAware { public static Map<String, GatewayRemoteService> remoteMap = new HashMap<>(); - public static Map<String, GatewaySyncService> syncMap = new HashMap<>(); + public static Map<String, DeviceReportService> reportMap = new HashMap<>(); + + public static Map<String, GatewaySyncGranService> syncGrain = new HashMap<>(); + + public static Map<String, GatewaySyncIdCardService> syncIdCard = new HashMap<>(); + + public static Map<String, GatewaySyncLedService> syncLed = new HashMap<>(); + + public static Map<String, GatewaySyncLprService> syncLpr = new HashMap<>(); + + public static Map<String, GatewaySyncWeightService> syncWeight = new HashMap<>(); @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { Map<String, GatewayRemoteService> serviceMap1 = applicationContext.getBeansOfType(GatewayRemoteService.class); - for (String key : serviceMap1.keySet()) { remoteMap.put(serviceMap1.get(key).getProtocol(), serviceMap1.get(key)); } - - Map<String, GatewaySyncService> serviceMap2 = applicationContext.getBeansOfType(GatewaySyncService.class); - + Map<String, GatewaySyncGranService> serviceMap2 = applicationContext.getBeansOfType(GatewaySyncGranService.class); for (String key : serviceMap2.keySet()) { - syncMap.put(serviceMap2.get(key).getProtocol(), serviceMap2.get(key)); + syncGrain.put(serviceMap2.get(key).getGrainProtocol(), serviceMap2.get(key)); + } + + Map<String, GatewaySyncIdCardService> serviceMap3 = applicationContext.getBeansOfType(GatewaySyncIdCardService.class); + for (String key : serviceMap3.keySet()) { + syncIdCard.put(serviceMap3.get(key).getIdCardProtocol(), serviceMap3.get(key)); } + Map<String, GatewaySyncLedService> serviceMap4 = applicationContext.getBeansOfType(GatewaySyncLedService.class); + for (String key : serviceMap4.keySet()) { + syncLed.put(serviceMap4.get(key).getLedProtocol(), serviceMap4.get(key)); + } + + Map<String, GatewaySyncLprService> serviceMap5 = applicationContext.getBeansOfType(GatewaySyncLprService.class); + for (String key : serviceMap5.keySet()) { + syncLpr.put(serviceMap5.get(key).getLprProtocol(), serviceMap5.get(key)); + } + + Map<String, GatewaySyncWeightService> serviceMap6 = applicationContext.getBeansOfType(GatewaySyncWeightService.class); + for (String key : serviceMap6.keySet()) { + syncWeight.put(serviceMap6.get(key).getWeightProtocol(), serviceMap6.get(key)); + } + + Map<String, DeviceReportService> serviceMap7 = applicationContext.getBeansOfType(DeviceReportService.class); + for (String key : serviceMap7.keySet()) { + reportMap.put(serviceMap7.get(key).getProvinceProtocol(), serviceMap7.get(key)); + } } @@ -52,8 +86,58 @@ * @param protocol * @return */ - public GatewaySyncService getSyncService(String protocol) { - return syncMap.get(protocol); + public GatewaySyncGranService getSyncGrainService(String protocol) { + return syncGrain.get(protocol); + } + + /** + * 鏍规嵁瀹炵幇鍗忚鑾峰彇褰撳墠瀹炵幇鏂规硶 + * + * @param protocol + * @return + */ + public GatewaySyncIdCardService getSyncIdCardService(String protocol) { + return syncIdCard.get(protocol); + } + + /** + * 鏍规嵁瀹炵幇鍗忚鑾峰彇褰撳墠瀹炵幇鏂规硶 + * + * @param protocol + * @return + */ + public GatewaySyncLedService getSyncLedService(String protocol) { + return syncLed.get(protocol); + } + + /** + * 鏍规嵁瀹炵幇鍗忚鑾峰彇褰撳墠瀹炵幇鏂规硶 + * + * @param protocol + * @return + */ + public GatewaySyncLprService getSyncLprService(String protocol) { + return syncLpr.get(protocol); + } + + /** + * 鏍规嵁瀹炵幇鍗忚鑾峰彇褰撳墠瀹炵幇鏂规硶 + * + * @param protocol + * @return + */ + public GatewaySyncWeightService getSyncWeightService(String protocol) { + return syncWeight.get(protocol); + } + + /** + * 鏍规嵁瀹炵幇鍗忚鑾峰彇褰撳墠瀹炵幇鏂规硶 + * + * @param protocol + * @return + */ + public DeviceReportService getDeviceReportService(String protocol) { + return reportMap.get(protocol); } } -- Gitblit v1.9.3