From 638c54684fda25c64760d9f9706b303424fde7bc Mon Sep 17 00:00:00 2001 From: luyya Date: Thu, 10 Jul 2025 18:03:58 +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=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/common-dubbo.yml | 32 ++++++------- .../data2es/handler/RedisExpireListener.java | 4 +- .../data2es/schedule/BaseDataSchedule.java | 6 +-- .../controller/DeviceGPSController.java | 22 +++++++-- .../extract/schedule/JJDeviceSchedule.java | 4 +- .../service/impl/TDeviceGpsServiceImpl.java | 1 + .../main/resources/mapper/DeviceGpsMapper.xml | 6 +-- .../org/dromara/udp/config/AsyncUtils.java | 48 ++++++++++++------- .../udp/controller/OriginalUdpReceiver.java | 23 +++------ 9 files changed, 81 insertions(+), 65 deletions(-) diff --git a/stwzhj-common/stwzhj-common-dubbo/src/main/resources/common-dubbo.yml b/stwzhj-common/stwzhj-common-dubbo/src/main/resources/common-dubbo.yml index 90a28d63..bfdf0f3d 100644 --- a/stwzhj-common/stwzhj-common-dubbo/src/main/resources/common-dubbo.yml +++ b/stwzhj-common/stwzhj-common-dubbo/src/main/resources/common-dubbo.yml @@ -19,31 +19,31 @@ dubbo: password: ${spring.cloud.nacos.password} parameters: namespace: ${spring.profiles.active} - metadata-report: - address: redis://${spring.data.redis.host}:${spring.data.redis.port} - group: DUBBO_GROUP - username: dubbo - password: Ycgis@2509 - # 集群开关 - sentinel: false - parameters: - namespace: ${spring.profiles.active} - database: ${spring.data.redis.database} - timeout: ${spring.data.redis.timeout} - backup: 53.176.146.98:26380,53.176.146.99:26380,53.176.146.100:26380 # metadata-report: # address: redis://${spring.data.redis.host}:${spring.data.redis.port} # group: DUBBO_GROUP # username: dubbo -# password: ${spring.data.redis.password} +# password: Ycgis@2509 # # 集群开关 -# cluster: false +# sentinel: false # parameters: # namespace: ${spring.profiles.active} # database: ${spring.data.redis.database} # timeout: ${spring.data.redis.timeout} -# # 集群地址 cluster 为 true 生效 -# backup: 127.0.0.1:6379,127.0.0.1:6381 +# backup: 53.176.146.98:26380,53.176.146.99:26380,53.176.146.100:26380 + metadata-report: + address: redis://${spring.data.redis.host}:${spring.data.redis.port} + group: DUBBO_GROUP + username: dubbo + password: ${spring.data.redis.password} + # 集群开关 + cluster: false + parameters: + namespace: ${spring.profiles.active} + database: ${spring.data.redis.database} + timeout: ${spring.data.redis.timeout} + # 集群地址 cluster 为 true 生效 + backup: 127.0.0.1:6379,127.0.0.1:6381 # 消费者相关配置 consumer: # 结果缓存(LRU算法) diff --git a/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/handler/RedisExpireListener.java b/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/handler/RedisExpireListener.java index 750c97cc..614ce36a 100644 --- a/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/handler/RedisExpireListener.java +++ b/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/handler/RedisExpireListener.java @@ -68,9 +68,9 @@ public class RedisExpireListener extends KeyExpirationEventMessageListener { String deviceType = split[2]; String deviceCode = split[3]; - if ("5".equals(deviceType) || "9".equals(deviceType) || "8".equals(deviceType) || "7".equals(deviceType)){ + /*if ("5".equals(deviceType) || "9".equals(deviceType) || "8".equals(deviceType) || "7".equals(deviceType)){ return; - } + }*/ log.error("redis key expired:key={}",expiredKey); JSONObject object = RedisUtils.getBucket(RedisConstants.ONLINE_USERS + deviceType+":"+deviceCode); if (Objects.isNull(object)) { diff --git a/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/schedule/BaseDataSchedule.java b/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/schedule/BaseDataSchedule.java index b98c0a9c..a7009da3 100644 --- a/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/schedule/BaseDataSchedule.java +++ b/stwzhj-modules/wzhj-data2es/src/main/java/org/dromara/data2es/schedule/BaseDataSchedule.java @@ -33,13 +33,13 @@ public class BaseDataSchedule { @Autowired DSQinwuService dsQinwuService; - @Value("${ruansi.ruansi-kafka.send-to-third-enabled}") +// @Value("${ruansi.ruansi-kafka.send-to-third-enabled}") private boolean sendToThirdEnabled; - @Value("${ruansi.ruansi-kafka.start-update-time}") +// @Value("${ruansi.ruansi-kafka.start-update-time}") private String startUpdateTime; - @Value("${ruansi.ruansi-kafka.ds-preurl}") +// @Value("${ruansi.ruansi-kafka.ds-preurl}") private String dsPreurl; /** * 娱特单位抽取 diff --git a/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/controller/DeviceGPSController.java b/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/controller/DeviceGPSController.java index a75c75b2..a391c625 100644 --- a/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/controller/DeviceGPSController.java +++ b/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/controller/DeviceGPSController.java @@ -8,6 +8,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.dubbo.config.annotation.DubboReference; import org.dromara.data2es.api.RemoteDataToEsService; import org.dromara.data2es.api.domain.RemoteGpsInfo; +import org.dromara.extract.WzhjExtractApplication; import org.dromara.extract.domain.EsGpsInfo; import org.dromara.extract.exception.MyBusinessException; import org.dromara.extract.service.ITDeviceGpsService; @@ -16,6 +17,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; import org.springframework.context.annotation.Bean; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Scheduled; @@ -42,6 +45,7 @@ public class DeviceGPSController { @Value("${ruansi.start_update_time}") private String startUpdateTime; + @Value("${ruansi.jly_update_time}") private String jlyUpdateTime; @Value("${ruansi.last_update_time}") @@ -60,8 +64,8 @@ public class DeviceGPSController { return DateUtil.formatDateTime(info.getGpsTime()); } - @Scheduled(cron = "0/10 * * * * ?") - @Async +// @Scheduled(cron = "0/10 * * * * ?") +// @Async public void bdgcGps(){ if(StringUtils.isBlank(lastUpdateTime)){ try { @@ -106,8 +110,8 @@ public class DeviceGPSController { } - @Scheduled(cron = "0/8 * * * * ?") - @Async + @Scheduled(cron = "0/5 * * * * ?") +// @Async public void jlyGps(){ if(StringUtils.isBlank(jlyUpdateTime)){ jlyUpdateTime = startUpdateTime; @@ -141,7 +145,7 @@ public class DeviceGPSController { } - @Scheduled(cron = "0/30 * * * * ?") +// @Scheduled(cron = "0/30 * * * * ?") public void jlyGpsStatus(){ if(StringUtils.isBlank(jlyUpdateTime)){ jlyUpdateTime = startUpdateTime; @@ -193,4 +197,12 @@ public class DeviceGPSController { } } + + /*public static void main(String[] args) { + String time = "2025-07-10T10:25:40"; + EsGpsInfo gpsInfo = new EsGpsInfo(); + gpsInfo.setGpsTime(DateUtil.parse(time)); + System.out.println(gpsInfo.toString()); + } +*/ } diff --git a/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/schedule/JJDeviceSchedule.java b/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/schedule/JJDeviceSchedule.java index 08913859..c6885fb6 100644 --- a/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/schedule/JJDeviceSchedule.java +++ b/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/schedule/JJDeviceSchedule.java @@ -29,13 +29,13 @@ public class JJDeviceSchedule { @DubboReference RemoteDeviceService remoteDeviceService; - @Value("${ruansi.start_jlyupdate_time}") +// @Value("${ruansi.start_jlyupdate_time}") private String startUpdateTime; private String lastUpdateTime = ""; - @Scheduled(cron = "0 0/10 * * * ?") +// @Scheduled(cron = "0 0/10 * * * ?") public void saveORUpdateJly(){ if(StringUtils.isBlank(lastUpdateTime)){ lastUpdateTime = startUpdateTime; diff --git a/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/service/impl/TDeviceGpsServiceImpl.java b/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/service/impl/TDeviceGpsServiceImpl.java index ab08cbbf..0cd0f34c 100644 --- a/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/service/impl/TDeviceGpsServiceImpl.java +++ b/stwzhj-modules/wzhj-extract/src/main/java/org/dromara/extract/service/impl/TDeviceGpsServiceImpl.java @@ -25,6 +25,7 @@ public class TDeviceGpsServiceImpl implements ITDeviceGpsService { } @Override + @DS("zfjly") public List selectJlyGPS(EsGpsInfo esGpsInfo) { return deviceMapper.selectJlyGPS(esGpsInfo); } 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 f65ecaa5..4d288843 100644 --- a/stwzhj-modules/wzhj-extract/src/main/resources/mapper/DeviceGpsMapper.xml +++ b/stwzhj-modules/wzhj-extract/src/main/resources/mapper/DeviceGpsMapper.xml @@ -49,11 +49,11 @@