Преглед на файлове

修正五项损失数据推送

shilin преди 5 години
родител
ревизия
b93f85301c

+ 2 - 2
src/main/java/com/gyee/frame/common/spring/InitialRunner.java

@@ -61,14 +61,14 @@ public class InitialRunner implements CommandLineRunner {
 
         WindpowerstationExample windpowerstationExample=new WindpowerstationExample();
         windpowerstationExample.setOrderByClause("ordernum ASC");
-        windpowerstationExample.createCriteria().andIdNotLike("%_GDC").getAllCriteria();
+        windpowerstationExample.createCriteria().andIdNotLike("MCH_GDC").getAllCriteria();
         wpls= windpowerstationService.selectByExample(windpowerstationExample);
 
 
 
         ProjectExample projectExample=new ProjectExample();
         projectExample.setOrderByClause("ordernum ASC");
-        projectExample.createCriteria().andWindpowerstationidNotLike("%_GDC").getAllCriteria();
+        projectExample.createCriteria().andWindpowerstationidNotLike("MCH_GDC").getAllCriteria();
         pjls= projectService.selectByExample(projectExample);
 
         LineExample lineExample=new LineExample();

+ 1 - 1
src/main/java/com/gyee/frame/service/app/index/IndexDetailService.java

@@ -34,7 +34,7 @@ import java.util.*;
 public class IndexDetailService extends SocketToolService{
 	@Autowired
     private InitialRunner initialRunner;
-    private static int decimal_digit = 0;
+    private static int decimal_digit = 2;
 	IEdosUtil mongodb = new EdosUtil();
     @Resource
     private WindpowerinfodayService windpowerinfodayService;

+ 23 - 7
src/main/java/com/gyee/frame/service/app/index/IndexService.java

@@ -35,7 +35,7 @@ import java.util.*;
 public class IndexService extends SocketToolService{
 	@Autowired
     private InitialRunner initialRunner;
-    private static int decimal_digit = 0;
+    private static int decimal_digit = 2;
 	IEdosUtil mongodb = new EdosUtil();
     @Resource
     private WindpowerinfodayService windpowerinfodayService;
@@ -511,8 +511,16 @@ public class IndexService extends SocketToolService{
            double zhcydl = 99;
            double sbklyl = 99;
            double jpeyht = 99;
-
-
+           double zjrl=0.0;
+
+           if(windpowerstation.getCapacity()==null){
+               List<Windpowerstation> wps = InitialRunner.wpls;
+               for(Windpowerstation windpowerstationinner:wps){
+                   zjrl = zjrl + windpowerstationinner.getCapacity();
+               }
+           }else{
+               zjrl = windpowerstation.getCapacity();
+           }
            //mttr
            mttr = jybm + 10;
 
@@ -559,12 +567,20 @@ public class IndexService extends SocketToolService{
                zhcydl=wp.getDayzhcydl();
                //设备可利用率
                sbklyl=wp.getDaysbklyl();
-               System.out.println(wp.getRecorddate()+ "___" +wp.getMonthlyxs());
-               System.out.println(wp.getRecorddate()+ "___" +wp.getYearlyxs());
-               System.out.println(wp.getRecorddate()+ "___" +wp.getDayzhcydl());
-               System.out.println(wp.getRecorddate()+ "___" +wp.getDaysbklyl());
+//               System.out.println(wp.getRecorddate()+ "___" +wp.getMonthlyxs());
+//               System.out.println(wp.getRecorddate()+ "___" +wp.getYearlyxs());
+//               System.out.println(wp.getRecorddate()+ "___" +wp.getDayzhcydl());
+//               System.out.println(wp.getRecorddate()+ "___" +wp.getDaysbklyl());
            }
 
+           // 月利用小时
+          double temp = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_YFDL)).getPointValueInDouble();
+           ylyxs = (new BigDecimal(temp).multiply(new BigDecimal(10))).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
+           // 年利用小时
+           temp = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_NFDL)).getPointValueInDouble();
+            nlyxs = (new BigDecimal(temp).multiply(new BigDecimal(10))).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+
 
            try{
                //减排二氧化碳

+ 23 - 7
src/main/java/com/gyee/frame/service/app/windpowerstationdetail/WindpowerstationdetailService.java

@@ -34,7 +34,7 @@ public class WindpowerstationdetailService extends SocketToolService {
     //public static Map<String,String> comprehensive_target_pointMap = new HashMap<>();
     @Autowired
     private InitialRunner initialRunner;
-    private static int decimal_digit = 0;
+    private static int decimal_digit = 2;
     @Resource
     private WindpowerinfodayService windpowerinfodayService;
     @Resource
@@ -135,7 +135,16 @@ public class WindpowerstationdetailService extends SocketToolService {
             double zhcydl = 99;
             double sbklyl = 99;
             double jpeyht = 99;
+            double zjrl=0.0;
 
+            if(windpowerstation.getCapacity()==null){
+                List<Windpowerstation> wps = InitialRunner.wpls;
+                for(Windpowerstation windpowerstationinner:wps){
+                    zjrl = zjrl + windpowerstationinner.getCapacity();
+                }
+            }else{
+                zjrl = windpowerstation.getCapacity();
+            }
 
             //mttr
             mttr = jybm + 10;
@@ -173,18 +182,25 @@ public class WindpowerstationdetailService extends SocketToolService {
             Windpowerinfoday wp=windpowerinfodayService.findListByDate(windpowerstation.getId(),c.getTime());
             if(StringUtils.isNotNull(wp))
             {
-                ylyxs=wp.getMonthlyxs();
-                nlyxs=wp.getYearlyxs();
+//                ylyxs=wp.getMonthlyxs();
+//                nlyxs=wp.getYearlyxs();
                 //综合场用电率
                 zhcydl=wp.getDayzhcydl();
                 //设备可利用率
                 sbklyl=wp.getDaysbklyl();
-                System.out.println(wp.getRecorddate()+ "___" +wp.getMonthlyxs());
-                System.out.println(wp.getRecorddate()+ "___" +wp.getYearlyxs());
-                System.out.println(wp.getRecorddate()+ "___" +wp.getDayzhcydl());
-                System.out.println(wp.getRecorddate()+ "___" +wp.getDaysbklyl());
+//                System.out.println(wp.getRecorddate()+ "___" +wp.getMonthlyxs());
+//                System.out.println(wp.getRecorddate()+ "___" +wp.getYearlyxs());
+//                System.out.println(wp.getRecorddate()+ "___" +wp.getDayzhcydl());
+//                System.out.println(wp.getRecorddate()+ "___" +wp.getDaysbklyl());
             }
 
+            // 月利用小时
+            double temp = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_YFDL)).getPointValueInDouble();
+            ylyxs = (new BigDecimal(temp).multiply(new BigDecimal(10))).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
+            // 年利用小时
+            temp = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_NFDL)).getPointValueInDouble();
+            nlyxs = (new BigDecimal(temp).multiply(new BigDecimal(10))).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
+
 
             try{
                 //减排二氧化碳

+ 1 - 1
src/main/java/com/gyee/frame/service/app/windpowerstationdetail/Windspeedpowercurvedetail.java

@@ -27,7 +27,7 @@ import java.util.*;
 public class Windspeedpowercurvedetail extends SocketToolService {
     @Autowired
     private InitialRunner initialRunner;
-    private static int decimal_digit = 0;
+    private static int decimal_digit = 2;
     IEdosUtil mongodb = new EdosUtil();
     public static Map<String,String> windpowerstationdetail_twentyfourhourlinechart_target_pointMap = new HashMap<>();
     private double decimal(int num,double value){

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

@@ -26,7 +26,7 @@ import java.util.Map;
 public class Windspeedpowermodule extends SocketToolService {
     @Autowired
     private InitialRunner initialRunner;
-    private static int decimal_digit = 0;
+    private static int decimal_digit = 2;
     IEdosUtil mongodb = new EdosUtil();
     public void index_windSpeed_power_target_detail() throws Exception{
         Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;