Jelajahi Sumber

修正五项损失数据推送

shilin 5 tahun lalu
induk
melakukan
f69fae63ec

+ 5 - 14
src/main/java/com/gyee/frame/service/app/windpowerstationdetail/WindpowerstationdetailService.java

@@ -9,6 +9,7 @@ import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.model.enumeration.Messagetype;
 import com.gyee.frame.netty.websocket.util.SocketToolService;
 import com.gyee.frame.service.WindpowerinfodayService;
+import com.gyee.frame.service.app.index.FocastpowerService;
 import com.gyee.frame.util.StringUtils;
 import com.gyee.frame.util.golden.EdosUtil;
 import com.gyee.frame.util.golden.IEdosUtil;
@@ -36,6 +37,8 @@ public class WindpowerstationdetailService extends SocketToolService {
     private static int decimal_digit = 0;
     @Resource
     private WindpowerinfodayService windpowerinfodayService;
+    @Resource
+    private FocastpowerService focastpowerService;
     public void windpowerstationdetail_comprehensive_target() throws Exception {
 
         Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
@@ -66,7 +69,7 @@ public class WindpowerstationdetailService extends SocketToolService {
 
             try {
                 //安全天数
-                PointData aqts_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_AQTS).getCode());
+                PointData aqts_real = mongodb.getRealData(stationPointmap.get("0").get(Constant.TPOINT_AQTS).getCode());
                 aqts = new BigDecimal(aqts_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
             }catch (Exception e){
                 System.out.println(e.getMessage());
@@ -82,19 +85,7 @@ public class WindpowerstationdetailService extends SocketToolService {
             }
 
             //预测发电量
-            try{
-                if(windpowerstation.getId().equalsIgnoreCase("0")){
-                    List<Windpowerstation> wps = InitialRunner.wpls;
-                    for(Windpowerstation windpowerstationinner:wps){
-                        ycfdl = ycfdl + 12;
-                    }
-                }else{
-                    ycfdl = 6;
-                }
-            }
-            catch(Exception e){
-                System.out.printf(e.getMessage());
-            }
+            ycfdl=focastpowerService.focastpower(windpowerstation.getId());
 
             //装机容量
             try{

+ 14 - 10
src/main/java/com/gyee/frame/service/app/windpowerstationdetail/Windspeedpowermodule.java

@@ -7,6 +7,7 @@ import com.gyee.frame.model.auto.Windpowerstation;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.model.enumeration.Messagetype;
 import com.gyee.frame.netty.websocket.util.SocketToolService;
+import com.gyee.frame.util.StringUtils;
 import com.gyee.frame.util.golden.EdosUtil;
 import com.gyee.frame.util.golden.IEdosUtil;
 import com.gyee.frame.util.mongodb.IMongodbUtil;
@@ -201,8 +202,10 @@ public class Windspeedpowermodule extends SocketToolService {
 
             try{
                 //理论功率
-                PointData swdl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_ZLLGL).getCode());
-                llgl = new BigDecimal(swdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                PointData llgl_real=mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_ZLLGL).getCode());
+                //llgl = new BigDecimal(swdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
+                llgl =new BigDecimal(llgl_real.getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
             }catch (Exception e){
                 System.out.println(e.getMessage());
             }
@@ -246,18 +249,19 @@ public class Windspeedpowermodule extends SocketToolService {
             }
 
 
+
             pointDataMap.put("pjfs",pjfs);
-            pointDataMap.put("pjfsMin",pjfsMin);
-            pointDataMap.put("pjfsMax",pjfsMax);
+            pointDataMap.put("pjfsMin", StringUtils.round(pjfsMin,2));
+            pointDataMap.put("pjfsMax",StringUtils.round(pjfsMax,2));
             pointDataMap.put("ycfs",ycfs);
-            pointDataMap.put("ycfsMin",ycfsMin);
-            pointDataMap.put("ycfsMax",ycfsMax);
+            pointDataMap.put("ycfsMin",StringUtils.round(ycfsMin,2));
+            pointDataMap.put("ycfsMax",StringUtils.round(ycfsMax,2));
             pointDataMap.put("sjgl",sjgl);
-            pointDataMap.put("sjglMin",sjglMin);
-            pointDataMap.put("sjglMax",sjglMax);
+            pointDataMap.put("sjglMin",StringUtils.round(sjglMin,2));
+            pointDataMap.put("sjglMax",StringUtils.round(sjglMax,2));
             pointDataMap.put("llgl",llgl);
-            pointDataMap.put("llglMin",llglMin);
-            pointDataMap.put("llglMax",llglMax);
+            pointDataMap.put("llglMin",StringUtils.round(llglMin,2));
+            pointDataMap.put("llglMax",StringUtils.round(llglMax,2));
             windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
         }
         this.pushToWeb("pageNumber_7","functionNumber_3",windpowerstationpointDataMap, Messagetype.MESSAGE);