浏览代码

统一编码引入

wangjiawen 4 年之前
父节点
当前提交
ca88fda67f

+ 5 - 5
src/main/java/com/gyee/frame/common/quartz/task/Comprehensive_target.java

@@ -13,17 +13,17 @@ import java.util.Date;
  * @CLASSNAME   WeatherfdPushTask
  * @Description 向页面预测今天气象推送数据
  * @Auther Wang Jiawen
- * @DATE 2020/1/2 15:33
+ * @DATE 2020/1/2 15:33
  */
-@Component("comprehensive_target")
-public class Comprehensive_target {
+@Component("windpowerstationdetail_comprehensive_target")
+public class Windpowerstationdetail_comprehensive_target {
     @Autowired
     private WindpowerstationdetailService windpowerstationdetailService;
     /**
      * 无参的任务
      */
-    public void comprehensive_target() throws Exception {
-        windpowerstationdetailService.comprehensive_target();//调用list方法完成对 key :"weatherProphet_1" ,路径"weather/weatherProphet_1"的推送
+    public void windpowerstationdetail_comprehensive_target() throws Exception {
+        windpowerstationdetailService.windpowerstationdetail_comprehensive_target();//调用list方法完成对 key :"weatherProphet_1" ,路径"weather/weatherProphet_1"的推送
         //System.out.println("我已执行");
     }
 

+ 21 - 3
src/main/java/com/gyee/frame/service/app/windpowerstationdetail/WindpowerstationdetailService.java

@@ -1,5 +1,6 @@
 package com.gyee.frame.service.app.windpowerstationdetail;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.model.auto.WindPowerstationTestingPoint;
@@ -7,6 +8,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.BeanUtils;
 import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.StringUtils;
 import com.gyee.frame.util.mongodb.IMongodbUtil;
@@ -34,10 +36,13 @@ public class WindpowerstationdetailService extends SocketToolService {
     private InitialRunner initialRunner;
     private static int decimal_digit = 0;
 
-    public void comprehensive_target() throws Exception {
+    public void windpowerstationdetail_comprehensive_target() throws Exception {
 
         Map<String, Map<String, WindPowerstationTestingPoint>> stationPointmap = InitialRunner.stationPointmap;
-        List<Windpowerstation> wpls = InitialRunner.wpls;
+        List<Windpowerstation> wpls = new ArrayList<>();
+        for(Windpowerstation wp:InitialRunner.wpls){
+            wpls.add(wp);
+        }
         Windpowerstation windpowerstationAll = new Windpowerstation();
         windpowerstationAll.setId("0");
         wpls.add(windpowerstationAll);
@@ -80,7 +85,20 @@ public class WindpowerstationdetailService extends SocketToolService {
                 //预测发电量
                 ycfdl = swdl+12;
                 //装机容量
-                zjrl = 130;
+                try{
+                    //上网电量
+                    if(windpowerstation.getCapacity()==null){
+                        List<Windpowerstation> wps = InitialRunner.wpls;
+                        for(Windpowerstation windpowerstationinner:wps){
+                            zjrl = zjrl + windpowerstationinner.getCapacity();
+                        }
+                    }else{
+                        zjrl = windpowerstation.getCapacity();
+                    }
+
+                }catch (Exception e){
+                    System.out.println(e.getMessage());
+                }
                 pointDataMap.put("rfdl",rfdl);
                 pointDataMap.put("aqts",aqts);
                 pointDataMap.put("swdl",swdl);