Browse Source

光伏节能减排

2025年1月13日14:19:25
qingyuan_dev_new
lishuai 1 year ago
parent
commit
5f67362e5b
  1. 9
      modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/dto/ReductionStatistics.java
  2. 10
      modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java

9
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;
}
}

10
modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java

@ -186,7 +186,7 @@ public class PlantServiceImpl extends BaseServiceImpl<PlantMapper, PlantEntity>
@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<PlantMapper, PlantEntity>
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;
}

Loading…
Cancel
Save