|
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; |
|
|
import com.kms.yg.cz.dto.CharInfoDto; |
|
|
import com.kms.yg.cz.dto.CharInfoDto; |
|
|
import com.kms.yg.cz.dto.MonitorQueDto; |
|
|
import com.kms.yg.cz.dto.MonitorQueDto; |
|
|
import com.shuili.common.utils.DateUtils; |
|
|
import com.shuili.common.utils.DateUtils; |
|
|
|
|
|
import com.shuili.common.utils.StringUtils; |
|
|
import lombok.Getter; |
|
|
import lombok.Getter; |
|
|
import org.apache.commons.collections4.KeyValue; |
|
|
import org.apache.commons.collections4.KeyValue; |
|
|
import org.apache.commons.collections4.keyvalue.DefaultKeyValue; |
|
|
import org.apache.commons.collections4.keyvalue.DefaultKeyValue; |
|
@ -104,6 +105,7 @@ public enum MonitorComposeEnum { |
|
|
right.setSeries(getCollect(this.rightElements, this.rightName, dataMap, charInfoDto)); |
|
|
right.setSeries(getCollect(this.rightElements, this.rightName, dataMap, charInfoDto)); |
|
|
yAxis.add(right); |
|
|
yAxis.add(right); |
|
|
} |
|
|
} |
|
|
|
|
|
charInfoDto.setYAxis(yAxis); |
|
|
return charInfoDto; |
|
|
return charInfoDto; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -125,11 +127,11 @@ public enum MonitorComposeEnum { |
|
|
return null; |
|
|
return null; |
|
|
}) |
|
|
}) |
|
|
.filter(Objects::nonNull) |
|
|
.filter(Objects::nonNull) |
|
|
.collect(Collectors.toMap(KeyValue::getKey, KeyValue::getValue)); |
|
|
.collect(Collectors.toMap(KeyValue::getKey, KeyValue::getValue, (v1, v2) -> v2)); |
|
|
series.setData(charInfoDto.getXAxis().stream() |
|
|
series.setData(charInfoDto.getXAxis().stream() |
|
|
.map(time -> { |
|
|
.map(time -> { |
|
|
Object value = values.get(time); |
|
|
Object value = values.get(time); |
|
|
return value == null ? "0" : value.toString(); |
|
|
return value == null || StringUtils.isEmpty(value.toString()) ? "0" : value.toString(); |
|
|
}).collect(Collectors.toList())); |
|
|
}).collect(Collectors.toList())); |
|
|
return series; |
|
|
return series; |
|
|
}).collect(Collectors.toList()); |
|
|
}).collect(Collectors.toList()); |
|
|