From e40e5235b571cfb8d3eeca93109d34d0bcdcdf0d Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期四, 05 六月 2025 09:09:54 +0800
Subject: [PATCH] 调整参数

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TScreenContentController.java |   16 +++++++++++++++-
 1 files changed, 15 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 80f612a..beb6bee 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,8 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.Arrays;
 import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.List;
@@ -56,8 +58,20 @@
     @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()));
+        });
 
-        return AjaxResult.success(new PhotovoltaicAndConsumptionVO());
+        vo.setTodayGenerateElectricity(new BigDecimal("1821"));
+        return AjaxResult.success(vo);
     }
 
 

--
Gitblit v1.7.1