jiazx0107@163.com
2024-01-19 dd7a033e4591b8004ecd570ef4ff2ef925df65bc
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;
    }
}