|
@@ -1,14 +1,9 @@
|
|
|
package com.gyee.frame.service.leaderboard;
|
|
|
|
|
|
import com.gyee.frame.common.spring.InitialRunner;
|
|
|
-import com.gyee.frame.model.auto.ModelpowerRd;
|
|
|
-import com.gyee.frame.model.auto.Windpowerstation;
|
|
|
-import com.gyee.frame.model.auto.Windturbinecurvefittingmonth;
|
|
|
-import com.gyee.frame.model.custom.StatisticalAnalysisRnewTopVo;
|
|
|
-import com.gyee.frame.model.custom.StatisticalAnalysisTopVo;
|
|
|
-import com.gyee.frame.service.ActivePowerDataService;
|
|
|
-import com.gyee.frame.service.WindturbinecurvefittingmonthService;
|
|
|
-import com.gyee.frame.service.WindturbineinfodayService;
|
|
|
+import com.gyee.frame.model.auto.*;
|
|
|
+import com.gyee.frame.model.custom.*;
|
|
|
+import com.gyee.frame.service.*;
|
|
|
import com.gyee.frame.util.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -26,7 +21,26 @@ public class LeaderboardService {
|
|
|
private WindturbinecurvefittingmonthService windturbinecurvefittingmonthService;
|
|
|
@Resource
|
|
|
private WindturbineinfodayService windturbineinfodayService;
|
|
|
+ @Resource
|
|
|
+ private Windturbineinfoday3Service windturbineinfoday3Service;
|
|
|
+ @Resource
|
|
|
+ private WarningInfoDayService warningInfoDayService;
|
|
|
+ @Resource
|
|
|
+ private WindturbinecurvefittingService windturbinecurvefittingService;
|
|
|
+ @Resource
|
|
|
+ private CurvefittingmainService curvefittingmainService;
|
|
|
+ @Resource
|
|
|
+ private CurvefittingmonthmainService curvefittingmonthmainService;
|
|
|
|
|
|
+ private final String SJBZ = "sjbz";
|
|
|
+ private final String SJZY = "sjzy";
|
|
|
+ private final String ZYBZ = "zybz";
|
|
|
+ private final String TB = "tb";
|
|
|
+ private final String HB = "hb";
|
|
|
+ private final String BG = "bg";
|
|
|
+
|
|
|
+ private String name1;
|
|
|
+ private String name2;
|
|
|
|
|
|
public List<StatisticalAnalysisTopVo> getRnewTopDate(String wpIps, Date beginDate, Date endDate) {
|
|
|
|
|
@@ -199,7 +213,7 @@ public class LeaderboardService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
- public List<StatisticalAnalysisTopVo> getWindturbineinfo(String wpIds, Date beginDate, Date endDate) {
|
|
|
+ public List<StatisticalAnalysisTopVo> totalPowerCapacityTopList(String wpIds, Date beginDate, Date endDate) {
|
|
|
List<StatisticalAnalysisTopVo> ls=new ArrayList<>();
|
|
|
|
|
|
if ( StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
|
|
@@ -230,4 +244,781 @@ public class LeaderboardService {
|
|
|
return ls;
|
|
|
}
|
|
|
|
|
|
+ public List<Windturbineinfoday3> utilizationList(Tablepar tablepar, String wpIds, Date beginDate, Date endDate, String type) {
|
|
|
+ List<Windturbineinfoday3> ls=new ArrayList<>();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(wpIds) && StringUtils.notEmp(type) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
|
|
|
+
|
|
|
+
|
|
|
+ ls = windturbineinfoday3Service.utilizationList(tablepar, wpIds, beginDate, endDate, type);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return ls;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<Windturbineinfoday3> lossList(Tablepar tablepar, String wpIds, Date beginDate, Date endDate, String type) {
|
|
|
+ List<Windturbineinfoday3> ls=new ArrayList<>();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(wpIds) && StringUtils.notEmp(type) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
|
|
|
+
|
|
|
+
|
|
|
+ ls = windturbineinfoday3Service.lossList(tablepar, wpIds, beginDate, endDate, type);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return ls;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<StatisticalAnalysisTopVo> loadfactortoplist(String wpIds, Date beginDate, Date endDate) {
|
|
|
+ List<StatisticalAnalysisTopVo> vos=new ArrayList<>();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
|
|
|
+ List<String> wpids=new ArrayList<>();
|
|
|
+ if(StringUtils.isNotEmpty(wpIds))
|
|
|
+ {
|
|
|
+ String[] wpid = wpIds.split(",");
|
|
|
+
|
|
|
+ for(String w:wpid)
|
|
|
+ {
|
|
|
+ wpids.add(w);
|
|
|
+ }
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ for(Windpowerstation wp:InitialRunner.wpls)
|
|
|
+ {
|
|
|
+ if(wp.getId().endsWith("FDC"))
|
|
|
+ {
|
|
|
+ wpids.add(wp.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ vos = windturbineinfodayService.getWindturbineinfo(wpids, beginDate, endDate);
|
|
|
+
|
|
|
+ if (!vos.isEmpty()) {
|
|
|
+ Map<String, Equipmentmodel> mlmap = InitialRunner.mlmap;
|
|
|
+ Map<String, Windturbine> wtmap = InitialRunner.wtmap;
|
|
|
+ for (StatisticalAnalysisTopVo vo : vos) {
|
|
|
+ if (StringUtils.notEmp(vo.getWindturbine()) && wtmap.containsKey(vo.getWindturbine())) {
|
|
|
+ Windturbine wt = wtmap.get(vo.getWindturbine());
|
|
|
+ if (StringUtils.notEmp(wt.getModelid()) && mlmap.containsKey(wt.getModelid())) {
|
|
|
+ Equipmentmodel ml = mlmap.get(wt.getModelid());
|
|
|
+ if (ml.getPowerproduction() != 0) {
|
|
|
+ BigDecimal b1 = new BigDecimal(vo.getGeneratingCapacity());
|
|
|
+ BigDecimal b2 = new BigDecimal(ml.getPowerproduction());
|
|
|
+
|
|
|
+ vo.setGeneratingCapacity(b1.divide(b2.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public List<StatisticalAnalysisWarningTopVo> getWarningTopDate(Tablepar tablepar,String type, Date beginDate, Date endDate) {
|
|
|
+ List<StatisticalAnalysisWarningTopVo> vos=new ArrayList<>();
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(type))
|
|
|
+ {
|
|
|
+ switch (type) {
|
|
|
+ case "1":
|
|
|
+ vos=warningInfoDayService.getWarningInfoDayByWarningid(tablepar,beginDate, endDate);
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ vos=warningInfoDayService.getWarningInfoDayByWarningClassify(tablepar,beginDate, endDate);
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ vos=warningInfoDayService.getWarningInfoDayByManufacturer(tablepar,beginDate, endDate);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+ public List<StatisticalAnalysisWarningTopVo> getWarningTopDatePercentage(String type, Date beginDate, Date endDate) {
|
|
|
+ List<StatisticalAnalysisWarningTopVo> vos=new ArrayList<>();
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(type))
|
|
|
+ {
|
|
|
+ switch (type) {
|
|
|
+ case "1":
|
|
|
+ vos=warningInfoDayService.getWarningInfoDayByWarningidPercentage(beginDate, endDate);
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ vos=warningInfoDayService.getWarningInfoDayByWarningClassifyPercentage(beginDate, endDate);
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ vos=warningInfoDayService.getWarningInfoDayByManufacturerPercentage(beginDate, endDate);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+ /*******************************************************************************************************************************************************/
|
|
|
+
|
|
|
+ public List<Curvefittingmain> curvefittingmainList(Tablepar tablepar, String wpId, Date recorddate) {
|
|
|
+
|
|
|
+ List<Curvefittingmain> list =new ArrayList<>();
|
|
|
+ List<String> wtIds=new ArrayList<>();
|
|
|
+ if(StringUtils.notEmp(wpId) && StringUtils.notEmp(recorddate))
|
|
|
+ {
|
|
|
+ List<Windturbine> wtls=InitialRunner.wp_wtmap.get(wpId);
|
|
|
+ for(Windturbine wt:wtls)
|
|
|
+ {
|
|
|
+ wtIds.add(wt.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ list =curvefittingmainService.getCurvefittingmainList(tablepar,wtIds,recorddate);
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, Object> getCurvechatAjax(String type,String wtId, Date recorddate) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(type) && StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate))
|
|
|
+ {
|
|
|
+ List<DataVo> datavos = new ArrayList<DataVo>();
|
|
|
+ List<Windturbinecurvefitting> wcls = windturbinecurvefittingService.comparechatAjax(wtId, recorddate);
|
|
|
+ Map<String, Windturbine> wtmap = InitialRunner.wtmap;
|
|
|
+ Map<String, Map<String, ModelPower>> modelPowermap = InitialRunner.modelPowermap;
|
|
|
+ Map<String, ModelPower> modelmap = null;
|
|
|
+ if (wtmap.containsKey(wtId)) {
|
|
|
+ Windturbine wt = wtmap.get(wtId);
|
|
|
+ if (modelPowermap.containsKey(wt.getModelid())) {
|
|
|
+ modelmap = modelPowermap.get(wt.getModelid());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!wcls.isEmpty()) {
|
|
|
+ Collections.sort(wcls, new Comparator<Windturbinecurvefitting>() {
|
|
|
+ public int compare(Windturbinecurvefitting arg0, Windturbinecurvefitting arg1) {
|
|
|
+ return arg0.getSpeed().compareTo(arg1.getSpeed());
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ for (Windturbinecurvefitting wc : wcls) {
|
|
|
+
|
|
|
+ DataVo vo = new DataVo();
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ vo.setValue1(wc.getSpeed());
|
|
|
+ if (StringUtils.notEmp(type) && type.equals(SJBZ) && null != modelmap) {
|
|
|
+ if (modelmap.containsKey(String.valueOf(wc.getSpeed()))) {
|
|
|
+ ModelPower mp = modelmap.get(String.valueOf(wc.getSpeed()));
|
|
|
+ vo.setValue3(mp.getEnsurepower());
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(SJZY)) {
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+ vo.setValue3(wc.getOptimalpower());
|
|
|
+
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(ZYBZ) && null != modelmap) {
|
|
|
+ if (modelmap.containsKey(String.valueOf(wc.getSpeed()))) {
|
|
|
+ ModelPower mp = modelmap.get(String.valueOf(wc.getSpeed()));
|
|
|
+ vo.setValue3(mp.getEnsurepower());
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ vo.setValue2(wc.getOptimalpower());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ datavos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ curvechat(type);
|
|
|
+
|
|
|
+ map.put("datas", datavos);
|
|
|
+ map.put("name1", name1);
|
|
|
+ map.put("name2", name2);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public Map<String, Object> curvechatAjaxtb(String type,String wtId, Date recorddate) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(type) && StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate))
|
|
|
+ {
|
|
|
+ List<DataVo> datavos = new ArrayList<DataVo>();
|
|
|
+ Map<Double, Double> speedmap = new HashMap<Double, Double>();
|
|
|
+ List<Windturbinecurvefitting> thisdayls = windturbinecurvefittingService.comparechatAjax(wtId,recorddate);
|
|
|
+
|
|
|
+ // 去年统计指标
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ cal.setTime(recorddate);
|
|
|
+ cal.add(Calendar.YEAR, -1);
|
|
|
+
|
|
|
+ List<Windturbinecurvefitting> lastyearls = windturbinecurvefittingService.comparechatAjax(wtId,cal.getTime());
|
|
|
+
|
|
|
+ if (!lastyearls.isEmpty()) {
|
|
|
+
|
|
|
+ for (Windturbinecurvefitting wc : lastyearls) {
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ speedmap.put(wc.getSpeed(), wc.getActualpower());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!thisdayls.isEmpty()) {
|
|
|
+ Collections.sort(thisdayls, new Comparator<Windturbinecurvefitting>() {
|
|
|
+ public int compare(Windturbinecurvefitting arg0, Windturbinecurvefitting arg1) {
|
|
|
+ return arg0.getSpeed().compareTo(arg1.getSpeed());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ for (Windturbinecurvefitting wc : thisdayls) {
|
|
|
+
|
|
|
+ DataVo vo = new DataVo();
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ vo.setValue1(wc.getSpeed());
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+
|
|
|
+ if (speedmap.containsKey(wc.getSpeed())) {
|
|
|
+ vo.setValue3(speedmap.get(wc.getSpeed()));
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ datavos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ curvechat(type);
|
|
|
+
|
|
|
+ map.put("datas", datavos);
|
|
|
+ map.put("name1", name1);
|
|
|
+ map.put("name2", name2);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, Object> curvechatAjaxhb(String type,String wtId, Date recorddate) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(type) && StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate))
|
|
|
+ {
|
|
|
+ List<DataVo> datavos = new ArrayList<DataVo>();
|
|
|
+ Map<Double, Double> speedmap = new HashMap<Double, Double>();
|
|
|
+ List<Windturbinecurvefitting> thisdayls = windturbinecurvefittingService.comparechatAjax(wtId,recorddate);
|
|
|
+
|
|
|
+ // 上个月统计指标
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ cal.setTime(recorddate);
|
|
|
+ cal.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
+
|
|
|
+ List<Windturbinecurvefitting> lastyearls = windturbinecurvefittingService.comparechatAjax(wtId,cal.getTime());
|
|
|
+
|
|
|
+ if (!lastyearls.isEmpty()) {
|
|
|
+
|
|
|
+ for (Windturbinecurvefitting wc : lastyearls) {
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ speedmap.put(wc.getSpeed(), wc.getActualpower());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!thisdayls.isEmpty()) {
|
|
|
+ Collections.sort(thisdayls, new Comparator<Windturbinecurvefitting>() {
|
|
|
+ public int compare(Windturbinecurvefitting arg0, Windturbinecurvefitting arg1) {
|
|
|
+ return arg0.getSpeed().compareTo(arg1.getSpeed());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ for (Windturbinecurvefitting wc : thisdayls) {
|
|
|
+
|
|
|
+ DataVo vo = new DataVo();
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ vo.setValue1(wc.getSpeed());
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+
|
|
|
+ if (speedmap.containsKey(wc.getSpeed())) {
|
|
|
+ vo.setValue3(speedmap.get(wc.getSpeed()));
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ datavos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ curvechat(type);
|
|
|
+
|
|
|
+ map.put("datas", datavos);
|
|
|
+ map.put("name1", name1);
|
|
|
+ map.put("name2", name2);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, Object> curvechatAjaxbg(String type,String wtId, Date recorddate) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(type) && StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate))
|
|
|
+ {
|
|
|
+ List<DataVo> datavos = new ArrayList<DataVo>();
|
|
|
+ Map<Double, Double> speedmap = new HashMap<Double, Double>();
|
|
|
+ List<Windturbinecurvefitting> thisdayls = windturbinecurvefittingService.comparechatAjax(wtId,recorddate);
|
|
|
+
|
|
|
+ // 标杆风机指标
|
|
|
+ Windturbine wt = InitialRunner.wtmap.get(wtId);
|
|
|
+ String stid = wt.getStandardid();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(stid))
|
|
|
+ {
|
|
|
+ List<Windturbinecurvefitting> stmonthls = windturbinecurvefittingService.comparechatAjax(wtId,recorddate);
|
|
|
+
|
|
|
+ if (null != stmonthls && !stmonthls.isEmpty()) {
|
|
|
+
|
|
|
+ if (!stmonthls.isEmpty()) {
|
|
|
+
|
|
|
+ for (Windturbinecurvefitting wc : stmonthls) {
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ speedmap.put(wc.getSpeed(), wc.getActualpower());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!thisdayls.isEmpty()) {
|
|
|
+ Collections.sort(thisdayls, new Comparator<Windturbinecurvefitting>() {
|
|
|
+ public int compare(Windturbinecurvefitting arg0, Windturbinecurvefitting arg1) {
|
|
|
+ return arg0.getSpeed().compareTo(arg1.getSpeed());
|
|
|
+ /*
|
|
|
+ * int result = 0; if (arg0.getSpeed() >
|
|
|
+ * arg1.getSpeed()) result = 1; else result = 0; return
|
|
|
+ * result;
|
|
|
+ */
|
|
|
+ }
|
|
|
+ });
|
|
|
+ for (Windturbinecurvefitting wc : thisdayls) {
|
|
|
+
|
|
|
+ DataVo vo = new DataVo();
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ vo.setValue1(wc.getSpeed());
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+
|
|
|
+ if (speedmap.containsKey(wc.getSpeed())) {
|
|
|
+ vo.setValue3(speedmap.get(wc.getSpeed()));
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ datavos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ curvechat(type);
|
|
|
+
|
|
|
+ map.put("datas", datavos);
|
|
|
+ map.put("name1", name1);
|
|
|
+ map.put("name2", name2);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void curvechat(String type) {
|
|
|
+ if (StringUtils.notEmp(type) && type.equals(SJBZ)) {
|
|
|
+
|
|
|
+ name1 = "实际功率";
|
|
|
+ name2 = "保证功率";
|
|
|
+
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(SJZY)) {
|
|
|
+
|
|
|
+ name1 = "实际功率";
|
|
|
+ name2 = "最优功率";
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(ZYBZ)) {
|
|
|
+
|
|
|
+ name1 = "最优功率";
|
|
|
+ name2 = "保证功率";
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(TB)) {
|
|
|
+
|
|
|
+ name1 = "本日实际功率";
|
|
|
+ name2 = "去年同期实际功率";
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(HB)) {
|
|
|
+
|
|
|
+ name1 = "本日实际功率";
|
|
|
+ name2 = "上日实际功率";
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(BG)) {
|
|
|
+
|
|
|
+ name1 = "本日实际功率";
|
|
|
+ name2 = "标杆实际功率";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /*******************************************************************************************************************************************************/
|
|
|
+
|
|
|
+ public List<Curvefittingmonthmain> curvefittingmonthmainList(Tablepar tablepar, String wpId, String year,String month) {
|
|
|
+
|
|
|
+ List<Curvefittingmonthmain> list =new ArrayList<>();
|
|
|
+ List<String> wtIds=new ArrayList<>();
|
|
|
+ if(StringUtils.notEmp(wpId) && StringUtils.notEmp(year) && StringUtils.notEmp(month))
|
|
|
+ {
|
|
|
+ List<Windturbine> wtls=InitialRunner.wp_wtmap.get(wpId);
|
|
|
+ for(Windturbine wt:wtls)
|
|
|
+ {
|
|
|
+ wtIds.add(wt.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ list =curvefittingmonthmainService.getCurvefittingmonthmainList(tablepar,wtIds,year,month);
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+
|
|
|
+ }
|
|
|
+ public Map<String, Object> curveMonthchatAjax(String type,String wtId, String year,String month) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(type) && StringUtils.notEmp(wtId) && StringUtils.notEmp(year) && StringUtils.notEmp(month))
|
|
|
+ {
|
|
|
+ List<DataVo> datavos = new ArrayList<DataVo>();
|
|
|
+ List<Windturbinecurvefittingmonth> wcls = windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(wtId, year,month);
|
|
|
+ Map<String, Windturbine> wtmap = InitialRunner.wtmap;
|
|
|
+ Map<String, Map<String, ModelPower>> modelPowermap = InitialRunner.modelPowermap;
|
|
|
+
|
|
|
+ Map<String, ModelPower> modelmap = null;
|
|
|
+ if (wtmap.containsKey(wtId)) {
|
|
|
+ Windturbine wt = wtmap.get(wtId);
|
|
|
+ if (modelPowermap.containsKey(wt.getModelid())) {
|
|
|
+ modelmap = modelPowermap.get(wt.getModelid());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!wcls.isEmpty()) {
|
|
|
+ Collections.sort(wcls, new Comparator<Windturbinecurvefittingmonth>() {
|
|
|
+ public int compare(Windturbinecurvefittingmonth arg0, Windturbinecurvefittingmonth arg1) {
|
|
|
+ return arg0.getSpeed().compareTo(arg1.getSpeed());
|
|
|
+ /*
|
|
|
+ * int result = 0; if (arg0.getSpeed() >
|
|
|
+ * arg1.getSpeed()) result = 1; else result = 0; return
|
|
|
+ * result;
|
|
|
+ */
|
|
|
+ }
|
|
|
+ });
|
|
|
+ for (Windturbinecurvefittingmonth wc : wcls) {
|
|
|
+ // private final String SJBZ ="sjbz" ;
|
|
|
+ // private final String SJZY ="sjzy" ;
|
|
|
+ // private final String ZYBZ ="zybz" ;
|
|
|
+ DataVo vo = new DataVo();
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ vo.setValue1(wc.getSpeed());
|
|
|
+ if (StringUtils.notEmp(type) && type.equals(SJBZ) && null != modelmap) {
|
|
|
+ if (modelmap.containsKey(String.valueOf(wc.getSpeed()))) {
|
|
|
+ ModelPower mp = modelmap.get(String.valueOf(wc.getSpeed()));
|
|
|
+ vo.setValue3(mp.getEnsurepower());
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+ name1 = "实际功率";
|
|
|
+ name2 = "保证功率";
|
|
|
+
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(SJZY)) {
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+ vo.setValue3(wc.getOptimalpower());
|
|
|
+ name1 = "实际功率";
|
|
|
+ name2 = "最优功率";
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(ZYBZ) && null != modelmap) {
|
|
|
+ if (modelmap.containsKey(String.valueOf(wc.getSpeed()))) {
|
|
|
+ ModelPower mp = modelmap.get(String.valueOf(wc.getSpeed()));
|
|
|
+ vo.setValue3(mp.getEnsurepower());
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ vo.setValue2(wc.getOptimalpower());
|
|
|
+
|
|
|
+ name1 = "最优功率";
|
|
|
+ name2 = "保证功率";
|
|
|
+ }
|
|
|
+
|
|
|
+ datavos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ curvemonthchat(type);
|
|
|
+
|
|
|
+ map.put("datas", datavos);
|
|
|
+ map.put("name1", name1);
|
|
|
+ map.put("name2", name2);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public Map<String, Object> curveMonthchatAjaxtb(String type,String wtId, String year,String month) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(type) && StringUtils.notEmp(wtId) && StringUtils.notEmp(year) && StringUtils.notEmp(month))
|
|
|
+ {
|
|
|
+ List<DataVo> datavos = new ArrayList<DataVo>();
|
|
|
+ Map<Double, Double> speedmap = new HashMap<Double, Double>();
|
|
|
+ List<Windturbinecurvefittingmonth> thismonthls = windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(wtId, year,month);
|
|
|
+
|
|
|
+ // 去年统计指标
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ cal.set(Calendar.YEAR,Integer.valueOf(year));
|
|
|
+ cal.set(Calendar.MONTH,Integer.valueOf(month)-1);
|
|
|
+ cal.add(Calendar.YEAR, -1);
|
|
|
+
|
|
|
+ String lastyear=String.valueOf(cal.get(Calendar.YEAR));
|
|
|
+
|
|
|
+ List<Windturbinecurvefittingmonth> lastyearls =windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(wtId, lastyear,month);
|
|
|
+
|
|
|
+ if (!lastyearls.isEmpty()) {
|
|
|
+
|
|
|
+ for (Windturbinecurvefittingmonth wc : lastyearls) {
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ speedmap.put(wc.getSpeed(), wc.getActualpower());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!thismonthls.isEmpty()) {
|
|
|
+ Collections.sort(thismonthls, new Comparator<Windturbinecurvefittingmonth>() {
|
|
|
+ public int compare(Windturbinecurvefittingmonth arg0, Windturbinecurvefittingmonth arg1) {
|
|
|
+ return arg0.getSpeed().compareTo(arg1.getSpeed());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ for (Windturbinecurvefittingmonth wc : thismonthls) {
|
|
|
+
|
|
|
+ DataVo vo = new DataVo();
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ vo.setValue1(wc.getSpeed());
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+ name1 = "本月实际功率";
|
|
|
+ name2 = "去年同期实际功率";
|
|
|
+ if (speedmap.containsKey(wc.getSpeed())) {
|
|
|
+ vo.setValue3(speedmap.get(wc.getSpeed()));
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ datavos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ curvemonthchat(type);
|
|
|
+
|
|
|
+ map.put("datas", datavos);
|
|
|
+ map.put("name1", name1);
|
|
|
+ map.put("name2", name2);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, Object> curveMonthchatAjaxhb(String type,String wtId, String year,String month) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(type) && StringUtils.notEmp(wtId) && StringUtils.notEmp(year) && StringUtils.notEmp(month))
|
|
|
+ {
|
|
|
+ List<DataVo> datavos = new ArrayList<DataVo>();
|
|
|
+ Map<Double, Double> speedmap = new HashMap<Double, Double>();
|
|
|
+ List<Windturbinecurvefittingmonth> thismonthls = windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(wtId, year,month);
|
|
|
+
|
|
|
+ // 上个月统计指标
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ cal.set(Calendar.YEAR,Integer.valueOf(year));
|
|
|
+ cal.set(Calendar.MONTH,Integer.valueOf(month)-1);
|
|
|
+ cal.add(Calendar.MONTH, -1);
|
|
|
+
|
|
|
+ String lastyearmonth=String.valueOf(cal.get(Calendar.MONTH));
|
|
|
+
|
|
|
+ List<Windturbinecurvefittingmonth> lastmonthls =windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(wtId, year,lastyearmonth);
|
|
|
+
|
|
|
+
|
|
|
+ if (!lastmonthls.isEmpty()) {
|
|
|
+
|
|
|
+ for (Windturbinecurvefittingmonth wc : lastmonthls) {
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ speedmap.put(wc.getSpeed(), wc.getActualpower());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!thismonthls.isEmpty()) {
|
|
|
+ Collections.sort(thismonthls, new Comparator<Windturbinecurvefittingmonth>() {
|
|
|
+ public int compare(Windturbinecurvefittingmonth arg0, Windturbinecurvefittingmonth arg1) {
|
|
|
+ // 修改横轴排序
|
|
|
+ return arg0.getSpeed().compareTo(arg1.getSpeed());
|
|
|
+ /*
|
|
|
+ * int result = 0; if (arg0.getSpeed() >
|
|
|
+ * arg1.getSpeed()) result = 1; else result = 0; return
|
|
|
+ * result;
|
|
|
+ */
|
|
|
+ }
|
|
|
+ });
|
|
|
+ for (Windturbinecurvefittingmonth wc : thismonthls) {
|
|
|
+
|
|
|
+ DataVo vo = new DataVo();
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ vo.setValue1(wc.getSpeed());
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+ name1 = "本月实际功率";
|
|
|
+ name2 = "上月实际功率";
|
|
|
+ if (speedmap.containsKey(wc.getSpeed())) {
|
|
|
+ vo.setValue3(speedmap.get(wc.getSpeed()));
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ datavos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ curvemonthchat(type);
|
|
|
+ map.put("datas", datavos);
|
|
|
+ map.put("name1", name1);
|
|
|
+ map.put("name2", name2);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, Object> curveMonthchatAjaxbg(String type,String wtId, String year,String month) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(type) && StringUtils.notEmp(wtId) && StringUtils.notEmp(year) && StringUtils.notEmp(month))
|
|
|
+ {
|
|
|
+ List<DataVo> datavos = new ArrayList<DataVo>();
|
|
|
+ Map<Double, Double> speedmap = new HashMap<Double, Double>();
|
|
|
+ List<Windturbinecurvefittingmonth> thismonthls = windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(wtId, year,month);
|
|
|
+
|
|
|
+ // 标杆风机指标
|
|
|
+ Windturbine wt = InitialRunner.wtmap.get(wtId);
|
|
|
+ String stid = wt.getStandardid();
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(stid))
|
|
|
+ {
|
|
|
+ List<Windturbinecurvefittingmonth> stmonthls = windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(stid, year,month);
|
|
|
+
|
|
|
+ if (null != stmonthls && !stmonthls.isEmpty()) {
|
|
|
+
|
|
|
+ if (!stmonthls.isEmpty()) {
|
|
|
+
|
|
|
+ for (Windturbinecurvefittingmonth wc : stmonthls) {
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ speedmap.put(wc.getSpeed(), wc.getActualpower());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!thismonthls.isEmpty()) {
|
|
|
+ Collections.sort(thismonthls, new Comparator<Windturbinecurvefittingmonth>() {
|
|
|
+ public int compare(Windturbinecurvefittingmonth arg0, Windturbinecurvefittingmonth arg1) {
|
|
|
+ return arg0.getSpeed().compareTo(arg1.getSpeed());
|
|
|
+ /*
|
|
|
+ * int result = 0; if (arg0.getSpeed() >
|
|
|
+ * arg1.getSpeed()) result = 1; else result = 0; return
|
|
|
+ * result;
|
|
|
+ */
|
|
|
+ }
|
|
|
+ });
|
|
|
+ for (Windturbinecurvefittingmonth wc : thismonthls) {
|
|
|
+
|
|
|
+ DataVo vo = new DataVo();
|
|
|
+ int c = (int) wc.getSpeed().intValue();
|
|
|
+ if (c == wc.getSpeed()) {
|
|
|
+ vo.setValue1(wc.getSpeed());
|
|
|
+ vo.setValue2(wc.getActualpower());
|
|
|
+ name1 = "本月实际功率";
|
|
|
+ name2 = "标杆实际功率";
|
|
|
+ if (speedmap.containsKey(wc.getSpeed())) {
|
|
|
+ vo.setValue3(speedmap.get(wc.getSpeed()));
|
|
|
+ } else {
|
|
|
+ vo.setValue3(0.0);
|
|
|
+ }
|
|
|
+ datavos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ curvemonthchat(type);
|
|
|
+
|
|
|
+ map.put("datas", datavos);
|
|
|
+ map.put("name1", name1);
|
|
|
+ map.put("name2", name2);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void curvemonthchat(String type) {
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(type) && type.equals(SJBZ)) {
|
|
|
+
|
|
|
+ name1 = "实际功率";
|
|
|
+ name2 = "保证功率";
|
|
|
+
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(SJZY)) {
|
|
|
+
|
|
|
+ name1 = "实际功率";
|
|
|
+ name2 = "最优功率";
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(ZYBZ)) {
|
|
|
+
|
|
|
+ name1 = "最优功率";
|
|
|
+ name2 = "保证功率";
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(TB)) {
|
|
|
+
|
|
|
+ name1 = "本月实际功率";
|
|
|
+ name2 = "去年同期实际功率";
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(HB)) {
|
|
|
+
|
|
|
+ name1 = "本月实际功率";
|
|
|
+ name2 = "上月实际功率";
|
|
|
+ } else if (StringUtils.notEmp(type) && type.equals(BG)) {
|
|
|
+
|
|
|
+ name1 = "本月实际功率";
|
|
|
+ name2 = "标杆实际功率";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|