Parcourir la source

单机信息总览线路明细功率曲线接口

shilin il y a 3 ans
Parent
commit
b2aca7cca9

+ 1 - 2
src/main/java/com/gyee/frame/controller/goodness/WindturbineDetailLineChartController.java

@@ -1,6 +1,5 @@
 package com.gyee.frame.controller.goodness;
 
-import com.alibaba.fastjson.JSONArray;
 import com.github.pagehelper.PageInfo;
 import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
@@ -91,7 +90,7 @@ public class WindturbineDetailLineChartController {
         List<List<EchartDataVo>> result = windturbinegoodnessService.getplotBands(wtId, date);
 
 //
-        System.out.println( JSONArray.toJSON(result));
+//        System.out.println( JSONArray.toJSON(result));
 
         if (result != null) {
             return AjaxResult.successData(AjaxStatus.success.code, result);

+ 4 - 1
src/main/java/com/gyee/frame/service/goodness/WindturbinegoodnessService.java

@@ -278,10 +278,13 @@ public class WindturbinegoodnessService {
 //                                c.add(Calendar.MINUTE, -6);
                                 endTime = sdf.format(c.getTime());
                                 time=sdf2.format(c.getTime());
+
+                                vos.get(0).setTime2(time);
                                 EchartDataVo vo = new EchartDataVo();
                                 vo.setxAxis(endTime);
-                                vo.setTime2(time);
                                 vos.add(vo);
+
+
                                 if (vos.size() == 2) {
                                     resultvos.add(vos);
                                     vos = new ArrayList<>();

+ 16 - 13
src/test/java/test/GoodnessTest.java

@@ -1,14 +1,17 @@
 package test;
 
 import com.gyee.SpringbootStart;
+import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.common.spring.SpringUtils;
 import com.gyee.frame.controller.goodness.WindturbineDetailLineChartController;
+import com.gyee.frame.model.custom.EchartDataVo;
 import com.gyee.frame.model.custom.Tablepar;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
 
 import java.util.Calendar;
 import java.util.Date;
+import java.util.List;
 
 public class GoodnessTest {
 
@@ -160,19 +163,19 @@ public class GoodnessTest {
 //
 //
 //        WindturbineDetailLineChartController windturbineDetailLineChartController= SpringUtils.getBean("windturbineDetailLineChartController");
-//
-//        AjaxResult ajaxResult = windturbineDetailLineChartController.getplotBands(wtid, "2021-01-02");
-//
-//        List<List<EchartDataVo>> test3 = (List<List<EchartDataVo>>) ajaxResult.get("data");
-//
-//        for (List<EchartDataVo> ls : test3) {
-//            for (EchartDataVo wtd : ls) {
-//                System.out.println(wtd.getName() + "----------------" + wtd.getxAxis());
-//            }
-//
-//        }
-//        System.out.println("***************************************************************************************");
-//
+
+        AjaxResult ajaxResult = windturbineDetailLineChartController.getplotBands(wtid, "2021-01-02");
+
+        List<List<EchartDataVo>> test3 = (List<List<EchartDataVo>>) ajaxResult.get("data");
+
+        for (List<EchartDataVo> ls : test3) {
+            for (EchartDataVo wtd : ls) {
+                System.out.println(wtd.getName() + "----------------" + wtd.getxAxis());
+            }
+
+        }
+        System.out.println("***************************************************************************************");
+
 //        AjaxResult ajaxResult2 =windturbineDetailLineChartController.plotBandAjax(wtid,"2021-01-02 00:01" ,"2021-01-02 03:22");
 //
 //        Map<String, Double> test2=(Map<String, Double>)ajaxResult2.get("data");