Merge remote-tracking branch 'origin/master'
| | |
| | | @Operation(summary = "查询最大值") |
| | | Map<String, Object> queryPointMaxValue(@RequestBody ApiPointValueQueryDTO queryDto); |
| | | |
| | | @PostMapping(PREFIX + "/query-point/max-time-value") |
| | | @Operation(summary = "查询最大值(带时间)") |
| | | Map<String, Object> queryPointMaxTimeValue(@RequestBody ApiPointValueQueryDTO queryDto); |
| | | |
| | | @PostMapping(PREFIX + "/query-point/max-value-range") |
| | | @Operation(summary = "查询最大值") |
| | | Map<String, Object> queryPointMaxValueRange(@RequestBody ApiPointValueQueryDTO queryDto); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> queryPointMaxTimeValue(ApiPointValueQueryDTO queryDto) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | if (StringUtils.isEmpty(queryDto.getPointNo())) { |
| | | return null; |
| | | } |
| | | if (queryDto.getStart() == null) { |
| | | return null; |
| | | } |
| | | if (queryDto.getEnd() == null) { |
| | | queryDto.setEnd(new Date()); |
| | | } |
| | | DaPointDTO daPointDTO = daPointService.getByNo(queryDto.getPointNo()); |
| | | InfluxPointValuePOJO pojo = new InfluxPointValuePOJO(); |
| | | pojo.setPoint(queryDto.getPointNo()); |
| | | pojo.setType(daPointDTO.getDataType()); |
| | | result = influxDBService.queryPointMaxTimeValue(pojo, queryDto.getStart(), queryDto.getEnd()); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> queryPointMaxValueRange(ApiPointValueQueryDTO queryDto) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | if (StringUtils.isEmpty(queryDto.getPointNo())) { |
| | |
| | | |
| | | Object queryPointMaxValue(InfluxPointValuePOJO point, Date startTime); |
| | | |
| | | Map<String, Object> queryPointMaxTimeValue(InfluxPointValuePOJO point, Date startTime, Date endTime); |
| | | |
| | | List<PointValueExportVO> exportPointValue(ApiPointValueQueryDTO queryDto); |
| | | |
| | | Object queryPointMaxValueRange(InfluxPointValuePOJO point, Date startTime, Date endTime); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> queryPointMaxTimeValue(InfluxPointValuePOJO point, Date startTime, Date endTime) { |
| | | Map<String, Object> result = new HashMap<>(2); |
| | | List<Map<String, Object>> valueList = this.queryPointValues(point, startTime, endTime); |
| | | if (CollectionUtils.isEmpty(valueList)) { |
| | | return null; |
| | | } |
| | | |
| | | double valueL = new BigDecimal(valueList.get(0).get(VALUE).toString()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | String timeM = valueList.get(0).get(TIME).toString(); |
| | | double valueM = valueL; |
| | | for (Map<String, Object> item : valueList) { |
| | | double valueI = new BigDecimal(item.get(VALUE).toString()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| | | if (valueI >= valueL ) { |
| | | valueM = valueI; |
| | | timeM = item.get(TIME).toString(); |
| | | } |
| | | valueL = valueI; |
| | | } |
| | | result.put(TIME, timeM); |
| | | result.put(VALUE, valueM); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Object queryPointMaxValueRange(InfluxPointValuePOJO point, Date startTime, Date endTime) { |
| | | if (influxQLQueryApi == null) { |
| | | influxQLQueryApi = influxDBInstance.getClient().getInfluxQLQueryApi(); |
| | |
| | | influx-db: |
| | | org: iailab |
| | | token: _338h4Kbu2KQaes5QwAyOz9pTUueXoSF9XmPi8N9oTS1SrhTZVj4J9JfSraUyWA0PfWMZOlf9QWax-USkJQR_A== |
| | | url: http://172.16.8.200:8086 |
| | | url: http://172.16.1.221:8086 |
| | | username: iailab |
| | | password: iailab2019 |
| | | password: eF7!gT6*rJ |
| | | |
| | | iems: |
| | | upload-dir: D:/DLUT/upload/ |