From cc6adcef37a1af767805682c335b7e95c98bb78f Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 06 三月 2026 10:01:46 +0800
Subject: [PATCH] 最新版本541200007

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java |   64 +++++++++++--------------------
 1 files changed, 23 insertions(+), 41 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
index 3ba9af1..d535761 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -237,8 +237,8 @@
             initReginCameralList(allList,req );//鑾峰彇鍏ㄩ儴鐩戞帶鐐规暟鎹�
         }else  if(Constants.equalsInteger(req.getWithCameras(),Constants.TWO)){
             initReginCameralList(allList,req );//鑾峰彇鍏ㄩ儴鐩戞帶鐐规暟鎹�
-            initReginFireDeviveList(allList);//鑾峰彇鍏ㄩ儴鐩戞帶鐐规暟鎹�
-            initReginSensorList(allList);//鑾峰彇鍏ㄩ儴鐩戞帶鐐规暟鎹�
+            initReginFireDeviveList(allList, req);//鑾峰彇鍏ㄩ儴鐩戞帶鐐规暟鎹�
+            initReginSensorList(allList,req);//鑾峰彇鍏ㄩ儴鐩戞帶鐐规暟鎹�
         }
         List<PageRegionInfoResponse> data = new RegionTreeVO(allList).buildTree();
         //鍔犲叆缂撳瓨
@@ -276,7 +276,8 @@
         return allList;
     }
 
-    private void initReginFireDeviveList(List<PageRegionInfoResponse> allList ) {
+    private void initReginFireDeviveList(List<PageRegionInfoResponse> allList,CarmeraListVO req) {
+        String name =req.getName();
         List<CarmeraListVO> carmeraListVOList = fireDeviceList();
         if(carmeraListVOList!=null && carmeraListVOList.size()>0){
             for(PageRegionInfoResponse p : allList){
@@ -291,7 +292,8 @@
             }
         }
     }
-    private void initReginSensorList(List<PageRegionInfoResponse> allList) {
+    private void initReginSensorList(List<PageRegionInfoResponse> allList,CarmeraListVO req) {
+        String name =req.getName();
         List<CarmeraListVO> carmeraListVOList = sensorList();
         if(carmeraListVOList!=null && carmeraListVOList.size()>0){
             for(PageRegionInfoResponse p : allList){
@@ -306,7 +308,7 @@
             }
         }
     }
-//    @PostConstruct
+    @PostConstruct
     public void cacheRegionAndDeviceData(){
         log.error("===============缂撳瓨娴峰悍骞冲彴鍖哄煙璁惧淇℃伅======寮�濮�============");
         try {
@@ -325,7 +327,6 @@
             stringRedisTemplate.opsForValue().set(Constants.RedisKeys.HK_SENSOR,sensorList);//鎵�鏈変紶鎰熷櫒
             log.error("===============缂撳瓨娴峰悍骞冲彴鍖哄煙璁惧淇℃伅======鎴愬姛============");
         }catch (Exception e){
-            e.printStackTrace();
             log.error("===============缂撳瓨娴峰悍骞冲彴鍖哄煙璁惧淇℃伅澶辫触==================");
         }
     }
@@ -338,7 +339,7 @@
             for(PageRegionInfoResponse p : allList){
                 for(CarmeraListVO c : carmeraListVOList){
                     if(StringUtils.equals(p.getIndexCode(),c.getReginCode())
-                            && (StringUtils.isBlank(name) || StringUtils.contains(c.getName(),name))){
+                            && (StringUtils.contains(c.getName(),name) ||StringUtils.isBlank(name))){
                         if(p.getCarmeraList()==null){
                             p.setCarmeraList(new ArrayList<>());
                         }
@@ -1710,41 +1711,23 @@
     @Override
     public    YearDeviceDataVO yearFightingAdminDeviceData(){
         YearDeviceDataVO data = new YearDeviceDataVO();
-//        FireStatisticRequest param = new FireStatisticRequest();
-//        param.setIndexCode("api_fire_statistic");
-//        BaseResponse<FireStatisticResponse> response = HKService.fireStatistic(param);
-//        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ) {
-//            data.setProtectNum(Constants.formatIntegerNum(response.getData().getMaintenanceNum()));
-//            data.setPlanProtectTotal(Constants.formatIntegerNum(response.getData().getDeviceTotalNum()));
-//        }
-//        param = new FireStatisticRequest();
-//        param.setIndexCode("api_fire_statistic_month");
-//        BaseResponse<FireStatisticResponse> response1 = HKService.fireStatisticMonth(param);
-//        if(response1 != null && StringUtils.equals(response1.getCode(), HKConstants.RESPONSE_SUCCEE)
-//                && response1.getData()!=null ) {
-//            data.setMonthAddNum(Constants.formatIntegerNum(response1.getData().getMaintenanceNumMonth()));
-//            data.setMonthTotalNum(Constants.formatIntegerNum(response1.getData().getDeviceTotalNum()));
-//        }
-
-        data.setProtectNum(Constants.ZERO);
-        data.setPlanProtectTotal(Constants.ZERO);
-        data.setMonthAddNum(Constants.ZERO);
-        data.setMonthTotalNum(Constants.ZERO);
-        BaseResponse<SensorStatusStatisticResponse> response = HKService.sensorStatusStatistic();
-        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)
-                && response.getData()!=null ) {
-            data.setProtectNum(Constants.formatIntegerNum(response.getData().getSensorMainNum()));
-            data.setPlanProtectTotal(Constants.formatIntegerNum(response.getData().getSensorNum()));
-            data.setMonthAddNum(Constants.formatIntegerNum(response.getData().getSensorMainMonthNum()));
-            data.setMonthTotalNum(Constants.formatIntegerNum(response.getData().getSensorNum()));
+        FireStatisticRequest param = new FireStatisticRequest();
+        param.setIndexCode("api_fire_statistic");
+        BaseResponse<FireStatisticResponse> response = HKService.fireStatistic(param);
+        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ) {
+            data.setProtectNum(Constants.formatIntegerNum(response.getData().getMaintenanceNum()));
+            data.setPlanProtectTotal(Constants.formatIntegerNum(response.getData().getDeviceTotalNum()));
         }
-
+        param = new FireStatisticRequest();
+        param.setIndexCode("api_fire_statistic_month");
+        BaseResponse<FireStatisticResponse> response1 = HKService.fireStatisticMonth(param);
+        if(response1 != null && StringUtils.equals(response1.getCode(), HKConstants.RESPONSE_SUCCEE)
+                && response1.getData()!=null ) {
+            data.setMonthAddNum(Constants.formatIntegerNum(response1.getData().getMaintenanceNumMonth()));
+            data.setMonthTotalNum(Constants.formatIntegerNum(response1.getData().getDeviceTotalNum()));
+        }
         return data;
     }
-
-
-
-
 
     /**
      * 銆愭秷闃茬鎺с�戠湅鏉�-鍒嗙被鍜屾眹鎬荤殑鍚勭姸鎬佽澶囨暟閲�
@@ -2596,8 +2579,7 @@
                 .selectAs(Platform::getName,PlatformWarnEvent::getPlatformName)
                 .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
                 .eq(PlatformWarnEvent::getIsdeleted,Constants.ZERO)
-                //.apply(" to_days(t.create_date) = to_days(now()) ")
-                .apply(" ( t.create_date > now() - INTERVAL 10 MINUTE ) ")
+                .apply("to_days(t.create_date) = to_days(now())")
                 .orderByDesc(PlatformWarnEvent::getCreateDate)
                 .last(" limit "+limit)
         );

--
Gitblit v1.9.3