|
@@ -95,258 +95,642 @@ public class WpInfoPushService {
|
|
|
public Map<String, Object> findWpInfo() throws Exception {
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
|
-
|
|
|
+ List<ZtjsVo> vos = new ArrayList<>();
|
|
|
List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
for (Windpowerstation wp : InitialRunner.wpallls) {
|
|
|
|
|
|
+ ZtjsVo vo = new ZtjsVo();
|
|
|
+
|
|
|
+
|
|
|
+ vo.setFdl(0.0);
|
|
|
+ vo.setSwdl(0.0);
|
|
|
+ vo.setLyxs(0.0);
|
|
|
+ vo.setFs(0.0);
|
|
|
+ vo.setGl(0.0);
|
|
|
+ vo.setCxgl(0.0);
|
|
|
+ vo.setLlgl(0.0);
|
|
|
+ vo.setBzgl(0.0);
|
|
|
+ vo.setYcgl(0.0);
|
|
|
+ vo.setAGCzl(0.0);
|
|
|
+ vo.setLlfdl(0.0);
|
|
|
+ vo.setScadafdl(0.0);
|
|
|
+ vo.setWhss(0.0);
|
|
|
+ vo.setGzss(0.0);
|
|
|
+ vo.setSlss(0.0);
|
|
|
+ vo.setXdss(0.0);
|
|
|
+ vo.setXnss(0.0);
|
|
|
+
|
|
|
String id = wp.getId();
|
|
|
+ double scadafdl = 0.0;
|
|
|
+ Double zjrl = 0.0;
|
|
|
+ Double zjts = 0.0;
|
|
|
+
|
|
|
+ Double sjgl = 0.0;
|
|
|
+ Double bzgl = 0.0;
|
|
|
+ Double yfgl = 0.0;
|
|
|
+
|
|
|
+/*************************************************基础指标*************************************************************/
|
|
|
+
|
|
|
+ zjrl = wp.getCapacity();
|
|
|
+ zjts = Double.valueOf(wp.getQuantity());
|
|
|
+
|
|
|
+ vo.setWpId(wp.getId());
|
|
|
+ vo.setWpName(wp.getName());
|
|
|
+ vo.setZjrl(zjrl);
|
|
|
+ Map<String, Object> jczbmap = new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+ jczbmap.put("zjts", zjts);
|
|
|
+ jczbmap.put("name", wp.getName());
|
|
|
+ List<String> jczbls = new ArrayList<>();
|
|
|
+
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_SJGL).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_RFDL).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_YFDL).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_NFDL).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_SSFS).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_SWDL).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.ZBZGL).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_ZZSGL).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FJZT).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WT_RFDL).getCode());
|
|
|
+ jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, ycPoints1[0]).getCode());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ List<PointData> jczblist = realApiUtil.getRealData(jczbls);
|
|
|
+
|
|
|
+ if (!jczblist.isEmpty() && jczblist.size() == jczbls.size()) {
|
|
|
+ //实际功率
|
|
|
+ sjgl = MathUtil.twoBit(jczblist.get(0).getPointValueInDouble());
|
|
|
+ vo.setGl(sjgl);
|
|
|
+ //jczbmap.put("sjgl", sjgl);
|
|
|
+ //日发电量
|
|
|
+ double fdl = MathUtil.twoBit(jczblist.get(1).getPointValueInDouble());
|
|
|
+ vo.setFdl(fdl);
|
|
|
+ // jczbmap.put("rfdl", rfdl);
|
|
|
+
|
|
|
+// //月发电量
|
|
|
+// double yfdl=MathUtil.twoBit(jczblist.get(2).getPointValueInDouble());
|
|
|
+// jczbmap.put("yfdl", yfdl);
|
|
|
+// //年发电量
|
|
|
+// double nfdl=MathUtil.twoBit(jczblist.get(3).getPointValueInDouble());
|
|
|
+// jczbmap.put("nfdl", nfdl);
|
|
|
+ if(zjrl!=0)
|
|
|
+ {
|
|
|
+ //月利用小时
|
|
|
+ double ylyxs = (new BigDecimal(jczblist.get(2).getPointValueInDouble()).multiply(new BigDecimal(10))).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ //jczbmap.put("ylyxs",ylyxs );
|
|
|
+ vo.setLyxs(ylyxs);
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ vo.setLyxs(0.0);
|
|
|
+ }
|
|
|
+
|
|
|
+ //实时风速
|
|
|
+ double ssfs = MathUtil.twoBit(jczblist.get(4).getPointValueInDouble());
|
|
|
+ // jczbmap.put("ssfs",ssfs );
|
|
|
+ vo.setFs(ssfs);
|
|
|
+ //上网电量
|
|
|
+ double swdl = MathUtil.twoBit(jczblist.get(5).getPointValueInDouble());
|
|
|
+ // jczbmap.put("swdl",swdl );
|
|
|
+ vo.setSwdl(swdl);
|
|
|
+ //保证功率
|
|
|
+ bzgl = new BigDecimal(jczblist.get(6).getPointValueInDouble()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ //jczbmap.put("bzgl", bzgl);
|
|
|
+ vo.setBzgl(bzgl);
|
|
|
+ //应发功率
|
|
|
+ yfgl = new BigDecimal(jczblist.get(7).getPointValueInDouble()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ // jczbmap.put("yfgl", yfgl);
|
|
|
+ vo.setLlgl(yfgl);
|
|
|
+ //目标状态
|
|
|
+ double fczt = StringUtils.round(jczblist.get(8).getPointValueInDouble(), 0);
|
|
|
+ jczbmap.put("fczt", fczt);
|
|
|
+
|
|
|
+ //SCADA发电量
|
|
|
+ scadafdl = StringUtils.round(jczblist.get(9).getPointValueInDouble(), 2);
|
|
|
+ //jczbmap.put("scadafdl",scadafdl );
|
|
|
+ vo.setScadafdl(scadafdl);
|
|
|
+ //预测功率
|
|
|
+ double ycgl = StringUtils.round(jczblist.get(10).getPointValueInDouble(), 2);
|
|
|
+ jczbmap.put("ycgl", ycgl);
|
|
|
+ vo.setYcgl(ycgl);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ //实际功率
|
|
|
+ jczbmap.put("sjgl", 0.0);
|
|
|
+ //日发电量
|
|
|
+ jczbmap.put("rfdl", 0.0);
|
|
|
+ //月发电量
|
|
|
+ jczbmap.put("yfdl", 0.0);
|
|
|
+ //年发电量
|
|
|
+ jczbmap.put("nfdl", 0.0);
|
|
|
+ //月利用小时
|
|
|
+ jczbmap.put("ylyxs", 0.0);
|
|
|
+ //年利用小时
|
|
|
+ jczbmap.put("nlyxs", 0.0);
|
|
|
+ //实时风速
|
|
|
+ jczbmap.put("ssfs", 0.0);
|
|
|
+ //上网电量
|
|
|
+ jczbmap.put("swdl", 0.0);
|
|
|
+ //保证功率
|
|
|
+ jczbmap.put("bzgl", 0.0);
|
|
|
+ //应发功率
|
|
|
+ jczbmap.put("yfgl", 0.0);
|
|
|
+ //目标状态
|
|
|
+ jczbmap.put("fczt", -1.0);
|
|
|
+ //SCADA发电量
|
|
|
+ jczbmap.put("scadafdl", 0.0);
|
|
|
+ //预测功率
|
|
|
+ jczbmap.put("ycgl", 0.0);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
List<Windsubstation> subls = windsubstationService.findByWpId(wp.getId());
|
|
|
if (!subls.isEmpty()) {
|
|
|
+
|
|
|
+ double agccxyg=0.0;
|
|
|
+ double agcygsd=0.0;
|
|
|
for (Windsubstation sub : subls) {
|
|
|
- Map<String, Object> jczbmap = new HashMap<>();
|
|
|
- jczbmap.put("name", sub.getName());
|
|
|
- double zjts = Double.valueOf(wp.getQuantity());
|
|
|
|
|
|
|
|
|
-/*****************************************************各调度AGC指标******************************************************************/
|
|
|
Map<String, Windsubstationtestingpointnew> submap = windsubstationtestingpointnewService.findBySubIdMap(sub.getId());
|
|
|
if (!submap.isEmpty()) {
|
|
|
- List<String> jczbls = new ArrayList<>();
|
|
|
+ List<String> subjczbls = new ArrayList<>();
|
|
|
|
|
|
|
|
|
if (submap.containsKey(Constant.AGC001)) {
|
|
|
- jczbls.add(submap.get(Constant.AGC001).getCode());
|
|
|
+ subjczbls.add(submap.get(Constant.AGC001).getCode());
|
|
|
}
|
|
|
|
|
|
if (submap.containsKey(Constant.AGC002)) {
|
|
|
- jczbls.add(submap.get(Constant.AGC002).getCode());
|
|
|
+ subjczbls.add(submap.get(Constant.AGC002).getCode());
|
|
|
}
|
|
|
|
|
|
- List<PointData> jczblist = realApiUtil.getRealData(jczbls);
|
|
|
+ List<PointData> subjczblist = realApiUtil.getRealData(subjczbls);
|
|
|
|
|
|
- if (!jczblist.isEmpty() && jczblist.size() == jczbls.size()) {
|
|
|
+ if (!subjczblist.isEmpty() && subjczblist.size() == subjczbls.size()) {
|
|
|
|
|
|
//AGC出线有功
|
|
|
- double agccxyg = StringUtils.round(jczblist.get(0).getPointValueInDouble(), 2);
|
|
|
+ agccxyg = agccxyg+ StringUtils.round(subjczblist.get(0).getPointValueInDouble(), 2);
|
|
|
jczbmap.put("agccxyg", agccxyg);
|
|
|
//AGC有功设定
|
|
|
- double agcygsd = StringUtils.round(jczblist.get(1).getPointValueInDouble(), 2);
|
|
|
+ agcygsd = agcygsd+StringUtils.round(subjczblist.get(1).getPointValueInDouble(), 2);
|
|
|
jczbmap.put("agcygsd", agcygsd);
|
|
|
|
|
|
- } else {
|
|
|
- //AGC出线有功
|
|
|
- jczbmap.put("agccxyg", 0.0);
|
|
|
- //AGC有功设定
|
|
|
- jczbmap.put("agcygsd", 0.0);
|
|
|
-
|
|
|
}
|
|
|
-/*****************************************************各调度AGC指标******************************************************************/
|
|
|
-/*****************************************************各模块通信状态******************************************************************/
|
|
|
-
|
|
|
-
|
|
|
- List<Windpowerstationpointnew> wpoints = windPowerstationTestingPoint2Service.getJsztList(id);
|
|
|
-
|
|
|
- if (!wpoints.isEmpty()) {
|
|
|
- for (Windpowerstationpointnew wpoint : wpoints) {
|
|
|
- if (StringUtils.notEmp(wpoint) && StringUtils.notEmp(wpoint.getName())) {
|
|
|
- String name = wpoint.getName();
|
|
|
- if (name.indexOf("风机") != -1) {
|
|
|
- PointData pointData = realApiUtil.getRealData(wpoint.getCode());
|
|
|
- jczbmap.put("zxzt_fjzt", pointData.getPointValueInDouble());
|
|
|
- } else if (name.indexOf("升压站") != -1) {
|
|
|
- PointData pointData = realApiUtil.getRealData(wpoint.getCode());
|
|
|
- jczbmap.put("zxzt_syzzt", pointData.getPointValueInDouble());
|
|
|
- } else if (name.indexOf("电计量") != -1) {
|
|
|
- PointData pointData = realApiUtil.getRealData(wpoint.getCode());
|
|
|
- jczbmap.put("zxzt_djlzt", pointData.getPointValueInDouble());
|
|
|
- } else if (name.indexOf("agc") != -1) {
|
|
|
- PointData pointData = realApiUtil.getRealData(wpoint.getCode());
|
|
|
- jczbmap.put("zxzt_acgzt", pointData.getPointValueInDouble());
|
|
|
- } else if (name.indexOf("测风塔") != -1) {
|
|
|
- PointData pointData = realApiUtil.getRealData(wpoint.getCode());
|
|
|
- jczbmap.put("zxzt_cftzt", pointData.getPointValueInDouble());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Windpowerstationpointnew> wpoints= windPowerstationTestingPoint2Service.getJsztList(id);
|
|
|
+
|
|
|
+ if(!wpoints.isEmpty())
|
|
|
+ {
|
|
|
+ for(Windpowerstationpointnew wpoint:wpoints)
|
|
|
+ {
|
|
|
+ if(StringUtils.notEmp(wpoint) && StringUtils.notEmp(wpoint.getName()))
|
|
|
+ {
|
|
|
+ String name=wpoint.getName();
|
|
|
+ if(name.indexOf("风机")!=-1)
|
|
|
+ {
|
|
|
+ PointData pointData=realApiUtil.getRealData(wpoint.getCode());
|
|
|
+ jczbmap.put("zxzt_fjzt",pointData.getPointValueInDouble());
|
|
|
+ }else if(name.indexOf("升压站")!=-1)
|
|
|
+ {
|
|
|
+ PointData pointData=realApiUtil.getRealData(wpoint.getCode());
|
|
|
+ jczbmap.put("zxzt_syzzt",pointData.getPointValueInDouble());
|
|
|
+ }else if(name.indexOf("电计量")!=-1)
|
|
|
+ {
|
|
|
+ PointData pointData=realApiUtil.getRealData(wpoint.getCode());
|
|
|
+ jczbmap.put("zxzt_djlzt",pointData.getPointValueInDouble());
|
|
|
+ }else if(name.indexOf("agc")!=-1)
|
|
|
+ {
|
|
|
+ PointData pointData=realApiUtil.getRealData(wpoint.getCode());
|
|
|
+ jczbmap.put("zxzt_acgzt",pointData.getPointValueInDouble());
|
|
|
+ }else if(name.indexOf("测风塔")!=-1)
|
|
|
+ {
|
|
|
+ PointData pointData=realApiUtil.getRealData(wpoint.getCode());
|
|
|
+ jczbmap.put("zxzt_cftzt",pointData.getPointValueInDouble());
|
|
|
}
|
|
|
-/*****************************************************各模块通信状态******************************************************************/
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+
|
|
|
+ int tempyear = c.get(Calendar.YEAR);
|
|
|
+ int tempmonth = c.get(Calendar.MONTH) + 1;
|
|
|
+ int daynum = c.get(Calendar.DAY_OF_MONTH);
|
|
|
+ List<WpMttrAndMtbMonth> mmls = wpMttrAndMtbMonthService.getMttrAndMtbf(id, tempyear, tempmonth);
|
|
|
+
|
|
|
+ if (!mmls.isEmpty()) {
|
|
|
+ WpMttrAndMtbMonth mm = mmls.get(0);
|
|
|
+ double stoptimes = mm.getStoprtimes();
|
|
|
+ double stophours = mm.getStophours();
|
|
|
+ double mttr = 0.0;
|
|
|
+ double 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();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ jczbmap.put("mttr", mttr);
|
|
|
+ jczbmap.put("mtbf", mtbf);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+/*************************************************基础指标*************************************************************/
|
|
|
+
|
|
|
/*****************************************************升压站指标******************************************************************/
|
|
|
|
|
|
|
|
|
- if (ZtConfig.getMaps().containsKey(id + "_UAB")) {
|
|
|
- List<String> ls = new ArrayList<>();
|
|
|
+ if (ZtConfig.getMaps().containsKey(id + "_UAB")) {
|
|
|
+ List<String> ls = new ArrayList<>();
|
|
|
|
|
|
- ls = ZtConfig.getMaps().get(id + "_UAB");
|
|
|
- if (!ls.isEmpty()) {
|
|
|
- List<PointData> zblist = realApiUtil.getRealData(ls);
|
|
|
- double temp = 0.0;
|
|
|
- if (!zblist.isEmpty()) {
|
|
|
+ ls = ZtConfig.getMaps().get(id + "_UAB");
|
|
|
+ if (!ls.isEmpty()) {
|
|
|
+ List<PointData> zblist = realApiUtil.getRealData(ls);
|
|
|
+ double temp = 0.0;
|
|
|
+ if (!zblist.isEmpty()) {
|
|
|
|
|
|
- for (int i = 0; i < zblist.size(); i++)
|
|
|
- temp = temp + zblist.get(i).getPointValueInDouble();
|
|
|
+ for (int i = 0; i < zblist.size(); i++)
|
|
|
+ temp = temp + zblist.get(i).getPointValueInDouble();
|
|
|
|
|
|
- }
|
|
|
- jczbmap.put("uab", MathUtil.twoBit(temp));
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ jczbmap.put("uab", MathUtil.twoBit(temp));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- if (ZtConfig.getMaps().containsKey(id + "_IA")) {
|
|
|
- List<String> ls = new ArrayList<>();
|
|
|
+ if (ZtConfig.getMaps().containsKey(id + "_IA")) {
|
|
|
+ List<String> ls = new ArrayList<>();
|
|
|
|
|
|
- ls = ZtConfig.getMaps().get(id + "_IA");
|
|
|
- if (!ls.isEmpty()) {
|
|
|
- List<PointData> zblist = realApiUtil.getRealData(ls);
|
|
|
- double temp = 0.0;
|
|
|
- if (!zblist.isEmpty()) {
|
|
|
+ ls = ZtConfig.getMaps().get(id + "_IA");
|
|
|
+ if (!ls.isEmpty()) {
|
|
|
+ List<PointData> zblist = realApiUtil.getRealData(ls);
|
|
|
+ double temp = 0.0;
|
|
|
+ if (!zblist.isEmpty()) {
|
|
|
|
|
|
- for (int i = 0; i < zblist.size(); i++)
|
|
|
- temp = temp + zblist.get(i).getPointValueInDouble();
|
|
|
+ for (int i = 0; i < zblist.size(); i++)
|
|
|
+ temp = temp + zblist.get(i).getPointValueInDouble();
|
|
|
|
|
|
- }
|
|
|
- jczbmap.put("ia", MathUtil.twoBit(temp));
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ jczbmap.put("ia", MathUtil.twoBit(temp));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- if (ZtConfig.getMaps().containsKey(id + "_DNLB")) {
|
|
|
- List<String> ls = new ArrayList<>();
|
|
|
+ if (ZtConfig.getMaps().containsKey(id + "_DNLB")) {
|
|
|
+ List<String> ls = new ArrayList<>();
|
|
|
|
|
|
- ls = ZtConfig.getMaps().get(id + "_DNLB");
|
|
|
- if (!ls.isEmpty()) {
|
|
|
- List<PointData> zblist = realApiUtil.getRealData(ls);
|
|
|
- double temp = 0.0;
|
|
|
- if (!zblist.isEmpty()) {
|
|
|
+ ls = ZtConfig.getMaps().get(id + "_DNLB");
|
|
|
+ if (!ls.isEmpty()) {
|
|
|
+ List<PointData> zblist = realApiUtil.getRealData(ls);
|
|
|
+ double temp = 0.0;
|
|
|
+ if (!zblist.isEmpty()) {
|
|
|
|
|
|
- for (int i = 0; i < zblist.size(); i++)
|
|
|
- temp = temp + zblist.get(i).getPointValueInDouble();
|
|
|
+ for (int i = 0; i < zblist.size(); i++)
|
|
|
+ temp = temp + zblist.get(i).getPointValueInDouble();
|
|
|
|
|
|
- }
|
|
|
- jczbmap.put("dnlb", MathUtil.twoBit(temp));
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ jczbmap.put("dnlb", MathUtil.twoBit(temp));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/*****************************************************升压站指标******************************************************************/
|
|
|
/*************************************************测风塔*************************************************************/
|
|
|
|
|
|
- if (InitialRunner.wpmap.containsKey(id)) {
|
|
|
- Windpowerstationpointnew point2 = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FCCFTFX30);
|
|
|
+ if (InitialRunner.wpmap.containsKey(id)) {
|
|
|
+ Windpowerstationpointnew point2 = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FCCFTFX30);
|
|
|
|
|
|
- if (StringUtils.notEmp(point2.getCode())) {
|
|
|
- PointData value = realApiUtil.getRealData(point2);
|
|
|
- jczbmap.put("cftfx", MathUtil.twoBit(value.getPointValueInDouble()));
|
|
|
- }
|
|
|
- point2 = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FCCFTFS30);
|
|
|
+ if (StringUtils.notEmp(point2.getCode())) {
|
|
|
+ PointData value = realApiUtil.getRealData(point2);
|
|
|
+ jczbmap.put("cftfx", MathUtil.twoBit(value.getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ point2 = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FCCFTFS30);
|
|
|
|
|
|
- if (StringUtils.notEmp(point2.getCode())) {
|
|
|
- PointData value = realApiUtil.getRealData(point2);
|
|
|
- jczbmap.put("cftfs", MathUtil.twoBit(value.getPointValueInDouble()));
|
|
|
- }
|
|
|
+ if (StringUtils.notEmp(point2.getCode())) {
|
|
|
+ PointData value = realApiUtil.getRealData(point2);
|
|
|
+ jczbmap.put("cftfs", MathUtil.twoBit(value.getPointValueInDouble()));
|
|
|
+ }
|
|
|
|
|
|
- //map.put(wp.getId() + "cftmap", cftmap);
|
|
|
- }
|
|
|
+ //map.put(wp.getId() + "cftmap", cftmap);
|
|
|
+ }
|
|
|
|
|
|
/*************************************************测风塔*************************************************************/
|
|
|
|
|
|
/*************************************************6种状态*************************************************************/
|
|
|
|
|
|
|
|
|
- List<Windsubandwindturbiinereal> list=windsubandwindturbiinerealService.findWtBySub(sub.getId());
|
|
|
|
|
|
- if(!list.isEmpty())
|
|
|
- {
|
|
|
|
|
|
- List<String> fjzbls = new ArrayList<>();
|
|
|
- List<String> gfzbls = new ArrayList<>();
|
|
|
- //光伏没有明细计算点,所以区分开
|
|
|
- if(wp.getId().endsWith("FDC") && InitialRunner.wp_wtmap.containsKey(wp.getId())){
|
|
|
- List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
|
|
|
- for(Windsubandwindturbiinereal wsub:list)
|
|
|
- {
|
|
|
- //明细状态
|
|
|
- fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wsub.getWindturbineid(), Constant.ZTMX).getCode());
|
|
|
- }
|
|
|
- for (Windturbine wt : wtls) {
|
|
|
-
|
|
|
- }
|
|
|
- } else if(wp.getId().endsWith("GDC") && InitialRunner.gp_nbqmap.containsKey(wp.getId())){
|
|
|
- List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
|
|
|
- for (Inverter wt : wtls) {
|
|
|
- //状态
|
|
|
- gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
|
|
|
- }
|
|
|
- }
|
|
|
+ List<String> zbls = new ArrayList<>();
|
|
|
+ //光伏没有明细计算点,所以区分开
|
|
|
+ if(wp.getId().endsWith("FDC") && InitialRunner.wp_wtmap.containsKey(wp.getId())){
|
|
|
+ List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
|
|
|
+ for(Windturbine wt:wtls)
|
|
|
+ {
|
|
|
+ //明细状态
|
|
|
+ zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
|
|
|
+ }
|
|
|
+ for (Windturbine wt : wtls) {
|
|
|
|
|
|
- int djts=0;
|
|
|
- int yxts=0;
|
|
|
- int gzts=0;
|
|
|
- int lxts=0;
|
|
|
- int whts=0;
|
|
|
- int xdts=0;
|
|
|
- int slts=0;
|
|
|
- int jrts=0;
|
|
|
- List<PointData> gfzblist = realApiUtil.getRealData(gfzbls);
|
|
|
- if (!gfzblist.isEmpty() && gfzbls.size() == gfzblist.size()) {
|
|
|
- for (int i = 0; i < gfzblist.size(); i++) {
|
|
|
- double gfzt = MathUtil.twoBit(MathUtil.twoBit(gfzblist.get(i).getPointValueInDouble()));
|
|
|
- switch (Double.valueOf(gfzt).intValue()) {
|
|
|
- case 0:
|
|
|
- djts++;
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- yxts++;
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- gzts++;
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- lxts++;
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- whts++;
|
|
|
- break;
|
|
|
- case 5:
|
|
|
- xdts++;
|
|
|
- break;
|
|
|
- case 6:
|
|
|
- slts++;
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
-
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- jrts=djts+yxts+gzts+lxts+whts+xdts+slts;
|
|
|
-
|
|
|
- jczbmap.put("zjts", jrts);
|
|
|
- jczbmap.put("djts", djts);
|
|
|
- jczbmap.put("yxts", yxts);
|
|
|
- jczbmap.put("gzts", gzts);
|
|
|
- jczbmap.put("lxts", lxts);
|
|
|
- jczbmap.put("whts", whts);
|
|
|
- jczbmap.put("xdts", xdts);
|
|
|
- jczbmap.put("slts", slts);
|
|
|
- }
|
|
|
+ }
|
|
|
+ } else if(wp.getId().endsWith("GDC") && InitialRunner.gp_nbqmap.containsKey(wp.getId())){
|
|
|
+ List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
|
|
|
+ for (Inverter wt : wtls) {
|
|
|
+ //状态
|
|
|
+ zbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ int djts=0;
|
|
|
+ int yxts=0;
|
|
|
+ int gzts=0;
|
|
|
+ int lxts=0;
|
|
|
+ int whts=0;
|
|
|
+ int xdts=0;
|
|
|
+ int slts=0;
|
|
|
+ int jrts=0;
|
|
|
+ List<PointData> gfzblist = realApiUtil.getRealData(zbls);
|
|
|
+ if (!gfzblist.isEmpty() && zbls.size() == gfzblist.size()) {
|
|
|
+ for (int i = 0; i < gfzblist.size(); i++) {
|
|
|
+ double gfzt = MathUtil.twoBit(MathUtil.twoBit(gfzblist.get(i).getPointValueInDouble()));
|
|
|
+ switch (Double.valueOf(gfzt).intValue()) {
|
|
|
+ case 0:
|
|
|
+ djts++;
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ yxts++;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ gzts++;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ lxts++;
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ whts++;
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ xdts++;
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ slts++;
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ jrts=djts+yxts+gzts+lxts+whts+xdts+slts;
|
|
|
+
|
|
|
+ jczbmap.put("zjts", jrts);
|
|
|
+ jczbmap.put("djts", djts);
|
|
|
+ jczbmap.put("yxts", yxts);
|
|
|
+ jczbmap.put("gzts", gzts);
|
|
|
+ jczbmap.put("lxts", lxts);
|
|
|
+ jczbmap.put("whts", whts);
|
|
|
+ jczbmap.put("xdts", xdts);
|
|
|
+ jczbmap.put("slts", slts);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ map.put("maps", maps);
|
|
|
/*************************************************6种状态*************************************************************/
|
|
|
- }
|
|
|
|
|
|
- maps.add(jczbmap);
|
|
|
+/*************************************************五项损失**************************************************************/
|
|
|
+
|
|
|
|
|
|
|
|
|
- }
|
|
|
+ Map<String, Double> wxssmap = new HashMap<>();
|
|
|
+ List<String> wxssls = new ArrayList<>();
|
|
|
+
|
|
|
+ // 日场内受累检修
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RLZSSDL).getCode());
|
|
|
+ // 日场内受累故障
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RSZSSDL).getCode());
|
|
|
+ //日待机损失
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RSDJZSDL).getCode());
|
|
|
+ //日手动停机损失
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RSSTZSDL).getCode());
|
|
|
+ //日性能损失
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RXNZSDL).getCode());
|
|
|
+ //日缺陷降出力损失
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RSQXZSDL).getCode());
|
|
|
+ //日故障损失
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RGZSSDL).getCode());
|
|
|
+ //日检修损失
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RJXSSDL).getCode());
|
|
|
+ //日限电损失
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RXDSSDL).getCode());
|
|
|
+
|
|
|
+ //日场外受累电网
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RWZSSDL).getCode());
|
|
|
+ // 日场外受累天气
|
|
|
+ wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RTZSSDL).getCode());
|
|
|
+
|
|
|
+ List<PointData> wxsslist = realApiUtil.getRealData(wxssls);
|
|
|
+
|
|
|
+ if (!wxsslist.isEmpty() && wxsslist.size() == wxssls.size()) {
|
|
|
+
|
|
|
+ Double rjxsl = MathUtil.twoBit(wxsslist.get(0).getPointValueInDouble());
|
|
|
+ // 日场内受累故障
|
|
|
+ Double rgzzsl = MathUtil.twoBit(wxsslist.get(1).getPointValueInDouble());
|
|
|
+
|
|
|
+
|
|
|
+ wxssmap.put("rjxsl", rjxsl);
|
|
|
+ wxssmap.put("rgzzsl", rgzzsl);
|
|
|
+
|
|
|
+
|
|
|
+ //日待机损失
|
|
|
+ Double rdjss = MathUtil.twoBit(wxsslist.get(2).getPointValueInDouble());
|
|
|
+ //日手动停机损失
|
|
|
+ Double rsdtjss = MathUtil.twoBit(wxsslist.get(3).getPointValueInDouble());
|
|
|
+ //日性能损失
|
|
|
+ Double rxnss = MathUtil.twoBit(wxsslist.get(4).getPointValueInDouble());
|
|
|
+ //日缺陷降出力损失
|
|
|
+ Double rqxjclss = MathUtil.twoBit(wxsslist.get(5).getPointValueInDouble());
|
|
|
+
|
|
|
+ //日欠发损失=日待机损失+日手动停机损失+日性能损失+日缺陷降出力损失
|
|
|
+ Double rqfssdl = new BigDecimal(rdjss + rsdtjss + rxnss + rqxjclss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+
|
|
|
+ Double rgzss = MathUtil.twoBit(wxsslist.get(6).getPointValueInDouble());
|
|
|
+ //日故障损失电量=日故障损失+日故障受累
|
|
|
+ Double rgzssdl = new BigDecimal(rgzss + rgzzsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ //日检修损失电量=日检修损失+日检修受累
|
|
|
+ Double rjxss = MathUtil.twoBit(wxsslist.get(7).getPointValueInDouble());
|
|
|
+ Double rjxssdl = new BigDecimal(rjxss + rjxsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+
|
|
|
+
|
|
|
+ vo.setWhss(rjxssdl);
|
|
|
+ vo.setGzss(rgzssdl);
|
|
|
+ vo.setXnss(rqfssdl);
|
|
|
+// wxssmap.put("rqfssdl", rqfssdl);
|
|
|
+// wxssmap.put("rgzssdl", rgzssdl);
|
|
|
+// wxssmap.put("rjxssdl", rjxssdl);
|
|
|
+
|
|
|
+
|
|
|
+ double temp = 0.0;
|
|
|
+ temp = MathUtil.twoBit(wxsslist.get(8).getPointValueInDouble());
|
|
|
+ Double rxdssdl = new BigDecimal(temp).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+
|
|
|
+ // wxssmap.put("rxdssdl", StringUtils.round(rxdssdl < 0.0 ? 0.0 : rxdssdl, 2));
|
|
|
+ vo.setXdss(rxdssdl);
|
|
|
+ Double rdwsl = MathUtil.twoBit(wxsslist.get(9).getPointValueInDouble());
|
|
|
+ Double rtqsl = MathUtil.twoBit(wxsslist.get(10).getPointValueInDouble());
|
|
|
+ Double rslssdl = new BigDecimal(rdwsl + rtqsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+
|
|
|
+ //wxssmap.put("rslssdl", rslssdl);
|
|
|
+ vo.setSlss(rslssdl);
|
|
|
+ vo.setLlfdl(MathUtil.twoBit(scadafdl + rjxssdl + rgzssdl + rqfssdl + rxdssdl + rslssdl));
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ wxssmap.put("rjxsl", 0.0);
|
|
|
+ wxssmap.put("rgzzsl", 0.0);
|
|
|
+ wxssmap.put("rqfssdl", 0.0);
|
|
|
+ wxssmap.put("rgzssdl", 0.0);
|
|
|
+ wxssmap.put("rjxssdl", 0.0);
|
|
|
+ wxssmap.put("rxdssdl", 0.0);
|
|
|
+ wxssmap.put("rslssdl", 0.0);
|
|
|
+
|
|
|
|
|
|
}
|
|
|
+ // map.put("wxssmap", wxssmap);
|
|
|
|
|
|
- map.put("maps", maps);
|
|
|
+/****************************************************五项损失************************************************************/
|
|
|
+
|
|
|
+
|
|
|
+ vos.add(vo);
|
|
|
+
|
|
|
+ maps.add(jczbmap);
|
|
|
}
|
|
|
|
|
|
+ int gfsl = 0;
|
|
|
+ int fcsl = 0;
|
|
|
+ ZtjsVo gfvo = new ZtjsVo();
|
|
|
+ gfvo.setWpId("-2");
|
|
|
+ gfvo.setWpName("光伏合计");
|
|
|
+ initalVo(gfvo);
|
|
|
+ ZtjsVo fcvo = new ZtjsVo();
|
|
|
+ fcvo.setWpId("-1");
|
|
|
+ fcvo.setWpName("风电合计");
|
|
|
+ initalVo(fcvo);
|
|
|
+ ZtjsVo qsvo = new ZtjsVo();
|
|
|
+ qsvo.setWpId("0");
|
|
|
+ qsvo.setWpName("总计");
|
|
|
+ initalVo(qsvo);
|
|
|
+ for (ZtjsVo vo : vos) {
|
|
|
+ if (vo.getWpId().endsWith("FDC")) {
|
|
|
+
|
|
|
+ fcvo.setZjrl(fcvo.getZjrl() + vo.getZjrl());
|
|
|
+ fcvo.setFdl(fcvo.getFdl() + vo.getFdl());
|
|
|
+ fcvo.setSwdl(fcvo.getSwdl() + vo.getSwdl());
|
|
|
+ fcvo.setLyxs(fcvo.getLyxs() + vo.getLyxs());
|
|
|
+ fcvo.setFs(fcvo.getFs() + vo.getFs());
|
|
|
+ fcvo.setGl(fcvo.getGl() + vo.getGl());
|
|
|
+ fcvo.setCxgl(fcvo.getCxgl() + vo.getCxgl());
|
|
|
+ fcvo.setLlgl(fcvo.getLlgl() + vo.getLlgl());
|
|
|
+ fcvo.setBzgl(fcvo.getBzgl() + vo.getBzgl());
|
|
|
+ fcvo.setYcgl(fcvo.getYcgl() + vo.getYcgl());
|
|
|
+ fcvo.setAGCzl(fcvo.getAGCzl() + vo.getAGCzl());
|
|
|
+ fcvo.setLlfdl(fcvo.getLlfdl() + vo.getLlfdl());
|
|
|
+ fcvo.setScadafdl(fcvo.getScadafdl() + vo.getScadafdl());
|
|
|
+ fcvo.setWhss(fcvo.getWhss() + vo.getWhss());
|
|
|
+ fcvo.setGzss(fcvo.getGzss() + vo.getGzss());
|
|
|
+ fcvo.setSlss(fcvo.getSlss() + vo.getSlss());
|
|
|
+ fcvo.setXdss(fcvo.getXdss() + vo.getXdss());
|
|
|
+ fcvo.setXnss(fcvo.getXnss() + vo.getXnss());
|
|
|
+
|
|
|
+ fcsl++;
|
|
|
+ } else if (vo.getWpId().endsWith("GDC")) {
|
|
|
+ gfvo.setZjrl(gfvo.getZjrl() + vo.getZjrl());
|
|
|
+ gfvo.setFdl(gfvo.getFdl() + vo.getFdl());
|
|
|
+ gfvo.setSwdl(gfvo.getSwdl() + vo.getSwdl());
|
|
|
+ gfvo.setLyxs(gfvo.getLyxs() + vo.getLyxs());
|
|
|
+ gfvo.setFs(gfvo.getFs() + vo.getFs());
|
|
|
+ gfvo.setGl(gfvo.getGl() + vo.getGl());
|
|
|
+ gfvo.setCxgl(gfvo.getCxgl() + vo.getCxgl());
|
|
|
+ gfvo.setLlgl(gfvo.getLlgl() + vo.getLlgl());
|
|
|
+ gfvo.setBzgl(gfvo.getBzgl() + vo.getBzgl());
|
|
|
+ gfvo.setYcgl(gfvo.getYcgl() + vo.getYcgl());
|
|
|
+ gfvo.setAGCzl(gfvo.getAGCzl() + vo.getAGCzl());
|
|
|
+ gfvo.setLlfdl(gfvo.getLlfdl() + vo.getLlfdl());
|
|
|
+ gfvo.setScadafdl(gfvo.getScadafdl() + vo.getScadafdl());
|
|
|
+ gfvo.setWhss(gfvo.getWhss() + vo.getWhss());
|
|
|
+ gfvo.setGzss(gfvo.getGzss() + vo.getGzss());
|
|
|
+ gfvo.setSlss(gfvo.getSlss() + vo.getSlss());
|
|
|
+ gfvo.setXdss(gfvo.getXdss() + vo.getXdss());
|
|
|
+ gfvo.setXnss(gfvo.getXnss() + vo.getXnss());
|
|
|
+ gfsl++;
|
|
|
+ }
|
|
|
+
|
|
|
+ qsvo.setZjrl(qsvo.getZjrl() + vo.getZjrl());
|
|
|
+ qsvo.setFdl(qsvo.getFdl() + vo.getFdl());
|
|
|
+ qsvo.setSwdl(qsvo.getSwdl() + vo.getSwdl());
|
|
|
+ qsvo.setLyxs(qsvo.getLyxs() + vo.getLyxs());
|
|
|
+ qsvo.setFs(qsvo.getFs() + vo.getFs());
|
|
|
+ qsvo.setGl(qsvo.getGl() + vo.getGl());
|
|
|
+ qsvo.setCxgl(qsvo.getCxgl() + vo.getCxgl());
|
|
|
+ qsvo.setLlgl(qsvo.getLlgl() + vo.getLlgl());
|
|
|
+ qsvo.setBzgl(qsvo.getBzgl() + vo.getBzgl());
|
|
|
+ qsvo.setYcgl(qsvo.getYcgl() + vo.getYcgl());
|
|
|
+ qsvo.setAGCzl(qsvo.getAGCzl() + vo.getAGCzl());
|
|
|
+ qsvo.setLlfdl(qsvo.getLlfdl() + vo.getLlfdl());
|
|
|
+ qsvo.setScadafdl(qsvo.getScadafdl() + vo.getScadafdl());
|
|
|
+ qsvo.setWhss(qsvo.getWhss() + vo.getWhss());
|
|
|
+ qsvo.setGzss(qsvo.getGzss() + vo.getGzss());
|
|
|
+ qsvo.setSlss(qsvo.getSlss() + vo.getSlss());
|
|
|
+ qsvo.setXdss(qsvo.getXdss() + vo.getXdss());
|
|
|
+ qsvo.setXnss(qsvo.getXnss() + vo.getXnss());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fcsl != 0) {
|
|
|
+ Double fs = new BigDecimal(fcvo.getFs()).divide(new BigDecimal(fcsl), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+
|
|
|
+ fcvo.setFs(fs);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (gfsl != 0) {
|
|
|
+ Double fs = new BigDecimal(gfvo.getFs()).divide(new BigDecimal(gfsl), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+
|
|
|
+ gfvo.setFs(fs);
|
|
|
+ }
|
|
|
+ if (vos.size() != 0) {
|
|
|
+ Double fs = new BigDecimal(qsvo.getFs()).divide(new BigDecimal(vos.size()), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+
|
|
|
+ qsvo.setFs(fs);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ZtjsVo> result = new ArrayList<>();
|
|
|
+
|
|
|
+ for (ZtjsVo vo : vos) {
|
|
|
+ if (vo.getWpId().endsWith("FDC")) {
|
|
|
+
|
|
|
+ result.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ roundVo(fcvo);
|
|
|
+ result.add(fcvo);
|
|
|
+ for (ZtjsVo vo : vos) {
|
|
|
+ if (vo.getWpId().endsWith("GDC")) {
|
|
|
+
|
|
|
+ result.add(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ roundVo(gfvo);
|
|
|
+ result.add(gfvo);
|
|
|
+ roundVo(qsvo);
|
|
|
+ result.add(qsvo);
|
|
|
+ map.put("vos", result);
|
|
|
return map;
|
|
|
}
|
|
|
|