| | |
| | | List<DaPointDTO> pointMeasureList = daPointService.getMeasurePoint(minfreq); |
| | | pointValues.addAll(measureHandle.handle(collectTime, pointMeasureList, dataMap, listGood, listBad)); |
| | | |
| | | List<String> listBadNew = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(listBad)) { |
| | | log.info("BAD点值修复"); |
| | | List<InfluxPointValuePOJO> influxParams = new ArrayList<>(); |
| | | for (String bad : listBad) { |
| | | DaPointDTO daPointDTO = daPointService.getByNo(bad); |
| | | InfluxPointValuePOJO pojo = new InfluxPointValuePOJO(); |
| | | pojo.setPoint(bad); |
| | | pojo.setType(daPointDTO.getDataType()); |
| | | influxParams.add(pojo); |
| | | } |
| | | Map<String, Object> lastValue = influxDBService.queryPointsLastValue(influxParams); |
| | | log.info("lastValue=" + JSONObject.toJSONString(lastValue)); |
| | | if (!CollectionUtils.isEmpty(lastValue)) { |
| | | for (String bad : listBad) { |
| | | if (lastValue.containsKey(bad)) { |
| | | listGood.add(bad); |
| | | dataMap.put(bad, lastValue.get(bad)); |
| | | } else { |
| | | listBadNew.add(bad); |
| | | } |
| | | } |
| | | } else { |
| | | listBadNew = listBad; |
| | | } |
| | | } |
| | | |
| | | log.info("读取计算点"); |
| | | List<DaPointDTO> pointCalculateList = daPointService.getMathPoint(minfreq); |
| | | pointValues.addAll(calculateHandle.handle(collectTime, pointCalculateList, dataMap, listGood, listBadNew)); |
| | | pointValues.addAll(calculateHandle.handle(collectTime, pointCalculateList, dataMap, listGood, listBad)); |
| | | |
| | | log.info("读取累计点"); |
| | | List<DaPointDTO> pointCumulateList = daPointService.getCumulatePoint(minfreq); |
| | | pointValues.addAll(cumulateHandle.handle(collectTime, pointCumulateList, listGood, listBadNew)); |
| | | pointValues.addAll(cumulateHandle.handle(collectTime, pointCumulateList, listGood, listBad)); |
| | | |
| | | log.info("存入时序库"); |
| | | influxDBService.asyncWritePointValues(pointValues); |