ソースを参照

功率预测提交

wangb@gyee-china.com 1 年間 前
コミット
86c7146229

+ 2 - 2
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/Forecast/ForecastController.java

@@ -27,7 +27,7 @@ public class ForecastController {
 
     @GetMapping("/short")
     @ResponseBody
-    @ApiOperation(value = "首页", notes = "首页")
+    @ApiOperation(value = "单场站", notes = "单场站")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "wpId", value = "场站编号", required = true, dataType = "string", paramType = "query"),
             @ApiImplicitParam(name = "beginDate", value = "开始时间", required = true, dataType = "string", paramType = "query"),
@@ -52,7 +52,7 @@ public class ForecastController {
 
     @GetMapping("/shorttype")
     @ResponseBody
-    @ApiOperation(value = "首页", notes = "首页")
+    @ApiOperation(value = "所有场站", notes = "所有场站")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "beginDate", value = "开始时间", required = true, dataType = "string", paramType = "query"),
             @ApiImplicitParam(name = "endDate", value = "结束时间", required = true, dataType = "string", paramType = "query"),

+ 14 - 16
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/ElectricityVo.java

@@ -9,6 +9,11 @@ public class ElectricityVo {
      */
     private Double jhdl;
 
+    /**
+     * 日发电量预测
+     */
+    private BigDecimal rfdlyc;
+
 
     /**
      * 实际电量
@@ -33,14 +38,15 @@ public class ElectricityVo {
     /**
      * 短期准确率
      */
-    private Double dqzql;
-
-    /**
-     * 超短期准确率
-     */
-    private BigDecimal cdqzql;
+    private BigDecimal dqzql;
 
+    public BigDecimal getRfdlyc() {
+        return rfdlyc;
+    }
 
+    public void setRfdlyc(BigDecimal rfdlyc) {
+        this.rfdlyc = rfdlyc;
+    }
 
     public Double getJhdl() {
         return jhdl;
@@ -82,19 +88,11 @@ public class ElectricityVo {
         this.qnzb = qnzb;
     }
 
-    public Double getDqzql() {
+    public BigDecimal getDqzql() {
         return dqzql;
     }
 
-    public void setDqzql(Double dqzql) {
+    public void setDqzql(BigDecimal dqzql) {
         this.dqzql = dqzql;
     }
-
-    public BigDecimal getCdqzql() {
-        return cdqzql;
-    }
-
-    public void setCdqzql(BigDecimal cdqzql) {
-        this.cdqzql = cdqzql;
-    }
 }

+ 39 - 12
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Electricity/Electricityservice.java

@@ -112,19 +112,34 @@ public class Electricityservice {
                     calendar.set(Calendar.SECOND, 0);
                     calendar.set(Calendar.MILLISECOND, 0);
 
-                    Date firstDayZeroHour = calendar.getTime();
                     Date yearHour = calendar.getTime();
 
+                    // 获取当前日期
+                    Calendar calendar2 = Calendar.getInstance();
+                    calendar2.setTime(new Date());
 
+                    // 设置为本年一月一号0点
+                    calendar2.set(Calendar.MONTH, Calendar.JANUARY); // 0表示一月
+                    calendar2.set(Calendar.DAY_OF_MONTH, 1);
+                    calendar2.set(Calendar.HOUR_OF_DAY, 0);
+                    calendar2.set(Calendar.MINUTE, 0);
+                    calendar2.set(Calendar.SECOND, 0);
+                    calendar2.set(Calendar.MILLISECOND, 0);
 
-                    for (int i = month2; i > 0; i--) {
+                    Date firstDayZeroHour = calendar2.getTime();
+
+
+                    for (int i = 1; i <= 12; i++) {
                         double bnjhdlsum = 0.0;
                         double yeardlsum = 0.0;
                         double bysjdlhjsum = 0.0;
-                        BigDecimal cdqzqlsum = null;
+                        BigDecimal dqzqlsum = null;
+                        BigDecimal rfdlyclsum = null;
                         double number = 100;
                         day = i;
                         for (ProBasicPowerstation wpls : wplist) {
+
+                            //计划电量
                             List<ProBasicProjectPlan> currentls = proBasicProjectPlanService.getmonthList(String.valueOf(day)); //本月所有集合
 
                             List<ProBasicProjectPlan> yearls = proBasicProjectPlanService.getList(String.valueOf(currentyear));
@@ -133,19 +148,23 @@ public class Electricityservice {
                             yeardlsum += yearjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //本年计划电量合
 
 
-                            //本年所有集合
+                            //计划电量本年所有集合
                             List<ProBasicProjectPlan> currentjh = currentls.stream().filter(wp -> wp.getWindpowerstationId().equals(wpls.getId())).collect(Collectors.toList());
                             bnjhdlsum += currentjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //本月计划电量合
 
+
+                            //实际电量
                             List<ProEconPowerstationInfoDay1> sjdlls = proEconPowerstationInfoDay1Service.getmax(wpls.getId(),firstDayZeroHour);
                             if (!sjdlls.isEmpty() && sjdlls !=null) {
                                 bysjdlhjsum += sjdlls.get(0).getYfdl().doubleValue();
                             }
 
+                            //短期预测准确率和日发电量预测
                             List<ProEconStationPower> dqycls =  powerService.getlist(wpls.getId(),firstDayZeroHour);
 
                             if (!dqycls.isEmpty() && dqycls != null){
-                                cdqzqlsum = dqycls.stream().map(ProEconStationPower::getPowerAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
+                                dqzqlsum = dqycls.stream().map(ProEconStationPower::getPowerAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
+                                rfdlyclsum = dqycls.stream().map(ProEconStationPower::getDayPowerForecast).reduce(BigDecimal.ZERO, BigDecimal::add);
                             }
                         }
 
@@ -178,9 +197,12 @@ public class Electricityservice {
                         vo.setQnzb(MathUtil.twoBit(((bysjdlhjsum / 10000) / yeardlsum)));
 
                         //添加超短期准确率
-                        vo.setCdqzql(cdqzqlsum);
+                        vo.setDqzql(dqzqlsum);
+
+                        //添加日发电量预测
+                        vo.setRfdlyc(rfdlyclsum);
 
-                        firstDayZeroHour = DateUtils.addMonths(firstDayZeroHour, -1);
+                        firstDayZeroHour = DateUtils.addMonths(firstDayZeroHour, +1);
 
                         vos.add(vo);
                         SortUtils.sort(vos, "hours", SortUtils.ASC);
@@ -189,9 +211,12 @@ public class Electricityservice {
 
                     double yeardlsum = 0.0;
                     double bnsjdlhjsum = 0.0;
-                    BigDecimal cdqzqlhjsum = null;
+                    BigDecimal dqzqlhjsum = null;
+                    BigDecimal rfdlychjsum = null;
                     double cdqyc = 0.0;
 
+
+                    //计算合计
                     for (ProBasicPowerstation wpls : wplist) {
                         //计划电量合计
                         List<ProBasicProjectPlan> yearls = proBasicProjectPlanService.getList(String.valueOf(currentyear));
@@ -217,13 +242,15 @@ public class Electricityservice {
 
                         List<ProEconStationPower> dqyc =  powerService.getlist1(wpls.getId(),firstDayOfYearZeroHour);
                         if (!dqyc.isEmpty() && dqyc!=null) {
-                            cdqzqlhjsum = dqyc.stream().map(ProEconStationPower::getPowerAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
+                            dqzqlhjsum = dqyc.stream().map(ProEconStationPower::getPowerAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
+                            rfdlychjsum = dqyc.stream().map(ProEconStationPower::getDayPowerForecast).reduce(BigDecimal.ZERO, BigDecimal::add);
                         }
-
-                        map.put("bnsjdlhj",MathUtil.twoBit(bnsjdlhjsum / 10000));
                         map.put("bnjhdlhj",MathUtil.twoBit(yeardlsum));
+                        map.put("rfdlychj",rfdlychjsum);
+                        map.put("bnsjdlhj",MathUtil.twoBit(bnsjdlhjsum / 10000));
                         map.put("qnzbhj",MathUtil.twoBit((bnsjdlhjsum / 10000) /yeardlsum));
-                        map.put("cdqzqlhj",cdqzqlhjsum);
+                        map.put("dqzqlhj",dqzqlhjsum);
+
                     }
 
                 }

ファイルの差分が大きいため隠しています
+ 554 - 241
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Forecast/ForecastService.java