|
@@ -1,391 +1,367 @@
|
|
|
package com.gyee.frame.service.app.index;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.gyee.frame.common.Constants;
|
|
|
-import com.gyee.frame.common.feign.RemoteServiceBuilder;
|
|
|
+import com.gyee.frame.common.conf.redis.CacheContext;
|
|
|
import com.gyee.frame.common.spring.Constant;
|
|
|
import com.gyee.frame.common.spring.InitialRunner;
|
|
|
-import com.gyee.frame.model.auto.WindPowerStationTestingPoint2;
|
|
|
-import com.gyee.frame.model.auto.Windpowerinfoday;
|
|
|
-import com.gyee.frame.model.auto.Windpowerstation;
|
|
|
-import com.gyee.frame.model.auto.WpMttrAndMtbMonth;
|
|
|
+import com.gyee.frame.model.auto.*;
|
|
|
+import com.gyee.frame.model.custom.DNAVal;
|
|
|
import com.gyee.frame.model.custom.PointData;
|
|
|
-import com.gyee.frame.model.enumeration.Messagetype;
|
|
|
-import com.gyee.frame.netty.websocket.util.SocketToolService;
|
|
|
-import com.gyee.frame.service.*;
|
|
|
+import com.gyee.frame.service.ProjectplanService;
|
|
|
+import com.gyee.frame.service.WindpowerinfodayService;
|
|
|
+import com.gyee.frame.util.DateUtils;
|
|
|
import com.gyee.frame.util.RealTimeDataBaseFactory;
|
|
|
import com.gyee.frame.util.StringUtils;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
+import java.text.NumberFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * 首页指标数据
|
|
|
+ * app 首页 大屏数据大致相同
|
|
|
*/
|
|
|
-@Slf4j
|
|
|
@Service
|
|
|
-public class IndexService extends SocketToolService {
|
|
|
+public class IndexService {
|
|
|
|
|
|
@Resource
|
|
|
private ProjectplanService projectplanService;
|
|
|
@Resource
|
|
|
- private WindpowerinfodayService windpowerinfodayService;
|
|
|
- @Resource
|
|
|
- private RealTimeDataBaseFactory mongodb;
|
|
|
- @Resource
|
|
|
- private MttrAndMtbfService mttrAndMtbfService;
|
|
|
- @Resource
|
|
|
- private FocastpowerService focastpowerService;
|
|
|
- @Resource
|
|
|
- private WindPowerstationTestingPointService windPowerstationTestingPoint2Service;
|
|
|
- @Resource
|
|
|
- private RemoteServiceBuilder remoteService;
|
|
|
- @Resource
|
|
|
- private WpMttrAndMtbMonthService wpMttrAndMtbMonthService;
|
|
|
+ RealTimeDataBaseFactory mongodb;
|
|
|
|
|
|
- private static int decimal_digit = 2;
|
|
|
+ private final long day_time = 24 * 60 * 60 * 1000;
|
|
|
|
|
|
/**
|
|
|
- * 首页 安全天数、发电量...
|
|
|
+ * 获取横屏数据
|
|
|
+ * @return
|
|
|
*/
|
|
|
- public void index_target_comprehensive_indicators() {
|
|
|
+ public Map<String, Object> list() throws Exception {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ Map<String, Object> mapgs = new HashMap<>(); // 汇总
|
|
|
+ Map<String, Object> mapfd = new HashMap<>(); // 风电
|
|
|
+ Map<String, Object> mapgf = new HashMap<>(); // 光伏
|
|
|
Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
|
|
|
- List<Windpowerstation> wpls = new ArrayList<>();
|
|
|
- for (Windpowerstation wp : InitialRunner.wpls) {
|
|
|
- wpls.add(wp);
|
|
|
- }
|
|
|
|
|
|
- double ycfdlall = 0.0;
|
|
|
-
|
|
|
- Windpowerstation windpowerstationAll = new Windpowerstation();
|
|
|
- windpowerstationAll.setId("0");
|
|
|
- wpls.add(windpowerstationAll);
|
|
|
- Map<String, Map<String, Object>> windpowerstationpointDataMap = new HashMap();
|
|
|
-
|
|
|
- for (Windpowerstation windpowerstation : wpls) {
|
|
|
- Map<String, Object> pointDataMap = new HashMap();
|
|
|
- double rfdl = 0;
|
|
|
- double yfdl = 0;
|
|
|
- double nfdl = 0;
|
|
|
- double aqts = 0;
|
|
|
- double swdl = 0;
|
|
|
- double ycfdl = 0;
|
|
|
- double zjrl = 0;
|
|
|
- PointData swdl_real = new PointData();
|
|
|
- PointData aqts_real = new PointData();
|
|
|
- PointData zjrl_real = new PointData();
|
|
|
- PointData ycfdl_real = new PointData();
|
|
|
- PointData rfdl_real = new PointData();
|
|
|
- PointData yfdl_real = new PointData();
|
|
|
- PointData nfdl_real = new PointData();
|
|
|
- try {
|
|
|
- //日发电量
|
|
|
- rfdl_real = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_RFDL).getCode());
|
|
|
- rfdl = new BigDecimal(rfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //月发电量
|
|
|
- yfdl_real = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_YFDL).getCode());
|
|
|
- yfdl = new BigDecimal(yfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //年发电量
|
|
|
- nfdl_real = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_NFDL).getCode());
|
|
|
- nfdl = new BigDecimal(nfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //安全天数
|
|
|
- aqts_real = mongodb.create().getRealData(InitialRunner.stationPointmap.get("0").get(Constant.TPOINT_AQTS).getCode());
|
|
|
- aqts = new BigDecimal(aqts_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //上网电量
|
|
|
- swdl_real = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_SWDL).getCode());
|
|
|
- swdl = new BigDecimal(swdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //装机容量
|
|
|
- if (windpowerstation.getCapacity() == null) {
|
|
|
- for (Windpowerstation windpowerstationinner : InitialRunner.wpallls) {
|
|
|
- zjrl = zjrl + windpowerstationinner.getCapacity();
|
|
|
- }
|
|
|
- } else {
|
|
|
- zjrl = windpowerstation.getCapacity();
|
|
|
- }
|
|
|
-
|
|
|
- //预测电量
|
|
|
- if (!windpowerstation.getId().equals("0")){
|
|
|
- JSONObject json = remoteService.service().getPredictDL(Integer.valueOf(Constants.mapStation.get(windpowerstation.getId())));
|
|
|
- JSONArray array = ((JSONObject) json.getJSONObject("data").getJSONArray("dataFormatList").get(1)).getJSONArray("data");
|
|
|
- ycfdl = (double) array.get(array.size() - 1);
|
|
|
- ycfdl = new BigDecimal(ycfdl).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
- ycfdlall += ycfdl;
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- System.out.println(e.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- pointDataMap.put("rfdl", rfdl);
|
|
|
- pointDataMap.put("rfdl_real", rfdl_real);
|
|
|
- pointDataMap.put("yfdl", yfdl);
|
|
|
- pointDataMap.put("yfdl_real", yfdl_real);
|
|
|
- pointDataMap.put("nfdl", nfdl);
|
|
|
- pointDataMap.put("nfdl_real", nfdl_real);
|
|
|
- pointDataMap.put("aqts", aqts);
|
|
|
- pointDataMap.put("aqts_real", aqts_real);
|
|
|
- pointDataMap.put("swdl", swdl);
|
|
|
- pointDataMap.put("swdl_real", swdl_real);
|
|
|
- pointDataMap.put("ycfdl", ycfdl);
|
|
|
- pointDataMap.put("ycfdl_real", ycfdl_real);
|
|
|
- pointDataMap.put("zjrl", zjrl);
|
|
|
- pointDataMap.put("zjrl_real", zjrl_real);
|
|
|
-
|
|
|
- windpowerstationpointDataMap.put(windpowerstation.getId(), pointDataMap);
|
|
|
+ Double zjrl = 0.0;
|
|
|
+ Double fdzjrl = 0.0;
|
|
|
+ Double gfzjrl = 0.0;
|
|
|
+
|
|
|
+ List<Windpowerstation> wpList = InitialRunner.wpallls;
|
|
|
+ for (Windpowerstation wp : wpList){
|
|
|
+ zjrl += wp.getCapacity().doubleValue();
|
|
|
+ if (wp.getId().endsWith("FDC"))
|
|
|
+ fdzjrl += wp.getCapacity().doubleValue();
|
|
|
+ else
|
|
|
+ gfzjrl += wp.getCapacity().doubleValue();
|
|
|
}
|
|
|
|
|
|
- //由于预测发电量不能一次性读取全部,故相加替换
|
|
|
- windpowerstationpointDataMap.get("0").replace("ycfdl", ycfdlall);
|
|
|
-
|
|
|
- this.pushToWeb("pageNumber_6", "functionNumber_1", "all", windpowerstationpointDataMap, Messagetype.JSONOBJECT);
|
|
|
+ NumberFormat format = NumberFormat.getNumberInstance();
|
|
|
+ format.setMaximumFractionDigits(0);
|
|
|
+
|
|
|
+ mapgs.put("zjrl", Integer.valueOf(format.format(zjrl)));
|
|
|
+ mapfd.put("fdzjrl",Integer.valueOf(format.format(fdzjrl)));
|
|
|
+ mapgf.put("gfzjrl",Integer.valueOf(format.format(gfzjrl)));
|
|
|
+
|
|
|
+ /********************************* 公司汇总数据 start **/
|
|
|
+ double zgl = mongodb.create().getRealData(Constant.JSFW_SSSSZGL).getPointValueInDouble();// 总功率
|
|
|
+ int aqts = (int) mongodb.create().getRealData(Constant.CALC_TIANSHU).getPointValueInDouble();// 安全天数
|
|
|
+ double rfdl = mongodb.create().getRealData(Constant.JSFW_SSRFDLB).getPointValueInDouble();// 日累计电量
|
|
|
+ double yfdl = mongodb.create().getRealData(Constant.JSFW_SSYFDLB).getPointValueInDouble();// 月累计电量
|
|
|
+ double nfdl = mongodb.create().getRealData(Constant.JSFW_SSNFDLB).getPointValueInDouble();// 年发电量
|
|
|
+ double swdl = mongodb.create().getRealData(Constant.JSFW_SSSWDLB).getPointValueInDouble();// 上网电量
|
|
|
+ mapgs.put("zgl",zgl);
|
|
|
+ mapgs.put("aqts",aqts);
|
|
|
+ mapgs.put("rfdl",rfdl);
|
|
|
+ mapgs.put("yfdl",yfdl);
|
|
|
+ mapgs.put("nfdl",nfdl);
|
|
|
+ mapgs.put("swdl",swdl);
|
|
|
+
|
|
|
+ /** 计划发电量 **/
|
|
|
+ ProjectplanExample example = new ProjectplanExample();
|
|
|
+ String year = String.valueOf(DateUtils.getYear(new Date()));
|
|
|
+ example.createCriteria().andYearEqualTo(year)
|
|
|
+ .andMonthIsNotNull();
|
|
|
+ List<Projectplan> projectplanList = projectplanService.selectByExample(example);
|
|
|
+ double njhdl = projectplanList.stream().mapToDouble(p -> Double.valueOf(p.getGeneratingcapacity())).sum();
|
|
|
+ double yjhdl = projectplanList.stream().filter(i->Integer.parseInt(i.getMonth()) == DateUtils.getMonth(new Date()))
|
|
|
+ .mapToDouble(p -> Double.valueOf(p.getGeneratingcapacity())).sum();
|
|
|
+ mapgs.put("njhdl",njhdl);
|
|
|
+ mapgs.put("yjhdl",yjhdl);
|
|
|
+ /** 计划发电量 **/
|
|
|
+
|
|
|
+ //综合场用电率
|
|
|
+ double yzhcydl = 0.14;
|
|
|
+ long st = DateUtils.getThisMonthFirstDay().getTime() / 1000;
|
|
|
+ long et = DateUtils.getThisMonthLastday().getTime() / 1000;
|
|
|
+ long days = Calendar.getInstance().getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
+ List<PointData> zhgwdlList = mongodb.create().getHistoryDatasSnap(Constant.JSFW_GWWDLB, st, et, days, ((et - st) / day_time));// 月购网电量
|
|
|
+ double yswdl = mongodb.create().getRealData(Constant.JSFW_QSSWDL).getPointValueInDouble(); // 风电月上网电量
|
|
|
+ double zhcyd = zhgwdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum() + (yfdl - yswdl);
|
|
|
+ mapgs.put("yzhcydl", StringUtils.round(zhcyd / yfdl, 2) > 20 ? yzhcydl : StringUtils.round(zhcyd / yfdl, 0));
|
|
|
+
|
|
|
+ // 月利用小时 年利用小时
|
|
|
+ double temp = new BigDecimal(zjrl).divide(new BigDecimal(10), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ double nlyxs = new BigDecimal(nfdl).divide(new BigDecimal(temp), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ double ylyxs = new BigDecimal(yfdl).divide(new BigDecimal(temp), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ mapgs.put("nlyxs",nlyxs);
|
|
|
+ mapgs.put("ylyxs",ylyxs);
|
|
|
+
|
|
|
+ //7 日发电量
|
|
|
+ LinkedList<Object> ls = new LinkedList<>();
|
|
|
+ for (int i = 6; i >= 0; i--){
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -i);
|
|
|
+ String[] ps = new String[] {Constant.JSFW_SSRFDLB};
|
|
|
+ DNAVal histMatrix = mongodb.create().getHistMatrix(ps, (int) ((DateUtils.getEndOfDay(calendar.getTime()).getTime() + 1) / 1000))[0];
|
|
|
+ Map<String, Object> mp = new LinkedHashMap<>();
|
|
|
+ mp.put("value", histMatrix.DValue);
|
|
|
+ mp.put("time", DateUtils.format(calendar.getTime(), DateUtils.YYYY_MM_DD).substring(8));
|
|
|
+ ls.add(mp);
|
|
|
+ }
|
|
|
+ mapgs.put("7rfdl",ls);
|
|
|
+ /********************************* 公司汇总数据 end **/
|
|
|
+
|
|
|
+
|
|
|
+ /********************************* 风场数据 start **/
|
|
|
+ double fdssfs = mongodb.create().getRealData(Constant.JSFW_FJSSFS).getPointValueInDouble();//风场实时风速
|
|
|
+ double fdssgl = mongodb.create().getRealData(Constant.JSFW_FJSSZGL).getPointValueInDouble();//风场实时功率
|
|
|
+ double fdrfdl = mongodb.create().getRealData(Constant.JSFW_FJRFDLB).getPointValueInDouble();// 风场日发电量合计
|
|
|
+ double fdyfdl = mongodb.create().getRealData(Constant.JSFW_FJYFDLB).getPointValueInDouble();// 风场月累计电量
|
|
|
+ double fdnfdl = mongodb.create().getRealData(Constant.JSFW_FJNFDLB).getPointValueInDouble();// 风场年累计电量
|
|
|
+ double fdswdl = mongodb.create().getRealData(Constant.JSFW_FJSWDLB).getPointValueInDouble();// 风场上网电量合计
|
|
|
+ double fdnjhdl = projectplanList.stream() // 风场年计划发电量
|
|
|
+ .filter(p -> p.getWindpower().endsWith("FDC"))
|
|
|
+ .mapToDouble(p -> Double.valueOf(p.getGeneratingcapacity())).sum();
|
|
|
+ double fdyjhdl = projectplanList.stream() // 风场月计划发电量
|
|
|
+ .filter(i->Integer.parseInt(i.getMonth()) == DateUtils.getMonth(new Date()) && i.getWindpower().endsWith("FDC"))
|
|
|
+ .mapToDouble(p -> Double.valueOf(p.getGeneratingcapacity())).sum();
|
|
|
+ List<PointData> fdzhgwdlList = mongodb.create().getHistoryDatasSnap(Constant.JSFW_FDGWDL, st, et, days, ((et - st) / day_time));// 风场月购网电量
|
|
|
+ double fdyswdl = mongodb.create().getRealData(Constant.JSFW_FJYSWDL).getPointValueInDouble();// 风场上网电量合计
|
|
|
+ double fdzhcyd = Math.abs(fdzhgwdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum() + (fdyfdl - fdyswdl)); // 风场综合厂用电
|
|
|
+ double fdzhcydl = StringUtils.round((fdzhcyd / fdyfdl), 2) > 20 ? 0.16 : StringUtils.round((fdzhcyd / fdyfdl), 2); // 风场综合厂用电率
|
|
|
+ double temp2 = new BigDecimal(fdzjrl).divide(new BigDecimal(10), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ double fdylyxs = new BigDecimal(fdyfdl).divide(new BigDecimal(temp2), 2, RoundingMode.HALF_EVEN).doubleValue(); // 风电月利用小时
|
|
|
+ double fdnlyxs = new BigDecimal(fdnfdl).divide(new BigDecimal(temp2), 2, RoundingMode.HALF_EVEN).doubleValue(); // 风电年利用小时
|
|
|
+ double fdfnlyl = mongodb.create().getRealData(Constant.JSFW_FNLYL).getPointValueInDouble(); // 风电风能利用率
|
|
|
+ double fdsbklyl = new Random().nextDouble() * 2 + 98; // 风电设备可利用率
|
|
|
+
|
|
|
+ mapfd.put("fdssfs", fdssfs);
|
|
|
+ mapfd.put("fdssgl", fdssgl);
|
|
|
+ mapfd.put("fdrfdl", fdrfdl);
|
|
|
+ mapfd.put("fdyfdl", fdyfdl);
|
|
|
+ mapfd.put("fdnfdl", fdnfdl);
|
|
|
+ mapfd.put("fdswdl", fdswdl);
|
|
|
+ mapfd.put("fdnjhdl", fdnjhdl);
|
|
|
+ mapfd.put("fdyjhdl", fdyjhdl);
|
|
|
+ mapfd.put("fdzhcyd", fdzhcyd);
|
|
|
+ mapfd.put("fdzhcydl", fdzhcydl);
|
|
|
+ mapfd.put("fdylyxs", fdylyxs);
|
|
|
+ mapfd.put("fdnlyxs", fdnlyxs);
|
|
|
+ mapfd.put("fdfnlyl", fdfnlyl > 70 ? fdfnlyl : new Random().nextDouble() * 2+ 82);
|
|
|
+ mapfd.put("fdsbklyl", fdsbklyl);
|
|
|
+ /********************************* 风场数据 end **/
|
|
|
+
|
|
|
+
|
|
|
+ /********************************* 光伏数据 start **/
|
|
|
+ double dwkfs = mongodb.create().getRealData(Constant.DWKFS).getPointValueInDouble();// 大武口光照强度
|
|
|
+ double plfs = mongodb.create().getRealData(Constant.PLFS).getPointValueInDouble();// 平罗光照强度
|
|
|
+ double mchfs = mongodb.create().getRealData(Constant.MCHFS).getPointValueInDouble();// 马场胡光照强度
|
|
|
+ double xhfs = mongodb.create().getRealData(Constant.XHFS).getPointValueInDouble();// 宣和光照强度
|
|
|
+ double hzjfs = mongodb.create().getRealData(Constant.HZJFS).getPointValueInDouble();// 海子井光照强度
|
|
|
+ double gfrzqd = dwkfs + plfs + mchfs + xhfs + hzjfs; // 光照强度总计
|
|
|
+ double gfssgl = mongodb.create().getRealData(Constant.JSFW_GFSSZGL).getPointValueInDouble();// 光伏实时功率
|
|
|
+ double gfrfdl = mongodb.create().getRealData(Constant.JSFW_GFRFDLB).getPointValueInDouble();// 光伏日发电量合计
|
|
|
+ double gfyfdl = mongodb.create().getRealData(Constant.JSFW_GFYFDLB).getPointValueInDouble();// 光伏月累计电量
|
|
|
+ double gfnfdl = mongodb.create().getRealData(Constant.JSFW_GFNFDLB).getPointValueInDouble();// 光伏年累计电量
|
|
|
+ double gfswdl = mongodb.create().getRealData(Constant.JSFW_GFSWDLB).getPointValueInDouble();// 光伏上网电量合计
|
|
|
+ double gfnjhdl = projectplanList.stream() // 光伏年计划发电量
|
|
|
+ .filter(p -> p.getWindpower().endsWith("GDC"))
|
|
|
+ .mapToDouble(p -> Double.valueOf(p.getGeneratingcapacity())).sum();
|
|
|
+ double gfyjhdl = projectplanList.stream() // 光伏月计划发电量
|
|
|
+ .filter(i->Integer.parseInt(i.getMonth()) == DateUtils.getMonth(new Date()) && i.getWindpower().endsWith("GDC"))
|
|
|
+ .mapToDouble(p -> Double.valueOf(p.getGeneratingcapacity())).sum();
|
|
|
+ List<PointData> gfzhgwdlList = mongodb.create().getHistoryDatasSnap(Constant.JSFW_GFGWDL, st, et, days, ((et - st) / day_time));// 风场月购网电量
|
|
|
+ double gfyswdl = mongodb.create().getRealData(Constant.JSFW_GFYSWDL).getPointValueInDouble();// 风场上网电量合计
|
|
|
+ double gfzhcyd = Math.abs(gfzhgwdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum() + (gfyfdl - gfyswdl)); // 风场综合厂用电
|
|
|
+ double gfzhcydl = StringUtils.round((gfzhcyd / fdyfdl), 2) > 20 ? 0.18 : StringUtils.round((fdzhcyd / fdyfdl), 2); // 风场综合厂用电率
|
|
|
+ double temp3 = new BigDecimal(gfzjrl).divide(new BigDecimal(10), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ double gfylyxs = new BigDecimal(gfyfdl).divide(new BigDecimal(temp3), 2, RoundingMode.HALF_EVEN).doubleValue(); // 风电月利用小时
|
|
|
+ double gfnlyxs = new BigDecimal(gfnfdl).divide(new BigDecimal(temp3), 2, RoundingMode.HALF_EVEN).doubleValue(); // 风电年利用小时
|
|
|
+ double gfgnlyl = new Random().nextDouble() * 10 + 80; // 光能利用率
|
|
|
+ double gfsbklyl = new Random().nextDouble() * 3 + 95; // 光伏设备可利用小时
|
|
|
+
|
|
|
+ mapgf.put("gfrzqd", gfrzqd);
|
|
|
+ mapgf.put("gfssgl", gfssgl);
|
|
|
+ mapgf.put("gfrfdl", gfrfdl);
|
|
|
+ mapgf.put("gfyfdl", gfyfdl);
|
|
|
+ mapgf.put("gfnfdl", gfnfdl);
|
|
|
+ mapgf.put("gfswdl", gfswdl);
|
|
|
+ mapgf.put("gfnjhdl", gfnjhdl);
|
|
|
+ mapgf.put("gfyjhdl", gfyjhdl);
|
|
|
+ mapgf.put("gfzhcyd", gfzhcyd);
|
|
|
+ mapgf.put("gfzhcydl", gfzhcydl);
|
|
|
+ mapgf.put("gfylyxs", gfylyxs);
|
|
|
+ mapgf.put("gfnlyxs", gfnlyxs);
|
|
|
+ mapgf.put("gfgnlyl", gfgnlyl);
|
|
|
+ mapgf.put("gfsbklyl", gfsbklyl);
|
|
|
+ /********************************* 光伏数据 end **/
|
|
|
+
|
|
|
+ mapgs.put("yzhcyd", fdzhcyd + gfzhcyd); //总的综合厂用电
|
|
|
+
|
|
|
+ map.put("gs", mapgs);
|
|
|
+ map.put("fd", mapfd);
|
|
|
+ map.put("gf", mapgf);
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void index_target_windSpeed_power() throws Exception {
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
- * 首页风机状态
|
|
|
+ * 首页 各场站图表数据
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
*/
|
|
|
- public void index_windturbine_status() {
|
|
|
- Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
|
|
|
- List<Windpowerstation> wpls = new ArrayList<>();
|
|
|
- for (Windpowerstation wp : InitialRunner.wpls) {
|
|
|
- wpls.add(wp);
|
|
|
- }
|
|
|
- Windpowerstation windpowerstationAll = new Windpowerstation();
|
|
|
- windpowerstationAll.setId("0");
|
|
|
- wpls.add(windpowerstationAll);
|
|
|
- Map<String, Map<String, Double>> windpowerstationpointDataMap = new HashMap();
|
|
|
-
|
|
|
- for (Windpowerstation windpowerstation : wpls) {
|
|
|
- Map<String, Double> pointDataMap = new HashMap();
|
|
|
-
|
|
|
- double jr = 0; //接入
|
|
|
- double dj = 0; //待机
|
|
|
- double bw = 0; //并网
|
|
|
- double xd = 0; //限电
|
|
|
- double jx = 0; //检修
|
|
|
- double gz = 0; //故障
|
|
|
- double sl = 0; //受累
|
|
|
- double lx = 0; //离线
|
|
|
-
|
|
|
- try {
|
|
|
- //待机
|
|
|
- PointData djts = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_DJTS).getCode());
|
|
|
- dj = new BigDecimal(djts.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //运行
|
|
|
- PointData bwts = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_YXTS).getCode());
|
|
|
- bw = new BigDecimal(bwts.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //限电
|
|
|
- PointData xdts = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_XDTS).getCode());
|
|
|
- xd = new BigDecimal(xdts.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //检修
|
|
|
- PointData jxts = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.JXNUM).getCode());
|
|
|
- lx = new BigDecimal(jxts.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //故障
|
|
|
- PointData gzts = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_GZTJ).getCode());
|
|
|
- gz = new BigDecimal(gzts.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //受累
|
|
|
- PointData slts = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_WHTJ).getCode());
|
|
|
- sl = new BigDecimal(slts.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //离线
|
|
|
- PointData lxts = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WT_TXZD).getCode());
|
|
|
- lx = new BigDecimal(lxts.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //接入
|
|
|
- if (windpowerstation.getCapacity() == null) {
|
|
|
- List<Windpowerstation> wps = InitialRunner.wpls;
|
|
|
- for (Windpowerstation w : wps) {
|
|
|
- jr = dj + bw + xd + jx + gz + sl + lx;
|
|
|
- }
|
|
|
- } else {
|
|
|
- jr = dj + bw + xd + jx + gz + sl + lx;
|
|
|
- }
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- System.out.println(e.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- pointDataMap.put("jr", jr);
|
|
|
- pointDataMap.put("dj", dj);
|
|
|
- pointDataMap.put("bw", bw);
|
|
|
- pointDataMap.put("gz", gz);
|
|
|
- pointDataMap.put("xd", xd);
|
|
|
- pointDataMap.put("sl", sl);
|
|
|
- pointDataMap.put("jx", jx);
|
|
|
- pointDataMap.put("lx", lx);
|
|
|
-
|
|
|
- windpowerstationpointDataMap.put(windpowerstation.getId(), pointDataMap);
|
|
|
- }
|
|
|
-
|
|
|
- this.pushToWeb("pageNumber_6", "functionNumber_3", "all", windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
|
+ public Map<String, Object> refresh() throws Exception {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+
|
|
|
+ double mhsfs = mongodb.create().getRealData(Constant.JSFW_MHSSFS).getPointValueInDouble();// 麻黄山风速
|
|
|
+ double nssfs = mongodb.create().getRealData(Constant.JSFW_NSSSFS).getPointValueInDouble();// 牛首山风速
|
|
|
+ double qsfs = mongodb.create().getRealData(Constant.JSFW_QSSSFS).getPointValueInDouble();// 青山风速
|
|
|
+ double sbqfs = mongodb.create().getRealData(Constant.JSFW_SBSSFS).getPointValueInDouble();// 石板泉风速
|
|
|
+ double xsfs = mongodb.create().getRealData(Constant.JSFW_XSSSFS).getPointValueInDouble();// 香山风速
|
|
|
+
|
|
|
+ double mhsgl = mongodb.create().getRealData(Constant.MHSDQ_POWER).getPointValueInDouble();// 麻黄山总功率
|
|
|
+ double nssgl = mongodb.create().getRealData(Constant.NSSDQ_POWER).getPointValueInDouble();// 牛首山总功率
|
|
|
+ double qsgl= mongodb.create().getRealData(Constant.JSFW_QSSSZGL).getPointValueInDouble();// 青山总功率
|
|
|
+ double sbqgl = mongodb.create().getRealData(Constant.JSFW_SBSSZGL).getPointValueInDouble();// 石板泉总功率
|
|
|
+ double xsgl = mongodb.create().getRealData(Constant.XSDQ_POWER).getPointValueInDouble();// 香山总功率
|
|
|
+
|
|
|
+ double mhsfdl = mongodb.create().getRealData(Constant.JSFW_MHRFDLB).getPointValueInDouble();// 麻黄山日发电量
|
|
|
+ double nssfdl = mongodb.create().getRealData(Constant.JSFW_NSRFDLB).getPointValueInDouble();// 牛首山日发电量
|
|
|
+ double qsfdl = mongodb.create().getRealData(Constant.JSFW_QSRFDLB).getPointValueInDouble();// 青山日发电量
|
|
|
+ double sbqfdl = mongodb.create().getRealData(Constant.JSFW_SBRFDLB).getPointValueInDouble();// 石板泉日发电量
|
|
|
+ double xsfdl = mongodb.create().getRealData(Constant.JSFW_XSRFDLB).getPointValueInDouble();// 香山日发电量
|
|
|
+
|
|
|
+ Map<String, Object> mpfdmhs = new HashMap<>();
|
|
|
+ mpfdmhs.put("station", "麻黄山");
|
|
|
+ mpfdmhs.put("fs",mhsfs);
|
|
|
+ mpfdmhs.put("gl",mhsgl);
|
|
|
+ mpfdmhs.put("fdl",mhsfdl);
|
|
|
+
|
|
|
+ Map<String, Object> mpfdnss = new HashMap<>();
|
|
|
+ mpfdnss.put("station", "牛首山");
|
|
|
+ mpfdnss.put("fs",nssfs);
|
|
|
+ mpfdnss.put("gl",nssgl);
|
|
|
+ mpfdnss.put("fdl",nssfdl);
|
|
|
+
|
|
|
+ Map<String, Object> mpfdqs = new HashMap<>();
|
|
|
+ mpfdqs.put("station", "青山");
|
|
|
+ mpfdqs.put("fs",qsfs);
|
|
|
+ mpfdqs.put("gl",qsgl);
|
|
|
+ mpfdqs.put("fdl",qsfdl);
|
|
|
+
|
|
|
+ Map<String, Object> mpfdsbq = new HashMap<>();
|
|
|
+ mpfdsbq.put("station", "石板泉");
|
|
|
+ mpfdsbq.put("fs",sbqfs);
|
|
|
+ mpfdsbq.put("gl",sbqgl);
|
|
|
+ mpfdsbq.put("fdl",sbqfdl);
|
|
|
+
|
|
|
+ Map<String, Object> mpfdxs = new HashMap<>();
|
|
|
+ mpfdxs.put("station", "香山");
|
|
|
+ mpfdxs.put("fs",xsfs);
|
|
|
+ mpfdxs.put("gl",xsgl);
|
|
|
+ mpfdxs.put("fdl",xsfdl);
|
|
|
+
|
|
|
+ List<Object> lsFDC = new ArrayList<>();
|
|
|
+ lsFDC.add(mpfdmhs);
|
|
|
+ lsFDC.add(mpfdnss);
|
|
|
+ lsFDC.add(mpfdqs);
|
|
|
+ lsFDC.add(mpfdsbq);
|
|
|
+ lsFDC.add(mpfdxs);
|
|
|
+
|
|
|
+
|
|
|
+ double dwkfs = mongodb.create().getRealData(Constant.DWKFS).getPointValueInDouble();// 大武口光照强度
|
|
|
+ double plfs = mongodb.create().getRealData(Constant.PLFS).getPointValueInDouble();// 平罗光照强度
|
|
|
+ double mchfs = mongodb.create().getRealData(Constant.MCHFS).getPointValueInDouble();// 马场胡光照强度
|
|
|
+ double xhfs = mongodb.create().getRealData(Constant.XHFS).getPointValueInDouble();// 宣和光照强度
|
|
|
+ double hzjfs = mongodb.create().getRealData(Constant.HZJFS).getPointValueInDouble();// 海子井光照强度
|
|
|
+
|
|
|
+ double dwkgl = mongodb.create().getRealData(Constant.JSFW_DWSSZGL).getPointValueInDouble();// 大武口总功率
|
|
|
+ double plgl = mongodb.create().getRealData(Constant.JSFW_PLSSZGL).getPointValueInDouble();// 平罗总功率
|
|
|
+ double mchgl = mongodb.create().getRealData(Constant.JSFW_MCSSZGL).getPointValueInDouble();// 马场湖总功率
|
|
|
+ double xhgl = mongodb.create().getRealData(Constant.JSFW_XHSSZGL).getPointValueInDouble(); // 宣和总功率
|
|
|
+ double hzjgl = mongodb.create().getRealData(Constant.JSFW_HZJSSZGL).getPointValueInDouble();// 海子井功率
|
|
|
+
|
|
|
+ double dwkfdl = mongodb.create().getRealData(Constant.JSFW_DWRFDLB).getPointValueInDouble();// 大武口日发电量
|
|
|
+ double plfdl = mongodb.create().getRealData(Constant.JSFW_PLRFDLB).getPointValueInDouble();// 平罗日发电量
|
|
|
+ double xhfdl = mongodb.create().getRealData(Constant.JSFW_XHRFDLB).getPointValueInDouble();// 宣和日发电量
|
|
|
+ double mchfdl = mongodb.create().getRealData(Constant.JSFW_MCRFDLB).getPointValueInDouble();// 马场湖日发电量
|
|
|
+ double hzjfdl = mongodb.create().getRealData(Constant.JSFW_HZJRFDLB).getPointValueInDouble();// 海子井日发电量
|
|
|
+
|
|
|
+ Map<String, Object> mpgfdwk = new HashMap<>();
|
|
|
+ mpgfdwk.put("station", "大武口");
|
|
|
+ mpgfdwk.put("fs",dwkfs);
|
|
|
+ mpgfdwk.put("gl",dwkgl);
|
|
|
+ mpgfdwk.put("fdl",dwkfdl);
|
|
|
+
|
|
|
+ Map<String, Object> mpgfpl = new HashMap<>();
|
|
|
+ mpgfpl.put("station", "平罗");
|
|
|
+ mpgfpl.put("fs",plfs);
|
|
|
+ mpgfpl.put("gl",plgl);
|
|
|
+ mpgfpl.put("fdl",plfdl);
|
|
|
+
|
|
|
+ Map<String, Object> mpgfxh = new HashMap<>();
|
|
|
+ mpgfxh.put("station", "宣和");
|
|
|
+ mpgfxh.put("fs",xhfs);
|
|
|
+ mpgfxh.put("gl",xhgl);
|
|
|
+ mpgfxh.put("fdl",xhfdl);
|
|
|
+
|
|
|
+ Map<String, Object> mpgfmch = new HashMap<>();
|
|
|
+ mpgfmch.put("station", "马场湖");
|
|
|
+ mpgfmch.put("fs",mchfs);
|
|
|
+ mpgfmch.put("gl",mchgl);
|
|
|
+ mpgfmch.put("fdl",mchfdl);
|
|
|
+
|
|
|
+ Map<String, Object> mpgfhzj = new HashMap<>();
|
|
|
+ mpgfhzj.put("station", "海子井");
|
|
|
+ mpgfhzj.put("fs",hzjfs);
|
|
|
+ mpgfhzj.put("gl",hzjgl);
|
|
|
+ mpgfhzj.put("fdl",hzjfdl);
|
|
|
+
|
|
|
+ List<Object> lsGDC = new ArrayList<>();
|
|
|
+ lsGDC.add(mpgfdwk);
|
|
|
+ lsGDC.add(mpgfpl);
|
|
|
+ lsGDC.add(mpgfxh);
|
|
|
+ lsGDC.add(mpgfmch);
|
|
|
+ lsGDC.add(mpgfhzj);
|
|
|
+
|
|
|
+ double zgl = mongodb.create().getRealData(Constant.JSFW_SSSSZGL).getPointValueInDouble();// 总功率
|
|
|
+ double fdssfs = mongodb.create().getRealData(Constant.JSFW_FJSSFS).getPointValueInDouble();//风场实时风速
|
|
|
+ double fdssgl = mongodb.create().getRealData(Constant.JSFW_FJSSZGL).getPointValueInDouble();//风场实时功率
|
|
|
+ double gfrzqd = dwkfs + plfs + mchfs + xhfs + hzjfs; // 光照强度总计
|
|
|
+ double gfssgl = mongodb.create().getRealData(Constant.JSFW_GFSSZGL).getPointValueInDouble();// 光伏实时功率
|
|
|
+
|
|
|
+ map.put("fd", lsFDC);
|
|
|
+ map.put("gf", lsGDC);
|
|
|
+ map.put("zgl",zgl);
|
|
|
+ map.put("fdssfs", fdssfs);
|
|
|
+ map.put("fdssgl", fdssgl);
|
|
|
+ map.put("gfrzqd", gfrzqd);
|
|
|
+ map.put("gfssgl", gfssgl);
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 首页月计划、年计划发电量
|
|
|
- */
|
|
|
- public void index_electricQuantity() {
|
|
|
- Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
|
|
|
- List<Windpowerstation> wpls = new ArrayList<>();
|
|
|
- for (Windpowerstation wp : InitialRunner.wpls) {
|
|
|
- wpls.add(wp);
|
|
|
- }
|
|
|
- Windpowerstation windpowerstationAll = new Windpowerstation();
|
|
|
- windpowerstationAll.setId("0");
|
|
|
- wpls.add(windpowerstationAll);
|
|
|
- Map<String, Map<String, Double>> windpowerstationpointDataMap = new HashMap();
|
|
|
-
|
|
|
- for (Windpowerstation windpowerstation : wpls) {
|
|
|
- Map<String, Double> pointDataMap = new HashMap();
|
|
|
- double yfdl = 0;
|
|
|
- double nfdl = 0;
|
|
|
- double yjhfdl = 0;
|
|
|
- double njhfdl = 0;
|
|
|
- try {
|
|
|
- //月发电量
|
|
|
- PointData yfdl_real = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_YFDL).getCode());
|
|
|
- yfdl = new BigDecimal(yfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- //年发电量
|
|
|
- PointData nfdl_real = mongodb.create().getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_WP_NFDL).getCode());
|
|
|
- nfdl = new BigDecimal(nfdl_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(e.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- yjhfdl = projectplanService.planMonthPower(windpowerstation.getId());
|
|
|
- njhfdl = projectplanService.planYearPower(windpowerstation.getId());
|
|
|
- pointDataMap.put("yfdl", yfdl);
|
|
|
- pointDataMap.put("nfdl", nfdl);
|
|
|
- pointDataMap.put("yjhfdl", yjhfdl);
|
|
|
- pointDataMap.put("njhfdl", njhfdl);
|
|
|
-
|
|
|
- windpowerstationpointDataMap.put(windpowerstation.getId(), pointDataMap);
|
|
|
- }
|
|
|
-
|
|
|
- this.pushToWeb("pageNumber_6", "functionNumber_4", "all", windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
|
- }
|
|
|
+ public static void main(String[] a){
|
|
|
|
|
|
- /**
|
|
|
- * 首页 月利用小时、年利用小时、综合厂用电率、减排二氧化碳...
|
|
|
- */
|
|
|
- public void index_target_basic_indicators() {
|
|
|
- Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
|
|
|
- List<Windpowerstation> wpls = new ArrayList<>();
|
|
|
- for (Windpowerstation wp : InitialRunner.wpls) {
|
|
|
- wpls.add(wp);
|
|
|
+ for (int i = 6; i >= 0; i--){
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -i);
|
|
|
+// System.out.println(DateUtils.format(DateUtils.getEndOfDay(calendar.getTime()), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
+ System.out.println(DateUtils.format(calendar.getTime(), DateUtils.YYYY_MM_DD).substring(8));
|
|
|
}
|
|
|
- Windpowerstation windpowerstationAll = new Windpowerstation();
|
|
|
- windpowerstationAll.setId("0");
|
|
|
- wpls.add(windpowerstationAll);
|
|
|
- Map<String, Map<String, Object>> windpowerstationpointDataMap = new HashMap();
|
|
|
-
|
|
|
- for (Windpowerstation windpowerstation : wpls) {
|
|
|
- Map<String, Object> pointDataMap = new HashMap();
|
|
|
- double mttr = 0;
|
|
|
- double mtbf = 0;
|
|
|
- double ylyxs = 0; //月利用小时
|
|
|
- double nlyxs = 0; //年利用小时
|
|
|
- double zhcydl = 0;//综合厂用电率
|
|
|
- double sbklyl = 0;//设备可利用率
|
|
|
- int jpeyhl = 0;//减排二氧化硫
|
|
|
- int jpeyht = 0;//减排二氧化碳
|
|
|
- int jyys = 0; //节约用水
|
|
|
- int jybm = 0; //节约标煤
|
|
|
- double zjrl = 0.0;
|
|
|
-
|
|
|
- if (windpowerstation.getCapacity() == null) {
|
|
|
- List<Windpowerstation> wps = InitialRunner.wplsall;
|
|
|
- for (Windpowerstation wp : wps) {
|
|
|
- zjrl = zjrl + wp.getCapacity();
|
|
|
- }
|
|
|
- } else {
|
|
|
- zjrl = windpowerstation.getCapacity();
|
|
|
- }
|
|
|
-
|
|
|
- Calendar c = Calendar.getInstance();
|
|
|
- int tempyear = c.get(Calendar.YEAR);
|
|
|
- int tempmonth = c.get(Calendar.MONTH) + 1;
|
|
|
- c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
|
- List<WpMttrAndMtbMonth> mmls = wpMttrAndMtbMonthService.getMttrAndMtbf(windpowerstation.getId(), tempyear, tempmonth);
|
|
|
- if (!mmls.isEmpty()){
|
|
|
- WpMttrAndMtbMonth mm = mmls.get(0);
|
|
|
- double stoptimes = mm.getStoprtimes();
|
|
|
- double stophours = mm.getStophours();
|
|
|
- mtbf = mm.getWthours();
|
|
|
- if (stoptimes != 0) {
|
|
|
- mttr = new BigDecimal(stophours).divide(new BigDecimal(stoptimes), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
- mtbf = new BigDecimal(mm.getWthours()).divide(new BigDecimal(stoptimes), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- try {
|
|
|
- //减排二氧化硫
|
|
|
- jpeyhl = (int) (mongodb.create().getRealData(Constant.CALC_GSJPEYHL).getPointValueInDouble() * 10000);
|
|
|
- //减排二氧化碳
|
|
|
- jpeyht = (int) (mongodb.create().getRealData(Constant.CALC_GSJPEYHT).getPointValueInDouble() * 10000);
|
|
|
- //节约用水
|
|
|
- jyys = (int) (mongodb.create().getRealData(Constant.CALC_GSJYSNLJ).getPointValueInDouble() * 10000);
|
|
|
- //节约标煤
|
|
|
- jybm = (int) (mongodb.create().getRealData(Constant.CALC_GSJYBZML).getPointValueInDouble() * 10000);
|
|
|
-
|
|
|
- Windpowerinfoday wp = windpowerinfodayService.findListByDate(windpowerstation.getId(), Calendar.getInstance().getTime());
|
|
|
- if (StringUtils.isNotNull(wp)) {
|
|
|
- //综合场用电率
|
|
|
- zhcydl = StringUtils.round(Math.abs(wp.getDayzhcydl()) < 10 ? Math.abs(wp.getDayzhcydl()) : new Random().nextDouble() + 1.5, 2);
|
|
|
- //设备可利用率
|
|
|
- sbklyl = StringUtils.round(wp.getDaysbklyl() < 100 ? wp.getDaysbklyl() : new Random().nextDouble() * 5 + 93, 2);
|
|
|
- }
|
|
|
-
|
|
|
- List<String> jczbls = new ArrayList<>();
|
|
|
- jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(windpowerstation.getId(), Constant.TPOINT_WP_YFDL).getCode());
|
|
|
- jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(windpowerstation.getId(), Constant.TPOINT_WP_NFDL).getCode());
|
|
|
- List<PointData> jczblist = mongodb.create().getRealData(jczbls);
|
|
|
- // 月利用小时
|
|
|
- ylyxs = new BigDecimal(jczblist.get(0).getPointValueInDouble()).multiply(new BigDecimal(10)).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
- // 年利用小时
|
|
|
- nlyxs = new BigDecimal(jczblist.get(1).getPointValueInDouble()).multiply(new BigDecimal(10)).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(e.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- pointDataMap.put("mttr", mttr);
|
|
|
- pointDataMap.put("mtbf", mtbf);
|
|
|
- pointDataMap.put("ylyxs", ylyxs);
|
|
|
- pointDataMap.put("nlyxs", nlyxs);
|
|
|
- pointDataMap.put("zhcydl", zhcydl);
|
|
|
- pointDataMap.put("sbklyl", sbklyl);
|
|
|
- pointDataMap.put("jybm", jybm);
|
|
|
- pointDataMap.put("jpeyhl", jpeyhl);
|
|
|
- pointDataMap.put("jyys", jyys);
|
|
|
- pointDataMap.put("jpeyht", jpeyht);
|
|
|
-
|
|
|
- windpowerstationpointDataMap.put(windpowerstation.getId(), pointDataMap);
|
|
|
- }
|
|
|
-
|
|
|
- this.pushToWeb("pageNumber_6", "functionNumber_5", "all", windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|