浏览代码

首页计划发电量改为实时值

wangb 5 天之前
父节点
当前提交
09c0f3826d

+ 5 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/SingleAnalysisController.java

@@ -275,9 +275,14 @@ public class SingleAnalysisController {
 
             cal.setTime(recordDate);
             cal.add(Calendar.MONTH, -1);
+            int mon = cal.get(Calendar.MONTH) + 1;
+            String monthStr = String.format("%02d", mon);
 
             Date lastMonth = DateUtils.truncate(cal.getTime());
             SingleAnalysisVo hqzb = singleAnalysisService.SingleAnalysisListByWtId(wtId, lastMonth);
+
+            SingleAnalysisVo hqzbnew = singleAnalysisService.SingleAnalysisTurbineinfoday(wtId, year, monthStr, hqzb);
+
             SingleAnalysisVo hbzb = singleAnalysisService.SingleAnalysisListByWtId(byzb, hqzb);
 
             hqzb.setWtcode(wtcode);

+ 3 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/agc/AgcDeviateController.java

@@ -80,6 +80,9 @@ public class AgcDeviateController {
     }
 
 
+    /**
+     * 风机功率风速分析
+     */
     @GetMapping("/windturbine/curve")
     public Map<String, List<SpeedPowerAnalysis>> getWindturbineData(@RequestParam(value = "startTs") long startTs,
                                                                     @RequestParam(value = "endTs") long endTs,

+ 11 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/ITurbineInfoDayService.java

@@ -21,7 +21,17 @@ public interface ITurbineInfoDayService extends IService<TurbineInfoDay> {
     List<TurbineInfoDay> getTurbineList(String wtid,String kssj,String jssj) throws ParseException;
 
     /**
-     * 获取风机一段时间电量和
+     * 获取所有风机一段时间电量
      */
     List<TurbineInfoDay> getTurbineMonthList(String windpowerstationId, Date startDate, Date endDate);
+
+    /**
+     * 获取单台风机一段时间电量的和
+     */
+    TurbineInfoDay getTurbineSingle(String turbineId, Date startDate, Date endDate);
+
+    /**
+     * 获取单台风机一段时间电量
+     */
+    List<TurbineInfoDay> getTurbineSingleList(String turbineId, Date startDate, Date endDate);
 }

+ 58 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/TurbineInfoDayServiceImpl.java

@@ -24,6 +24,64 @@ import java.util.List;
 public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper, TurbineInfoDay> implements ITurbineInfoDayService {
 
     @Override
+    public List<TurbineInfoDay> getTurbineSingleList(String turbineId, Date startDate, Date endDate) {
+        QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
+        qw.eq("turbine_id", turbineId)
+                .between("record_date", startDate, endDate)
+                .orderByAsc("record_date");
+        return baseMapper.selectList(qw);
+    }
+
+    @Override
+    public TurbineInfoDay getTurbineSingle(String turbineId, Date startDate, Date endDate) {
+        QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
+        qw.eq("turbine_id", turbineId)
+                .between("record_date", startDate, endDate)
+                .groupBy("turbine_id",
+                        "to_char(record_date, 'yyyy-MM')" )
+                .orderByAsc("turbine_id")
+                .select(
+                        "turbine_id",
+                        "SUM(rfdl) as rfdl",
+                        "SUM(jhjxss) as jhjxss",
+                        "SUM(fjhjxss) as fjhjxss",
+                        "SUM(xdss) as xdss",
+                        "SUM(slss) as slss",
+                        "SUM(xnss) as xnss",
+                        "SUM(llfdl) as llfdl",
+                        "AVG(pjfs) as pjfs",
+                        "AVG(edfs) as edfs",
+                        "AVG(xfqrfs) as xfqrfs",
+                        "AVG(hjwd) as hjwd",
+                        "SUM(djss) as djss",
+                        "SUM(gzss) as gzss",
+                        "SUM(dj_min) as dj_min",
+                        "SUM(tj_min) as tj_min",
+                        "SUM(yx_min) as yx_min",
+                        "SUM(gz_min) as gz_min",
+                        "SUM(jx_min) as jx_min",
+                        "SUM(xd_min) as xd_min",
+                        "SUM(lx_min) as lx_min",
+                        "SUM(djcs) as djcs",
+                        "SUM(tjcs) as tjcs",
+                        "SUM(yxcs) as yxcs",
+                        "SUM(gzcs) as gzcs",
+                        "SUM(jxcs) as jxcs",
+                        "SUM(xdcs) as xdcs",
+                        "SUM(lxcs) as lxcs",
+                        "AVG(jfpl) as jfpl",
+                        "AVG(glyzxxs) as glyzxxs",
+                        "AVG(fx) as fx",
+                        "SUM(yxfss) as yxfss",
+                        "SUM(lyxs) as lyxs",
+                        "AVG(klyl) as klyl",
+                        "AVG(fnlyl) as fnlyl",
+                        "AVG(bll) as bll"
+                );
+        return baseMapper.selectOne(qw);
+    }
+
+    @Override
     public List<TurbineInfoDay> getTurbineMonthList(String windpowerstationId, Date startDate, Date endDate) {
         QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
         qw.eq("station_id", windpowerstationId)

+ 52 - 58
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/homepage/EconomyPointHomePageService.java

@@ -3,16 +3,15 @@ package com.gyee.runeconomy.service.homepage;
 
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.model.PointData;
 import com.gyee.common.util.DateUtils;
-import com.gyee.common.vo.healthmanager.CompareVo;
 import com.gyee.runeconomy.dto.response.EconHomePagePointRateDTO;
 import com.gyee.runeconomy.dto.response.ProEconPointCodeDTO;
 import com.gyee.runeconomy.init.CacheContext;
-import com.gyee.runeconomy.model.StationInfoMin;
 import com.gyee.runeconomy.model.auto.*;
 import com.gyee.runeconomy.model.vo.*;
 import com.gyee.runeconomy.service.auto.*;
-import org.hibernate.query.criteria.internal.expression.function.AggregationFunction;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -23,7 +22,6 @@ import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.*;
-import java.time.format.DateTimeFormatter;
 import java.time.temporal.TemporalAdjusters;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -77,6 +75,9 @@ public class EconomyPointHomePageService {
     @Resource
     private ITurbineInfoDayService iTurbineInfoDayService;
 
+    @Resource
+    private IEdosUtil edosUtil;
+
 
     /**
      * 指标率相应类
@@ -139,6 +140,9 @@ public class EconomyPointHomePageService {
 
     private Map<Integer, Double> nfdlLastCal = new HashMap<>();
     private Map<Integer, BigDecimal> nllfdlCal = new HashMap<>();
+
+    private Double yjh;
+    private Double njh;
     private LocalDate lastCalDate;
 
     private Map<LocalDate, BigDecimal> fnlyl = new HashMap<>();
@@ -1695,10 +1699,11 @@ public class EconomyPointHomePageService {
     }
 
 
-    public Map<String, Object> getHomeMiddle(String companyId) throws ParseException {
-        double rfdl = dayFdlCal(LocalDate.now());
-        Integer month = LocalDate.now().getMonthValue();
-        int year = LocalDate.now().getYear();
+    public Map<String, Object> getHomeMiddle(String companyId) throws Exception {
+        LocalDate now = LocalDate.now();
+        double rfdl = dayFdlCal(now);
+        int month = now.getMonthValue();
+        int year = now.getYear();
         Map<String, Object> allmap = new HashMap<>();
         PlanDataVo pd = new PlanDataVo();
         Double week = weekFdlCal();
@@ -1708,19 +1713,10 @@ public class EconomyPointHomePageService {
         pd.setYfdlsj(monCache.add(new BigDecimal(rfdl)).doubleValue());
         BigDecimal yearCache = nfdlCal.get(year);
         pd.setNfdlsj(yearCache.add(new BigDecimal(rfdl)).doubleValue());
+
         //计划发电量
-        List<ProBasicProjectPlan> list = iProBasicProjectPlanService.list();
-        List<ProBasicProjectPlan> pp = list.stream()
-                .filter(ls -> String.valueOf(month).equals(ls.getMonth())
-                        && ls.getYear().equals(String.valueOf(year)) && ls.getProjectId().equals(companyId))
-                .collect(Collectors.toList());
-        if (pp.isEmpty()) {
-            pd.setZfdljh(0.0);
-            pd.setYfdljh(0.0);
-        } else {
-            pd.setZfdljh(pp.get(0).getGeneratingCapacity() / 4);
-            pd.setYfdljh(pp.get(0).getGeneratingCapacity());
-        }
+        pd.setZfdljh(NumberUtil.round(yjh / 4, 0).doubleValue());
+        pd.setYfdljh(NumberUtil.round(yjh, 0).doubleValue());
         Double zjd = calDivide(pd.getZfdlsj(), pd.getZfdljh());
         pd.setZjd(zjd * 100);
         pd.setZwcl(zjd);
@@ -1728,14 +1724,7 @@ public class EconomyPointHomePageService {
         pd.setYjd(yjd * 100);
         pd.setYwcl(yjd);
 
-        List<ProBasicProjectPlan> pp2 = list.stream()
-                .filter(ls -> ls.getYear().equals(String.valueOf(year)) && ls.getProjectId().equals(companyId) && ls.getMonth() == null)
-                .collect(Collectors.toList());
-        if (pp2.isEmpty()) {
-            pd.setNfdljh(0.0);
-        } else {
-            pd.setNfdljh(pp2.get(0).getGeneratingCapacity());
-        }
+        pd.setNfdljh(NumberUtil.round(njh, 0).doubleValue());
         Double njd = calDivide(pd.getNfdlsj(), pd.getNfdljh());
         pd.setNjd(njd * 100);
         pd.setNwcl(njd);
@@ -1913,10 +1902,10 @@ public class EconomyPointHomePageService {
         Map<String, Object> allmap = new HashMap<>();
         Map<String, Object> zbtqdb = new HashMap<>();
         List<ColumnVo> ls1 = new ArrayList<>();
-        ColumnVo cl1 = new ColumnVo("指标名称","wtId");
-        ColumnVo cl2 = new ColumnVo(String.valueOf(LocalDate.now().getYear()),"recodedate");
-        ColumnVo cl3 = new ColumnVo(String.valueOf(LocalDate.now().getYear() - 1),"recodedate2");
-        ColumnVo cl4 = new ColumnVo("涨跌%","operation");
+        ColumnVo cl1 = new ColumnVo("指标名称", "wtId");
+        ColumnVo cl2 = new ColumnVo(String.valueOf(LocalDate.now().getYear()), "recodedate");
+        ColumnVo cl3 = new ColumnVo(String.valueOf(LocalDate.now().getYear() - 1), "recodedate2");
+        ColumnVo cl4 = new ColumnVo("涨跌%", "operation");
         ls1.add(cl1);
         ls1.add(cl2);
         ls1.add(cl3);
@@ -1968,20 +1957,20 @@ public class EconomyPointHomePageService {
 
         //主要经济指标同期对比
         List<ComparetqVo> compareTqLs = new ArrayList<>();
-        ComparetqVo cvNfdl = new ComparetqVo("年发电量",nfdl.getValue(),nfdlLastCal.get(now.getYear()-1),0.0);
-        ComparetqVo cvNswdl = new ComparetqVo("年上网电量",0.0,0.0,0.0);
-        ComparetqVo cvNgwdl = new ComparetqVo("年购网电量",0.0,0.0,0.0);
-        ComparetqVo cvNcydl = new ComparetqVo("年场用电量",0.0,0.0,0.0);
+        ComparetqVo cvNfdl = new ComparetqVo("年发电量", nfdl.getValue(), nfdlLastCal.get(now.getYear() - 1), 0.0);
+        ComparetqVo cvNswdl = new ComparetqVo("年上网电量", 0.0, 0.0, 0.0);
+        ComparetqVo cvNgwdl = new ComparetqVo("年购网电量", 0.0, 0.0, 0.0);
+        ComparetqVo cvNcydl = new ComparetqVo("年场用电量", 0.0, 0.0, 0.0);
 
         //添加同期和本期的数据
-        addData(stationInfoDayLastYearLs,cvNswdl,cvNgwdl,cvNcydl,true);
-        addData(stationInfoDayThisYearLs,cvNswdl,cvNgwdl,cvNcydl,false);
+        addData(stationInfoDayLastYearLs, cvNswdl, cvNgwdl, cvNcydl, true);
+        addData(stationInfoDayThisYearLs, cvNswdl, cvNgwdl, cvNcydl, false);
 
         //计算同比增长率
-        compareRate(cvNfdl,cvNfdl.getRecodedate(),cvNfdl.getRecodedate2());
-        compareRate(cvNswdl,cvNswdl.getRecodedate(),cvNswdl.getRecodedate2());
-        compareRate(cvNgwdl,cvNgwdl.getRecodedate(),cvNgwdl.getRecodedate2());
-        compareRate(cvNcydl,cvNcydl.getRecodedate(),cvNcydl.getRecodedate2());
+        compareRate(cvNfdl, cvNfdl.getRecodedate(), cvNfdl.getRecodedate2());
+        compareRate(cvNswdl, cvNswdl.getRecodedate(), cvNswdl.getRecodedate2());
+        compareRate(cvNgwdl, cvNgwdl.getRecodedate(), cvNgwdl.getRecodedate2());
+        compareRate(cvNcydl, cvNcydl.getRecodedate(), cvNcydl.getRecodedate2());
 
         compareTqLs.add(cvNfdl);
         compareTqLs.add(cvNswdl);
@@ -2000,10 +1989,10 @@ public class EconomyPointHomePageService {
     /**
      * 计算同比增长率
      */
-    private void compareRate(ComparetqVo wtId,double recodedate, double recodedate2) {
+    private void compareRate(ComparetqVo wtId, double recodedate, double recodedate2) {
         if (recodedate2 != 0.0) {
-            wtId.setOperation(NumberUtil.round((recodedate-recodedate2) / recodedate2*100,2).doubleValue());
-        }else {
+            wtId.setOperation(NumberUtil.round((recodedate - recodedate2) / recodedate2 * 100, 2).doubleValue());
+        } else {
             wtId.setOperation(100);
         }
     }
@@ -2011,24 +2000,24 @@ public class EconomyPointHomePageService {
     /**
      * 添加同期和本期的数据
      */
-    private void addData(List<StationInfoDay> stationInfoDays,ComparetqVo cvNswdl,ComparetqVo cvNgwdl,ComparetqVo cvNcydl, boolean isLastYear) {
+    private void addData(List<StationInfoDay> stationInfoDays, ComparetqVo cvNswdl, ComparetqVo cvNgwdl, ComparetqVo cvNcydl, boolean isLastYear) {
         if (stationInfoDays != null && !stationInfoDays.isEmpty()) {
             StationInfoDay stationInfoDay = stationInfoDays.get(0);
             if (isLastYear) {
-                cvNswdl.setRecodedate2(NumberUtil.round(stationInfoDay.getSwdl() / 1000.0,2).doubleValue());
-                cvNgwdl.setRecodedate2(NumberUtil.round(stationInfoDay.getGwdl() / 1000.0,2).doubleValue());
-                cvNcydl.setRecodedate2(NumberUtil.round(stationInfoDay.getCydl() / 100.0,2).doubleValue());
-            }else {
-                cvNswdl.setRecodedate(NumberUtil.round(stationInfoDay.getSwdl() / 1000.0,2).doubleValue());
-                cvNgwdl.setRecodedate(NumberUtil.round(stationInfoDay.getGwdl() / 1000.0,2).doubleValue());
-                cvNcydl.setRecodedate(NumberUtil.round(stationInfoDay.getCydl() / 100.0,2).doubleValue());
+                cvNswdl.setRecodedate2(NumberUtil.round(stationInfoDay.getSwdl() / 1000.0, 2).doubleValue());
+                cvNgwdl.setRecodedate2(NumberUtil.round(stationInfoDay.getGwdl() / 1000.0, 2).doubleValue());
+                cvNcydl.setRecodedate2(NumberUtil.round(stationInfoDay.getCydl() / 100.0, 2).doubleValue());
+            } else {
+                cvNswdl.setRecodedate(NumberUtil.round(stationInfoDay.getSwdl() / 1000.0, 2).doubleValue());
+                cvNgwdl.setRecodedate(NumberUtil.round(stationInfoDay.getGwdl() / 1000.0, 2).doubleValue());
+                cvNcydl.setRecodedate(NumberUtil.round(stationInfoDay.getCydl() / 100.0, 2).doubleValue());
             }
-        }else {
+        } else {
             if (isLastYear) {
                 cvNswdl.setRecodedate2(0);
                 cvNgwdl.setRecodedate2(0);
                 cvNcydl.setRecodedate2(0);
-            }else {
+            } else {
                 cvNswdl.setRecodedate(0);
                 cvNgwdl.setRecodedate(0);
                 cvNcydl.setRecodedate(0);
@@ -2040,7 +2029,7 @@ public class EconomyPointHomePageService {
     /**
      * 缓存月、年发电量
      */
-    public void calFdl() {
+    public void calFdl() throws Exception {
         if (LocalDate.now().equals(lastCalDate)) {
             return;
         }
@@ -2075,10 +2064,10 @@ public class EconomyPointHomePageService {
         List<TurbineInfoDay> lastYearData = iTurbineInfoDayService.list(currentqw);
         if (lastYearData.isEmpty()) {
             double nfdlc = 0.0;
-            nfdlLastCal.put(intYear-1, nfdlc);
+            nfdlLastCal.put(intYear - 1, nfdlc);
         } else {
             Double nfdlc = calDivide(lastYearData.get(0).getRfdl(), 1000.0);
-            nfdlLastCal.put(intYear-1, nfdlc);
+            nfdlLastCal.put(intYear - 1, nfdlc);
         }
         currentqw.clear();
 
@@ -2102,6 +2091,11 @@ public class EconomyPointHomePageService {
             yllfdlCal.put(yearAndMonth, new BigDecimal(yllfdlc));
         }
         currentqw.clear();
+
+        PointData yjhpd = edosUtil.getRealData("区域集控.惠安风场.统计计算.月计划输入值");
+        yjh = yjhpd.getPointValueInDouble();
+        PointData njhpd = edosUtil.getRealData("区域集控.惠安风场.统计计算.年计划输入值");
+        njh = njhpd.getPointValueInDouble();
         lastCalDate = LocalDate.now();
     }
 

+ 219 - 16
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/singleanalysis/SingleAnalysisService.java

@@ -915,7 +915,7 @@ public class SingleAnalysisService {
     }
 
 
-    public Map<String, List<SingleAnalysisVo>> SingleAnalysisListByWtIdDetiml(String wtId, Date beginDate, Date endDate) {
+    public Map<String, List<SingleAnalysisVo>> SingleAnalysisListByWtIdDetiml2(String wtId, Date beginDate, Date endDate) {
 
         Map<String, List<SingleAnalysisVo>> map = new HashMap<>();
         List<SingleAnalysisVo> fdlfsls = new ArrayList<>();
@@ -1108,6 +1108,209 @@ public class SingleAnalysisService {
         return map;
     }
 
+
+    public Map<String, List<SingleAnalysisVo>> SingleAnalysisListByWtIdDetiml(String wtId, Date beginDate, Date endDate) {
+
+        Map<String, List<SingleAnalysisVo>> map = new HashMap<>();
+        List<SingleAnalysisVo> fdlfsls = new ArrayList<>();
+        List<SingleAnalysisVo> wsls = new ArrayList<>();
+        List<SingleAnalysisVo> jfpldjsjls = new ArrayList<>();
+        if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+            Map<String, Map<Long, ProEconEquipmentInfoDay1>> day1map = new HashMap<>();
+            Map<String, Map<Long, ProEconEquipmentInfoDay2>> day2map = new HashMap<>();
+
+            QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windturbine_id", wtId).ge("record_date", beginDate)
+                    .le("record_date", endDate)
+                    .orderByAsc("record_date");;
+            List<ProEconEquipmentInfoDay1> wtday1ls = proEconEquipmentInfoDay1Service.list(queryWrapper);
+            if (!wtday1ls.isEmpty()) {
+                for (ProEconEquipmentInfoDay1 wtday1 : wtday1ls) {
+                    if (day1map.containsKey(wtday1.getWindturbineId())) {
+                        Map<Long, ProEconEquipmentInfoDay1> tempmap = day1map.get(wtday1.getWindturbineId());
+                        tempmap.put(wtday1.getRecordDate().getTime(), wtday1);
+                        day1map.put(wtId, tempmap);
+                    } else {
+                        Map<Long, ProEconEquipmentInfoDay1> tempmap = new HashMap<>();
+                        tempmap.put(wtday1.getRecordDate().getTime(), wtday1);
+                        day1map.put(wtId, tempmap);
+                    }
+                }
+            }
+            QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("windturbine_id", wtId).ge("record_date", beginDate)
+                    .le("record_date", endDate)
+                    .orderByAsc("record_date");;
+            List<ProEconEquipmentInfoDay2> wtday2ls = proEconEquipmentInfoDay2Service.list(queryWrapper2);
+            if (!wtday2ls.isEmpty()) {
+                for (ProEconEquipmentInfoDay2 wtday2 : wtday2ls) {
+                    if (day2map.containsKey(wtday2.getWindturbineId())) {
+                        Map<Long, ProEconEquipmentInfoDay2> tempmap = day2map.get(wtday2.getWindturbineId());
+                        tempmap.put(wtday2.getRecordDate().getTime(), wtday2);
+                        day2map.put(wtId, tempmap);
+                    } else {
+                        Map<Long, ProEconEquipmentInfoDay2> tempmap = new HashMap<>();
+                        tempmap.put(wtday2.getRecordDate().getTime(), wtday2);
+                        day2map.put(wtId, tempmap);
+                    }
+                }
+            }
+            QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper4 = new QueryWrapper<>();
+            queryWrapper4.eq("windturbine_id", wtId).ge("record_date", beginDate)
+                    .le("record_date", endDate)
+                    .orderByAsc("record_date");
+            List<ProEconEquipmentInfoDay4> wtday4ls = proEconEquipmentInfoDay4Service.list(queryWrapper4);
+            ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
+            ProBasicPowerstation wp = CacheContext.wpmap.get(wt.getWindpowerstationId());
+
+            if (StringUtils.notEmp(wtday2ls) && !wtday2ls.isEmpty()) {
+
+                for (ProEconEquipmentInfoDay2 wtd : wtday2ls) {
+
+                    SingleAnalysisVo vo = new SingleAnalysisVo();
+
+                    Calendar c = Calendar.getInstance();
+
+                    c.setTime(wtd.getRecordDate());
+                    int dayTimes = 24;//风机日历小时合计
+
+
+                    if (day1map.containsKey(wtd.getWindturbineId())) {
+                        Map<Long, ProEconEquipmentInfoDay1> map1 = day1map.get(wtd.getWindturbineId());
+                        if (map1.containsKey(wtd.getRecordDate().getTime())) {
+                            ProEconEquipmentInfoDay1 daypo = map1.get(wtd.getRecordDate().getTime());
+                            double fdl = null != daypo.getRfdl() ? daypo.getRfdl() : 0.0;//风机发电量合计
+                            if (CacheContext.modelMap.containsKey(wt.getModelId())) {
+                                ProEconEquipmentmodel model = CacheContext.modelMap.get(wt.getModelId());
+                                double lyxs = new BigDecimal(fdl).divide(new BigDecimal(model.getPowerProduction()), 2, RoundingMode.HALF_UP).doubleValue();
+                                vo.setLyxs(lyxs);
+                            }
+
+                            fdl = new BigDecimal(fdl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
+                            double fs = null != daypo.getRpjfs() ? daypo.getRpjfs() : 0.0;//风机平均风速
+                            vo.setFdl(StringUtils.round(fdl, 2));
+                            vo.setFs(StringUtils.round(fs, 2));
+                        }
+                    }
+
+                    double yxxs = null != wtd.getRyxxs() ? wtd.getRyxxs() : 0.0;//风机运行小时合计
+                    double gzxs = null != wtd.getRgztjxs() ? wtd.getRgztjxs() : 0.0;//风机故障小时合计
+                    double jxxs = null != wtd.getRjxtjxs() ? wtd.getRjxtjxs() : 0.0;//风机检修小时合计
+                    double tjxs = null != wtd.getRxdxs() ? wtd.getRxdxs() : 0.0;//风限电小时合计
+                    double zdxs = null != wtd.getRtxzdxs() ? wtd.getRtxzdxs() : 0.0;//风机中断小时合计
+
+                    vo.setWindPowerStationId(wt.getWindpowerstationId());
+                    vo.setWindPowerStationName(wp.getName());
+                    vo.setWindturbineName(wt.getName());
+                    vo.setWindturbineid(wt.getId());
+                    vo.setRecorddate(wtd.getRecordDate());
+
+
+                    vo.setYxxs(StringUtils.round(yxxs, 2));
+                    vo.setGzxs(StringUtils.round(gzxs, 2));
+                    vo.setJxxs(StringUtils.round(jxxs, 2));
+                    vo.setTjxs(StringUtils.round(tjxs, 2));
+                    vo.setZdxs(StringUtils.round(zdxs, 2));
+                    vo.setRlxs(StringUtils.round(dayTimes, 2));
+
+                    fdlfsls.add(vo);
+
+                }
+
+            }
+
+            if (StringUtils.notEmp(wtday1ls) && !wtday1ls.isEmpty()) {
+                for (ProEconEquipmentInfoDay1 wtd : wtday1ls) {
+                    SingleAnalysisVo vo = new SingleAnalysisVo();
+                    double gzss = null != wtd.getRgzssdl() ? wtd.getRgzssdl() : 0.0;//风机故障损失合计
+                    double jxss = null != wtd.getRjxssdl() ? wtd.getRjxssdl() : 0.0;//风机检修损失合计
+                    double xdss = null != wtd.getRxdtjssdl() ? wtd.getRxdtjssdl() : 0.0;//风机限电损失合计
+                    double xnss = null != wtd.getRxnssdl() ? wtd.getRxnssdl() : 0.0;//风机性能损失时合计
+                    double ycwsldwssdl = null != wtd.getRcwsldwssdl() ? wtd.getRcwsldwssdl() : 0.0;//场外受累电网损失电量
+                    double ycwsltqssdl = null != wtd.getRcwsltqssdl() ? wtd.getRcwsldwssdl() : 0.0;//场外受累天气损失电量
+                    double slss = StringUtils.round(ycwsldwssdl + ycwsltqssdl, 2);
+
+
+                    vo.setWindPowerStationId(wt.getWindpowerstationId());
+                    vo.setWindPowerStationName(wp.getName());
+                    vo.setWindturbineName(wt.getName());
+                    vo.setWindturbineid(wt.getId());
+                    vo.setRecorddate(wtd.getRecordDate());
+
+                    vo.setGzss(StringUtils.round(gzss, 2));
+                    vo.setJxss(StringUtils.round(jxss, 2));
+                    vo.setXdss(StringUtils.round(xdss, 2));
+                    vo.setXnss(StringUtils.round(xnss, 2));
+                    vo.setSlss(StringUtils.round(slss, 2));
+                    wsls.add(vo);
+                }
+
+            }
+
+
+            if (StringUtils.notEmp(wtday4ls) && !wtday4ls.isEmpty()) {
+
+                for (ProEconEquipmentInfoDay4 wtd : wtday4ls) {
+
+                    SingleAnalysisVo vo = new SingleAnalysisVo();
+
+                    vo.setRecorddate(wtd.getRecordDate());
+
+                    double jfsc = null != wtd.getRjfsc() ? wtd.getRjfsc() : 0.0;//静风时长
+                    double jfpl = new BigDecimal(jfsc).divide(new BigDecimal(24), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();//静风频率
+
+                    vo.setJfpl(StringUtils.round(jfpl, 2));
+                    if (day2map.containsKey(wtd.getWindturbineId())) {
+                        Map<Long, ProEconEquipmentInfoDay2> map2 = day2map.get(wtd.getWindturbineId());
+                        if (map2.containsKey(wtd.getRecordDate().getTime())) {
+                            ProEconEquipmentInfoDay2 daypo = map2.get(wtd.getRecordDate().getTime());
+                            vo.setTjxs(daypo.getRdjxsmx());
+                        }
+                    }
+
+                    vo.setWindPowerStationId(wt.getWindpowerstationId());
+                    vo.setWindPowerStationName(wp.getName());
+                    vo.setWindturbineName(wt.getName());
+                    vo.setWindturbineid(wt.getId());
+
+
+                    jfpldjsjls.add(vo);
+                }
+            }
+            map.put("ff", fdlfsls);//发电量和风速
+            map.put("ws", wsls);//五项损失,绑定五个
+            map.put("jd", jfpldjsjls);//静风频率和待机时间
+        }
+
+        List<TurbineInfoDay> turbineSingle = turbineInfoDayService.getTurbineSingleList(wtId, beginDate, endDate);
+        Map<Date, TurbineInfoDay> col= turbineSingle.stream().collect(Collectors.toMap(TurbineInfoDay::getRecordDate, Function.identity()));
+        List<SingleAnalysisVo> ff = map.get("ff").stream().collect(Collectors.toList());
+        List<SingleAnalysisVo> ws = map.get("ws").stream().collect(Collectors.toList());
+        List<SingleAnalysisVo> jd = map.get("jd").stream().collect(Collectors.toList());
+        ff.forEach(f -> {
+            TurbineInfoDay tb = col.get(f.getRecorddate());
+            f.setFdl(NumberUtil.round(tb.getRfdl() , 2).doubleValue());
+            f.setFs(NumberUtil.round(tb.getPjfs(), 2).doubleValue());
+        });
+        ws.forEach(w -> {
+            TurbineInfoDay tb = col.get(w.getRecorddate());
+            w.setSlss(NumberUtil.round(tb.getSlss(), 2).doubleValue());
+            w.setXnss(NumberUtil.round(tb.getXnss(), 2).doubleValue());
+            w.setXdss(NumberUtil.round(tb.getXdss(), 2).doubleValue());
+            w.setJxss(NumberUtil.round(tb.getJhjxss(), 2).doubleValue());
+            w.setGzss(NumberUtil.round(tb.getGzss(), 2).doubleValue());
+        });
+        jd.forEach(j -> {
+            TurbineInfoDay tb = col.get(j.getRecorddate());
+            j.setJfpl(NumberUtil.round(tb.getJfpl(), 2).doubleValue());
+            j.setDjxs(NumberUtil.round(tb.getDjMin() / 60, 2).doubleValue());
+        });
+
+        return map;
+    }
+
     public SingleAnalysisVo SingleAnalysisListByWtId(SingleAnalysisVo vo1, SingleAnalysisVo vo2) {
 
         SingleAnalysisVo vo = new SingleAnalysisVo();
@@ -1377,35 +1580,35 @@ public class SingleAnalysisService {
                 .apply("to_char(record_date,'YYYY-MM')='" + date + "'");
         List<TurbineInfoDay> list = turbineInfoDayService.list(qw);
         double rfdl = list.stream().mapToDouble(TurbineInfoDay::getRfdl).sum();
-        byzb.setFdl(NumberUtil.round(rfdl/1000,2).doubleValue());
+        byzb.setFdl(NumberUtil.round(rfdl / 1000, 2).doubleValue());
         double pjfs = list.stream().mapToDouble(TurbineInfoDay::getPjfs).average().orElse(0.0);
-        byzb.setFs(NumberUtil.round(pjfs,2).doubleValue());
+        byzb.setFs(NumberUtil.round(pjfs, 2).doubleValue());
         double gzss = list.stream().mapToDouble(TurbineInfoDay::getGzss).sum();
-        byzb.setGzss(NumberUtil.round(gzss/1000,2).doubleValue());
+        byzb.setGzss(NumberUtil.round(gzss / 1000, 2).doubleValue());
         double jhjxss = list.stream().mapToDouble(TurbineInfoDay::getJhjxss).sum();
-        byzb.setJxss(NumberUtil.round(jhjxss/1000,2).doubleValue());
+        byzb.setJxss(NumberUtil.round(jhjxss / 1000, 2).doubleValue());
         double xdss = list.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
-        byzb.setXdss(NumberUtil.round(xdss/1000,2).doubleValue());
+        byzb.setXdss(NumberUtil.round(xdss / 1000, 2).doubleValue());
         double xnss = list.stream().mapToDouble(TurbineInfoDay::getXnss).sum();
-        byzb.setXnss(NumberUtil.round(xnss/1000,2).doubleValue());
+        byzb.setXnss(NumberUtil.round(xnss / 1000, 2).doubleValue());
         double slss = list.stream().mapToDouble(TurbineInfoDay::getXnss).sum();
-        byzb.setSlss(NumberUtil.round(slss/1000,2).doubleValue());
+        byzb.setSlss(NumberUtil.round(slss / 1000, 2).doubleValue());
         double llfdl = list.stream().mapToDouble(TurbineInfoDay::getXnss).sum();
-        byzb.setLlfdl(NumberUtil.round(llfdl/1000,2).doubleValue());
+        byzb.setLlfdl(NumberUtil.round(llfdl / 1000, 2).doubleValue());
         double gzmin = list.stream().mapToDouble(TurbineInfoDay::getGzMin).sum();
-        byzb.setGzxs(NumberUtil.round(gzmin/60,2).doubleValue());
+        byzb.setGzxs(NumberUtil.round(gzmin / 60, 2).doubleValue());
         double jxmin = list.stream().mapToDouble(TurbineInfoDay::getJxMin).sum();
-        byzb.setJxxs(NumberUtil.round(jxmin/60,2).doubleValue());
+        byzb.setJxxs(NumberUtil.round(jxmin / 60, 2).doubleValue());
         double lxmin = list.stream().mapToDouble(TurbineInfoDay::getLxMin).sum();
-        byzb.setZdxs(NumberUtil.round(lxmin/60,2).doubleValue());
+        byzb.setZdxs(NumberUtil.round(lxmin / 60, 2).doubleValue());
         double yxmin = list.stream().mapToDouble(TurbineInfoDay::getYxMin).sum();
-        byzb.setYxxs(NumberUtil.round(yxmin/60,2).doubleValue());
+        byzb.setYxxs(NumberUtil.round(yxmin / 60, 2).doubleValue());
         double djmin = list.stream().mapToDouble(TurbineInfoDay::getDjMin).sum();
-        byzb.setDjxs(NumberUtil.round(djmin/60,2).doubleValue());
+        byzb.setDjxs(NumberUtil.round(djmin / 60, 2).doubleValue());
         double sblyxs = list.stream().mapToDouble(TurbineInfoDay::getLyxs).sum();
-        byzb.setLyxs(NumberUtil.round(sblyxs,2).doubleValue());
+        byzb.setLyxs(NumberUtil.round(sblyxs, 2).doubleValue());
         double sbklyl = list.stream().mapToDouble(TurbineInfoDay::getKlyl).average().orElse(0.0);
-        byzb.setSbklyl(NumberUtil.round(sbklyl,2).doubleValue());
+        byzb.setSbklyl(NumberUtil.round(sbklyl, 2).doubleValue());
         return byzb;
     }
 }