From 5f67362e5b8685442786d307f872307a99ccd91f Mon Sep 17 00:00:00 2001 From: lishuai Date: Mon, 13 Jan 2025 14:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=89=E4=BC=8F=E8=8A=82=E8=83=BD=E5=87=8F?= =?UTF-8?q?=E6=8E=92=202025=E5=B9=B41=E6=9C=8813=E6=97=A514:19:25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qingyuan/manageboard/dto/ReductionStatistics.java | 9 +++++++++ .../manageboard/service/impl/PlantServiceImpl.java | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/dto/ReductionStatistics.java b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/dto/ReductionStatistics.java index 686d050..b840e77 100644 --- a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/dto/ReductionStatistics.java +++ b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/dto/ReductionStatistics.java @@ -32,5 +32,14 @@ public class ReductionStatistics { @Schema(description = "属性值") private BigDecimal tree; + @Schema(description = "属性主键-累计") + private BigDecimal tceTotal; + + @Schema(description = "属性名称-累计") + private BigDecimal co2Total; + + @Schema(description = "属性值-累计") + private BigDecimal treeTotal; + } } 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 72c0d3d..c20d93c 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 @@ -186,7 +186,7 @@ public class PlantServiceImpl extends BaseServiceImpl @Override public ReductionStatistics.ReductionInfo reduction() { BigDecimal nowTotalA29yy = this.nowTotalA29yy(); - // BigDecimal allTotalA29yy = this.AllTotalA29yy(); + BigDecimal allTotalA29yy = this.AllTotalA29yy(); BigDecimal tceRatio = BigDecimal.valueOf(0.0004); BigDecimal co2Ratio = BigDecimal.valueOf(0.000475); BigDecimal treeRatio = BigDecimal.valueOf(18.3).divide(BigDecimal.valueOf(40),8,RoundingMode.UP).multiply(BigDecimal.valueOf(1000)); @@ -197,10 +197,10 @@ public class PlantServiceImpl extends BaseServiceImpl nowYearInfo.setTree(nowYearInfo.getCo2().multiply(treeRatio).setScale(4,RoundingMode.UP)); // ReductionStatistics.ReductionInfo allInfo = new ReductionStatistics.ReductionInfo(); -// allInfo.setTce(allTotalA29yy.multiply(tceRatio).setScale(4,RoundingMode.UP)); -// allInfo.setCo2(allTotalA29yy.multiply(co2Ratio).setScale(4,RoundingMode.UP)); -// allInfo.setTree(allInfo.getCo2().multiply(treeRatio).setScale(4,RoundingMode.UP)); -// ReductionStatistics result = new ReductionStatistics(nowYearInfo,allInfo); + nowYearInfo.setTceTotal(allTotalA29yy.multiply(tceRatio).setScale(4,RoundingMode.UP)); + nowYearInfo.setCo2Total(allTotalA29yy.multiply(co2Ratio).setScale(4,RoundingMode.UP)); + nowYearInfo.setTreeTotal(nowYearInfo.getCo2Total().multiply(treeRatio).setScale(4,RoundingMode.UP)); + // ReductionStatistics result = new ReductionStatistics(nowYearInfo,allInfo); return nowYearInfo; }