| | |
| | | } |
| | | dtos.forEach(dto -> { |
| | | try { |
| | | Object value = singleCompute(dto, collectTime, listGood, listBad); |
| | | InfluxPointValuePOJO pojo = GenInfluxPointValueUtils.getByPoint(dto, value); |
| | | Object rawValue = singleCompute(dto, collectTime, listGood, listBad); |
| | | BigDecimal coefficient = dto.getUnittransfactor() == null ? BigDecimal.ONE : dto.getUnittransfactor(); |
| | | BigDecimal calValue = new BigDecimal(rawValue.toString()).multiply(coefficient); |
| | | InfluxPointValuePOJO pojo = GenInfluxPointValueUtils.getByPoint(dto, calValue); |
| | | pojo.setTimestamp(GenInfluxPointValueUtils.getByMin(collectTime, DataPointFreqEnum.getEumByCode(dto.getMinfreqid()))); |
| | | result.add(pojo); |
| | | } catch (Exception ex) { |
| | |
| | | if (redisTemplate.hasKey(PointCollector.PV + item.getPointNo())) { |
| | | value = redisTemplate.opsForValue().get(PointCollector.PV + item.getPointNo()); |
| | | } else { |
| | | value = singleCompute(item, calendar.getTime()); |
| | | Object rawValue = singleCompute(item, calendar.getTime()); |
| | | BigDecimal coefficient = item.getUnittransfactor() == null ? BigDecimal.ONE : item.getUnittransfactor(); |
| | | value = new BigDecimal(rawValue.toString()).multiply(coefficient); |
| | | } |
| | | data.put(item.getPointNo(), value); |
| | | }); |
| | |
| | | queryDto.setEnd(endTime); |
| | | queryDto.setPointNo(dto.getMomentPoint()); |
| | | log.info("queryDto=" + JSONObject.toJSONString(queryDto)); |
| | | List<ApiPointValueDTO> dataList = dataPointApi.queryPointHistoryValue(queryDto); |
| | | List<ApiPointValueDTO> dataList = new ArrayList<>(); |
| | | List<ApiPointValueDTO> dataListTemp = dataPointApi.queryPointHistoryValue(queryDto); |
| | | if (dto.getIsCumuNeg() != null && dto.getIsCumuNeg().equals(0)) { |
| | | for(ApiPointValueDTO item : dataListTemp) { |
| | | if (item.getV() > 0) { |
| | | dataList.add(item); |
| | | } |
| | | } |
| | | } else { |
| | | dataList = dataListTemp; |
| | | } |
| | | |
| | | if (CollectionUtils.isEmpty(dataList)) { |
| | | log.info("dataList is empty"); |
| | | if (listGood != null) { |