Commit 1433c184 authored by chenzhao's avatar chenzhao

修改 风机曲线图右侧数值接口 修改风机曲线光伏打点接口 修改逆变器状态颜色

parent b25328ce
...@@ -695,7 +695,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -695,7 +695,7 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "详情基础信息") @ApiOperation(value = "详情基础信息")
@GetMapping("/getStatisticsInfo") @GetMapping("/getStatisticsInfo")
public ResponseModel<Map<String,String>> getStatisticsInfo(@RequestParam(value = "equipmentIndexName", required = false) String equipmentIndexName, public ResponseModel<Map<String,Object>> getStatisticsInfo(@RequestParam(value = "equipmentIndexName", required = false) String equipmentIndexName,
@RequestParam(value = "stationId", required = false) String stationId, @RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value = "stationType", required = false) String stationType) { @RequestParam(value = "stationType", required = false) String stationType) {
// StationBasic stationBasic = stationBasicMapper.selectById(stationId); // StationBasic stationBasic = stationBasicMapper.selectById(stationId);
......
...@@ -12,7 +12,10 @@ import java.util.Map; ...@@ -12,7 +12,10 @@ import java.util.Map;
public interface TemporaryDataMapper extends BaseMapper<TemporaryData> { public interface TemporaryDataMapper extends BaseMapper<TemporaryData> {
List<Map<String, String>> timingTemporarysSorageData (@RequestParam(value ="gatewayId" ) String gatewayId); List<Map<String, Object>> timingTemporarysSorageData (@RequestParam(value ="gatewayId" ) String gatewayId);
List<Map<String, Object>> timingTemporarysSorageDataByIndexName (@RequestParam(value ="gatewayId" ) String gatewayId,
@RequestParam(value ="equipmentIndexName" ) String equipmentIndexName);
Map<String, String> getStatisticsInfo (@RequestParam(value ="gatewayId" ) String gatewayId, Map<String, String> getStatisticsInfo (@RequestParam(value ="gatewayId" ) String gatewayId,
......
...@@ -306,9 +306,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -306,9 +306,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
colorMap.put("正常运行", "#00aa00"); colorMap.put("正常运行", "#00aa00");
colorMap.put("报警运行", "#ffc400"); colorMap.put("报警运行", "#ffc400");
colorMap.put("停机状态", "#0055ff"); colorMap.put("停机状态", "#0055ff");
colorMap.put("故障状态", "#00aaff"); colorMap.put("故障状态", "#ff0000");
colorMap.put("限功率", "#a3f5aa"); colorMap.put("限功率", "#a3f5aa");
colorMap.put("待机状态", "#ff0000"); colorMap.put("待机状态", "#00aaff");
colorMap.put("维护状态", "#ff00ff"); colorMap.put("维护状态", "#ff00ff");
colorMap.put("通讯中断", "#7d8e95"); colorMap.put("通讯中断", "#7d8e95");
list.forEach(item -> { list.forEach(item -> {
...@@ -421,18 +421,18 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -421,18 +421,18 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public Map<String, Object> getDetailsWindSpeedAll(String gatewayId) { public Map<String, Object> getDetailsWindSpeedAll(String gatewayId) {
List<Map<String, String>> list = temporaryDataMapper.timingTemporarysSorageData(gatewayId); List<Map<String, Object>> list = temporaryDataMapper.timingTemporarysSorageData(gatewayId);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<String> values = new ArrayList<>(); List<String> values = new ArrayList<>();
List<String> valueList = new ArrayList<>(); List<String> valueList = new ArrayList<>();
Set<String> time = new TreeSet<>(); Set<String> time = new TreeSet<>();
for (Map<String, String> stringStringMap : list) { for (Map<String, Object> stringStringMap : list) {
if (stringStringMap.get("equipmentIndexName").equals("有功功率")) { if (stringStringMap.get("equipmentIndexName").toString().equals("有功功率")) {
values.add(stringStringMap.get("value")); values.add(stringStringMap.get("value").toString());
} else { } else {
valueList.add(stringStringMap.get("value")); valueList.add(stringStringMap.get("value").toString());
time.add(stringStringMap.get("createdTime")); time.add(stringStringMap.get("createdTime").toString());
} }
} }
...@@ -663,9 +663,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -663,9 +663,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public void schedSolarPower(String gatewayId, long timeInMillis) { public void schedSolarPower(String gatewayId, long timeInMillis) {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
queryCondtion.put(CommonConstans.QueryStringDisplayName, Arrays.asList("总辐射累计")); queryCondtion.put(CommonConstans.QueryStringDisplayNameKeyword, Arrays.asList("总辐射累计"));
List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
queryCondtion.put(CommonConstans.QueryStringDisplayName, Arrays.asList("有功功率")); queryCondtion.put(CommonConstans.QueryStringDisplayNameKeyword, Arrays.asList("有功功率"));
List<ESEquipments> indicatorsDtoLists = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> indicatorsDtoLists = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
List<TemporaryData> temporaryDatas = new ArrayList<>(); List<TemporaryData> temporaryDatas = new ArrayList<>();
List<TemporaryData> temporaryDatass = new ArrayList<>(); List<TemporaryData> temporaryDatass = new ArrayList<>();
...@@ -802,9 +802,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -802,9 +802,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
likeCodtion.put(CommonConstans.QueryStringDisplayName+".keyword", "合位"); likeCodtion.put(CommonConstans.QueryStringDisplayName+".keyword", "合位");
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class,likeCodtion); List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class,likeCodtion);
Collator instance = Collator.getInstance(Locale.CHINA);
Collections.sort(listData, (e1, e2) -> {
return instance.compare(e1.getFrontModule(), e2.getFrontModule());
});
List<Map<String, Object>> statusMaps = new ArrayList<>(); List<Map<String, Object>> statusMaps = new ArrayList<>();
Map<String, List<ESEquipments>> collect = listData.stream().collect(Collectors.groupingBy(ESEquipments::getFrontModule, LinkedHashMap::new, Collectors.toList())); Map<String, List<ESEquipments>> collect = listData.stream().collect(Collectors.groupingBy(ESEquipments::getFrontModule, LinkedHashMap::new, Collectors.toList()));
for (String s : collect.keySet()) { for (String s : collect.keySet()) {
Map<String, Object> statusMap = new HashMap<>(); Map<String, Object> statusMap = new HashMap<>();
if (frontModule.equals("前光")) { if (frontModule.equals("前光")) {
...@@ -1466,7 +1470,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1466,7 +1470,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return resultMap; return resultMap;
} }
public Map<String, String> getStatisticsInfo(String equipmentIndexName, String stationId) { public Map<String, Object> getStatisticsInfo(String equipmentIndexName, String stationId) {
StationCacheInfoDto stationCacheInfoDto = commonServiceImpl.getStationCacheInfoDtoByStationId(stationId); StationCacheInfoDto stationCacheInfoDto = commonServiceImpl.getStationCacheInfoDtoByStationId(stationId);
String gatewayId = stationCacheInfoDto.getFanGatewayId(); String gatewayId = stationCacheInfoDto.getFanGatewayId();
if (!"FDZ".equals(stationCacheInfoDto.getStationType())) { if (!"FDZ".equals(stationCacheInfoDto.getStationType())) {
...@@ -1477,9 +1481,49 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1477,9 +1481,49 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId()));
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
String load = String.format(CommonConstans.Twodecimalplaces, Double.parseDouble(String.valueOf(listData.get(0).getValueDouble())) / Double.parseDouble(stationCacheInfoDto.getInstalledCapacity())); String load = String.format(CommonConstans.Twodecimalplaces, Double.parseDouble(String.valueOf(listData.get(0).getValueDouble())) / Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
Map<String, String> result = temporaryDataMapper.getStatisticsInfo(gatewayId, equipmentIndexName);
result.put("load", load);
return result; List<Map<String, Object>> list = temporaryDataMapper.timingTemporarysSorageDataByIndexName(gatewayId,equipmentIndexName);
Map<String,Object> map = new HashMap<>();
List<String> values = new ArrayList<>();
Set<String> time = new TreeSet<>();
String v = list.get(0).get("value").toString();
double min = Double.parseDouble(v);
double max = Double.parseDouble(v);
double mean = 0.0;
String minTime =list.get(0).get("createdTime").toString();
String maxTime =list.get(0).get("createdTime").toString();
for (Map<String, Object> stringStringMap : list) {
double value = Double.parseDouble(stringStringMap.get("value").toString());
values.add( String.format("%.2f",value));
if (value < min){
min = value;
minTime = stringStringMap.get("createdTime").toString();
}else if (value > max){
max = value;
maxTime = stringStringMap.get("createdTime").toString();
}
time.add(stringStringMap.get("createdTime").toString());
}
for (String value : values) {
mean += Double.parseDouble(value);
}
mean = Double.parseDouble(String.format("%.2f",mean/values.size()));
List<Map<String,Object>> seriesData = new ArrayList<>();
map.put("mean",mean);
map.put("max",max);
map.put("min",min);
map.put("maxTime",maxTime);
map.put("minTime",minTime);
map.put("load", load);
return map;
} }
......
...@@ -19,6 +19,27 @@ ...@@ -19,6 +19,27 @@
</if> </if>
</where> </where>
GROUP BY batch_no ,equipmentIndexName; GROUP BY batch_no ,equipmentIndexName;
</select>
<select id="timingTemporarysSorageDataByIndexName" resultType="map">
SELECT avg(value) as value ,
created_time as createdTime ,
equipmentIndexName
FROM
`temporary_data`
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId}
</if>
<if test="gatewayId == null and gatewayId == ''">
equipmentNumber is not null and equipmentIndexName is not null
</if>
<if test="equipmentIndexName != null and equipmentIndexName != ''">
and equipmentIndexName =#{equipmentIndexName}
</if>
</where>
GROUP BY batch_no ,equipmentIndexName;
</select> </select>
......
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