Browse Source

光资源分析

wangb@gyee-china.com 1 year ago
parent
commit
b17c0e26de

+ 47 - 13
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/Economic/EconomicController.java

@@ -50,7 +50,7 @@ public class EconomicController {
 
     ) throws Exception {
 
-        Map<String, Object> map = economicService.getEconomyPointInfo( date,companyId, type, statype,datetype);
+        Map<String, Object> map = economicService.getEconomyPointInfo(date, companyId, type, statype, datetype);
         if (null != map) {
             return R.data(ResultMsg.ok(map));
         } else {
@@ -67,7 +67,7 @@ public class EconomicController {
                         @RequestParam(value = "endtime", required = true) Date endtime
     ) throws Exception {
 
-        List<PowercurveVo> map = economicService.powercurve(type,wpid, starttime, endtime);
+        List<PowercurveVo> map = economicService.powercurve(type, wpid, starttime, endtime);
         if (null != map) {
             return R.data(ResultMsg.ok(map));
         } else {
@@ -77,27 +77,29 @@ public class EconomicController {
 
     /**
      * 功率列表
+     *
      * @param windturbineids 风机ids
-     * @param type 0:全部;-1:风电;-2:光伏
-     * @param dateType 1:日;2:月;3:年
+     * @param type           0:全部;-1:风电;-2:光伏
+     * @param dateType       1:日;2:月;3:年
      * @return
      */
     @GetMapping("/curvefitting")
     @ResponseBody
     @CrossOrigin(origins = "*", maxAge = 3600)
-    public R curvefittinglist(@RequestParam(value = "companys",required = true) String companys,
-                              @RequestParam(value = "type",required = true) String type,
-                              @RequestParam(value = "wpids",required = false) String wpids,
-                              @RequestParam(value = "windturbineids",required = false) String windturbineids,
+    public R curvefittinglist(@RequestParam(value = "companys", required = true) String companys,
+                              @RequestParam(value = "type", required = true) String type,
+                              @RequestParam(value = "wpids", required = false) String wpids,
+                              @RequestParam(value = "windturbineids", required = false) String windturbineids,
                               @RequestParam(value = "starttime", required = false) String starttime,
-                              @RequestParam(value = "endtime", required = false) String  endtime,
+                              @RequestParam(value = "endtime", required = false) String endtime,
                               @RequestParam(value = "dateType", required = false) String dateType
     ) throws Exception {
-        List<Glqx>curvefitting = null;
-        if(StringUtils.isEmpty(type)) type = "-2";
-        if(StringUtils.isEmpty(dateType)) dateType = "1";
+        List<Glqx> curvefitting = null;
+        if (StringUtils.isEmpty(type)) type = "-2";
+        if (StringUtils.isEmpty(dateType)) dateType = "1";
 
-            curvefitting = economicService.curveFittingList(wpids, type, starttime,endtime,dateType,windturbineids);
+
+        curvefitting = economicService.curveFittingList(companys,wpids, type, starttime, endtime, dateType, windturbineids);
         if (StringUtils.isNotNull(curvefitting)) {
             return R.data(ResultMsg.ok(curvefitting));
         } else {
@@ -105,4 +107,36 @@ public class EconomicController {
         }
 
     }
+
+    /**
+     * 光资源分析
+     *
+     * @param windturbineids 风机ids
+     * @param type           0:全部;-1:风电;-2:光伏
+     * @param dateType       1:日;2:月;3:年
+     * @return
+     */
+    @GetMapping("/irradiance")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R irradiance(@RequestParam(value = "companys", required = true) String companys,
+                        @RequestParam(value = "type", required = true) String type,
+                        @RequestParam(value = "wpids", required = false) String wpids,
+                        @RequestParam(value = "windturbineids", required = false) String windturbineids,
+                        @RequestParam(value = "starttime", required = false) String starttime,
+                        @RequestParam(value = "endtime", required = false) String endtime,
+                        @RequestParam(value = "dateType", required = false) String dateType
+    ) throws Exception {
+        List<Glqx> irradiance = null;
+        if (StringUtils.isEmpty(type)) type = "-2";
+        if (StringUtils.isEmpty(dateType)) dateType = "1";
+
+        irradiance = economicService.irradiance(companys,wpids, type, starttime, endtime, dateType, windturbineids);
+        if (StringUtils.isNotNull(irradiance)) {
+            return R.data(ResultMsg.ok(irradiance));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+
+    }
 }

+ 9 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/dto/Glqx.java

@@ -5,6 +5,7 @@ public class Glqx {
     private String name;
     private Double sjgl;
     private Double ycgl;
+    private Double pjgzd;
     private long time;
 
     public String getId() {
@@ -46,4 +47,12 @@ public class Glqx {
     public void setTime(long time) {
         this.time = time;
     }
+
+    public Double getPjgzd() {
+        return pjgzd;
+    }
+
+    public void setPjgzd(Double pjgzd) {
+        this.pjgzd = pjgzd;
+    }
 }

+ 92 - 3
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/Economic/EconomicService.java

@@ -345,7 +345,7 @@ public class EconomicService {
     }
 
 
-    public List<Glqx> curveFittingList(String wpids, String type, String starttime, String endtime, String dateType, String windturbineids) throws Exception {
+    public List<Glqx> curveFittingList(String companys,String wpids, String type, String starttime, String endtime, String dateType, String windturbineids) throws Exception {
         Map<String, List<List<Glqx>>> resultMap = new HashMap<>();
 
 
@@ -369,7 +369,12 @@ public class EconomicService {
             if (wpids.contains(wt1.getWindpowerstationId())) {
                 EconomicVo vo1 = new EconomicVo();
                 vo1.setId(wt1.getWindturbineId());
-                vo1.setName(wt1.getAname());
+                vo1.setName(wt1.getNemName());
+                wt.add(vo1);
+            }else if (wpids.isEmpty() && companys.contains("RGN")){
+                EconomicVo vo1 = new EconomicVo();
+                vo1.setId(wt1.getWindturbineId());
+                vo1.setName(wt1.getNemName());
                 wt.add(vo1);
             }
         }
@@ -436,4 +441,88 @@ public class EconomicService {
 
         return vo;
     }
-}
+
+
+    public List<Glqx> irradiance(String companys,String wpids, String type, String starttime, String endtime, String dateType, String windturbineids) throws Exception {
+
+        List<ProBasicOrganizeEquipment> wtls = CacheContext.organizeEquipmentList;
+        List<EconomicVo> wt = new ArrayList<>();
+        ;
+        List<Glqx> vo = new ArrayList<Glqx>();
+
+
+        Date beginDate = DateUtils.parseDate1(starttime);
+        Date endDate = DateUtils.parseDate1(endtime);
+        Date current = com.gyee.common.util.DateUtils.getCurrentDate();
+        if (endDate.after(current)) {
+            endDate = current;
+        }
+
+
+        for (ProBasicOrganizeEquipment wt1 : wtls) {
+            if (wpids.contains(wt1.getWindpowerstationId())) {
+                EconomicVo vo1 = new EconomicVo();
+                vo1.setId(wt1.getWindturbineId());
+                vo1.setName(wt1.getNemName());
+                wt.add(vo1);
+            }else if (wpids.isEmpty() && companys.contains("RGN")){
+                EconomicVo vo1 = new EconomicVo();
+                vo1.setId(wt1.getWindturbineId());
+                vo1.setName(wt1.getNemName());
+                wt.add(vo1);
+            }
+        }
+
+
+        for (EconomicVo wt2 : wt) {
+
+
+            if (windturbineids.contains(wt2.getId())) {
+
+                ProBasicEquipmentPoint pjgzd = null;
+
+                if (type.equals("-2")) {
+                    pjgzd = proBasicEquipmentPointService.getEquipmentPoint(wt2.getId(), ContantXk.AIEMI002);
+                }if (type.equals("-1")){
+                    pjgzd = proBasicEquipmentPointService.getEquipmentPoint(wt2.getId(), ContantXk.AIEMI002);
+                }
+                if (pjgzd.getId() == null) {
+                    continue;
+                }
+
+
+                List<PointData> pjgzdls = edosUtil.getHistoryDatasSnap(pjgzd, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 900L);
+                double temp1 = 0;
+                for (int i = 0; i < pjgzdls.size(); i++) {
+
+                    Glqx vos = new Glqx();
+                    vos.setPjgzd(0.0);
+                    vos.setName("0");
+                    vos.setId("0");
+                    vos.setTime(2023);
+
+                    temp1 = pjgzdls.get(i).getPointValueInDouble();
+
+                    if (pjgzd.getWindturbineId().contains(wt2.getId())) {
+//                            Date date = new Date(pjgzdls.get(i).getPointTime());
+//                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//                            String formattedDate = sdf.format(date);
+                        vos.setTime(pjgzdls.get(i).getPointTime());
+//                            vos.setTime(formattedDate);
+                        vos.setId(wt2.getId());
+                        vos.setName(wt2.getName());
+                        vos.setPjgzd(StringUtils.round(temp1, 2));
+                    }
+
+                    vo.add(vos);
+                }
+
+
+            }
+
+        }
+        return vo;
+    }
+
+
+    }