| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 累计点处理 |
| | |
| | | Object rawValue = singleCompute(item, calendar.getTime()); |
| | | BigDecimal coefficient = item.getUnittransfactor() == null ? BigDecimal.ONE : item.getUnittransfactor(); |
| | | value = new BigDecimal(rawValue.toString()).multiply(coefficient); |
| | | // 写入缓存 |
| | | redisTemplate.opsForValue().set(PointCollector.PV + item.getPointNo(), |
| | | new BigDecimal(value.toString()).doubleValue(), PointCollector.offset, TimeUnit.SECONDS); |
| | | } |
| | | data.put(item.getPointNo(), value); |
| | | }); |