Commit 137fff5f authored by chenzhao's avatar chenzhao

修改代码

parent 2e21653c
...@@ -49,7 +49,7 @@ public class CommonServiceImpl { ...@@ -49,7 +49,7 @@ public class CommonServiceImpl {
Integer sleepTime; Integer sleepTime;
@Value("${sleep.time:30}") @Value("${sleep.time:30}")
Integer zxzsleepTime; Integer zxzsleepTime;
@Value("${base.url:http://36.40.66.175:30009/maas/maas/processes/api/}") @Value("${base.url:http://139.9.173.44:30009/maas/maas/processes/api/}")
String baseUrl; String baseUrl;
//----------------工况变量工况变量划分请求属性配置------------------------ //----------------工况变量工况变量划分请求属性配置------------------------
@Value("${gkblhffan.url:74435221-796d-43c0-ae72-319792b8f89e}") @Value("${gkblhffan.url:74435221-796d-43c0-ae72-319792b8f89e}")
......
...@@ -35,6 +35,8 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -35,6 +35,8 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -223,7 +225,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -223,7 +225,7 @@ public class MonitorFanIdxController extends BaseController {
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值")); queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"));
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId())); queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result1 = commonService.getListDataByCondtions(queryCondtion1, null, ESEquipments.class); List<ESEquipments> result1 = commonService.getListDataByCondtions(queryCondtion1, null, ESEquipments.class);
columnMap.put("有功功率", String.format("%.2f",result1.get(0).getValueF())); columnMap.put("有功功率", String.format("%.2f",result1.get(0).getValueF()/1000));
String num = monitorFanIndicator.getEquipCount(gatewayId,"FDZ"); String num = monitorFanIndicator.getEquipCount(gatewayId,"FDZ");
columnMap.put("风机台数",num); columnMap.put("风机台数",num);
...@@ -601,7 +603,6 @@ public class MonitorFanIdxController extends BaseController { ...@@ -601,7 +603,6 @@ public class MonitorFanIdxController extends BaseController {
String boosterGatewayId = stationBasic.getBoosterGatewayId(); String boosterGatewayId = stationBasic.getBoosterGatewayId();
String [] columnList = new String[]{"日发电量","月发电量","年发电量"}; String [] columnList = new String[]{"日发电量","月发电量","年发电量"};
String [] columnLists = new String[]{"有功功率"}; String [] columnLists = new String[]{"有功功率"};
String [] syLists = new String[]{"WTX-801_25_WTX-801_总辐射累计","WTX-801_25_WTX-801_总辐射","日照时数"};
Map<String, Object> columnMap = new HashMap<>(); Map<String, Object> columnMap = new HashMap<>();
//日 月 年发电量同仅统计逆变器数据 //日 月 年发电量同仅统计逆变器数据
List<Map<String, Object>> mapList; List<Map<String, Object>> mapList;
...@@ -612,26 +613,15 @@ public class MonitorFanIdxController extends BaseController { ...@@ -612,26 +613,15 @@ public class MonitorFanIdxController extends BaseController {
} }
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P","WTX-801_25_WTX-801_总辐射累计","WTX-801_25_WTX-801_总辐射"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result1 = commonService.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> result1 = commonService.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
columnMap.put("有功功率", String.format("%.2f",result1.get(0).getValueF())); columnMap.put("有功功率", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1,"南瑞光差保护_313P")/1000));
mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and(equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' or equipmentIndexName='有功功率')"); // mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and(equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' or equipmentIndexName='有功功率')");
//日-月-年-发电量需要保留四位小数问题修改 //日-月-年-发电量需要保留四位小数问题修改
for (String column : columnList) {
Double result = commonService.getTotalByIndicatior(mapList, column);
columnMap.put(column, String.format("%.4f",result* CommonConstans.pvGenPoweActor));
}
for (String column : syLists) {
Double result = commonService.getNumByIndicatior(boosterGatewayId, column);
columnMap.put(column, String.format("%.2f",result));
}
for (String column : columnLists) {
Double result = commonService.getTotalByIndicatior(gatewayId, column);
columnMap.put(column, String.format("%.2f",result));
}
String num = monitorFanIndicator.getEquipCount(gatewayId,"GF"); String num = monitorFanIndicator.getEquipCount(gatewayId,"GF");
columnMap.put("风机台数",num); columnMap.put("风机台数",num);
...@@ -653,7 +643,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -653,7 +643,7 @@ public class MonitorFanIdxController extends BaseController {
data3.put("title",columnMap.get("月发电量").toString()); data3.put("title",columnMap.get("月发电量").toString());
objects.add(data3); objects.add(data3);
Map<String, Object> data4 = new HashMap<>(); Map<String, Object> data4 = new HashMap<>();
data4.put("title",columnMap.get("WTX-801_25_WTX-801_总辐射").toString()); data4.put("title",commonService.getSumByEquipmentIndxName(result1,"WTX-801_25_WTX-801_总辐射"));
objects.add(data4); objects.add(data4);
Map<String, Object> data5 = new HashMap<>(); Map<String, Object> data5 = new HashMap<>();
data5.put("title",columnMap.get("年发电量").toString()); data5.put("title",columnMap.get("年发电量").toString());
...@@ -665,7 +655,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -665,7 +655,7 @@ public class MonitorFanIdxController extends BaseController {
data7.put("title",columnMap.get("日照时数").toString()); data7.put("title",columnMap.get("日照时数").toString());
objects.add(data7); objects.add(data7);
Map<String, Object> data8 = new HashMap<>(); Map<String, Object> data8 = new HashMap<>();
data8.put("title",columnMap.get("WTX-801_25_WTX-801_总辐射累计").toString()); data8.put("title",commonService.getSumByEquipmentIndxName(result1,"WTX-801_25_WTX-801_总辐射累计"));
objects.add(data8); objects.add(data8);
Map<String, Object> data9 = new HashMap<>(); Map<String, Object> data9 = new HashMap<>();
data9.put("title","0.00%");//综合效率 data9.put("title","0.00%");//综合效率
......
...@@ -205,7 +205,7 @@ public class MonitoringServiceImpl { ...@@ -205,7 +205,7 @@ public class MonitoringServiceImpl {
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getAvagerByEquipmentIndxName(result, "瞬时风速"))); completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getAvagerByEquipmentIndxName(result, "瞬时风速")));
completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"))); completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值")/1000));
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"))); completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")));
completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"))); completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量")));
completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"))); completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
...@@ -213,15 +213,15 @@ public class MonitoringServiceImpl { ...@@ -213,15 +213,15 @@ public class MonitoringServiceImpl {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList( "日发电量", "月发电量", "年发电量")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList( "日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>(); Map<String, String> likeQuerCondtion = new HashMap<>();
shouldQueryCondtion.put("frontModule", "逆变器"); likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
Map<String, List<String>> queryCondtion1 = new HashMap<>(); Map<String, List<String>> queryCondtion1 = new HashMap<>();
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("WTX-801_25_WTX-801_总辐射","南瑞光差保护_313P")); queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("WTX-801_25_WTX-801_总辐射","南瑞光差保护_313P"));
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId())); queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, shouldQueryCondtion, ESEquipments.class); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class,likeQuerCondtion);
List<ESEquipments> result1 = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class); List<ESEquipments> result1 = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class);
completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射"))); completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射")));
completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "南瑞光差保护_313P"))); completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "南瑞光差保护_313P")/1000));
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor)); completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor));
completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor)); completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, new BigDecimal(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor))); completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, new BigDecimal(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor)));
......
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