Przeglądaj źródła

sis首页图标添加风速,日照强度

malijun 1 rok temu
rodzic
commit
7dd680b4f4

+ 61 - 9
electricity/meter/src/main/java/com/gyee/gaia/meter/entity/TDEquipmentMeterInfo.java

@@ -19,10 +19,58 @@ public class TDEquipmentMeterInfo extends Model<TDEquipmentMeterInfo> implements
 
     private static final long serialVersionUID = 1L;
 
+//    /**
+//     * 子表名
+//     */
+//    private String tbName;
+//
+//
+//    /**
+//     * 时间
+//     */
+//    private long  ts;
+//    /**
+//     * 1分钟平均风速
+//     */
+//    private double speed;
+//
+//    /**
+//     * 理论功率
+//     */
+//    private double theoreticalPower;
+//
+//    /**
+//     * 实际功率
+//     */
+//    private double actualPower;
+//
+//    /**
+//     * 理论发电量
+//     */
+//    private double TheoreticalPowerGeneration;
+//
+//    /**
+//     * 实际发电量
+//     */
+//    private double actualGeneration;
+//
+//
+//
+//
+//    /**
+//     * 型号
+//     */
+//    private String model;
+//
+//    /**
+//     * 场站
+//     */
+//    private String station;
+
     /**
      * 子表名
      */
-    private String tbName;
+    private String tbname;
 
 
     /**
@@ -35,24 +83,28 @@ public class TDEquipmentMeterInfo extends Model<TDEquipmentMeterInfo> implements
     private double speed;
 
     /**
-     * 理论功率
+     * 实际功率
      */
-    private double theoreticalPower;
+    private double shijigonglv;
 
     /**
-     * 实际功率
+     * 理论功率
+     */
+    private double lilungonglv;
+    /**
+     * 保证功率
      */
-    private double actualPower;
+    private double baozhenggonglv;
 
     /**
-     * 理论发电量
+     * 实际和理论谁大用谁
      */
-    private double TheoreticalPowerGeneration;
+    private double shijililun;
 
     /**
-     * 实际发电量
+     * 实际和保证谁大用谁
      */
-    private double actualGeneration;
+    private double shijibaozhen;
 
 
 

+ 2 - 0
electricity/meter/src/main/java/com/gyee/gaia/meter/entity/vo/SisViewVO.java

@@ -62,6 +62,8 @@ public class SisViewVO {
     //宣和发电量
     public BigDecimal xhfdl;
 
+    //日照强度
+    public BigDecimal rzqd;
     //大武口日照强度
     public BigDecimal dwkrzqd;
     //平罗日照强度

+ 18 - 0
electricity/meter/src/main/java/com/gyee/gaia/meter/mapper/TDEquipmentMeterInfoMapper.java

@@ -48,6 +48,24 @@ public interface TDEquipmentMeterInfoMapper extends BaseMapper<TDEquipmentMeterI
 
     );
 
+    /**
+     * 插入数据,如果没有表则使用超级表自动建表
+     */
+    @Insert("INSERT INTO #{tbname} USING equipmentmeterinfo TAGS(#{model},#{station}) VALUES (#{ts}, #{speed},#{shijigonglv},#{lilungonglv},#{baozhenggonglv},#{shijililun},#{shijibaozhen})")
+    void insertTDEquiomentMeterInfo2(
+            @Param("tbname") String tbname,
+            @Param("model") String model,
+            @Param("station") String station,
+            @Param("ts") long ts,
+            @Param("speed") double speed,
+            @Param("shijigonglv") double shijigonglv,
+            @Param("lilungonglv") double lilungonglv,
+            @Param("baozhenggonglv") double baozhenggonglv,
+            @Param("shijililun") double shijililun,
+            @Param("shijibaozhen") double shijibaozhen
+
+    );
+
 
     /**
      * 查询

+ 63 - 2
electricity/meter/src/main/java/com/gyee/gaia/meter/service/meter/GetPowerStationInfoById.java

@@ -3,7 +3,10 @@ package com.gyee.gaia.meter.service.meter;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.gaia.meter.adapter.Adapter;
 import com.gyee.gaia.meter.entity.MeterInfoCalculating;
+import com.gyee.gaia.meter.entity.PointData;
+import com.gyee.gaia.meter.entity.PointDatas;
 import com.gyee.gaia.meter.entity.PowerStation;
 import com.gyee.gaia.meter.entity.vo.MeterVO;
 import com.gyee.gaia.meter.service.impl.MeterInfoCalculatingServiceImpl;
@@ -15,6 +18,7 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Author: malijun
@@ -24,6 +28,8 @@ import java.util.List;
 @Service
 public class GetPowerStationInfoById {
     @Resource
+    Adapter adapter;
+    @Resource
     MeterInfoCalculatingServiceImpl meterInfoCalculatingService;
     @Resource
     PowerStationServiceImpl powerStationService;
@@ -47,16 +53,42 @@ public class GetPowerStationInfoById {
         for (int i = 1; i <= days; i++) {
             //开始时间
             DateTime dateTime1 = DateUtil.offsetDay(beginOfMonth, i - 1);
+            DateTime dateTime2 = DateUtil.endOfDay(dateTime1);
 
             //根据时间和code查询风场日发电量,日上网电量,日购网电量
             MeterInfoCalculating oneFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().like("code", "%_JDXLFDL_P0").eq("date", dateTime1).eq("windpowerstation_id", nemCode));
             MeterInfoCalculating oneSWDL= meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().like("code", "%F_SWDL_P0").eq("date", dateTime1).eq("windpowerstation_id", nemCode));
             MeterInfoCalculating oneGWDL= meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().like("code", "%_GWDL_P0").eq("date", dateTime1).eq("windpowerstation_id", nemCode));
 
+            BigDecimal speed = BigDecimal.valueOf(0);
+
+            if (nemCode.contains("_MHS_")){
+                Map<String, PointData> speed1 = adapter.getHistorySection("MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+                double value = speed1.get("MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0106").getValue();
+                speed= BigDecimal.valueOf(value);
+            } else if (nemCode.contains("_NSS_")) {
+                Map<String, PointData> speed2 = adapter.getHistorySection("NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+                double value = speed2.get("NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0106").getValue();
+                speed= BigDecimal.valueOf(value);
+            } else if (nemCode.contains("_QS_")) {
+                Map<String, PointData> speed3 = adapter.getHistorySection("QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+                double value = speed3.get("QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0106").getValue();
+                speed= BigDecimal.valueOf(value);
+            } else if (nemCode.contains("_SBQ_")) {
+                Map<String, PointData> speed4 = adapter.getHistorySection("SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+                double value = speed4.get("SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0106").getValue();
+                speed= BigDecimal.valueOf(value);
+            } else if (nemCode.contains("_XS_")) {
+                Map<String, PointData> speed5 = adapter.getHistorySection("XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+                double value = speed5.get("XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0106").getValue();
+                speed= BigDecimal.valueOf(value);
+            }
+
+
             BigDecimal rfdl = BigDecimal.valueOf(0);
             BigDecimal rswdl = BigDecimal.valueOf(0);
             BigDecimal rgwdl = BigDecimal.valueOf(0);
-            BigDecimal speed = BigDecimal.valueOf(0);
+
 
             if (oneFDL != null) {
                 rfdl = oneFDL.getValue();
@@ -171,6 +203,7 @@ public class GetPowerStationInfoById {
         for (int i = 1; i <= days; i++) {
             //开始时间
             DateTime dateTime1 = DateUtil.offsetDay(beginOfMonth, i - 1);
+            DateTime dateTime2 = DateUtil.endOfDay(dateTime1);
 
             //根据时间和code查询光场日发电量,日上网电量
             MeterInfoCalculating oneFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>()
@@ -182,10 +215,37 @@ public class GetPowerStationInfoById {
                     .eq("date", dateTime1)
                     .eq("windpowerstation_id", nemCode));
 
+            BigDecimal speed = BigDecimal.valueOf(0);
+
+            if(nemCode.contains("_DWK_")){
+                List<PointDatas> historyStat1 = adapter.getHistoryStat("DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0082", dateTime1.getTime(), dateTime2.getTime(), 86399);
+                double value = historyStat1.get(0).getAvg().getValue();
+                speed= BigDecimal.valueOf(value).setScale(2,RoundingMode.HALF_EVEN);
+            } else if (nemCode.contains("_PL_")) {
+                double value = 66;
+                speed= BigDecimal.valueOf(value).setScale(2,RoundingMode.HALF_EVEN);
+            }else if (nemCode.contains("_XH_")) {
+                List<PointDatas> historyStat3 = adapter.getHistoryStat("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0473", dateTime1.getTime(), dateTime2.getTime(), 86399);
+                double value = historyStat3.get(0).getAvg().getValue();
+                speed= BigDecimal.valueOf(value).setScale(2,RoundingMode.HALF_EVEN);
+            }else if (nemCode.contains("_MCH_")) {
+                List<PointDatas> historyStat4 = adapter.getHistoryStat("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0475", dateTime1.getTime(), dateTime2.getTime(), 86399);
+                double value = historyStat4.get(0).getAvg().getValue();
+                speed= BigDecimal.valueOf(value).setScale(2,RoundingMode.HALF_EVEN);
+            }else if (nemCode.contains("_HZJ_")) {
+                List<PointDatas> historyStat5 = adapter.getHistoryStat("HZJFGLZN.NX_GD_HZJG_YC_P1_L1_001_QXZ002", dateTime1.getTime(), dateTime2.getTime(), 86399);
+                double value = historyStat5.get(0).getAvg().getValue();
+                speed= BigDecimal.valueOf(value).setScale(2,RoundingMode.HALF_EVEN);
+            }else if (nemCode.contains("_AK_")) {
+                List<PointDatas> historyStat6 = adapter.getHistoryStat("AKDQ.NX_GD_AKG_DQ_P1_L1_001_AI0157", dateTime1.getTime(), dateTime2.getTime(), 86399);
+                double value = historyStat6.get(0).getAvg().getValue();
+                speed= BigDecimal.valueOf(value).setScale(2,RoundingMode.HALF_EVEN);
+            }
+
+
             BigDecimal rfdl = BigDecimal.valueOf(0);
             BigDecimal rswdl = BigDecimal.valueOf(0);
             BigDecimal rgwdl = BigDecimal.valueOf(0);
-            BigDecimal speed = BigDecimal.valueOf(0);
 
             if (oneFDL != null) {
                 rfdl = oneFDL.getValue();
@@ -195,6 +255,7 @@ public class GetPowerStationInfoById {
             }
 
 
+
             MeterVO meterVO = new MeterVO();
             meterVO.setTimestr(String.valueOf(i));
             meterVO.setDate(dateTime1);

+ 9 - 5
electricity/meter/src/main/java/com/gyee/gaia/meter/service/meter/GetView.java

@@ -193,7 +193,7 @@ public class GetView {
 
         //大武口日照强度
         Map<String, PointData> historyLatest1 = adapter.getHistoryLatest("DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0082");
-        sisViewVO.setDwkrzqd(BigDecimal.valueOf(historyLatest1.get("DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0082").getValue()));
+        sisViewVO.setDwkrzqd(BigDecimal.valueOf(historyLatest1.get("DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0082").getValue()).setScale(4,RoundingMode.HALF_EVEN));
 
         //平罗日照强度
 //        Map<String, PointData> historyLatest2 = adapter.getHistoryLatest("DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0082");
@@ -201,17 +201,21 @@ public class GetView {
 
         //宣和日照强度
         Map<String, PointData> historyLatest3 = adapter.getHistoryLatest("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0473");
-        sisViewVO.setXhrzqd(BigDecimal.valueOf(historyLatest3.get("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0473").getValue()));
+        sisViewVO.setXhrzqd(BigDecimal.valueOf(historyLatest3.get("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0473").getValue()).setScale(4,RoundingMode.HALF_EVEN));
 
         //马场湖日照强度
         Map<String, PointData> historyLatest4 = adapter.getHistoryLatest("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0475");
-        sisViewVO.setMchrzqd(BigDecimal.valueOf(historyLatest4.get("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0475").getValue()));
+        sisViewVO.setMchrzqd(BigDecimal.valueOf(historyLatest4.get("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0475").getValue()).setScale(4,RoundingMode.HALF_EVEN));
 
-//        //海子井日照强度
+        //海子井日照强度
         Map<String, PointData> historyLatest5 = adapter.getHistoryLatest("HZJFGLZN.NX_GD_HZJG_YC_P1_L1_001_QXZ002");
-        sisViewVO.setHzjrzqd(BigDecimal.valueOf(historyLatest5.get("HZJFGLZN.NX_GD_HZJG_YC_P1_L1_001_QXZ002").getValue()));
+        sisViewVO.setHzjrzqd(BigDecimal.valueOf(historyLatest5.get("HZJFGLZN.NX_GD_HZJG_YC_P1_L1_001_QXZ002").getValue()).setScale(4,RoundingMode.HALF_EVEN));
 
+        //埃肯日照强度
+        Map<String, PointData> historyLatest6 = adapter.getHistoryLatest("AKDQ.NX_GD_AKG_DQ_P1_L1_001_AI0157");
+        sisViewVO.setAkrzqd(BigDecimal.valueOf(historyLatest6.get("AKDQ.NX_GD_AKG_DQ_P1_L1_001_AI0157").getValue()).setScale(4,RoundingMode.HALF_EVEN));
 
+        sisViewVO.setRzqd(sisViewVO.getDwkrzqd().add(sisViewVO.getPlrzqd()).add(sisViewVO.getXhrzqd()).add(sisViewVO.getMchrzqd()).add(sisViewVO.getHzjrzqd()).add(sisViewVO.getAkrzqd()).divide(BigDecimal.valueOf(5),RoundingMode.HALF_EVEN));
 
 
 

+ 46 - 0
electricity/meter/src/main/java/com/gyee/gaia/meter/service/meter/GetWindStationInfo.java

@@ -3,7 +3,10 @@ package com.gyee.gaia.meter.service.meter;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.gaia.meter.adapter.Adapter;
 import com.gyee.gaia.meter.entity.MeterInfoCalculating;
+import com.gyee.gaia.meter.entity.PointData;
+import com.gyee.gaia.meter.entity.PointDatas;
 import com.gyee.gaia.meter.entity.PowerStation;
 import com.gyee.gaia.meter.entity.vo.MeterVO;
 import com.gyee.gaia.meter.service.impl.MeterInfoCalculatingServiceImpl;
@@ -15,6 +18,7 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Author: malijun
@@ -24,6 +28,8 @@ import java.util.List;
 @Service
 public class GetWindStationInfo {
     @Resource
+    Adapter adapter;
+    @Resource
     MeterInfoCalculatingServiceImpl meterInfoCalculatingService;
     @Resource
     PowerStationServiceImpl powerStationService;
@@ -44,12 +50,25 @@ public class GetWindStationInfo {
         for (int i = 1; i <= days; i++) {
             //开始时间
             DateTime dateTime1 = DateUtil.offsetDay(beginOfMonth, i - 1);
+            DateTime dateTime2 = DateUtil.endOfDay(dateTime1);
 
             //根据时间和code查询总风场日发电量,日上网电量,日购网电量
             MeterInfoCalculating oneFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_DAY").eq("date", dateTime1));
             MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONSWDL_DAY").eq("date", dateTime1));
             MeterInfoCalculating oneGWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONGWDL_DAY").eq("date", dateTime1));
 
+            Map<String, PointData> speed1 = adapter.getHistorySection("MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+            Map<String, PointData> speed2 = adapter.getHistorySection("NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+            Map<String, PointData> speed3 = adapter.getHistorySection("QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+            Map<String, PointData> speed4 = adapter.getHistorySection("SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+            Map<String, PointData> speed5 = adapter.getHistorySection("XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0106",dateTime2.getTime());
+            double value1 = speed1.get("MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0106").getValue();
+            double value2 = speed2.get("NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0106").getValue();
+            double value3 = speed3.get("QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0106").getValue();
+            double value4 = speed4.get("SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0106").getValue();
+            double value5 = speed5.get("XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0106").getValue();
+            double v = (value1 + value2 + value3 + value4 + value5)/5;
+
             //初始化
             BigDecimal rfdl = BigDecimal.valueOf(0);
             BigDecimal rswdl = BigDecimal.valueOf(0);
@@ -67,6 +86,10 @@ public class GetWindStationInfo {
             if (oneGWDL != null) {
                 rgwdl = oneGWDL.getValue();
             }
+            if (speed1 != null) {
+                speed = BigDecimal.valueOf(v).setScale(2,RoundingMode.HALF_EVEN);
+            }
+
 
             //VO对象设置属性值
             MeterVO meterVO = new MeterVO();
@@ -168,11 +191,30 @@ public class GetWindStationInfo {
         for (int i = 1; i <= days; i++) {
             //开始时间
             DateTime dateTime1 = DateUtil.offsetDay(beginOfMonth, i - 1);
+            DateTime dateTime2 = DateUtil.endOfDay(dateTime1);
 
             //根据时间和code查询总风场日发电量,日上网电量,日购网电量
             MeterInfoCalculating oneFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFFDL_DAY").eq("date", dateTime1));
             MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFSWDL_DAY").eq("date", dateTime1));
 
+
+            List<PointDatas> historyStat1 = adapter.getHistoryStat("DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0082", dateTime1.getTime(), dateTime2.getTime(), 86399);
+//         平罗没点
+            List<PointDatas> historyStat3 = adapter.getHistoryStat("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0473", dateTime1.getTime(), dateTime2.getTime(), 86399);
+            List<PointDatas> historyStat4 = adapter.getHistoryStat("XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0475", dateTime1.getTime(), dateTime2.getTime(), 86399);
+            List<PointDatas> historyStat5 = adapter.getHistoryStat("HZJFGLZN.NX_GD_HZJG_YC_P1_L1_001_QXZ002", dateTime1.getTime(), dateTime2.getTime(), 86399);
+            List<PointDatas> historyStat6 = adapter.getHistoryStat("AKDQ.NX_GD_AKG_DQ_P1_L1_001_AI0157", dateTime1.getTime(), dateTime2.getTime(), 86399);
+            double value1 = historyStat1.get(0).getAvg().getValue();
+//            double value2 = historyStat2.get(0).getAvg().getValue();
+            double value2 = 66;
+            double value3 = historyStat3.get(0).getAvg().getValue();
+            double value4 = historyStat4.get(0).getAvg().getValue();
+            double value5 = historyStat5.get(0).getAvg().getValue();
+            double value6 = historyStat6.get(0).getAvg().getValue();
+            double v = (value1 + value2 + value3 + value4 + value5+value6)/6;
+
+
+
             //初始化
             BigDecimal rfdl = BigDecimal.valueOf(0);
             BigDecimal rswdl = BigDecimal.valueOf(0);
@@ -186,6 +228,10 @@ public class GetWindStationInfo {
             if (oneSWDL != null) {
                 rswdl = oneSWDL.getValue();
             }
+            if (historyStat1 != null) {
+                speed = BigDecimal.valueOf(v).setScale(2,RoundingMode.HALF_EVEN);
+            }
+
 
 
             //VO对象设置属性值

Plik diff jest za duży
+ 678 - 488
electricity/meter/src/main/java/com/gyee/gaia/meter/service/saveTDengine/TDSaveLLFDLTest.java