From 6fd8773f526a2e4bee8bf0b41b55cba3892b451b Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期四, 29 五月 2025 16:51:32 +0800 Subject: [PATCH] Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile into dev --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TScreenContentController.java | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 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 80f612a..e93e819 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 @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.Arrays; import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; @@ -56,8 +57,18 @@ @GetMapping(value = "/photovoltaicAndConsumption") public AjaxResult<PhotovoltaicAndConsumptionVO> photovoltaicAndConsumption() { //需调用接口 获取光伏发电量 - - return AjaxResult.success(new PhotovoltaicAndConsumptionVO()); + 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())); + }); + return AjaxResult.success(vo); } -- Gitblit v1.7.1