1.终端运行评价初始化类

2.解决稳态符合性占比图接口异常和暂态事件列表按照10kV电压等级查询结果为空
This commit is contained in:
wr
2025-05-08 14:00:49 +08:00
parent 1d594e0810
commit 31dd5f1f1e
8 changed files with 99 additions and 40 deletions

View File

@@ -97,7 +97,6 @@ public class TransientServiceImpl implements TransientService {
private final DeviceTreeClient deviceTreeClient;
@Override
public Page<TransientVO> getTransientData(TransientParam transientParam) {
Page<TransientVO> page = new Page<>();
@@ -196,11 +195,11 @@ public class TransientServiceImpl implements TransientService {
ip = monitorVO.getIp();
}
String waveName = eventDetail.getWavePath();
String cfgPath, datPath,cfgPath2,datPath2;
String cfgPath, datPath, cfgPath2, datPath2;
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
log.info("本地磁盘波形文件路径----"+cfgPath);
log.info("本地磁盘波形文件路径----" + cfgPath);
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
@@ -213,7 +212,7 @@ public class TransientServiceImpl implements TransientService {
//适配文件后缀小写
cfgPath2 = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG.toLowerCase();
datPath2 = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT.toLowerCase();
log.info("文件服务器波形文件路径----"+cfgPath);
log.info("文件服务器波形文件路径----" + cfgPath);
try (
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath);
InputStream datStream = fileStorageUtil.getFileStream(datPath)
@@ -230,7 +229,7 @@ public class TransientServiceImpl implements TransientService {
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
}
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
}catch (Exception e1){
} catch (Exception e1) {
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
}
@@ -292,11 +291,11 @@ public class TransientServiceImpl implements TransientService {
page.setSize(transientParam.getPageSize());
page.setCurrent(transientParam.getPageNum());
// 按部门分类的实际运行终端综合信息
List<GeneralDeviceDTO> generalDeviceDTOList =new ArrayList<>();
if(transientParam.getIsType()==0){
List<GeneralDeviceDTO> generalDeviceDTOList;
if (transientParam.getIsType() == 0) {
generalDeviceDTOList = generalDeviceInfoClient.getPracticalRunDeviceInfo(transientParam).getData();
}else{
generalDeviceDTOList = generalDeviceInfoClient.getOfflineRunDeviceInfo(transientParam).getData();
} else {
generalDeviceDTOList = generalDeviceInfoClient.getOfflineRunDeviceInfo(transientParam).getData();
}
if (!CollectionUtils.isEmpty(generalDeviceDTOList)) {
if (Objects.nonNull(transientParam.getEventValueMin())) {
@@ -308,12 +307,12 @@ public class TransientServiceImpl implements TransientService {
// 获取按终端分类的监测点索引集合
List<String> lineList = generalDeviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList());
List<TerminalTree> data = deviceTreeClient.getTerminalTree().getData();
if(!CollectionUtils.isEmpty(transientParam.getSubstationIds())){
if (!CollectionUtils.isEmpty(transientParam.getSubstationIds())) {
List<String> collect = data.stream().map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.filter(temp->transientParam.getSubstationIds().contains(temp.getId()))
.filter(temp -> transientParam.getSubstationIds().contains(temp.getId()))
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
@@ -321,7 +320,7 @@ public class TransientServiceImpl implements TransientService {
lineList.retainAll(collect);
}
if(!CollectionUtils.isEmpty(transientParam.getLineIds())){
if (!CollectionUtils.isEmpty(transientParam.getLineIds())) {
List<String> collect1 = data.stream().map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
@@ -329,11 +328,11 @@ public class TransientServiceImpl implements TransientService {
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.filter(temp->transientParam.getLineIds().contains(temp.getId()))
.filter(temp -> transientParam.getLineIds().contains(temp.getId()))
.map(TerminalTree::getId).collect(Collectors.toList());
lineList.retainAll(collect1);
}
if(CollUtil.isEmpty(lineList)){
if (CollUtil.isEmpty(lineList)) {
return new Page<>();
}
List<AreaLineInfoVO> lineInfoVOList = lineFeignClient.getBaseLineAreaInfo(lineList).getData();
@@ -351,17 +350,17 @@ public class TransientServiceImpl implements TransientService {
.in(CollUtil.isNotEmpty(transientParam.getEventType()), RmpEventDetailPO::getAdvanceType, transientParam.getEventType());
if(StrUtil.isNotBlank(transientParam.getOrderBy())){
if(transientParam.getSortBy().equals("start_time")){
wrapper.orderBy(true,transientParam.getOrderBy().equals("asc"),RmpEventDetailPO::getStartTime);
}else if(transientParam.getSortBy().equals("feature_amplitude")){
wrapper.orderBy(true,transientParam.getOrderBy().equals("asc"),RmpEventDetailPO::getFeatureAmplitude);
}else if(transientParam.getSortBy().equals("firstMs")){
wrapper.orderBy(true,transientParam.getOrderBy().equals("asc"),RmpEventDetailPO::getFirstMs);
}else if(transientParam.getSortBy().equals("duration")){
wrapper.orderBy(true,transientParam.getOrderBy().equals("asc"),RmpEventDetailPO::getDuration);
if (StrUtil.isNotBlank(transientParam.getOrderBy())) {
if (transientParam.getSortBy().equals("start_time")) {
wrapper.orderBy(true, transientParam.getOrderBy().equals("asc"), RmpEventDetailPO::getStartTime);
} else if (transientParam.getSortBy().equals("feature_amplitude")) {
wrapper.orderBy(true, transientParam.getOrderBy().equals("asc"), RmpEventDetailPO::getFeatureAmplitude);
} else if (transientParam.getSortBy().equals("firstMs")) {
wrapper.orderBy(true, transientParam.getOrderBy().equals("asc"), RmpEventDetailPO::getFirstMs);
} else if (transientParam.getSortBy().equals("duration")) {
wrapper.orderBy(true, transientParam.getOrderBy().equals("asc"), RmpEventDetailPO::getDuration);
}
}else {
} else {
wrapper.orderByDesc(RmpEventDetailPO::getStartTime);
}
@@ -383,7 +382,7 @@ public class TransientServiceImpl implements TransientService {
if (Objects.nonNull(transientParam.getFileFlag())) {
wrapper.eq(Objects.nonNull(transientParam.getFileFlag()), RmpEventDetailPO::getFileFlag, transientParam.getFileFlag());
}
wrapper.in(!CollectionUtils.isEmpty(transientParam.getVerifyReason()),RmpEventDetailPO::getVerifyReason,transientParam.getVerifyReason());
wrapper.in(!CollectionUtils.isEmpty(transientParam.getVerifyReason()), RmpEventDetailPO::getVerifyReason, transientParam.getVerifyReason());
// Page<RmpEventDetailPO> pageInfo = eventDetailService.page(new Page<>(transientParam.getPageNum(), transientParam.getPageSize()),wrapper);
Page<RmpEventDetailPO> pageInfo = pwRmpEventDetailMapper.selectPage(new Page<>(transientParam.getPageNum(), transientParam.getPageSize()), wrapper);
List<EventDetailNew> eventDetailData = BeanUtil.copyToList(pageInfo.getRecords(), EventDetailNew.class);
@@ -395,7 +394,7 @@ public class TransientServiceImpl implements TransientService {
List<DictData> typeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData();
for (EventDetailNew eventDetail : eventDetailData) {
DecimalFormat df = new DecimalFormat("#0.000");
eventDetail.setSeverity(Double.parseDouble(df.format(Objects.isNull(eventDetail.getSeverity())?0.00:eventDetail.getSeverity())));
eventDetail.setSeverity(Double.parseDouble(df.format(Objects.isNull(eventDetail.getSeverity()) ? 0.00 : eventDetail.getSeverity())));
for (AreaLineInfoVO areaLineInfoVO : r) {
if (eventDetail.getLineId().equals(areaLineInfoVO.getLineId())) {
eventDetail.setLineId(areaLineInfoVO.getLineId());
@@ -440,9 +439,9 @@ public class TransientServiceImpl implements TransientService {
@Override
public void updateEventReason(EventVerifyReasonParam eventVerifyReasonParam) {
eventDetailService.lambdaUpdate()
.eq(RmpEventDetailPO::getEventId,eventVerifyReasonParam.getEventId())
.set(RmpEventDetailPO::getVerifyReason,eventVerifyReasonParam.getVerifyReason())
.set(RmpEventDetailPO::getVerifyReasonDetail,eventVerifyReasonParam.getVerifyReasonDetail())
.eq(RmpEventDetailPO::getEventId, eventVerifyReasonParam.getEventId())
.set(RmpEventDetailPO::getVerifyReason, eventVerifyReasonParam.getVerifyReason())
.set(RmpEventDetailPO::getVerifyReasonDetail, eventVerifyReasonParam.getVerifyReasonDetail())
.update();
}
@@ -467,10 +466,10 @@ public class TransientServiceImpl implements TransientService {
*/
public void copyTempData(List<String> eventIds) {
List<RmpEventDetailPO> rmpEventDetailPOList = eventDetailService.listByIds(eventIds);
List<RmpEventDetailPO> nullWave = rmpEventDetailPOList.stream().filter(item->Objects.isNull(item.getWavePath())).collect(Collectors.toList());
if(nullWave.size()!=0){
throw new BusinessException("请选择存在波形的事件导出!");
}
List<RmpEventDetailPO> nullWave = rmpEventDetailPOList.stream().filter(item -> Objects.isNull(item.getWavePath())).collect(Collectors.toList());
if (nullWave.size() != 0) {
throw new BusinessException("请选择存在波形的事件导出!");
}
if (CollUtil.isNotEmpty(rmpEventDetailPOList)) {
for (int i = 0; i < rmpEventDetailPOList.size(); i++) {
//根据监测点id获取监测点详情