From 96eec6b8a7ff370c1bcd2a60519246ea90a93ee8 Mon Sep 17 00:00:00 2001 From: lishuai Date: Wed, 15 Jan 2025 17:04:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=94=B5=E9=87=8F=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=A4=84=E7=90=86=202025=E5=B9=B41=E6=9C=8815=E6=97=A517:03:58?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manageboard/service/impl/PlantServiceImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java index 5002ca9..65fca75 100644 --- a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java +++ b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java @@ -28,10 +28,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; +import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -226,7 +223,7 @@ public class PlantServiceImpl extends BaseServiceImpl TsKvDTO tsKvDTO29 = tsKvService.findLatestByCodeAndAttr(String.valueOf(plantId), "A29yy"); if(!Objects.isNull(tsKvDTO29)){ plantDTO.setAttrKey29yy(tsKvDTO29.getAttrKey()); - plantDTO.setVal29yy(tsKvDTO29.getVal()); + plantDTO.setVal29yy(new BigDecimal(tsKvDTO29.getVal()).divide(new BigDecimal(10000)).setScale(4,RoundingMode.UP).toPlainString()); //ๅนดๅ‡ๆŽ’้‡ if(!Objects.isNull(plantDTO.getProfitco2())){ BigDecimal reductionUsage = CalculationUtil.getCarbonUsage(new BigDecimal(tsKvDTO29.getVal()), reductionFactor, coefficient, 2); @@ -251,6 +248,7 @@ public class PlantServiceImpl extends BaseServiceImpl } } } + plantDTOS.sort(Comparator.comparing(PlantDTO::getCapacity).reversed()); return plantDTOS; }