From 588bb415370c4bad8e56cf76360e942c74c52090 Mon Sep 17 00:00:00 2001 From: luyya Date: Thu, 31 Jul 2025 17:11:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A3=E5=9F=8E=E4=BD=8D=E7=BD=AE=E6=B1=87?= =?UTF-8?q?=E8=81=9Aredis=E5=AD=98=E5=85=A5=E6=B2=A1=E6=9C=89devicename?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/data2es/service/impl/GpsServiceImpl.java | 1 + .../org/dromara/location/controller/LocationController.java | 4 ++-- .../java/org/dromara/system/schedule/DeviceRedisSchedule.java | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/service/impl/GpsServiceImpl.java b/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/service/impl/GpsServiceImpl.java index a86e5ac5..3cac7f0e 100644 --- a/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/service/impl/GpsServiceImpl.java +++ b/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/service/impl/GpsServiceImpl.java @@ -446,6 +446,7 @@ public class GpsServiceImpl implements IGpsService { esGpsInfoVO2.setPoliceName(deviceEntityV21.getPoliceName()); esGpsInfoVO2.setCarNum(deviceEntityV21.getCarNum()); esGpsInfoVO2.setPhoneNum(deviceEntityV21.getPhoneNum()); + esGpsInfoVO2.setDeviceName(deviceEntityV21.getDeviceName()); } String lat = esGpsInfo.getLat(); String lng = esGpsInfo.getLng(); diff --git a/stwzhj-modules/wzhj-location/src/main/java/org/dromara/location/controller/LocationController.java b/stwzhj-modules/wzhj-location/src/main/java/org/dromara/location/controller/LocationController.java index 79946b6d..096da857 100644 --- a/stwzhj-modules/wzhj-location/src/main/java/org/dromara/location/controller/LocationController.java +++ b/stwzhj-modules/wzhj-location/src/main/java/org/dromara/location/controller/LocationController.java @@ -68,7 +68,7 @@ public class LocationController { } }else { - key = keys +"*"; + key = keys +"[1,2,3,4,5,7,8]:*"; } list = RedisUtils.searchAndGetKeysValues(key); list.removeAll(Collections.singleton(null)); @@ -113,7 +113,7 @@ public class LocationController { .collect(Collectors.toList()); //根据前端勾选机构和全部的redis记录匹配是否包含 这样减少多次查询和查库 dlist.addAll(matchedObjects); }else { - String key = keys + "*"; // key值为 online_users:* + String key = keys + "[1,2,3,4,5,7,8]:*"; // key值为 online_users:* zzjgdms = params.get("zzjgdm").toString(); String[] zzjgdm = Convert.toStrArray(zzjgdms); Set targetSet = new HashSet<>(List.of(zzjgdm)); // 转为HashSet提高查询效率 diff --git a/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/schedule/DeviceRedisSchedule.java b/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/schedule/DeviceRedisSchedule.java index bb100ad0..de7df84a 100644 --- a/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/schedule/DeviceRedisSchedule.java +++ b/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/schedule/DeviceRedisSchedule.java @@ -53,6 +53,7 @@ public class DeviceRedisSchedule { } TDeviceBo bo = new TDeviceBo(); bo.setBeginTime(lastUpdateTime); + bo.setValid(1); bo.setEndTime(DateUtil.formatDateTime(new Date())); List list = deviceService.queryList(bo); if (list.size() >0){