From 814b453961763bf1b60af85f9f3bdc4682659ae8 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期一, 15 一月 2024 20:28:54 +0800 Subject: [PATCH] 添加手动推送粮情接口,以便第三方接口调用 --- src/main/java/com/fzzy/gateway/GatewayUtils.java | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/fzzy/gateway/GatewayUtils.java b/src/main/java/com/fzzy/gateway/GatewayUtils.java index e1e132f..7e4df85 100644 --- a/src/main/java/com/fzzy/gateway/GatewayUtils.java +++ b/src/main/java/com/fzzy/gateway/GatewayUtils.java @@ -59,6 +59,16 @@ return null; } + public static GatewayDevice getCacheByDeviceSIp(String ip) { + Collection<GatewayDevice> list = allCacheDevice(); + if (null == list || list.isEmpty()) return null; + + for (GatewayDevice device : list) { + if (ip.equals(device.getIp())) return device; + } + return null; + } + /** * 閽堝涓�涓�氳鍒嗘満瀵瑰涓粨鎯呭喌 * @@ -115,4 +125,17 @@ public static Collection<GatewayDevice> listDeviceWeight() { return cacheMapDeviceWeight.values(); } + + public static GatewayDevice getCacheByDepotSysId(String depotSysId) { + + if (null == depotSysId) return null; + Collection<GatewayDevice> list = allCacheDevice(); + if (null == list || list.isEmpty()) return null; + + for (GatewayDevice device : list) { + if (null == device.getDepotIdSys()) continue; + if (depotSysId.equals(device.getDepotIdSys())) return device; + } + return null; + } } -- Gitblit v1.9.3