| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return result; |
| | | } |
| | | dtos.forEach(dto -> { |
| | | InfluxPointValuePOJO pojo = GenInfluxPointValueUtils.getByPoint(dto); |
| | | BigDecimal defaultValue = dto.getDefaultValue(); |
| | | BigDecimal coefficient = dto.getUnittransfactor() == null ? BigDecimal.ONE : dto.getUnittransfactor(); |
| | | defaultValue = defaultValue.multiply(coefficient); |
| | | InfluxPointValuePOJO pojo = GenInfluxPointValueUtils.getByPoint(dto,defaultValue); |
| | | pojo.setTimestamp(GenInfluxPointValueUtils.getByMin(collectTime, DataPointFreqEnum.getEumByCode(dto.getMinfreqid()))); |
| | | dataMap.put(dto.getPointNo(), dto.getDefaultValue()); |
| | | |
| | | dataMap.put(dto.getPointNo(), defaultValue); |
| | | result.add(pojo); |
| | | listGood.add(dto.getPointNo()); |
| | | }); |
| | |
| | | List<DaPointDTO> pointConstantList = daPointService.getConstantPoint(pointNos); |
| | | if (!CollectionUtils.isEmpty(pointConstantList)) { |
| | | pointConstantList.forEach(item -> { |
| | | data.put(item.getPointNo(), item.getDefaultValue()); |
| | | BigDecimal coefficient = item.getUnittransfactor() == null ? BigDecimal.ONE : item.getUnittransfactor(); |
| | | data.put(item.getPointNo(), item.getDefaultValue().multiply(coefficient)); |
| | | }); |
| | | } |
| | | return data; |