From 3c85d5950da74812b7f9cc642c6784892c28cdfd Mon Sep 17 00:00:00 2001 From: luyya Date: Fri, 11 Jul 2025 14:48:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=B3=E5=B7=9E=E4=BD=8D=E7=BD=AE=E6=B1=87?= =?UTF-8?q?=E8=81=9A=E9=A6=96=E9=A1=B5=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/DeviceGpsMapper.xml | 1 + .../system/controller/system/IndexStaticsController.java | 7 +++++-- .../org/dromara/system/schedule/DeviceRedisSchedule.java | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stwzhj-modules/wzhj-extract/src/main/resources/mapper/DeviceGpsMapper.xml b/stwzhj-modules/wzhj-extract/src/main/resources/mapper/DeviceGpsMapper.xml index 4d288843..7125109a 100644 --- a/stwzhj-modules/wzhj-extract/src/main/resources/mapper/DeviceGpsMapper.xml +++ b/stwzhj-modules/wzhj-extract/src/main/resources/mapper/DeviceGpsMapper.xml @@ -52,6 +52,7 @@ select indexcode deviceCode,'5' deviceType, longitude lng, latitude lat,to_timestamp(updatatime, 'YYYY-MM-DD HH24:MI:SS') gpsTime from public.mobileposition_view and to_timestamp(updatatime, 'YYYY-MM-DD HH24:MI:SS') > #{gpsTime} + and to_timestamp(updatatime, 'YYYY-MM-DD HH24:MI:SS') <= now() order by updatatime desc diff --git a/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/controller/system/IndexStaticsController.java b/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/controller/system/IndexStaticsController.java index 0bc1caa7..ae010bcd 100644 --- a/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/controller/system/IndexStaticsController.java +++ b/stwzhj-modules/wzhj-system/src/main/java/org/dromara/system/controller/system/IndexStaticsController.java @@ -4,6 +4,7 @@ package org.dromara.system.controller.system; import cn.hutool.core.date.DateUtil; import jdk.dynalink.linker.LinkerServices; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.config.annotation.DubboReference; import org.dromara.common.core.domain.R; import org.dromara.common.redis.utils.RedisUtils; @@ -24,6 +25,7 @@ import java.util.*; @RequiredArgsConstructor @RestController +@Slf4j public class IndexStaticsController extends BaseController { private final ISysDeptService deptService; @@ -90,7 +92,7 @@ public class IndexStaticsController extends BaseController { /* * 通过ES来监听各类设备定位是否正常 * */ - @Scheduled(cron = "0 */30 * * * ?") +// @Scheduled(cron = "0 */30 * * * ?") public void listen(){ List strs = elasticSearchService.linstenDataStatus(); if (strs.size() >0){ @@ -105,8 +107,9 @@ public class IndexStaticsController extends BaseController { noticeService.insertNotice(noticeBo); } + } } - } + /* * 各地市总数和在线数 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 d9032267..98169d3a 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 @@ -39,7 +39,7 @@ public class DeviceRedisSchedule { /* * 把Redis中 online_user数据存入t_device_redis表中 * */ - @Scheduled(cron = "0/30 * * * * ?") +// @Scheduled(cron = "0/30 * * * * ?") public void handleDeviceRedis(){ List jlist = RedisUtils.searchAndGetKeysValues("online_users:*"); redisService.insertBatch(BeanUtil.copyToList(jlist, DeviceRedis.class)); @@ -81,7 +81,7 @@ public class DeviceRedisSchedule { /* * 定时删除设备状态为删除的定位信息和在线表 * */ -// @Scheduled(cron = "0 0 0/1 * * ?") + @Scheduled(cron = "0 0 0/1 * * ?") public void removeRedis(){ deviceService.deleteRedis(); }