diff --git a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/controller/PlantController.java b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/controller/PlantController.java index 4f27010..1404cb4 100644 --- a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/controller/PlantController.java +++ b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/controller/PlantController.java @@ -1,14 +1,14 @@ package com.thing.qingyuan.manageboard.controller; +import com.thing.common.core.annotation.LogOperation; +import com.thing.common.core.constants.Constant; +import com.thing.common.core.web.response.PageData; +import com.thing.common.core.web.response.Result; import com.thing.qingyuan.manageboard.dto.PhotovoltaicDTO; import com.thing.qingyuan.manageboard.dto.PhotovoltaicOverviewDTO; import com.thing.qingyuan.manageboard.dto.PlantDTO; import com.thing.qingyuan.manageboard.dto.ReductionStatistics; import com.thing.qingyuan.manageboard.service.PlantService; -import com.thing.common.core.annotation.LogOperation; -import com.thing.common.core.constants.Constant; -import com.thing.common.core.web.response.PageData; -import com.thing.common.core.web.response.Result; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -72,8 +72,9 @@ public class PlantController { @GetMapping ("reduction") @Operation(summary="管理端主平台-光伏节能减排信息") - private Result reduction(){ - return plantService.reduction(); + public Result reduction(){ + ReductionStatistics.ReductionInfo reduction = plantService.reduction(); + return new Result().ok(reduction); } diff --git a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/PlantService.java b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/PlantService.java index 194147c..076819c 100644 --- a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/PlantService.java +++ b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/PlantService.java @@ -21,7 +21,7 @@ public interface PlantService extends IBaseService { PhotovoltaicDTO findById(Long plantId); - Result reduction(); + ReductionStatistics.ReductionInfo reduction(); List list(Map params); 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 4d2bde2..72c0d3d 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 @@ -184,9 +184,9 @@ public class PlantServiceImpl extends BaseServiceImpl } @Override - public Result reduction() { + 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)); @@ -196,13 +196,13 @@ public class PlantServiceImpl extends BaseServiceImpl nowYearInfo.setCo2(nowTotalA29yy.multiply(co2Ratio).setScale(4,RoundingMode.UP)); 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); +// 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); - return new Result().ok(result); + return nowYearInfo; }