1.解决变电站数量不统一问题
2.替换最新污染值 3.解决终端数量不一致问题
This commit is contained in:
@@ -8,18 +8,22 @@ import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.event.pojo.po.EventDetailNew;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.AreaSubLineVO;
|
||||
import com.njcn.event.service.majornetwork.AreaInfoService;
|
||||
import com.njcn.event.service.majornetwork.EventDetailService;
|
||||
import com.njcn.harmonic.api.PollutionSubstationClient;
|
||||
import com.njcn.harmonic.pojo.excel.pollution.UserLinePollution;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -41,11 +45,12 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final EventDetailService eventDetailService;
|
||||
|
||||
private final PollutionSubstationClient pollutionSubstationClient;
|
||||
@Override
|
||||
public List<AreaSubLineVO> getAreaLineInfo(DeviceInfoParam.GridDiagram deviceInfoParam) {
|
||||
List<AreaSubLineVO> resultVOList = new ArrayList<>();
|
||||
List<String> lineIds =new ArrayList<>();
|
||||
Map<String, UserLinePollution> userMap = new HashMap<>();
|
||||
if(1==deviceInfoParam.getType()){
|
||||
if(CollectionUtil.isNotEmpty(deviceInfoParam.getCoutList())){
|
||||
lineIds.addAll(deviceInfoParam.getCoutList());
|
||||
@@ -61,6 +66,15 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
||||
|
||||
if (CollectionUtil.isNotEmpty(lineIds)) {
|
||||
List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
|
||||
if(1==deviceInfoParam.getType()){
|
||||
OnlineRateParam.Info param=new OnlineRateParam.Info();
|
||||
param.setIds(resList.stream().map(AreaLineInfoVO::getLineId).distinct().collect(Collectors.toList()));
|
||||
param.setDicData(deviceInfoParam.getDicData());
|
||||
param.setStartTime(deviceInfoParam.getSearchBeginTime());
|
||||
param.setEndTime(deviceInfoParam.getSearchEndTime());
|
||||
userMap = pollutionSubstationClient.getSumList(param).getData();
|
||||
}
|
||||
|
||||
//设置冀北告警监测点类型
|
||||
if(CollectionUtil.isNotEmpty(deviceInfoParam.getCoutList())){
|
||||
resList.stream().filter(x->deviceInfoParam.getCoutList().contains(x.getLineId())).forEach(x->x.setType(0));
|
||||
@@ -86,6 +100,11 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
||||
areaLineInfoVO.setNoDealCount(Math.toIntExact(aLong));
|
||||
}
|
||||
}
|
||||
if(userMap.containsKey(areaLineInfoVO.getLineId())){
|
||||
UserLinePollution userLinePollution = userMap.get(areaLineInfoVO.getLineId());
|
||||
areaLineInfoVO.setVHarmonicValue(userLinePollution.getVHarmonicValue());
|
||||
areaLineInfoVO.setUserList(BeanUtil.copyToList(userLinePollution.getUserList(),AreaLineInfoVO.User.class));
|
||||
}
|
||||
}
|
||||
|
||||
//组装成变电站
|
||||
|
||||
@@ -458,13 +458,11 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
long count90 = list.stream()
|
||||
.filter(x -> ObjectUtil.isNotNull(x.getSeverity()))
|
||||
.filter(x -> gwLineAllIds.contains(x.getMeasurementPointId()))
|
||||
.filter(x -> 0.9 > x.getFeatureAmplitude())
|
||||
.map(RmpEventDetailPO::getFeatureAmplitude).count();
|
||||
.filter(x -> 0.9 > x.getSeverity()).count();
|
||||
long count50 = list.stream()
|
||||
.filter(x -> ObjectUtil.isNotNull(x.getSeverity()))
|
||||
.filter(x -> gwLineAllIds.contains(x.getMeasurementPointId()))
|
||||
.filter(x -> 0.5 > x.getFeatureAmplitude())
|
||||
.map(RmpEventDetailPO::getFeatureAmplitude).count();
|
||||
.filter(x -> 0.5 > x.getSeverity()).count();
|
||||
if(count90>0){
|
||||
info.add(NumberUtil.round(count90*100.0/list.size(),2).doubleValue());
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user