feat(event): 添加暂态事件数据分析功能并优化数据集排序

- 在CsEventPO中新增暂态事件相关字段:暂态事件落点、暂降源关系、瞬态有效值和电压变化
- 扩展DataGroupEventVO和EventDetailVO以支持事件落点、暂降原因、暂降类型等新属性
- 重构CsEquipmentDeliveryServiceImpl中的数据集添加逻辑,实现按序号排序的数据集管理
- 更新设备数据集结构,将原有数据类型调整为实时、历史、暂态、运行等分类
- 修改CsUpgradeLogsController将GET请求改为POST请求以支持请求体参数
- 在LineTargetServiceImpl中修复数据类型转换问题,确保toUpperCase调用正确
- 优化统计数据显示逻辑,在StatisticsDataDataServiceImpl中修复完整性计算公式
- 为EleEpdPqdMapper添加数据源注解以支持多数据库操作
This commit is contained in:
xy
2026-06-08 10:15:18 +08:00
parent 16c0620dd3
commit 681ec99f23
11 changed files with 86 additions and 25 deletions

View File

@@ -142,6 +142,27 @@ public class CsEventPO extends BaseEntity {
@TableField(value = "advance_type")
private String advanceType;
/**
* 暂态事件落点(A区/B区/C区/D区;解析失败或未匹配返回 null)
*/
@TableField(value = "land_point")
private String landPoint;
/**
* 暂降源与监测位置关系 0-未知、1-上游、2-下游
*/
@TableField(value = "sag_source")
private String sagSource;
/**
* 瞬态-有效值
*/
@TableField(value = "rms")
private Double rms;
/**
* 瞬态-电压变化
*/
@TableField(value = "uchg")
private Double uchg;
}

View File

@@ -139,4 +139,13 @@ public class EventDetailVO {
@ApiModelProperty("事件落点")
private String landPoint;
@ApiModelProperty("暂降原因")
private String advanceReason;
@ApiModelProperty("暂降类型")
private String advanceType;
@ApiModelProperty("暂降源与监测位置关系 0-未知、1-上游、2-下游")
private String sagSource;
}

View File

@@ -169,7 +169,10 @@
b.LEVEL LEVEL,
b.location location,
c.dev_type devType,
b.land_point landPoint
b.land_point landPoint,
b.advance_reason advanceReason,
b.advance_type advanceType,
b.sag_source sagSource
<if test="csEventUserQueryPage != null and csEventUserQueryPage.type != null and csEventUserQueryPage.type != '' and csEventUserQueryPage.type ==0">
,d.NAME lineName
</if>
@@ -240,7 +243,7 @@
select DISTINCT b.id id,
b.device_id deviceId,b.line_id lineId,b.code code,
b.start_time startTime,b.tag tag ,b.wave_path wavePath,b.instant_pics,b.rms_pics , b.type type,b.level level,b.location location,b.cl_did clDid
,d.name lineName
,d.name lineName,b.advance_reason advanceReason,b.advance_type advanceType,b.sag_source sagSource
from cs_event b
left join cs_line d on d.line_id=b.line_id
where 1=1

View File

@@ -272,7 +272,7 @@ public class LineTargetServiceImpl implements ILineTargetService {
*/
public CsRtDataVO getLineRtData(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target, String cldId) {
CsRtDataVO csRtDataVO = new CsRtDataVO();
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,cldId);
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType.toUpperCase(),cldId);
if(Objects.isNull(statisticalDataDTO)){
statisticalDataDTO = new StatisticalDataDTO();
statisticalDataDTO.setLineId(lineId);
@@ -304,7 +304,7 @@ public class LineTargetServiceImpl implements ILineTargetService {
public CsRtDataVO getLineRtDataNew(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target,String uint) {
CsRtDataVO csRtDataVO = new CsRtDataVO();
String clDid = influxDbParamUtil.getClDidByLineId(lineId);
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,clDid);
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType.toUpperCase(),clDid);
if(Objects.isNull(statisticalDataDTO)){
statisticalDataDTO = new StatisticalDataDTO();
statisticalDataDTO.setLineId(lineId);

View File

@@ -154,7 +154,7 @@ public class StatisticsDataDataServiceImpl implements IStatisticsDataDataService
BigDecimal.valueOf(l1.stream().mapToDouble(RStatIntegrityD::getDueTime).sum()),
2, RoundingMode.HALF_UP
).doubleValue();
vo.setIntegrity(ratio);
vo.setIntegrity(Math.max(ratio,100.0));
} else {
vo.setIntegrity(0.0);
}
@@ -163,7 +163,7 @@ public class StatisticsDataDataServiceImpl implements IStatisticsDataDataService
if (CollectionUtil.isNotEmpty(l2)) {
int onlineMin = l2.stream().mapToInt(RStatOnlineRateD::getOnlineMin).sum();
double ratio = new BigDecimal(onlineMin * 100.0 / (1440 * l2.size())).setScale(2,RoundingMode.HALF_UP).doubleValue();
vo.setOnlineRate(ratio);
vo.setOnlineRate(Math.max(ratio,100.0));
} else {
vo.setOnlineRate(0.0);
}

View File

@@ -7,14 +7,13 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.njcn.csdevice.api.CsLineFeignClient;
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
import com.njcn.csharmonic.service.event.CsEventMonitorReportService;
import com.njcn.echarts.util.DrawPicUtil;
import com.njcn.event.common.pojo.dto.LineDetailDataCommDTO;
import com.njcn.event.common.service.CommMonitorEventReportService;
import com.njcn.event.pojo.param.ExportParam;
import com.njcn.system.api.DicDataFeignClient;
import lombok.RequiredArgsConstructor;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
@@ -43,6 +42,7 @@ public class CsEventMonitorReportServiceImpl implements CsEventMonitorReportServ
LineDetailDataCommDTO lineDetailDataCommDTO = new LineDetailDataCommDTO();
LineDetailDataVO lineDetailDataVO = csLineFeignClient.getLineDetailData(exportParam.getLineId()).getData();
BeanUtil.copyProperties(lineDetailDataVO,lineDetailDataCommDTO);
lineDetailDataCommDTO.setIsDip(true);
monitorEventReportService.getLineExport(exportParam,lineDetailDataCommDTO, response);
}
}