Commit a423906f authored by suhuiguang's avatar suhuiguang

fix(jyjc): 压力管道管道长度

1.压力管道管道长度调整为字符串/分隔开
parent 257079eb
......@@ -53,7 +53,7 @@ public final class PipLenCalUtils {
return Optional.ofNullable(pipeLengthText).filter(StringUtils::isNotEmpty).map(l -> Arrays.stream(l.split(PIPE_LENGTH_SPILT)).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add)).orElse(BigDecimal.ZERO).setScale(3, RoundingMode.HALF_UP);
}
public static double getPipLenMap(List<Map<String, Object>> equLists) {
public static String getPipLenMap(List<Map<String, Object>> equLists) {
return equLists.stream()
.map(r -> r.get("pipeLengthText"))
.filter(Objects::nonNull)
......@@ -64,7 +64,6 @@ public final class PipLenCalUtils {
.map(BigDecimal::new) // 转 BigDecimal
.reduce(BigDecimal.ZERO, BigDecimal::add) // 分段求和
)
.reduce(BigDecimal.ZERO, BigDecimal::add).stripTrailingZeros() // 全局求和
.doubleValue();
.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(3, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
}
}
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