| | |
| | | try { |
| | | Map<String, Object> dataMap = new HashMap<>(); |
| | | List<InfluxPointValuePOJO> pointValues = new ArrayList<>(); |
| | | |
| | | // 记录点位状态 |
| | | List<String> listGood = new ArrayList<>(); |
| | | List<String> listBad = new ArrayList<>(); |
| | | log.info("读取常量点"); |
| | | List<DaPointDTO> pointConstantList = daPointService.getConstantPoint(minfreq); |
| | | pointValues.addAll(constantHandle.handle(collectTime, pointConstantList, dataMap)); |
| | | pointValues.addAll(constantHandle.handle(collectTime, pointConstantList, dataMap,listGood,listBad)); |
| | | |
| | | log.info("读取测量点"); |
| | | List<DaPointDTO> pointMeasureList = daPointService.getMeasurePoint(minfreq); |
| | | pointValues.addAll(measureHandle.handle(collectTime, pointMeasureList, dataMap)); |
| | | pointValues.addAll(measureHandle.handle(collectTime, pointMeasureList, dataMap,listGood,listBad)); |
| | | |
| | | log.info("读取计算点"); |
| | | List<DaPointDTO> pointCalculateList = daPointService.getMathPoint(minfreq); |
| | | pointValues.addAll(calculateHandle.handle(collectTime, pointCalculateList, dataMap)); |
| | | pointValues.addAll(calculateHandle.handle(collectTime, pointCalculateList, dataMap,listGood,listBad)); |
| | | |
| | | log.info("读取累计点"); |
| | | List<DaPointDTO> pointCumulateList = daPointService.getCumulatePoint(minfreq); |
| | | pointValues.addAll(cumulateHandle.handle(collectTime, pointCumulateList)); |
| | | pointValues.addAll(cumulateHandle.handle(collectTime, pointCumulateList,listGood,listBad)); |
| | | |
| | | log.info("存入时序库"); |
| | | influxDBService.asyncWritePointValues(pointValues); |
| | |
| | | } |
| | | } |
| | | log.info("更新采集状态"); |
| | | daPointCollectStatusService.recordStatusList(pointValues, collectTime); |
| | | daPointCollectStatusService.recordStatusList(listGood,listBad, collectTime); |
| | | log.info("采集完成"); |
| | | } catch (Exception ex) { |
| | | log.info("采集异常!"); |
| | |
| | | data.putAll(cumulateHandle.getCurrent(pointNos)); |
| | | return data; |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | return R.error(ex.getMessage()); |
| | | } |
| | | |