浏览代码

功率曲线

xieshengjie 1 年之前
父节点
当前提交
493e89483d

+ 1 - 1
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/Economic/EconomicController.java

@@ -95,7 +95,7 @@ public class EconomicController {
         if(StringUtils.isEmpty(type)) type = "-2";
         if(StringUtils.isEmpty(dateType)) dateType = "1";
 
-            curvefitting = economicService.curveFittingList(wpids, type, starttime,endtime,dateType);
+            curvefitting = economicService.curveFittingList(wpids, type, starttime,endtime,dateType,windturbineids);
         if (StringUtils.isNotNull(curvefitting)) {
             return R.data(ResultMsg.ok(curvefitting));
         } else {

+ 30 - 22
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/Economic/EconomicService.java

@@ -346,7 +346,7 @@ public class EconomicService {
 
 
 
-    public  List<Glqx> curveFittingList(String wpids, String type, String starttime, String endtime, String dateType) throws Exception {
+    public  List<Glqx> curveFittingList(String wpids, String type, String starttime, String endtime, String dateType,String windturbineids) throws Exception {
         Map<String, List<List<Glqx>>> resultMap = new HashMap<>();
 
 
@@ -354,10 +354,8 @@ public class EconomicService {
         List<EconomicVo> wt = new ArrayList<>();
 
         List<List<Glqx>> tempList = new ArrayList<>();
-
+       ;
         List<Glqx> vo = new ArrayList<Glqx>();
-        Glqx vos = new Glqx();
-
 
 
         Date beginDate = DateUtils.parseDate(starttime);
@@ -377,6 +375,9 @@ public class EconomicService {
 
             for ( EconomicVo wt2 : wt) {
 
+
+                if (windturbineids.contains(wt2.getId())){
+
                 ProBasicEquipmentPoint sjgl = proBasicEquipmentPointService.getEquipmentPoint(wt2.getId(), ContantXk.AIG007);
                 ProBasicEquipmentPoint llgl = proBasicEquipmentPointService.getEquipmentPoint(wt2.getId(), ContantXk.AIG007);
                 if (sjgl.getId()==null){
@@ -384,37 +385,44 @@ public class EconomicService {
                 }
 
 
-                List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 15000L);
-                List<PointData> llglls = edosUtil.getHistoryDatasSnap(llgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 15000L);
+                List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 900L);
+                List<PointData> llglls = edosUtil.getHistoryDatasSnap(llgl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 900L);
                 double temp1 = 0;
                 double temp2 = 0;
                 for (int i = 0; i < sjglls.size(); i++) {
+
+                    Glqx vos = new Glqx();
+                    vos.setYcgl(0.0);
+                    vos.setSjgl(0.0);
+                    vos.setName("0");
+                    vos.setId("0");
+                    vos.setTime(2023);
+
                     temp1 = sjglls.get(i).getPointValueInDouble();
-                    for (EconomicVo wt3 : wt){
-                        if (sjgl.getWindturbineId().contains(wt3.getId())){
+
+                        if (sjgl.getWindturbineId().contains(wt2.getId())){
                             vos.setTime(sjglls.get(i).getPointTime());
-                            vos.setId(wt3.getId());
-                            vos.setName(wt3.getName());
+                            vos.setId(wt2.getId());
+                            vos.setName(wt2.getName());
+                            vos.setSjgl(StringUtils.round(temp1, 2));
                         }
-                    }
-                    vos.setSjgl(StringUtils.round(temp1, 2));
-                }
 
-                for (int i = 0; i < llglls.size(); i++) {
                     temp2 = llglls.get(i).getPointValueInDouble();
-                    for (EconomicVo wt3 : wt){
-                        if (sjgl.getWindturbineId().contains(wt3.getId())){
-                            vos.setTime(llglls.get(i).getPointTime());
-                            vos.setId(wt3.getId());
-                            vos.setName(wt3.getName());
-                        }
+                    if (llgl.getWindturbineId().contains(wt2.getId())){
+                        vos.setYcgl(StringUtils.round(temp2, 2));
                     }
-                    vos.setYcgl(StringUtils.round(temp2, 2));
+
+                    vo.add(vos);
                 }
+
+//                for (int i = 0; i < llglls.size(); i++) {
+//
+//                }
+
             }
-            vo.add(vos);
 
 
+            }
 
         }