From 1c357ae25d6858a4243552309e85c1476c9584a2 Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期一, 09 十月 2023 20:04:15 +0800
Subject: [PATCH] 优化贝博平房仓粮情解析
---
igds-core/src/main/java/com/ld/igds/common/impl/CoreDeviceServiceImpl.java | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/igds-core/src/main/java/com/ld/igds/common/impl/CoreDeviceServiceImpl.java b/igds-core/src/main/java/com/ld/igds/common/impl/CoreDeviceServiceImpl.java
index ac4ab1b..11d32fb 100644
--- a/igds-core/src/main/java/com/ld/igds/common/impl/CoreDeviceServiceImpl.java
+++ b/igds-core/src/main/java/com/ld/igds/common/impl/CoreDeviceServiceImpl.java
@@ -9,6 +9,8 @@
import com.ld.igds.constant.DeviceStatus;
import com.ld.igds.constant.DeviceType;
+import com.ld.igds.io.request.ExeDevice;
+import com.ld.igds.models.Depot;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -112,6 +114,30 @@
return list;
}
+ @SuppressWarnings("unchecked")
+ @Override
+ public Set<String> getCacheDeviceSerByDepotId(String companyId, String depotId) {
+ String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEVICE_LIST);
+
+ Set<String> keys = redisUtil.keys(patten);
+ if (null == keys) return null;
+
+ List<Device> list = new ArrayList<>();
+ for (String key : keys) {
+ list.addAll((List<Device>) redisUtil.get(key));
+ }
+ if (list.isEmpty()) {
+ return null;
+ }
+ Set<String> result = new HashSet<>();
+ for (Device device : list) {
+ if(depotId.equals(device.getDepotId())){
+ result.add(device.getSerId());
+ }
+ }
+ return result;
+ }
+
@Override
public Device getCacheDeviceById(String companyId, String id) {
String key = RedisConst.buildDeviceKey(companyId, RedisConst.KEY_DEVICE, id);
--
Gitblit v1.9.3