Commit a938cd3b authored by tangwei's avatar tangwei

解决冲突

parents a9fc3b65 399ebcab
......@@ -26,6 +26,7 @@ public class IndicatorsDto {
private String valueLabel;
private String distinct;
private String time;
private String timeValue;
private String displayName;
private String pictureName;
private String title;
......@@ -42,4 +43,14 @@ public class IndicatorsDto {
public void setTime(String time) {
this.time = time;
}
public void setTimeValue(String time) {
this.timeValue = time;
}
public String getTimeValue() {
if (null != timeValue) {
return timeValue.substring(0,5);
}
return null;
}
}
......@@ -636,7 +636,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
@Scheduled(cron = "0 */5 * * * ?")
@Scheduled(cron = "${windSpeed.Scheduled.cron}")
private void schedTaskData() {
LambdaQueryWrapper<StationBasic> wrapper = new LambdaQueryWrapper<>();
......@@ -1677,10 +1677,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
map.put("efficiency", keepTwoDecimalPlaces(e.getValue()));
break;
case "日发电量":
map.put("dayNum", keepTwoDecimalPlaces(e.getValue()));
double v = Double.parseDouble(e.getValue()) * CommonConstans.pvGenPoweActor;
map.put("dayNum", keepTwoDecimalPlaces(String.valueOf(v)));
break;
case "总发电量":
map.put("yearNum", keepTwoDecimalPlaces(e.getValue()));
double a = Double.parseDouble(e.getValue()) * CommonConstans.pvGenPoweActor;
map.put("yearNum", keepTwoDecimalPlaces(String.valueOf(a)));
break;
}
});
......@@ -1700,22 +1702,34 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
String[] equipNumber = equipNum.split("-");
String sql = "SELECT time ,equipmentIndexName ,value FROM iot_data_" + gatewayId + " WHERE time >'" + time + "' and equipmentSpecificName =~/" + equipNumber[0] + "子阵/ and equipmentSpecificName =~/逆变器" + equipNumber[1] + "/ and equipmentSpecificName =~/" + Integer.parseInt(equipNumber[2]) + "汇流箱/ and equipmentIndexName =~/路电流/";
String timeSql = "SELECT DISTINCT value FROM iot_data_" + gatewayId + " WHERE time >'" + time + "' and equipmentSpecificName =~/" + equipNumber[0] + "子阵/ and equipmentSpecificName =~/逆变器" + equipNumber[1] + "/ and equipmentSpecificName =~/" + Integer.parseInt(equipNumber[2]) + "汇流箱/ and equipmentIndexName =~/路电流/ group by time(2m)";
List<IndicatorsDto> dataList = influxDButils.getListData(sql, IndicatorsDto.class);
List<IndicatorsDto> timeList = influxDButils.getListDataAll(timeSql, IndicatorsDto.class);
List<IndicatorsDto> dataList = influxDButils.getListDataAll(sql, IndicatorsDto.class);
// List<IndicatorsDto> timeList = influxDButils.getListDataAll(timeSql, IndicatorsDto.class);
Map<String, List<IndicatorsDto>> timeMap = timeList.stream().collect(Collectors.groupingBy(IndicatorsDto::getTime, LinkedHashMap::new, Collectors.toList()));
Map<String, Object> resultMap = new HashMap<>();
// Map<String, List<IndicatorsDto>> timeMap = timeList.stream().collect(Collectors.groupingBy(IndicatorsDto::getTime, LinkedHashMap::new, Collectors.toList()));
Map<String, List<IndicatorsDto>> data = dataList.stream().collect(Collectors.groupingBy(IndicatorsDto::getEquipmentIndexName, LinkedHashMap::new, Collectors.toList()));
int num = 0;
List<Map<String, Object>> seriesData = new ArrayList<>();
for (String s : data.keySet()) {
data.get(s).stream().forEach(e->{
e.setTimeValue(e.getTime());
});
Map<String, Object> map = new HashMap<>();
List<String> value = data.get(s).stream().map(IndicatorsDto::getValue).collect(Collectors.toList());
map.put("data", value);
// map.put("name","pv"+s.substring(4,6));
seriesData.add(map);
if (value.size()>num){
Map<String, List<IndicatorsDto>> timeMap = data.get(s).stream().collect(Collectors.groupingBy(IndicatorsDto::getTimeValue , LinkedHashMap::new, Collectors.toList()));
resultMap.put("axisData", timeMap.keySet());
}
Map<String, Object> map = new HashMap<>();
map.put("seriesData", seriesData);
map.put("axisData", timeMap.keySet());
return map;
num = value.size()>num ? value.size():num;
}
resultMap.put("seriesData", seriesData);
return resultMap;
}
......
......@@ -79,7 +79,8 @@ gl.avg.column=有功功率,日利用小时,瞬时风速
#ES 曲线图定时 0 57 23 * * ?
windSpeed.cron = 0 25 9 * * ?
#本地使用 0 0 5 29 2 ? ? 线上使用 0 */5 * * * ?
windSpeed.Scheduled.cron = 0 0 5 29 2 ?
spring.elasticsearch.rest.uris=http://39.98.224.23:9200
spring.elasticsearch.rest.connection-timeout=30000
......
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