Commit c03b4661 authored by suhuiguang's avatar suhuiguang

1.大屏总览统计压力管道米转千米,保留3位小数

parent 3b4c2681
......@@ -34,6 +34,8 @@ import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
......@@ -296,6 +298,10 @@ public class DPStatisticsServiceImpl {
private void staticsCenterMapCountDataForPipeline(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) {
String length = techParamsPipelineMapper.sumPipeLengthByArea(dpFilterParamDto.getCityCode());
BigDecimal lengthDecimal = new BigDecimal(length);
if (lengthDecimal.compareTo(BigDecimal.ZERO) > 0) {
length = lengthDecimal.divide(new BigDecimal("1000"), 3, RoundingMode.HALF_UP).toPlainString();
}
result.put(DPMapStatisticsItemEnum.PRESSURE_PIPELINES.getCode(), length);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment