暂降统计添加中断类型

This commit is contained in:
hzj
2026-01-16 09:17:29 +08:00
parent 0502dc7508
commit 9143ff5b80

View File

@@ -47,6 +47,7 @@ import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.njcn.event.influxdb.QueryBuilder.beginOfDay;
import static com.njcn.event.influxdb.QueryBuilder.endOfDay;
@@ -122,9 +123,12 @@ public class AreaLineServiceImpl implements AreaLineService {
@Override
public EventHeatMapVO getEventHeatMap(DeviceInfoParam.BusinessParam deviceInfoParam) {
//新增需求添加中断
//获取暂降字典信息
DictData voltageData = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
if(ObjectUtil.isNull(voltageData)){
DictData shortInterruptionsData = dicDataFeignClient.getDicDataByCode(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getData();
if(ObjectUtil.isNull(voltageData)||ObjectUtil.isNull(shortInterruptionsData)){
throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
}
EventHeatMapVO eventHeatMapVO = new EventHeatMapVO();
@@ -146,7 +150,7 @@ public class AreaLineServiceImpl implements AreaLineService {
List<RmpEventDetailPO> info = eventDetailService.list(new QueryWrapper<RmpEventDetailPO>()
.select("measurement_point_id as measurementPointId,count(file_flag) as fileFlag")
.in("measurement_point_id", lineIndexs)
.eq("event_type", voltageData.getId())
.in("event_type", Stream.of(voltageData.getId(),shortInterruptionsData.getId()).collect(Collectors.toList()))
.ge("start_time" ,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
.le("start_time", DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())))
.groupBy("measurement_point_id")