高级算法特征值,暂降事件范围分析代码提交

This commit is contained in:
2023-08-10 16:30:01 +08:00
parent 336f3b1281
commit 855c8d98d6
73 changed files with 5766 additions and 88 deletions

View File

@@ -0,0 +1,44 @@
package com.njcn.event.api;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.event.api.fallback.EventDetailFeignClientFallbackFactory;
import com.njcn.event.api.fallback.RmpEventDetailFeignClientFallbackFactory;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
import com.njcn.event.pojo.vo.GeneralVO;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
* @author denghuajun
* @version 1.0.0
* @date 2022/3/16
*/
@FeignClient(value = ServerInfo.EVENT,path = "/rmpEventDetail",fallbackFactory = RmpEventDetailFeignClientFallbackFactory.class)
public interface RmpEventDetailFeignClient {
/**
* 获取暂降事件详细信息
* @param eventId 暂态事件id
* @author cdf
* @date 2023/7/28
*/
@GetMapping("/queryEventDetailByEventId")
HttpResult<RmpEventDetailPO> queryEventDetailByEventId(@RequestParam("eventId")String eventId);
}

View File

@@ -0,0 +1,46 @@
package com.njcn.event.api.fallback;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.event.api.EventDetailFeignClient;
import com.njcn.event.api.RmpEventDetailFeignClient;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
import com.njcn.event.pojo.vo.GeneralVO;
import com.njcn.event.utils.EventlEnumUtil;
import com.njcn.web.pojo.param.BaseParam;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* @date 2023/07/21
*/
@Slf4j
@Component
public class RmpEventDetailFeignClientFallbackFactory implements FallbackFactory<RmpEventDetailFeignClient> {
@Override
public RmpEventDetailFeignClient create(Throwable throwable) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (throwable.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) throwable.getCause();
exceptionEnum = EventlEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new RmpEventDetailFeignClient() {
@Override
public HttpResult<RmpEventDetailPO> queryEventDetailByEventId(String eventId) {
log.error("{}异常,降级处理,异常为:{}", "查询暂降明细", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -0,0 +1,41 @@
package com.njcn.event.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* pqs
*
* @author cdf
* @date 2023/8/9
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("r_mp_event_detail_ass")
public class RmpEventDetailAssPO extends BaseEntity {
/**
*事件关联分析表uuid
*/
private String eventAssId;
/**
*发生时间(归一化中第一个时间)
*/
private LocalDateTime timeId;
/**
*关联事件描述
*/
private String describe;
/**
*是否进行范围分析0分析1未分析
*/
private Integer analyseFlag;
}

View File

@@ -85,6 +85,7 @@ public class RmpEventDetailPO implements Serializable {
private String sagsource;
@ApiModelProperty(value = "开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
private LocalDateTime startTime;
@ApiModelProperty(value = "格式化开始时间")

View File

@@ -0,0 +1,110 @@
package com.njcn.event.pojo.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* pqs
*
* @author cdf
* @date 2023/7/20
*/
@Data
public class AdvanceEventDetailVO {
@ApiModelProperty(value = "暂时事件ID")
private String eventId;
@ApiModelProperty(value = "监测点ID")
private String measurementPointId;
@ApiModelProperty(value = "监测点ID(复制)")
private String lineId;
@ApiModelProperty(value = "统计类型")
private String eventType;
@ApiModelProperty(value = "暂降原因Event_Reason")
private String advanceReason;
@ApiModelProperty(value = "暂降类型Event_Type")
private String advanceType;
@ApiModelProperty(value = "事件关联分析表Guid")
private String eventassIndex;
@ApiModelProperty(value = "dq计算持续时间 ")
private Double dqTime;
@ApiModelProperty(value = "特征值计算更新时间外键PQS_Relevance的Time字段")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private LocalDateTime dealTime;
@ApiModelProperty(value = "默认事件个数为0")
private Integer num;
@ApiModelProperty(value = "波形文件是否从装置招到本地(0未招1已招)默认值为0")
private Integer fileFlag;
@ApiModelProperty(value = "特征值计算标志0未处理1已处理; 2已处理无结果;3计算失败默认值为0")
private Integer dealFlag;
@ApiModelProperty(value = "处理结果第一条事件发生时间(读comtra文件获取)")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private LocalDateTime firstTime;
@ApiModelProperty(value = "处理结果第一条事件暂降类型字典表PQS_Dicdata")
private String firstType;
@ApiModelProperty(value = "处理结果第一条事件发生时间毫秒(读comtra文件获取)")
private Double firstMs;
@ApiModelProperty(value = "暂降能量")
private Double energy;
@ApiModelProperty(value = "暂降严重度")
private Double severity;
@ApiModelProperty(value = "暂降源与监测位置关系 Upper:上游Lower :下游Unknown :未知;为空则是未计算")
private String sagsource;
@ApiModelProperty(value = "开始时间")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss.SSS")
private LocalDateTime startTime;
@ApiModelProperty(value = "持续时间,单位秒")
private Double duration;
@ApiModelProperty(value = "特征幅值")
private Double featureAmplitude;
@ApiModelProperty(value = "相别")
private String phase;
@ApiModelProperty(value = "事件描述")
private String eventDescribe;
@ApiModelProperty(value = "波形路径")
private String wavePath;
private Double transientValue;
private String gdName;
private String subName;
private String voltageId;
@ApiModelProperty(value = "特征值是否计算")
private String featureAmplitudeFlag;
@ApiModelProperty(value = "录波文件是否存在")
private String boFileFlag;
}