From 056e1a5e2153c37fa926de62ae3fe4ca298e45dd Mon Sep 17 00:00:00 2001 From: weidong Date: Sat, 1 Mar 2025 11:10:31 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=B0=86=E5=BC=82=E5=B8=B8=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=BC=96=E5=8F=B7=E6=94=BE=E5=85=A5=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sideslope/service/WarningServiceImpl.java | 7 ++++++- .../task/AbnormalDeviceProcessor.java | 19 +++++++++++++++---- .../src/main/resources/application.properties | 5 ++++- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/service/WarningServiceImpl.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/service/WarningServiceImpl.java index 20e29f7f..a5ecc7fb 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/service/WarningServiceImpl.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/service/WarningServiceImpl.java @@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; import javax.annotation.PostConstruct; import java.math.BigDecimal; @@ -38,7 +39,8 @@ public class WarningServiceImpl implements WarningService { // warning type <-> level & value Map cfgMap = new ConcurrentHashMap<>(); int warningLevel2Code = 0; - + @Value("${abnormal.check_list}") + private String checkList; @PostConstruct @Override public void refreshCfg(){ @@ -361,6 +363,9 @@ public class WarningServiceImpl implements WarningService { @Override public void checkFilteredResultJump(double[] latestRpos, GnssCalcData locationRecord){ + if(StringUtils.hasText(checkList)){ + if(checkList.contains(locationRecord.getDeviceid())) return; + } int[] warningValuesXY = cfgMap.get(WarningCfg.TYPE_XY_JUMP); int[] warningValuesZ = cfgMap.get(WarningCfg.TYPE_Z_JUMP); int warningCode = 0; diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/task/AbnormalDeviceProcessor.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/task/AbnormalDeviceProcessor.java index c9068ec1..80701a29 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/task/AbnormalDeviceProcessor.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/task/AbnormalDeviceProcessor.java @@ -8,10 +8,12 @@ import com.imdroid.sideslope.sal.DeviceService; 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.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; import javax.annotation.Resource; import java.time.LocalDateTime; @@ -35,6 +37,10 @@ public class AbnormalDeviceProcessor{ GnssGroupCalcMapper groupCalcMapper; @Autowired GnssCalcDataMapper dataMapper; + @Value("${abnormal.check_list}") + private String checkList; + @Value("${abnormal.refer_list}") + private String referList; // 非线程安全,需加同步保护 List groupCalcList; @@ -51,14 +57,19 @@ public class AbnormalDeviceProcessor{ return null; } - @Scheduled(cron = "0 0/10 * * * ?") // 每30分钟执行一次 + @Scheduled(cron = "0 0/10 * * * ?") // 每10分钟执行一次 private void checkDevice() { logger.info("zny checkDevice"); - //checkNoDataDevice("2345080","2345068","2410190"); + //checkNotGoodDevice("2412254","2412272"); - checkNotGoodDevice("2412270","2412272"); + if(StringUtils.hasText(checkList) && StringUtils.hasText(referList)) { + String[] checkDevices = checkList.split(","); + String[] referDevices = referList.split(","); + for (int i = 0; i < checkDevices.length && i < referDevices.length; i++) { + checkNotGoodDevice(checkDevices[i], referDevices[i]); + } + } //checkNoDataDevice("2345084","2415276","2345076"); - //checkNoDataDevice("2345085","2345068","2345075"); } void checkNoDataDevice(String noDataDeviceId, String refDeviceId1, String refDeviceId2){ diff --git a/sec-beidou-rtcm/src/main/resources/application.properties b/sec-beidou-rtcm/src/main/resources/application.properties index 28b24e53..d88f85c1 100644 --- a/sec-beidou-rtcm/src/main/resources/application.properties +++ b/sec-beidou-rtcm/src/main/resources/application.properties @@ -41,4 +41,7 @@ ntrip_server.port = 11100 sim.url = http://120.78.169.220:8089 sim.username = gzyzdz -sim.key = 632629d1269a202c9d49a574623e4e4c \ No newline at end of file +sim.key = 632629d1269a202c9d49a574623e4e4c + +abnormal.check_list = 2412270 +abnormal.refer_list = 2412272 \ No newline at end of file