河北新增在线监测功能
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.njcn.harmonic.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.harmonic.api.fallback.PmsLineWarningFeignClientFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
|
||||
/**
|
||||
* 流程实例 Api 接口
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.HARMONIC, path = "/onlineMonitor", fallbackFactory = PmsLineWarningFeignClientFallbackFactory.class)
|
||||
public interface PmsLineWarningFeignClient {
|
||||
|
||||
@PostMapping("/heBeiNorthAdd")
|
||||
HttpResult<String> heBeiNorthAdd();
|
||||
|
||||
}
|
||||
@@ -1,23 +1,12 @@
|
||||
package com.njcn.harmonic.api;
|
||||
|
||||
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.harmonic.api.fallback.HarmDataFeignClientFallbackFactory;
|
||||
import com.njcn.harmonic.api.fallback.RStatLimitRateDFeignClientFallbackFactory;
|
||||
import com.njcn.harmonic.pojo.param.HistoryHarmParam;
|
||||
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||
import com.njcn.influx.pojo.dto.HarmHistoryDataDTO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.harmonic.api.fallback;
|
||||
|
||||
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.harmonic.api.PmsLineWarningFeignClient;
|
||||
import com.njcn.harmonic.utils.HarmonicEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PmsLineWarningFeignClientFallbackFactory implements FallbackFactory<PmsLineWarningFeignClient> {
|
||||
@Override
|
||||
public PmsLineWarningFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = HarmonicEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new PmsLineWarningFeignClient() {
|
||||
@Override
|
||||
public HttpResult<String> heBeiNorthAdd() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "新增在线监测数据(冀北-按月统计累计超标天数)", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2024/6/18 15:53
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OnlineParam extends BaseParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty(value = "指标id")
|
||||
private String targetId;
|
||||
|
||||
@ApiModelProperty(value = "指标集合")
|
||||
private List<String> targetList;
|
||||
|
||||
@ApiModelProperty(value = "预警阈值")
|
||||
private Integer alertThreshold;
|
||||
|
||||
@ApiModelProperty(value = "告警阈值")
|
||||
private Integer alarmThreshold;
|
||||
|
||||
@ApiModelProperty(value = "数据类型")
|
||||
private Integer dataType;
|
||||
|
||||
@ApiModelProperty(value = "监测点类型 0:电网侧 1:非电网侧")
|
||||
private String lineType;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class ReportParam extends OnlineParam {
|
||||
|
||||
@ApiModelProperty(name = "type", value = "1:预警单 2:告警单")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(name = "issueDetail", value = "问题描述")
|
||||
private String issueDetail;
|
||||
|
||||
@ApiModelProperty(name = "reformAdvice", value = "整改意见")
|
||||
private String reformAdvice;
|
||||
|
||||
@ApiModelProperty(name = "year", value = "年")
|
||||
private String year;
|
||||
|
||||
@ApiModelProperty(name = "number", value = "编号")
|
||||
private String number;
|
||||
|
||||
@ApiModelProperty(name = "idList", value = "问题id集合")
|
||||
private List<String> idList;
|
||||
}
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class DetailParam extends OnlineParam {
|
||||
|
||||
@ApiModelProperty(name = "lineId", value = "监测点id")
|
||||
private String lineId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.njcn.harmonic.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 监测点每日稳态指标超标天数统计表
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2024-06-17
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("supervision_line_warning")
|
||||
public class PmsLineWarning extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 告警时间
|
||||
*/
|
||||
@MppMultiId(value = "alarm_time")
|
||||
private LocalDate alarmTime;
|
||||
|
||||
/**
|
||||
* 责任部门id
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
@MppMultiId(value = "line_id")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 指标类型(字典id)
|
||||
*/
|
||||
@MppMultiId(value = "target_type")
|
||||
private String targetType;
|
||||
|
||||
/**
|
||||
* 越限天数
|
||||
*/
|
||||
private Integer overLimitDay;
|
||||
|
||||
/**
|
||||
* 是否发送单子(0:未发 1:已发)
|
||||
*/
|
||||
private Integer initiateWarningFlag;
|
||||
|
||||
/**
|
||||
* 当前流程(0:无告警 1:预警 2:告警)
|
||||
*/
|
||||
private Integer step;
|
||||
|
||||
/**
|
||||
* 预警阈值
|
||||
*/
|
||||
private Integer alertThreshold;
|
||||
|
||||
/**
|
||||
* 告警阈值
|
||||
*/
|
||||
private Integer alarmThreshold;
|
||||
|
||||
/**
|
||||
* 阈值来源(0:系统生成 1:界面)
|
||||
*/
|
||||
private Integer thresholdResource;
|
||||
|
||||
/**
|
||||
* 预告警单id
|
||||
*/
|
||||
private String leafletId;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 在线监测监测点越限详情
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2024-07-05
|
||||
*/
|
||||
@Data
|
||||
public class LineLimitDetailVo implements Serializable {
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
@JsonFormat(pattern="yyyy-MM-dd")
|
||||
private LocalDate time;
|
||||
|
||||
@ApiModelProperty("越限详情")
|
||||
private String overLimitInfo;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2024/6/18 16:44
|
||||
*/
|
||||
@Data
|
||||
public class PmsOnlineVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("责任单位")
|
||||
private String dept;
|
||||
|
||||
@ApiModelProperty("变电站")
|
||||
private String substation;
|
||||
|
||||
@ApiModelProperty("装置名称")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty("监测点id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("监测对象类型")
|
||||
private String businessType;
|
||||
|
||||
@ApiModelProperty("监测对象名称")
|
||||
private String objectName;
|
||||
|
||||
@ApiModelProperty("指标id")
|
||||
private String targetType;
|
||||
|
||||
@ApiModelProperty("超标天数")
|
||||
private Integer overLimitDay;
|
||||
|
||||
@ApiModelProperty("频率偏差")
|
||||
private Integer freq;
|
||||
|
||||
@ApiModelProperty("电压偏差")
|
||||
private Integer voltage;
|
||||
|
||||
@ApiModelProperty("闪变")
|
||||
private Integer flicker;
|
||||
|
||||
@ApiModelProperty("三相电压不平衡度")
|
||||
private Integer ubalance;
|
||||
|
||||
@ApiModelProperty("负序电流")
|
||||
private Integer iNeg;
|
||||
|
||||
@ApiModelProperty("谐波电压")
|
||||
private Integer harmonicV;
|
||||
|
||||
@ApiModelProperty("谐波电流")
|
||||
private Integer harmonicI;
|
||||
|
||||
@ApiModelProperty("间谐波电压")
|
||||
private Integer inuharmV;
|
||||
|
||||
@ApiModelProperty("数据来源 0:系统默认 1:自定义")
|
||||
private Integer dataResource;
|
||||
|
||||
@ApiModelProperty("当前流程(null:无流程 1:预警 2:告警)")
|
||||
private Integer step;
|
||||
|
||||
@ApiModelProperty("最新数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
Reference in New Issue
Block a user