From 6ecf7171775a04bbcb52c9943bcafce699c837a7 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 25 六月 2025 11:11:26 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TScreenContentController.java | 21 +++------------------ 1 files changed, 3 insertions(+), 18 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 3e6d890..ba04879 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 @@ -15,6 +15,7 @@ import com.ruoyi.other.service.TScreenContentService; import com.ruoyi.other.service.TSystemConfigurationService; import com.ruoyi.other.util.EnergyRefreshService; +import com.ruoyi.other.util.KsolarUtils; import com.ruoyi.other.vo.*; import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; @@ -63,25 +64,9 @@ @GetMapping(value = "/photovoltaicAndConsumption") public AjaxResult<PhotovoltaicAndConsumptionVO> photovoltaicAndConsumption() { //需调用接口 获取光伏发电量 - List<Integer> siteIds= Arrays.asList(25,26); PhotovoltaicAndConsumptionVO vo = new PhotovoltaicAndConsumptionVO(); - List<TScreenContent> list = screenContentService.list(new LambdaQueryWrapper<TScreenContent>().in(TScreenContent::getSiteId, siteIds)); - if(list==null|| list.isEmpty()){ - return AjaxResult.success(vo); - } - vo.setGreenElectricityToday(list.get(0).getGreenElectricityToday()); - list.remove(0); - list.forEach(x->{ - vo.setGreenElectricityToday(vo.getGreenElectricityToday().add(x.getGreenElectricityToday())); - }); - - 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)); - - + vo.setTodayGenerateElectricity(new BigDecimal(KsolarUtils.getTodayEnergy(LocalDateTime.now().toString()))); + vo.setGreenElectricityToday(vo.getTodayGenerateElectricity().multiply(new BigDecimal("0.94")).setScale(2, RoundingMode.HALF_UP)); return AjaxResult.success(vo); } -- Gitblit v1.7.1