From 378669e94558e6d4d7383604f84dabd9d2242e7c Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期五, 06 六月 2025 09:54:12 +0800 Subject: [PATCH] 调整参数 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TScreenContentController.java | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TScreenContentController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TScreenContentController.java index beb6bee..6a3f91c 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TScreenContentController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TScreenContentController.java @@ -9,9 +9,11 @@ import com.ruoyi.common.security.annotation.RequiresPermissions; import com.ruoyi.other.api.domain.TNotice; import com.ruoyi.other.api.domain.TScreenContent; +import com.ruoyi.other.api.domain.TSystemConfiguration; import com.ruoyi.other.api.dto.NoticeQueryDto; import com.ruoyi.other.service.TNoticeService; import com.ruoyi.other.service.TScreenContentService; +import com.ruoyi.other.service.TSystemConfigurationService; import com.ruoyi.other.util.EnergyRefreshService; import com.ruoyi.other.vo.*; import io.swagger.annotations.ApiOperation; @@ -20,6 +22,7 @@ import javax.annotation.Resource; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.Arrays; import java.time.LocalDateTime; import java.util.HashMap; @@ -41,6 +44,8 @@ private TScreenContentService screenContentService; @Resource private EnergyRefreshService energyRefreshService; + @Resource + private TSystemConfigurationService systemConfigurationService; /** * 顶部-累计电量 @@ -70,7 +75,13 @@ vo.setGreenElectricityToday(vo.getGreenElectricityToday().add(x.getGreenElectricityToday())); }); - vo.setTodayGenerateElectricity(new BigDecimal("1821")); + TSystemConfiguration sysConfig = systemConfigurationService.getOne(new LambdaQueryWrapper<TSystemConfiguration>() + .eq(TSystemConfiguration::getType,4)); + BigDecimal refreshValueOne = new BigDecimal(sysConfig.getContent()); + vo.setTodayGenerateElectricity(refreshValueOne); + vo.setGreenElectricityToday(refreshValueOne.multiply(new BigDecimal("0.94")).setScale(2, RoundingMode.HALF_UP)); + + return AjaxResult.success(vo); } -- Gitblit v1.7.1