xushili 5 miesięcy temu
rodzic
commit
03c7d2cb17

+ 59 - 32
ruoyi-admin/src/test/java/com/ruoyi/NewTests.java

@@ -4,22 +4,17 @@ import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateRange;
 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.ruoyi.ucp.entity.*;
-import com.ruoyi.ucp.feign.AdapterApi;
-import com.ruoyi.ucp.service.*;
-import com.ruoyi.ucp.util.CalcCache;
+import com.ruoyi.ucp.entity.PointData;
+import com.ruoyi.ucp.entity.PointInfo;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
-import java.net.URI;
-import java.util.*;
-import java.util.function.Function;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 import java.util.stream.Collectors;
 
 @SpringBootTest//classes = RuoYiApp.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT
@@ -32,37 +27,69 @@ public class NewTests {
     @Test
     public void test() {
         Date date = DateUtil.date().toJdkDate();
-//        calcStationZhcydl(date);
-//        calcNhglZs(date);
+        //        calcStationZhcydl(date);
+        //        calcNhglZs(date);
         // 创建日期范围生成器
-        DateTime start = DateUtil.parse("2024-06-26");
-//        DateTime start = DateUtil.parse("2024-05-01");
-        DateTime end = DateUtil.parse("2024-06-26");
+        //        DateTime start = DateUtil.parse("2024-01-05");
+        DateTime start = DateUtil.parse("2024-05-01");
+        DateTime end = DateUtil.parse("2024-05-31");
         DateRange range = DateUtil.range(start, end, DateField.DAY_OF_YEAR);
         for (DateTime time : range) {
-            date=time.toJdkDate();
+            date = time.toJdkDate();
             System.out.println(DateUtil.date().toString() + ":" + time.toString());
             //安全天数
-//            calcAQTS(time.toJdkDate());
-//            task.calcLineDjlRfdl(date);
-//            //上网购网厂用电量
-//            task.calcStationSwGwCyDl(date);
-//            //计算综合厂用电量
-//            task.calcStationZhcydl(date);
-//
-//            task.calcTurbineRFDL(date);
-//            task.calcStationRfdlFj(date);
-//            task.writeReportPool(date);
+            //            calcAQTS(time.toJdkDate());
+            //            task.calcLineDjlRfdl(date);
+            //            //上网购网厂用电量
+            task.calcStationSwGwCyDl(date);
+            //            //计算综合厂用电量
+            task.calcStationZhcydl(date);
+            //
+            task.calcTurbineRFDL(date);
+            task.calcLineDjlRfdl(date);
+            task.calcStationRfdlFj(date);
+            //            task.writeReportPool(date);
 
-//            task.writeReportPool(date);
-//            task.calcTurbine5s2(date);
+            //            task.writeReportPool(date);
 
         }
-//        task.calcGlqxnh(start,end);
-//        calcTurbineRFDL(date);
+        //        calcTurbineRFDL(date);
         task.calcTurbine5s2(date);
-//        writeReportPool(date);
+        //        writeReportPool(date);
+
+    }
+
+    public static void main(String[] args) {
+        PointInfo info = new PointInfo();
+        PointData data = new PointData();
+        data.setTs(System.currentTimeMillis());
+        data.setDoubleValue(1.0);
+        List<PointData> datas = new ArrayList<>();
+        datas.add(data);
+        info.setPointDatas(datas);
+        List<PointData> pointDatas = info.getPointDatas();
+
+        PointInfo info2 = new PointInfo();
+        PointData data2 = new PointData();
+        data2.setTs(System.currentTimeMillis());
+        data2.setDoubleValue(2.0);
+        List<PointData> datas2 = new ArrayList<>();
+        datas2.add(data2);
+        info2.setPointDatas(datas2);
+        List<PointData> pointDatas2 = info2.getPointDatas();
+        List<PointInfo> pis= new ArrayList<>();
+        pis.add(info);
+        pis.add(info2);
+
+        List<List<PointData>> collect = pis.stream().map(pi->{
+            List<PointData> pd = pi.getPointDatas();
+            for (PointData pd2 : pd) {
+                pd2.setDoubleValue(33);
+            }
+            return pi.getPointDatas();
+        }).collect(Collectors.toList());
+        List<PointInfo> collect1 = pis.stream().peek(PointInfo::getPointDatas).collect(Collectors.toList());
+        System.out.println();
 
-//        task.calcStationSspjfs();
     }
 }

+ 3 - 5
universal-computing-platform/src/main/java/com/ruoyi/ucp/entity/LineInfoDay.java

@@ -24,14 +24,12 @@ public class LineInfoDay implements Serializable {
 
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
-
     private String stationId;
-
     private String projectId;
-
     private String lineId;
-
     private Date recordDate;
-
     private Integer rfdl;
+    private Double swdl;
+    private Double gwdl;
+    private Double cydl;
 }