Browse Source

首页优化

wangb 1 week ago
parent
commit
a82ab0491e

+ 14 - 4
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/homepage/EconomyPointHomePageService.java

@@ -1,6 +1,8 @@
 package com.gyee.runeconomy.service.homepage;
 
 
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.model.PointData;
@@ -2094,10 +2096,18 @@ public class EconomyPointHomePageService {
         }
         currentqw.clear();
 
-        PointData yjhpd = edosUtil.getRealData("区域集控.惠安风场.统计计算.月计划输入值");
-        yjh = yjhpd.getPointValueInDouble();
-        PointData njhpd = edosUtil.getRealData("区域集控.惠安风场.统计计算.年计划输入值");
-        njh = njhpd.getPointValueInDouble();
+        Date d = new Date();
+        DateTime dateTime = DateUtil.beginOfMonth(d);
+        Long s = dateTime.getTime() / 1000;
+        Long e = d.getTime() / 1000;
+        List<PointData> yjhpd = edosUtil.getHistoryDatasRaw("区域集控.惠安风场.统计计算.月计划输入值", s, e);
+        if (null != yjhpd && !yjhpd.isEmpty()) {
+            yjh = yjhpd.get(0).getPointValueInDouble();
+        }
+        List<PointData> njhpd = edosUtil.getHistoryDatasRaw("区域集控.惠安风场.统计计算.年计划输入值", s, e);
+        if (null != njhpd && !njhpd.isEmpty()) {
+            njh = njhpd.get(0).getPointValueInDouble();
+        }
         lastCalDate = LocalDate.now();
     }