zbj//1.暂降事件点图返回对象调整
This commit is contained in:
@@ -174,9 +174,9 @@ public class MonitorPointController extends BaseController {
|
||||
@PostMapping("/getPlot")
|
||||
@ApiOperation("暂降事件点图")
|
||||
@ApiImplicitParam(name = "statisticsParam", value = "暂降事件点图参数", required = true)
|
||||
public HttpResult<List<EventDetail>> getPlot(@RequestBody @Validated StatisticsParam statisticsParam){
|
||||
public HttpResult<VoltageToleranceCurveVO> getPlot(@RequestBody @Validated StatisticsParam statisticsParam){
|
||||
String methodDescribe = getMethodDescribe("getPlot");
|
||||
List<EventDetail> page = eventAnalysisService.getPlot(statisticsParam);
|
||||
VoltageToleranceCurveVO page = eventAnalysisService.getPlot(statisticsParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,page,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public interface EventAnalysisService {
|
||||
* @param statisticsParam
|
||||
* @return
|
||||
*/
|
||||
List<EventDetail> getPlot(StatisticsParam statisticsParam);
|
||||
VoltageToleranceCurveVO getPlot(StatisticsParam statisticsParam);
|
||||
|
||||
/**
|
||||
*监测点暂降事件分析查询
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.event.service.majornetwork.Impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -1417,7 +1418,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
* @author xxy
|
||||
*/
|
||||
@Override
|
||||
public List<EventDetail> getPlot(StatisticsParam statisticsParam) {
|
||||
public VoltageToleranceCurveVO getPlot(StatisticsParam statisticsParam) {
|
||||
List<EventDetail> result = new ArrayList<>();
|
||||
// QueryResult query = MonitorQuery(statisticsParam);
|
||||
// InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||
@@ -1476,8 +1477,37 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
|
||||
result.add(eventDetailNew);
|
||||
}
|
||||
if (CollUtil.isEmpty(result)) {
|
||||
return VoltageToleranceCurveVO.empty();
|
||||
}
|
||||
ArrayList<String> lineIds = new ArrayList<>();
|
||||
lineIds.add(statisticsParam.getLineIndex());
|
||||
List<AreaLineInfoVO> getBaseLineAreaInfo = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
|
||||
if (CollUtil.isEmpty(getBaseLineAreaInfo)) {
|
||||
return VoltageToleranceCurveVO.empty();
|
||||
}
|
||||
|
||||
return result;
|
||||
Map<String, AreaLineInfoVO> areaLineInfoVOMap =
|
||||
getBaseLineAreaInfo.parallelStream().collect(Collectors.toConcurrentMap(AreaLineInfoVO::getLineId,
|
||||
Function.identity()));
|
||||
|
||||
List<VoltageToleranceCurveVO.VoltageToleranceCurveDataList> curveDataList = result.parallelStream()
|
||||
.map(dto -> {
|
||||
AreaLineInfoVO info = areaLineInfoVOMap.get(dto.getLineId());
|
||||
|
||||
VoltageToleranceCurveVO.VoltageToleranceCurveDataList voltageToleranceCurve = new VoltageToleranceCurveVO.VoltageToleranceCurveDataList();
|
||||
voltageToleranceCurve.setLineId(dto.getLineId());
|
||||
voltageToleranceCurve.setPersistTime(dto.getDuration());
|
||||
voltageToleranceCurve.setEventValue(dto.getFeatureAmplitude());
|
||||
voltageToleranceCurve.setTime(dto.getStartTime());
|
||||
voltageToleranceCurve.setGdName(info.getGdName());
|
||||
voltageToleranceCurve.setSubName(info.getSubName());
|
||||
return voltageToleranceCurve;
|
||||
})
|
||||
//.sorted(VoltageToleranceCurveDataList.sortAscTime())
|
||||
.collect(Collectors.toCollection(() -> Collections.synchronizedList(new ArrayList<>())));
|
||||
|
||||
return VoltageToleranceCurveVO.buildVO(result.size(), curveDataList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user