燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-04-26 a3d41aaa84c64dd296a2bd89198682276ef7b1d3
src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java
@@ -253,28 +253,29 @@
      Map<String, List<Double>> result = new LinkedHashMap<>();
      List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d();
      Date nowDate = DateUtils.getNowDate();
      Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate));
      Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getAPeriodOfTime(nowDate, -3, Calendar.HOUR_OF_DAY)));
      List<DictRecord> recordList = dictRecordMapper.selectByTimeDictRecordList(startTime, endTime);
      List<String> tableNames = new ArrayList<>();
      for(DictRecord dr : recordList){
         if (suYuanMapper.isTableExists(dr.getTableName())>0){
      for (DictRecord dr : recordList) {
         if (suYuanMapper.isTableExists(dr.getTableName()) > 0) {
            tableNames.add(dr.getTableName());
         }
      }
      if (tableNames.isEmpty()){
      if (tableNames.isEmpty()) {
         return result;
      }
      for(MonitorPointPosition c : checkPoints){
      for (MonitorPointPosition c : checkPoints) {
         List<Double> values = new ArrayList<>();
         List<SuYuanMonitorData> data = suYuanMapper.getMonitorData(tableNames, c.getId());
         data.forEach(v -> {
            values.add(v.getValue());
         });
         if (null != data && data.size() > 0) {
            for (SuYuanMonitorData v : data) {
               values.add(v.getValue());
            }
         }
         result.put(c.getName(), values);
      }
      return result;
@@ -282,7 +283,7 @@
   @Override
   public List<Map<String, Object>> selectThisMonthLocationValueDataTop10() {
      List<Map<String, Object>> result = new ArrayList<>();
      /*List<Map<String, Object>> result = new ArrayList<>();
      List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d();
      Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthStart()));
      Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthEnd()));
@@ -300,7 +301,34 @@
         }
         result.add(map);
      });
      return CalculateUtils.sort(result, "value", true).subList(0, 10);*/
      List<Map<String, Object>> result = new ArrayList<>();
      List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d();
      Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthStart()));
      Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthEnd()));
      List<DictRecord> recordList = dictRecordMapper.selectByTimeDictRecordList(startTime, endTime);
      List<String> tableNames = new ArrayList<>();
      for (DictRecord dr : recordList) {
         if (suYuanMapper.isTableExists(dr.getTableName()) > 0) {
            tableNames.add(dr.getTableName());
         }
      }
      if (tableNames.isEmpty()) {
         return result;
      }
      for (MonitorPointPosition c : checkPoints) {
         Map<String, Object> map = suYuanMapper.getMonthValueDataMax(tableNames, c.getId());
         if (null != map && map.size() > 0) {
            String suYuanId = map.get("id").toString();
            map.put("name", commonService.select3dCheckPointById(suYuanId).getName());
            map.remove("id");
         }
         result.add(map);
      }
      return CalculateUtils.sort(result, "value", true).subList(0, 10);
   }
}