Commit adbe99e1 authored by wujiang's avatar wujiang

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

# Conflicts: # amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
parents 97a7b34b ba5d6b6b
...@@ -26,6 +26,7 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -26,6 +26,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.MatchPhraseQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregation;
...@@ -121,7 +122,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -121,7 +122,7 @@ public class MonitorFanIdxController extends BaseController {
list.add(date1); list.add(date1);
Map<String, Object> queryCondtion = new HashMap<>(); Map<String, Object> queryCondtion = new HashMap<>();
queryCondtion.put("color",stationBasic.getQrcodeColor()); queryCondtion.put("color",stationBasic.getQrcodeColor());
queryCondtion.put("date",list); queryCondtion.put("data",list);
return ResponseHelper.buildResponse(queryCondtion); return ResponseHelper.buildResponse(queryCondtion);
} }
...@@ -1083,7 +1084,13 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1083,7 +1084,13 @@ public class MonitorFanIdxController extends BaseController {
List<String> list = Arrays.asList(keys); List<String> list = Arrays.asList(keys);
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
if (!stationBasic.getStationType().equals("FDZ")) { if (!stationBasic.getStationType().equals("FDZ")) {
boolQueryBuilder.must((QueryBuilders.termsQuery("equipmentIndexName.keyword", CommonConstans.taiHeGenIndicator))).must(QueryBuilders.matchQuery("gatewayId.keyword", stationBasic.getBoosterGatewayId()));
MatchPhraseQueryBuilder queryBuilder1 = QueryBuilders.matchPhraseQuery(CommonConstans.QueryStringFrontMoudleNotKeyWord, "*逆变器*");
boolQueryBuilder.must((QueryBuilders.termsQuery("equipmentIndexName.keyword", list))
).must(QueryBuilders.matchQuery("gatewayId.keyword", stationBasic.getFanGatewayId()));
boolQueryBuilder.must(queryBuilder1);
} else { } else {
boolQueryBuilder.must((QueryBuilders.termsQuery("equipmentIndexName.keyword", list))).must(QueryBuilders.matchQuery("gatewayId.keyword", gatewayId)); boolQueryBuilder.must((QueryBuilders.termsQuery("equipmentIndexName.keyword", list))).must(QueryBuilders.matchQuery("gatewayId.keyword", gatewayId));
...@@ -1117,33 +1124,56 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1117,33 +1124,56 @@ public class MonitorFanIdxController extends BaseController {
map.put("num", key); map.put("num", key);
for (ESEquipments equip : resultMap.get(key)) { for (ESEquipments equip : resultMap.get(key)) {
String value = String.format("%.4f", equip.getValueF()); String value = String.format("%.4f", equip.getValueF());
map.put("name", equip.getEquipmentSpecificName().substring(0, equip.getEquipmentSpecificName().indexOf("#"))+"/"+key); if (stationBasic.getStationType().equals("FDZ")) {
map.put("name", equip.getEquipmentSpecificName().substring(0, equip.getEquipmentSpecificName().indexOf("#"))+"/"+key);
switch (equip.getEquipmentIndexName()) {
case "日发电量": }else{
map.put("dayNum", value); map.put("name", key);
break;
case "月发电量":
map.put("monthNum", value);
break;
case "年发电量":
map.put("yearNum", value);
case CommonConstans.taiHeGenIndicatorDay:
map.put("dayNum", value);
break;
case CommonConstans.taiHeGenIndicatorMonth:
map.put("monthNum", value);
break;
case CommonConstans.taiHeGenIndicatorYear:
map.put("yearNum", value);
break;
} }
if (!stationBasic.getStationType().equals("FDZ")) {
switch (equip.getEquipmentIndexName()) {
case "日发电量":
map.put("dayNum", String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(value) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
break;
case "月发电量":
map.put("monthNum", String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(value) * CommonConstans.pvGenPoweActorCurrentData));
break;
case "年发电量":
map.put("yearNum", String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(value) * CommonConstans.pvGenPoweActorCurrentData));
}
}else{
switch (equip.getEquipmentIndexName()) {
case "日发电量":
map.put("dayNum", value);
break;
case "月发电量":
map.put("monthNum", value);
break;
case "年发电量":
map.put("yearNum", value);
// case CommonConstans.taiHeGenIndicatorDay:
// map.put("dayNum", value);
// break;
// case CommonConstans.taiHeGenIndicatorMonth:
// map.put("monthNum", value);
// break;
// case CommonConstans.taiHeGenIndicatorYear:
// map.put("yearNum", value);
// break;
}
}
} }
esEquipmentsMap.add(map); esEquipmentsMap.add(map);
} }
if (stationBasic.getStationType().equals("FDZ")) {
this.sortByFeild(esEquipmentsMap, "num");
}else{
this.sortByFeildString(esEquipmentsMap, "num");
this.sortByFeild(esEquipmentsMap,"num"); }
IPage<Map<String, Object>> page = new Page<>(); IPage<Map<String, Object>> page = new Page<>();
page.setTotal(esEquipmentsMap.size()); page.setTotal(esEquipmentsMap.size());
page.setSize(999); page.setSize(999);
...@@ -1172,6 +1202,14 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1172,6 +1202,14 @@ public class MonitorFanIdxController extends BaseController {
return list; return list;
} }
public static List<Map<String, Object>> sortByFeildString(List<Map<String, Object>> list, String feild) {
if (CollectionUtils.isNotEmpty(list)) {
Collections.sort(list, (m1, m2)-> String.valueOf(m1.get(feild).toString()).compareTo(String.valueOf(m2.get(feild).toString())));
}
return list;
}
//@Scheduled(cron = "0/10 * * * * ? ") //@Scheduled(cron = "0/10 * * * * ? ")
......
...@@ -217,8 +217,15 @@ public class LargeScreenImpl { ...@@ -217,8 +217,15 @@ public class LargeScreenImpl {
mapdta.put("NJHWC", 0d); mapdta.put("NJHWC", 0d);
//平均数 //平均数
List<String> value = new ArrayList<>(); List<String> value = new ArrayList<>();
List<String> ids =new ArrayList<>();
for (StationCacheInfoDto stationCacheInfoDto : gatewayId) {
ids.add(stationCacheInfoDto.getFanGatewayId());
ids.add(stationCacheInfoDto.getBoosterGatewayId());
}
// List<String> ids = gatewayId.stream().map(StationCacheInfoDto::getFanGatewayId).collect(Collectors.toList());
List<String> ids = gatewayId.stream().map(StationCacheInfoDto::getFanGatewayId).collect(Collectors.toList());
value.add(SS); value.add(SS);
value.add(ZFS); value.add(ZFS);
value.add(ZFSLJ); value.add(ZFSLJ);
......
...@@ -123,4 +123,8 @@ public class CommonConstans { ...@@ -123,4 +123,8 @@ public class CommonConstans {
public static final String taiHeGenIndicatorMonth = "泰和月发电量总和"; public static final String taiHeGenIndicatorMonth = "泰和月发电量总和";
public static final String taiHeGenIndicatorYear = "泰和年发电量总和"; public static final String taiHeGenIndicatorYear = "泰和年发电量总和";
public static final String taiheActivePowerPoint = "南瑞光差保护_313P";
public static final String taiheIrradiationPonit = "WTX-801_25_WTX-801_总辐射";
public static final String xiazaoActivePowerPoint = "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值";
public static final String xiazaoWindSpeedrPoint = "瞬时风速";
} }
...@@ -291,19 +291,9 @@ public class MonitorFanIdxController extends BaseController { ...@@ -291,19 +291,9 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "概览-全站功率曲线") @ApiOperation(value = "概览-全站功率曲线")
@GetMapping("/overviewWindSpeed") @GetMapping("/overviewWindSpeed")
public ResponseModel<Map<String, Object>> getOverviewWindSpeed(@RequestParam(value = "stationId", required = false) String stationId, @RequestParam(value = "type", required = false) String type, @RequestParam(value = "areaCode", required = false) String areaCode) { public void getOverviewWindSpeed(@RequestParam(value = "stationId", required = true) String stationId, @RequestParam(value = "type", required = false) String type, @RequestParam(value = "areaCode", required = false) String areaCode) {
String gatewayId = ""; StationBasic stationBasic = stationBasicMapper.selectById(stationId);
if (null != stationId) { monitorFanIndicator.getDetailsWindSpeedAll(stationBasic);
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
gatewayId = stationBasic.getBoosterGatewayId();
if (null == type) {
gatewayId = stationBasic.getFanGatewayId();
}
}
Map<String, Object> detailsWindSpeed = monitorFanIndicator.getDetailsWindSpeedAll(gatewayId);
return ResponseHelper.buildResponse(detailsWindSpeed);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
...@@ -676,7 +666,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -676,7 +666,7 @@ public class MonitorFanIdxController extends BaseController {
Double todayPower = Double.valueOf(columnMap.get(CommonConstans.taiHeGenIndicatorDay).toString()); Double todayPower = Double.valueOf(columnMap.get(CommonConstans.taiHeGenIndicatorDay).toString());
Double total = commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射累计"); Double total = commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射累计");
if (todayPower > 0 && total > 0) { if (todayPower > 0 && total > 0) {
Double overallEfficiency = todayPower*CommonConstans.wkwhToMv / ((total / 3.6) * capacityl); Double overallEfficiency = todayPower * CommonConstans.wkwhToMv / ((total / 3.6) * capacityl);
data9.put("title", String.format("%.2f", overallEfficiency * 100) + "%");//综合效率 data9.put("title", String.format("%.2f", overallEfficiency * 100) + "%");//综合效率
} else { } else {
data9.put("title", "0.00%");//综合效率 data9.put("title", "0.00%");//综合效率
......
...@@ -363,16 +363,16 @@ public class CommonServiceImpl { ...@@ -363,16 +363,16 @@ public class CommonServiceImpl {
氮氧化物减排量(t)=发电量(万kW·h)*1.69 氮氧化物减排量(t)=发电量(万kW·h)*1.69
*/ */
co2.setUnit("二氧化碳减排量(t)"); co2.setUnit("二氧化碳减排量(t)");
co2.setTitle(String.format("%.2f", totalSocialContribution * CommonConstans.carbonDioxide*CommonConstans.kgToT)); co2.setTitle(String.format("%.2f", totalSocialContribution * CommonConstans.carbonDioxide));
socialContributionDtoList.add(co2); socialContributionDtoList.add(co2);
coal.setUnit("节约标准煤(t)"); coal.setUnit("节约标准煤(t)");
coal.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.standardCoal*CommonConstans.kgToT))); coal.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.standardCoal)));
socialContributionDtoList.add(coal); socialContributionDtoList.add(coal);
toner.setUnit("碳粉尘减排量(t)"); toner.setUnit("碳粉尘减排量(t)");
toner.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.toner * CommonConstans.kgToT))); toner.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.toner )));
socialContributionDtoList.add(toner); socialContributionDtoList.add(toner);
so2.setUnit("二氧化硫减排量(t)"); so2.setUnit("二氧化硫减排量(t)");
so2.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.sulfurDioxide * CommonConstans.kgToT))); so2.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.sulfurDioxide )));
socialContributionDtoList.add(so2); socialContributionDtoList.add(so2);
socialContributionDtoPage.setRecords(socialContributionDtoList); socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100); socialContributionDtoPage.setTotal(100);
......
...@@ -283,20 +283,20 @@ public class MonitoringServiceIMQTTmpl { ...@@ -283,20 +283,20 @@ public class MonitoringServiceIMQTTmpl {
/** /**
* 实时推送-场站功率曲线总概览 * 实时推送-场站功率曲线总概览
*/ */
@Scheduled(cron = fanStationPowerBightCron) // @Scheduled(cron = fanStationPowerBightCron)
public void getFanStationPowerBight() { // public void getFanStationPowerBight() {
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("sequence_nbr").eq("station_type", "FDZ")); // List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("sequence_nbr").eq("station_type", "FDZ"));
stationBasicList.forEach(stationBasic -> { // stationBasicList.forEach(stationBasic -> {
String gatewayId = stationBasic.getFanGatewayId(); // String gatewayId = stationBasic.getFanGatewayId();
Map<String, Object> detailsWindSpeed = monitorFanIndicator.getDetailsWindSpeedAll(gatewayId); // Map<String, Object> detailsWindSpeed = monitorFanIndicator.getDetailsWindSpeedAll(gatewayId);
try { // try {
emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr() + "_fanStationPowerBight_topic", JSON.toJSON(detailsWindSpeed).toString().getBytes("UTF-8"), 1, true); // emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr() + "_fanStationPowerBight_topic", JSON.toJSON(detailsWindSpeed).toString().getBytes("UTF-8"), 1, true);
logger.info("-----------------发送风电站功率曲线数据消息=================== 成功!" + JSON.toJSONString(detailsWindSpeed)); // logger.info("-----------------发送风电站功率曲线数据消息=================== 成功!" + JSON.toJSONString(detailsWindSpeed));
} catch (Exception exception) { // } catch (Exception exception) {
logger.error("-----------------发送风电站功率曲线数据消息=================== 失败!"); // logger.error("-----------------发送风电站功率曲线数据消息=================== 失败!");
} // }
}); // });
} // }
/** /**
* 实时同送-获取各场站的风机列表 * 实时同送-获取各场站的风机列表
......
...@@ -830,7 +830,7 @@ public class MonitoringServiceImpl { ...@@ -830,7 +830,7 @@ public class MonitoringServiceImpl {
sorted.forEach(stationBasic -> { sorted.forEach(stationBasic -> {
HashMap<String, String> hashMap1 = new HashMap<>(); HashMap<String, String> hashMap1 = new HashMap<>();
hashMap1.put("stationName", stationBasic.getStationName()); hashMap1.put("stationName", stationBasic.getStationName());
hashMap1.put("value", stationBasic.getAddress()); hashMap1.put("value", stationBasic.getAddress()+"%");
hashMap1.put("value1", stationBasic.getAddress()); hashMap1.put("value1", stationBasic.getAddress());
mapList.add(hashMap1); mapList.add(hashMap1);
}); });
...@@ -1051,19 +1051,19 @@ public class MonitoringServiceImpl { ...@@ -1051,19 +1051,19 @@ public class MonitoringServiceImpl {
page2.setRecords(list2); page2.setRecords(list2);
Double totalAnnual = (powerOfAnnualFD + powerOfAnnualGF); Double totalAnnual = (powerOfAnnualFD + powerOfAnnualGF);
HashMap<String, String> stringHashMap13 = new HashMap<>(); HashMap<String, String> stringHashMap13 = new HashMap<>();
stringHashMap13.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.carbonDioxide * CommonConstans.kgToT))); stringHashMap13.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.carbonDioxide )));
stringHashMap13.put("title2", "二氧化碳减排量(t)"); stringHashMap13.put("title2", "二氧化碳减排量(t)");
list3.add(stringHashMap13); list3.add(stringHashMap13);
HashMap<String, String> stringHashMap14 = new HashMap<>(); HashMap<String, String> stringHashMap14 = new HashMap<>();
stringHashMap14.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.standardCoal * CommonConstans.kgToT))); stringHashMap14.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.standardCoal )));
stringHashMap14.put("title2", "节约标准煤(t)"); stringHashMap14.put("title2", "节约标准煤(t)");
list3.add(stringHashMap14); list3.add(stringHashMap14);
HashMap<String, String> stringHashMap15 = new HashMap<>(); HashMap<String, String> stringHashMap15 = new HashMap<>();
stringHashMap15.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.toner * CommonConstans.kgToT))); stringHashMap15.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.toner )));
stringHashMap15.put("title2", "碳粉尘减排量(t)"); stringHashMap15.put("title2", "碳粉尘减排量(t)");
list3.add(stringHashMap15); list3.add(stringHashMap15);
HashMap<String, String> stringHashMap16 = new HashMap<>(); HashMap<String, String> stringHashMap16 = new HashMap<>();
stringHashMap16.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.sulfurDioxide * CommonConstans.kgToT))); stringHashMap16.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.sulfurDioxide )));
stringHashMap16.put("title2", "二氧化硫减排量(t)"); stringHashMap16.put("title2", "二氧化硫减排量(t)");
list3.add(stringHashMap16); list3.add(stringHashMap16);
page3.setRecords(list3); page3.setRecords(list3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment