Browse Source

声雷达 - dat 文件解析 下载 上传

hxf 1 năm trước cách đây
mục cha
commit
32be3abaf0

+ 0 - 9
wrdep-biz/src/main/java/com/jiayue/biz/job/FileAnalysisJob.java

@@ -63,16 +63,7 @@ public class FileAnalysisJob {
         log.debug("文件解析定时任务执行完成");
 
     }
-//    @Scheduled(fixedDelay = 60000 * 15)
-    public void sldFileAnalysis() {
 
-        log.debug("声雷达文件解析定时任务执行开始");
-
-        this.analysisData.AnalysisSldFile();
-
-        log.debug("声雷达文件解析定时任务执行完成");
-
-    }
 //    @Scheduled(fixedDelay = 6000
 //   @Scheduled(fixedDelay = 60000 * 15)
     public void eolFileAnalysis() {

+ 137 - 48
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/AnalysisDataImpl.java

@@ -649,7 +649,7 @@ public class AnalysisDataImpl {
         List<Map<String, Object>> filterData = new CheckDataRecode().checkValue(allData, type);
         String equipmentId = file.getName().substring(0, 4);
         String eTime = file.getName().substring(4, 12);
-        windTowerDataParentTableService.packageData(filterData, equipmentId, eTime, type, "");
+        windTowerDataParentTableService.packageData(filterData, equipmentId, type, "");
         reader.close();
 
     }
@@ -698,7 +698,7 @@ public class AnalysisDataImpl {
         List<Map<String, Object>> filterData = new CheckDataRecode().checkValue(allData, type);
         String eqId = file.getName().split("_")[0];
         String eTime = file.getName().split("_")[1];
-        windTowerDataParentTableService.packageData(filterData, eqId, eTime, type, "");
+        windTowerDataParentTableService.packageData(filterData, eqId, type, "");
         reader.close();
     }
 
@@ -780,49 +780,6 @@ public class AnalysisDataImpl {
     }
 
     /**
-     * 解析声雷达文件入库
-     */
-    public void AnalysisSldFile() {
-        File file = new File("D:\\AcousticRadar\\new\\");
-        if (!file.exists()) {
-            file.mkdirs();
-        }
-        //获取目录下的所有文件夹
-        File[] files = file.listFiles();
-        try {
-            for (File file1 : files) {
-                //获取新数据文件夹的文件名
-                String fileName = file1.getName();
-                //新老文件夹名字一致
-                File oldFile = new File("D:\\AcousticRadar\\old\\" + fileName);
-                //获取文件夹下的所有文件
-                File[] fileList = file1.listFiles();
-                for (File file2 : fileList) {
-                    //如果有zip文件就解压到当前文件夹
-                    if (isArchiveFile(file2)) {
-                        String zipPath = file2.getPath();
-                        //解压文件
-                        ZipUtil.unzip(file2.getPath(), file1.getPath() + "\\");
-                        //删除压缩包
-                        FileUtils.deleteFile(zipPath);
-                    }
-                    if (file2.getName().contains(".csv")) {
-                        //解析csv文件
-                        acousticRadar(file2, file1.getName());
-                        //将解析过的文件转移到备用目录
-                        com.jiayue.biz.util.FileUtil.move(file2.getPath(), oldFile.getPath() + "\\");
-                        log.info("声雷达文件入库成功");
-                    }
-                }
-            }
-        } catch (Exception e) {
-            log.error("声雷达文件入库错误");
-            e.printStackTrace();
-        }
-
-    }
-
-    /**
      * @param file csv文件
      * @param eqId 设备Id
      */
@@ -835,7 +792,7 @@ public class AnalysisDataImpl {
         //获取到csv文件
         List<CsvRow> rows = data.getRows();
         //获取层高
-        List<WindTowerInfo> equipmentNo = windTowerInfoService.lambdaQuery().eq(WindTowerInfo::getEquipmentNo,eqId).list();
+        List<WindTowerInfo> equipmentNo = windTowerInfoService.lambdaQuery().eq(WindTowerInfo::getEquipmentNo, eqId).list();
         String height = "";
         if (equipmentNo.size() == 0) {
             CsvRow csvRow = rows.get(0);
@@ -972,7 +929,8 @@ public class AnalysisDataImpl {
 
             //过滤数据
             List<Map<String, Object>> mapList1 = new CheckDataRecode().checkValue(mapList, "sld");
-            windTowerDataParentTableService.packageData(mapList1, eqId, time1, "sld", "");
+            windTowerDataParentTableService.packageData(mapList1, eqId, "sld", "");
+            com.jiayue.biz.util.FileUtil.move(file.getPath(), eolFilePath + File.separator + eqId);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -1159,7 +1117,7 @@ public class AnalysisDataImpl {
                     e.printStackTrace();
                 }
 
-                windTowerDataParentTableService.packageData(dataList, eqNo, "", "eol", "");
+                windTowerDataParentTableService.packageData(dataList, eqNo, "eol", "");
             }
 
         }
@@ -1278,5 +1236,136 @@ public class AnalysisDataImpl {
 
     }
 
+    /**
+     * dat文件解析
+     */
+    public void parseByDat(File file) {
+        String dec = "D:\\in" + File.separator;
+        String fileName = file.getName();
+        File newFile = new File(file.getPath());
+        //修改后缀名 方便解析
+        if (fileName.contains(".dat")) {
+            String newFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".csv";
+            newFile = new File(dec + newFileName);
+            file.renameTo(newFile);
+        }
+        CsvReader reader = CsvUtil.getReader();
+        CsvData csvRows = reader.read(newFile);
+        List<CsvRow> rows = csvRows.getRows();
+        CsvRow rowsOne = rows.get(1);
+        CsvRow rowsF = rows.get(5);
+
+        StringBuilder height = new StringBuilder();
+        StringBuilder wdHeight = new StringBuilder();
+        WindTowerInfo windTowerInfo = new WindTowerInfo();
+        for (int i = rowsOne.size() - 1; i >= 0; i--) {
+            String wsOrWdOrTOrRhOrPa = getWsOrWdOrTOrRhOrPa(rowsOne.get(i), height, wdHeight, i, rowsF, windTowerInfo);
+            rowsOne.set(i, wsOrWdOrTOrRhOrPa);
+        }
+
+
+        List<WindTowerInfo> equipmentNo = windTowerInfoService.getByEquipmentNo(windTowerInfo.getEquipmentNo());
+
+        if (equipmentNo.size() == 0) {
+            windTowerInfo.setHeights(height.toString());
+            windTowerInfo.setWdHeights(height.toString());
+            windTowerInfoService.saveOrUpdate(windTowerInfo);
+        }
+        List<Map<String, Object>> mapList = parseByHead(rows, rowsOne);
+        List<Map<String, Object>> mapList1 = new CheckDataRecode().checkValue(mapList, "dat");
+        windTowerDataParentTableService.packageData(mapList1, windTowerInfo.getEquipmentNo(), "dat", "");
+        //将后缀名修改回来
+        String newFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".dat";
+        File file1 = new File(dec + newFileName);
+        newFile.renameTo(file1);
+        try {
+            com.jiayue.biz.util.FileUtil.move(file1.getPath(), eolFilePath + File.separator + windTowerInfo.getEquipmentNo());
+        } catch (Exception e) {
+            log.info("dat文件转移失败");
+            throw new RuntimeException(e);
+        }
+
+    }
+
+    public List<Map<String, Object>> parseByHead(List<CsvRow> rows, CsvRow rowsOne) {
+        List<Map<String, Object>> mapList = new ArrayList<>();
+        for (int i = 4; i < rows.size(); i++) {
+            HashMap<String, Object> hashMap = new HashMap<>();
+            for (int j = 0; j < rows.get(i).size(); j++) {
+                if (StrUtil.isNotBlank(rowsOne.get(j))) {
+                    if (rowsOne.get(j).equals("time")) {
+                        hashMap.put(rowsOne.get(j), rows.get(i).get(j));
+                    } else {
+                        hashMap.put(rowsOne.get(j), new BigDecimal(rows.get(i).get(j)));
+                    }
+                }
+            }
+            mapList.add(hashMap);
+        }
+        return mapList;
+    }
+
+
+    public String getWsOrWdOrTOrRhOrPa(String attribute, StringBuilder wsHeight, StringBuilder wdHeight, int i, CsvRow rowsF, WindTowerInfo windTowerInfo) {
+        String str = "";
+        String height = "";
+        String avgOrStaOrMaxOrMin = getAvgOrStaOrMaxOrMin(attribute);
+        if (attribute.contains("TIMESTAMP")) {
+            str = "time";
+        } else if (attribute.contains("WS")) {
+            height = CalculationUtil.getNumberFromString(attribute);
+            if (wsHeight.toString().equals("")) {
+                wsHeight.append(height);
+            } else {
+                if (!wsHeight.toString().contains(height)) {
+                    wsHeight.append(",").append(height);
+                }
+            }
+            return "ws" + avgOrStaOrMaxOrMin + "_" + height;
+        } else if (attribute.contains("WD")) {
+            height = CalculationUtil.getNumberFromString(attribute);
+            if (wdHeight.toString().equals("")) {
+                wdHeight.append(height);
+            } else {
+                if (!wdHeight.toString().contains(height)) {
+                    wdHeight.append(",").append(height);
+                }
+            }
+            return "wd" + avgOrStaOrMaxOrMin + "_" + height;
+        } else if (attribute.contains("Ta")) {
+            str = "t";
+        } else if (attribute.contains("RH")) {
+            str = "rh";
+        } else if (attribute.contains("pa")) {
+            str = "pa";
+        } else if (attribute.contains("Station")) {
+            windTowerInfo.setEquipmentNo(rowsF.get(i));
+        } else if (attribute.equals("N")) {
+            windTowerInfo.setLatitude(new BigDecimal(rowsF.get(i)));
+        } else if (attribute.equals("E")) {
+            windTowerInfo.setLongitude(new BigDecimal(rowsF.get(i)));
+        } else {
+            return "";
+        }
+        return str + avgOrStaOrMaxOrMin;
+    }
+
+    public String getAvgOrStaOrMaxOrMin(String attribute) {
+        String str = "";
+        if (attribute.contains("Batt") || attribute.contains("Minute")) {
+            return str;
+        }
+        if (attribute.contains("Avg")) {
+            str = "Avg";
+        } else if (attribute.contains("Std")) {
+            str = "Sta";
+        } else if (attribute.contains("Max")) {
+            str = "Max";
+        } else if (attribute.contains("Min")) {
+            str = "Min";
+        }
+        return str;
+    }
+
 
 }

+ 1 - 1
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/CheckDataRecode.java

@@ -49,7 +49,7 @@ public class CheckDataRecode {
     public List<Map<String, Object>> checkValue(List<Map<String, Object>> allData, String type) {
         List<Map<String, Object>> filterData = new ArrayList<>();
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
-        if (type.equals("rld") || type.equals("station")) {
+        if (type.equals("rld") || type.equals("station") || type.equals("dat")) {
             simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         }
         if (type.equals("sld")) {

+ 22 - 11
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/DataRecalculationImpl.java

@@ -45,8 +45,6 @@ public class DataRecalculationImpl implements DataRecalculationService {
 
     private final WindTowerDataParentTableServiceImpl windTowerDataParentTableService;
 
-    private final WindTowerDataChildTableService windTowerDataChildTableService;
-
     private final WindTowerInfoServiceImpl windTowerInfoService;
     private final WindTowerCalculationDataServiceImpl windTowerCalculationDataService;
 
@@ -62,7 +60,6 @@ public class DataRecalculationImpl implements DataRecalculationService {
     private final ProphaseAnemometryDataMapper prophaseAnemometryDataMapper;
 
 
-
     public void teset() {
 //    File file1 = MultipartFileToFile(file);
 //    //如果是压缩包
@@ -117,6 +114,12 @@ public class DataRecalculationImpl implements DataRecalculationService {
                                 path = "D:\\in\\";
                                 FileUtil.move(file2.getPath(), path);
                                 this.systemCommandRWD();
+                            } else if (file2.getName().contains(".csv")) {
+                                analysisData.acousticRadar(file2, equipmentNo);
+                            } else if (file2.getName().contains(".dat")) {
+                                path = "D:\\in\\";
+                                FileUtil.move(file2.getPath(), path);
+                                analysisData.parseByDat(file2);
                             } else {
                                 return AjaxResult.error("请检查数据文件是否正确");
                             }
@@ -147,6 +150,14 @@ public class DataRecalculationImpl implements DataRecalculationService {
                 file.transferTo(new File(path + File.separator + file.getOriginalFilename()));
                 this.systemCommandRWD();
                 return AjaxResult.success("成功");
+            } else if (originalFilename.contains(".csv")) {
+                analysisData.acousticRadar(MultipartFileToFile(file), equipmentNo);
+                return AjaxResult.success("成功");
+            } else if (originalFilename.contains(".dat")) {
+                path = "D:\\in\\";
+                file.transferTo(new File(path + File.separator + file.getOriginalFilename()));
+                analysisData.parseByDat(MultipartFileToFile(file));
+                return AjaxResult.success("成功");
             } else {
                 return AjaxResult.error("请检查数据文件是否正确");
             }
@@ -157,6 +168,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
 
     }
 
+
     /**
      * 将MultipartFile转换为File
      *
@@ -504,8 +516,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
         //数据筛选
         List<Map<String, Object>> filterData = new CheckDataRecode().checkValue(allData, type);
         String eqId = file.getName().split("_")[0];
-        String eTime = file.getName().split("_")[1];
-        windTowerDataParentTableService.packageData(filterData, eqId, eTime, type, "");
+        windTowerDataParentTableService.packageData(filterData, eqId, type, "");
         reader.close();
     }
 
@@ -578,7 +589,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
                 log.info("正在进行数据过滤");
                 //重新走一遍数据过滤 然后存库
                 List<Map<String, Object>> mapList = new CheckDataRecode().checkValue(maps, list.get(0).getModelNumber());
-                windTowerDataParentTableService.packageData(mapList, equipmentNo, sdf.format(new Date(startDate)), list.get(0).getModelNumber(), "DataRecalculation");
+                windTowerDataParentTableService.packageData(mapList, equipmentNo, list.get(0).getModelNumber(), "DataRecalculation");
                 log.warn("数据筛选完成");
                 return AjaxResult.success("数据筛选完成");
             } else {
@@ -621,7 +632,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
             ArrayList<WindTowerCalculationData> paDay = windTowerCalculationDataService.paDay(startTime, endTime, equipmentNo, prophaseWeatherDataList, equipmentAttributeList);
             allDataList.addAll(paDay);
             //发电量与满发小时数
-            ArrayList<WindTowerCalculationData> calculateBattery = windTowerCalculationDataService.calculateBattery(startTime.getTime(), endTime.getTime(), windTowerInfoList.get(0), prophaseAnemometryDataList,  equipmentAttributeList, windTowerCalculationDataList);
+            ArrayList<WindTowerCalculationData> calculateBattery = windTowerCalculationDataService.calculateBattery(startTime.getTime(), endTime.getTime(), windTowerInfoList.get(0), prophaseAnemometryDataList, equipmentAttributeList, windTowerCalculationDataList);
             allDataList.addAll(calculateBattery);
             //日平均风速
             ArrayList<WindTowerCalculationData> wsDay = windTowerCalculationDataService.wsDay(startTime, endTime, equipmentNo, windTowerCalculationDataList, equipmentAttributeList, windTowerInfoList);
@@ -639,7 +650,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
             ArrayList<WindTowerCalculationData> wpdDay = windTowerCalculationDataService.wpdDay(startTime, endTime, equipmentNo, windTowerCalculationDataList, equipmentAttributeList, windTowerInfoList);
             allDataList.addAll(wpdDay);
             //日平均风切变
-            ArrayList<WindTowerCalculationData> shearDay = windTowerCalculationDataService.shearDay(startTime, endTime, equipmentNo, windTowerCalculationDataList, equipmentAttributeList, windTowerInfoList,prophaseAnemometryDataList);
+            ArrayList<WindTowerCalculationData> shearDay = windTowerCalculationDataService.shearDay(startTime, endTime, equipmentNo, windTowerCalculationDataList, equipmentAttributeList, windTowerInfoList, prophaseAnemometryDataList);
             allDataList.addAll(shearDay);
 
 
@@ -661,13 +672,13 @@ public class DataRecalculationImpl implements DataRecalculationService {
                 ArrayList<WindTowerCalculationData> wsMaxMonth = windTowerCalculationDataService.wsMaxMonth(DateTimeUtil.beginOfMonth(new Date(l)), DateTimeUtil.endOfMonth(new Date(l)), equipmentNo, prophaseAnemometryDataList, equipmentAttributeList, windTowerInfoList);
                 allDataList.addAll(wsMaxMonth);
                 //月平均风切变
-                ArrayList<WindTowerCalculationData> shearMonth = windTowerCalculationDataService.shearMonth(DateTimeUtil.beginOfMonth(new Date(l)), DateTimeUtil.endOfMonth(new Date(l)), equipmentNo, windTowerCalculationDataList, equipmentAttributeList, windTowerInfoList,prophaseAnemometryDataList);
+                ArrayList<WindTowerCalculationData> shearMonth = windTowerCalculationDataService.shearMonth(DateTimeUtil.beginOfMonth(new Date(l)), DateTimeUtil.endOfMonth(new Date(l)), equipmentNo, windTowerCalculationDataList, equipmentAttributeList, windTowerInfoList, prophaseAnemometryDataList);
                 allDataList.addAll(shearMonth);
                 //月平均风速标差
                 ArrayList<WindTowerCalculationData> staMonth = windTowerCalculationDataService.staMonth(DateTimeUtil.beginOfMonth(new Date(l)), DateTimeUtil.endOfMonth(new Date(l)), equipmentNo, prophaseAnemometryDataList, equipmentAttributeList, windTowerInfoList);
                 allDataList.addAll(staMonth);
                 //月玫瑰图
-                windDirectionStatisticsDataService.roseMonth(DateTimeUtil.beginOfMonth(new Date(l)), DateTimeUtil.endOfMonth(new Date(l)), equipmentNo, prophaseAnemometryDataList,prophaseWeatherDataList, equipmentAttributeList);
+                windDirectionStatisticsDataService.roseMonth(DateTimeUtil.beginOfMonth(new Date(l)), DateTimeUtil.endOfMonth(new Date(l)), equipmentNo, prophaseAnemometryDataList, prophaseWeatherDataList, equipmentAttributeList);
                 //月平均环境数据
                 ArrayList<WindTowerCalculationData> environmentData = windTowerCalculationDataService.environmentData(DateTimeUtil.beginOfMonth(new Date(l)), DateTimeUtil.endOfMonth(new Date(l)), equipmentNo, prophaseWeatherDataList, equipmentAttributeList);
                 allDataList.addAll(environmentData);
@@ -680,7 +691,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
             }
             // 统计概述
             statisticsSituationService.statisticsSituation(windTowerInfoList.get(0), statisticsSituations, equipmentAttributeList);
-            windTowerCalculationDataService.saveBatchByEquipmentId(allDataList,equipmentNo);
+            windTowerCalculationDataService.saveBatchByEquipmentId(allDataList, equipmentNo);
             log.info("计算统计数据执行完毕");
             return AjaxResult.success("数据已经重新统计");
         } catch (Exception e) {

+ 2 - 2
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/EmailImpl.java

@@ -556,8 +556,8 @@ public class EmailImpl extends ServiceImpl<EmailMapper, Email> implements EmailS
                 }else if(type.equals("csv")){
                     String id = subjectId.substring(subjectId.indexOf("[") + 1, subjectId.lastIndexOf("]"));
                     analysisDataService.acousticRadar(f,id);
-
-
+                }else if(type.equals("dat")){
+                    analysisDataService.parseByDat(f);
 
                 }
 

+ 12 - 6
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/WindTowerDataParentTableServiceImpl.java

@@ -75,14 +75,13 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
      *
      * @param allData     数据
      * @param equipmentId 设备编号
-     * @param eTime       时间
      * @param type        文件类型
      * @param operation   操作类型(DataRecalculation数据重算)
      */
-    public void packageData(List<Map<String, Object>> allData, String equipmentId, String eTime, String type, String operation) {
+    public void packageData(List<Map<String, Object>> allData, String equipmentId, String type, String operation) {
 
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
-        if (type.equals("rld")) {
+        if (type.equals("rld") || type.equals("dat")) {
             simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         }
         if (type.equals("sld")) {
@@ -128,6 +127,7 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
         }
 
     }
+
     public void packageOrgData(Map<String, Object> m, HashSet<String> heightAll, SimpleDateFormat simpleDateFormat, String equipmentId, String org) {
         for (String height : heightAll) {
             ProphaseAnemometryData one = new ProphaseAnemometryData();
@@ -197,7 +197,7 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
                 prophaseAnemometryPublicData.getTAve() != -99 && prophaseAnemometryPublicData.getPaAve() > 0) {
             BigDecimal airDensity = BigDecimal.valueOf(1.293).multiply(new BigDecimal(273).divide(new BigDecimal(273).add(BigDecimal.valueOf(prophaseAnemometryPublicData.getTAve())), 2, RoundingMode.HALF_UP)).multiply(BigDecimal.valueOf(prophaseAnemometryPublicData.getPaAve())).divide(new BigDecimal(1013), 2, RoundingMode.HALF_UP);
             prophaseAnemometryPublicData.setAirDensity(airDensity.floatValue());
-        }else{
+        } else {
             //随机数 上限1.28 下限1.15
             Random random = new Random();
             int randNumber = random.nextInt(128 - 115 + 1) + 115;
@@ -783,7 +783,7 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
                         .append(",").append("pa_ave")
                         .append(",").append("pa_sta");
                 //所有层高
-                String[] height = {"200", "200A","190", "190A","180", "180A","170", "170A","160", "160A","150", "150A", "140", "140A", "120", "120A", "110", "110A", "100", "100A", "90", "90A", "80", "80A", "70", "70A", "50", "50A", "30", "30A", "10", "10A"};
+                String[] height = {"200", "200A", "190", "190A", "180", "180A", "170", "170A", "160", "160A", "150", "150A", "140", "140A", "120", "120A", "110", "110A", "100", "100A", "90", "90A", "80", "80A", "70", "70A", "50", "50A", "30", "30A", "10", "10A"};
                 Map<String, Object> map = new HashMap<>();
                 if (!mapList.isEmpty()) {
                     map = mapList.get(0);
@@ -865,12 +865,18 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
                     if (time >= startTime && time <= endTime) {
                         return file;
                     }
-                } else if (name.contains(".elog")) {
+                } else if (name.contains(".elog") || name.contains(".csv")) {
                     String[] elogNameTime = name.split("_");
                     long time = DateUtil.parse(elogNameTime[1], "yyyyMMdd").getTime();
                     if (time >= startTime && time <= endTime) {
                         return file;
                     }
+                } else if (name.contains("dat")) {
+                    String subTime = name.substring(equipmentId.length(), equipmentId.length() + 8);
+                    long time = DateUtil.parse(subTime, "yyyyMMdd").getTime();
+                    if (time >= startTime && time <= endTime) {
+                        return file;
+                    }
                 }
                 return null;
             }).filter(file -> file != null && file.getName().contains(equipmentId)).collect(Collectors.toList());

+ 4 - 4
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/WindTowerInfoServiceImpl.java

@@ -129,9 +129,9 @@ public class WindTowerInfoServiceImpl extends ServiceImpl<WindTowerInfoMapper, W
     }
 
     public List<Map<String, String>> listEquipmentIdAndDataTime() {
-//        if (redisCache.getCacheObject("listEquipmentIdAndDataTime") != null) {
-//            return redisCache.getCacheObject("listEquipmentIdAndDataTime");
-//        }
+        if (redisCache.getCacheObject("listEquipmentIdAndDataTime") != null) {
+            return redisCache.getCacheObject("listEquipmentIdAndDataTime");
+        }
         //TODO韩雪峰  新建的塔没有统计概述的时候无法显示  需要考虑到这种情况
         List<WindTowerInfo> windTowerInfoList = this.list();
         List<StatisticsSituation> statisticsSituationList = statisticsSituationService.list();
@@ -184,7 +184,7 @@ public class WindTowerInfoServiceImpl extends ServiceImpl<WindTowerInfoMapper, W
             }
         }
         mapList.addAll(statusMapList);
-//        redisCache.setCacheObject("listEquipmentIdAndDataTime", mapList, 12, TimeUnit.HOURS);
+        redisCache.setCacheObject("listEquipmentIdAndDataTime", mapList, 12, TimeUnit.HOURS);
         return mapList;
     }