代码提交

This commit is contained in:
huangzj
2023-05-25 09:57:21 +08:00
parent da7b7ee8eb
commit 623750abaa
65 changed files with 4326 additions and 24 deletions

View File

@@ -0,0 +1,18 @@
package com.njcn.algorithm.constant;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 常量类
* @author qijian
* @version 1.0.0
* @date 2022年11月11日 09:56
*/
public interface DataParam {
List<String> phases = Stream.of("A","B","C","T").collect(Collectors.toList());
List<String> statMethods = Stream.of("avg","max","min","cp95").collect(Collectors.toList());
}

View File

@@ -18,6 +18,8 @@ public enum AlgorithmResponseEnum {
DICT_DATA_ERROR("A00501","暂无此字典表类型"),
NDID_ERROR("A00502","存在相同的ndid"),
DATA_ERROR("A00503","存在相同的数据"),
LINE_DATA_ERROR ("A00504","设备下监测点数据缺失"),
;

View File

@@ -29,6 +29,9 @@ public class AppProjectQueryParm {
@ApiModelProperty(value="项目Id")
private String projectId;
@ApiModelProperty(value="工程id")
private String engineeringId;
@ApiModelProperty(value="起始时间")
// @NotNull(message="起始时间不能为空!")
private String startTime;

View File

@@ -0,0 +1,75 @@
package com.njcn.algorithm.pojo.param;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.Date;
/**
* Description:
* Date: 2023/5/16 16:25【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class CsEquipmentAlarmAddParm {
/**
* 项目Id
*/
@ApiModelProperty(value = "项目Id")
@NotBlank(message="项目Id不能为空")
private String projectId;
/**
* 设备id
*/
@ApiModelProperty(value = "设备id")
@NotBlank(message="设备id不能为空")
private String equipmentId;
/**
* 告警信息
*/
@ApiModelProperty(value = "告警信息")
private String alarmMsg;
/**
* 告警级别(字典表)
*/
@ApiModelProperty(value = "告警级别")
@NotBlank(message="告警级别不能为空!")
private String alarmLevel;
/**
* 开始时间
*/
@ApiModelProperty(value = "开始时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@NotNull(message="开始时间不能为空!")
private LocalDateTime startTime;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@NotNull(message="结束时间不能为空!")
private LocalDateTime endTime;
}

View File

@@ -0,0 +1,67 @@
package com.njcn.algorithm.pojo.param;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
/**
* Description:
* Date: 2023/5/16 16:25【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class CsEquipmentAlarmPageParm {
@NotNull(message="当前页不能为空!")
@Min(value = 1, message = "当前页不能为0")
@ApiModelProperty(value = "当前页",name = "currentPage",dataType ="Integer",required = true)
private Integer currentPage;
/**显示条数*/
@NotNull(message="显示条数不能为空!")
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
private Integer pageSize;
/**
* 项目Id
*/
@ApiModelProperty(value = "项目Id")
private String projectId;
/**
* 设备id
*/
@ApiModelProperty(value = "设备id")
private String equipmentId;
/**
* 告警级别(字典表)
*/
@ApiModelProperty(value = "告警级别")
private String alarmLevel;
/**
* 开始时间
*/
@ApiModelProperty(value = "开始时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime startTime;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime endTime;
}

View File

@@ -0,0 +1,48 @@
package com.njcn.algorithm.pojo.param;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* Description:
* Date: 2023/5/17 15:40【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class CsEquipmentTransferAddParm {
@ApiModelProperty(value = "项目Id")
private String projectId;
@ApiModelProperty(value = "移交/恢复设备id集用分割")
private String equipmentIds;
@ApiModelProperty(value = "发起人")
private String promoter;
@ApiModelProperty(value = "移交人")
private String transferor;
/**
* 事件类型(权限转移,数据恢复)
*/
@ApiModelProperty(value = "事件类型")
private String eventType;
@ApiModelProperty(value = "备注")
private String remark;
}

View File

@@ -0,0 +1,54 @@
package com.njcn.algorithm.pojo.param;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
/**
* Description:
* Date: 2023/5/16 16:25【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class CsEventDetailPageParm {
@NotNull(message="当前页不能为空!")
@Min(value = 1, message = "当前页不能为0")
@ApiModelProperty(value = "当前页",name = "currentPage",dataType ="Integer",required = true)
private Integer currentPage;
/**显示条数*/
@NotNull(message="显示条数不能为空!")
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
private Integer pageSize;
/**
* 项目Id
*/
@ApiModelProperty(value = "项目Id")
private String projectId;
/**
* 开始时间
*/
@ApiModelProperty(value = "开始时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime startTime;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime endTime;
}

View File

@@ -0,0 +1,54 @@
package com.njcn.algorithm.pojo.param;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
/**
* Description:
* Date: 2023/5/16 16:25【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class CsStatLimitRatePageParm {
@NotNull(message="当前页不能为空!")
@Min(value = 1, message = "当前页不能为0")
@ApiModelProperty(value = "当前页",name = "currentPage",dataType ="Integer",required = true)
private Integer currentPage;
/**显示条数*/
@NotNull(message="显示条数不能为空!")
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
private Integer pageSize;
/**
* 项目Id
*/
@ApiModelProperty(value = "项目Id")
private String projectId;
/**
* 开始时间
*/
@ApiModelProperty(value = "开始时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime startTime;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime endTime;
}

View File

@@ -0,0 +1,47 @@
package com.njcn.algorithm.pojo.param;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
/**
* Description:
* Date: 2023/5/16 16:25【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class ThdDataQueryParm {
private String devId;
private String statisticalName;
/**
* 开始时间
*/
@ApiModelProperty(value = "开始时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@NotNull(message="开始时间不能为空!")
private String startTime;
/**
* 结束时间
*/
@ApiModelProperty(value = "结束时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@NotNull(message="结束时间不能为空!")
private String endTime;
}

View File

@@ -32,7 +32,7 @@ public class AppLineTopologyDiagramPO extends BaseEntity {
/**
* 监测点ID
*/
@MppMultiId(value = "line_id")
@TableField(value = "line_id")
private String lineId;
/**

View File

@@ -0,0 +1,99 @@
package com.njcn.algorithm.pojo.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;
/**
* Description:
* Date: 2023/5/16 16:25【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@TableName(value = "cs_equipment_alarm")
public class CsEquipmentAlarmPO extends BaseEntity {
/**
* id
*/
@TableId(value = "id", type = IdType.ASSIGN_UUID)
@ApiModelProperty(value = "id")
private String id;
/**
* 项目Id
*/
@TableField(value = "project_id")
private String projectId;
/**
* 设备id
*/
@TableField(value = "equipment_id")
private String equipmentId;
/**
* 告警信息
*/
@TableField(value = "alarm_msg")
private String alarmMsg;
/**
* 告警级别(字典表)
*/
@TableField(value = "alarm_level")
private String alarmLevel;
/**
* 开始时间
*/
@TableField(value = "start_time")
private LocalDateTime startTime;
/**
* 结束时间
*/
@TableField(value = "end_time")
private LocalDateTime endTime;
/**
* 状态(0删除 1正常)
*/
@TableField(value = "`status`")
private String status;
public static final String COL_ID = "id";
public static final String COL_PROJECT_ID = "project_id";
public static final String COL_EQUIPMENT_ID = "equipment_id";
public static final String COL_ALARM_MSG = "alarm_msg";
public static final String COL_ALARM_LEVEL = "alarm_level";
public static final String COL_START_TIME = "start_time";
public static final String COL_END_TIME = "end_time";
public static final String COL_STATUS = "status";
public static final String COL_CREATE_BY = "create_by";
public static final String COL_CREATE_TIME = "create_time";
public static final String COL_UPDATE_BY = "update_by";
public static final String COL_UPDATE_TIME = "update_time";
}

View File

@@ -0,0 +1,116 @@
package com.njcn.algorithm.pojo.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;
/**
*
* Description:
* Date: 2023/5/17 15:40【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@TableName(value = "cs_equipment_transfer")
public class CsEquipmentTransferPO {
/**
* id
*/
@TableId(value = "id", type = IdType.ASSIGN_UUID)
private String id;
/**
* 项目Id
*/
@TableField(value = "project_id")
private String projectId;
/**
* 移交/恢复设备id集用分割
*/
@TableField(value = "equipment_ids")
private String equipmentIds;
/**
* 发起人
*/
@TableField(value = "promoter")
private String promoter;
/**
* transferor
*/
@TableField(value = "transferor")
private String transferor;
/**
* 事件类型(权限转移,数据恢复)
*/
@TableField(value = "event_type")
private String eventType;
/**
* 备注
*/
@TableField(value = "remark")
private String remark;
/**
* 状态(0:删除 1:未注册 2:注册 3:接入)
*/
@TableField(value = "`status`")
private Integer status;
/**
* 创建用户
*/
@TableField(value = "create_by")
private String createBy;
/**
* 创建时间
*/
@TableField(value = "create_time")
private Date createTime;
/**
* 更新用户
*/
@TableField(value = "update_by")
private String updateBy;
/**
* 更新时间
*/
@TableField(value = "update_time")
private Date updateTime;
public static final String COL_ID = "id";
public static final String COL_PROJECT_ID = "project_id";
public static final String COL_EQUIPMENT_IDS = "equipment_ids";
public static final String COL_PROMOTER = "promoter";
public static final String COL_TRANSFEROR = "transferor";
public static final String COL_EVENT_TYPE = "event_type";
public static final String COL_REMARK = "remark";
public static final String COL_STATUS = "status";
public static final String COL_CREATE_BY = "create_by";
public static final String COL_CREATE_TIME = "create_time";
public static final String COL_UPDATE_BY = "update_by";
public static final String COL_UPDATE_TIME = "update_time";
}

View File

@@ -0,0 +1,214 @@
package com.njcn.algorithm.pojo.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* Description:
* Date: 2023/5/17 10:51【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@TableName(value = "cs_event_detail")
public class CsEventDetailPO {
/**
* 暂时事件ID
*/
@TableId(value = "event_id", type = IdType.ASSIGN_UUID)
private String eventId;
/**
* 监测点ID
*/
@TableField(value = "measurement_point_id")
private String measurementPointId;
/**
* 统计指标类型
*/
@TableField(value = "event_type")
private String eventType;
/**
* 暂降原因字典表PQS_Dicdata
*/
@TableField(value = "advance_reason")
private String advanceReason;
/**
* 暂降类型字典表PQS_Dicdata
*/
@TableField(value = "advance_type")
private String advanceType;
/**
* 事件关联分析表Guid
*/
@TableField(value = "eventass_index")
private String eventassIndex;
@TableField(value = "dq_time")
private Double dqTime;
/**
* 特征值计算更新时间外键PQS_Relevance的Time字段
*/
@TableField(value = "deal_time")
private Date dealTime;
/**
* 默认事件个数为0
*/
@TableField(value = "num")
private Integer num;
/**
* 波形文件是否从装置招到本地(0未招1已招)默认值为0
*/
@TableField(value = "file_flag")
private Boolean fileFlag;
/**
* 特征值计算标志0未处理1已处理; 2已处理无结果;3计算失败默认值为0
*/
@TableField(value = "deal_flag")
private Boolean dealFlag;
/**
* 处理结果第一条事件发生时间(读comtra文件获取)
*/
@TableField(value = "first_time")
private Date firstTime;
/**
* 处理结果第一条事件暂降类型字典表PQS_Dicdata
*/
@TableField(value = "first_type")
private String firstType;
/**
* 处理结果第一条事件发生时间毫秒(读comtra文件获取)
*/
@TableField(value = "first_ms")
private BigDecimal firstMs;
/**
* 暂降能量
*/
@TableField(value = "energy")
private Double energy;
/**
* 暂降严重度
*/
@TableField(value = "severity")
private Double severity;
/**
* 暂降源与监测位置关系 Upper:上游Lower :下游Unknown :未知;为空则是未计算
*/
@TableField(value = "sagsource")
private String sagsource;
/**
* 开始时间
*/
@TableField(value = "start_time")
private Date startTime;
/**
* 持续时间,单位秒
*/
@TableField(value = "duration")
private BigDecimal duration;
/**
* 特征幅值
*/
@TableField(value = "feature_amplitude")
private BigDecimal featureAmplitude;
/**
* 相别
*/
@TableField(value = "phase")
private String phase;
/**
* 事件描述
*/
@TableField(value = "event_describe")
private String eventDescribe;
/**
* 波形路径
*/
@TableField(value = "wave_path")
private String wavePath;
/**
* 暂态事件上送时间
*/
@TableField(value = "create_time")
private Date createTime;
@TableField(value = "transient_value")
private Double transientValue;
public static final String COL_EVENT_ID = "event_id";
public static final String COL_MEASUREMENT_POINT_ID = "measurement_point_id";
public static final String COL_EVENT_TYPE = "event_type";
public static final String COL_ADVANCE_REASON = "advance_reason";
public static final String COL_ADVANCE_TYPE = "advance_type";
public static final String COL_EVENTASS_INDEX = "eventass_index";
public static final String COL_DQ_TIME = "dq_time";
public static final String COL_DEAL_TIME = "deal_time";
public static final String COL_NUM = "num";
public static final String COL_FILE_FLAG = "file_flag";
public static final String COL_DEAL_FLAG = "deal_flag";
public static final String COL_FIRST_TIME = "first_time";
public static final String COL_FIRST_TYPE = "first_type";
public static final String COL_FIRST_MS = "first_ms";
public static final String COL_ENERGY = "energy";
public static final String COL_SEVERITY = "severity";
public static final String COL_SAGSOURCE = "sagsource";
public static final String COL_START_TIME = "start_time";
public static final String COL_DURATION = "duration";
public static final String COL_FEATURE_AMPLITUDE = "feature_amplitude";
public static final String COL_PHASE = "phase";
public static final String COL_EVENT_DESCRIBE = "event_describe";
public static final String COL_WAVE_PATH = "wave_path";
public static final String COL_CREATE_TIME = "create_time";
public static final String COL_TRANSIENT_VALUE = "transient_value";
}

View File

@@ -0,0 +1,73 @@
package com.njcn.algorithm.pojo.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
/**
*
* Description:
* Date: 2023/5/18 14:01【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@TableName(value = "cs_line")
public class CsLinePO extends BaseEntity {
/**
* 监测点id
*/
@TableId(value = "line_id", type = IdType.ASSIGN_UUID)
private String lineId;
/**
* 装置id
*/
@TableField(value = "dev_id")
private String devId;
/**
* 监测点名称
*/
@TableField(value = "`name`")
private String name;
/**
* 字典表:安装位置(负载侧,电网侧, 输出侧)
*/
@TableField(value = "`position`")
private String position;
/**
* 电压等级
*/
@TableField(value = "vol_grade")
private String volGrade;
/**
* PT变比
*/
@TableField(value = "pt_ratio")
private BigDecimal ptRatio;
/**
* CT变比
*/
@TableField(value = "ct_ratio")
private BigDecimal ctRatio;
/**
* 状态(0删除 1正常)
*/
@TableField(value = "`status`")
private Integer status;
}

View File

@@ -0,0 +1,245 @@
package com.njcn.algorithm.pojo.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;
/**
*
* Description:
* Date: 2023/5/17 13:45【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@TableName(value = "cs_stat_limit_rate_d")
public class CsStatLimitRateDPO {
@TableField(value = "time_id")
private Date timeId;
@TableField(value = "my_index")
private String myIndex;
@TableField(value = "phasic_type")
private String phasicType;
@TableField(value = "all_time")
private Integer allTime;
@TableField(value = "flicker_all_time")
private Integer flickerAllTime;
@TableField(value = "freq_dev_overtime")
private Integer freqDevOvertime;
@TableField(value = "voltage_dev_overtime")
private Integer voltageDevOvertime;
@TableField(value = "ubalance_overtime")
private Integer ubalanceOvertime;
@TableField(value = "flicker_overtime")
private Integer flickerOvertime;
@TableField(value = "uaberrance_overtime")
private Integer uaberranceOvertime;
@TableField(value = "uharm_2_overtime")
private Integer uharm2Overtime;
@TableField(value = "uharm_3_overtime")
private Integer uharm3Overtime;
@TableField(value = "uharm_4_overtime")
private Integer uharm4Overtime;
@TableField(value = "uharm_5_overtime")
private Integer uharm5Overtime;
@TableField(value = "uharm_6_overtime")
private Integer uharm6Overtime;
@TableField(value = "uharm_7_overtime")
private Integer uharm7Overtime;
@TableField(value = "uharm_8_overtime")
private Integer uharm8Overtime;
@TableField(value = "uharm_9_overtime")
private Integer uharm9Overtime;
@TableField(value = "uharm_10_overtime")
private Integer uharm10Overtime;
@TableField(value = "uharm_11_overtime")
private Integer uharm11Overtime;
@TableField(value = "uharm_12_overtime")
private Integer uharm12Overtime;
@TableField(value = "uharm_13_overtime")
private Integer uharm13Overtime;
@TableField(value = "uharm_14_overtime")
private Integer uharm14Overtime;
@TableField(value = "uharm_15_overtime")
private Integer uharm15Overtime;
@TableField(value = "uharm_16_overtime")
private Integer uharm16Overtime;
@TableField(value = "uharm_17_overtime")
private Integer uharm17Overtime;
@TableField(value = "uharm_18_overtime")
private Integer uharm18Overtime;
@TableField(value = "uharm_19_overtime")
private Integer uharm19Overtime;
@TableField(value = "uharm_20_overtime")
private Integer uharm20Overtime;
@TableField(value = "uharm_21_overtime")
private Integer uharm21Overtime;
@TableField(value = "uharm_22_overtime")
private Integer uharm22Overtime;
@TableField(value = "uharm_23_overtime")
private Integer uharm23Overtime;
@TableField(value = "uharm_24_overtime")
private Integer uharm24Overtime;
@TableField(value = "uharm_25_overtime")
private Integer uharm25Overtime;
@TableField(value = "iharm_2_overtime")
private Integer iharm2Overtime;
@TableField(value = "iharm_3_overtime")
private Integer iharm3Overtime;
@TableField(value = "iharm_4_overtime")
private Integer iharm4Overtime;
@TableField(value = "iharm_5_overtime")
private Integer iharm5Overtime;
@TableField(value = "iharm_6_overtime")
private Integer iharm6Overtime;
@TableField(value = "iharm_7_overtime")
private Integer iharm7Overtime;
@TableField(value = "iharm_8_overtime")
private Integer iharm8Overtime;
@TableField(value = "iharm_9_overtime")
private Integer iharm9Overtime;
@TableField(value = "iharm_10_overtime")
private Integer iharm10Overtime;
@TableField(value = "iharm_11_overtime")
private Integer iharm11Overtime;
@TableField(value = "iharm_12_overtime")
private Integer iharm12Overtime;
@TableField(value = "iharm_13_overtime")
private Integer iharm13Overtime;
@TableField(value = "iharm_14_overtime")
private Integer iharm14Overtime;
@TableField(value = "iharm_15_overtime")
private Integer iharm15Overtime;
@TableField(value = "iharm_16_overtime")
private Integer iharm16Overtime;
@TableField(value = "iharm_17_overtime")
private Integer iharm17Overtime;
@TableField(value = "iharm_18_overtime")
private Integer iharm18Overtime;
@TableField(value = "iharm_19_overtime")
private Integer iharm19Overtime;
@TableField(value = "iharm_20_overtime")
private Integer iharm20Overtime;
@TableField(value = "iharm_21_overtime")
private Integer iharm21Overtime;
@TableField(value = "iharm_22_overtime")
private Integer iharm22Overtime;
@TableField(value = "iharm_23_overtime")
private Integer iharm23Overtime;
@TableField(value = "iharm_24_overtime")
private Integer iharm24Overtime;
@TableField(value = "iharm_25_overtime")
private Integer iharm25Overtime;
@TableField(value = "inuharm_1_overtime")
private Integer inuharm1Overtime;
@TableField(value = "inuharm_2_overtime")
private Integer inuharm2Overtime;
@TableField(value = "inuharm_3_overtime")
private Integer inuharm3Overtime;
@TableField(value = "inuharm_4_overtime")
private Integer inuharm4Overtime;
@TableField(value = "inuharm_5_overtime")
private Integer inuharm5Overtime;
@TableField(value = "inuharm_6_overtime")
private Integer inuharm6Overtime;
@TableField(value = "inuharm_7_overtime")
private Integer inuharm7Overtime;
@TableField(value = "inuharm_8_overtime")
private Integer inuharm8Overtime;
@TableField(value = "inuharm_9_overtime")
private Integer inuharm9Overtime;
@TableField(value = "inuharm_10_overtime")
private Integer inuharm10Overtime;
@TableField(value = "inuharm_11_overtime")
private Integer inuharm11Overtime;
@TableField(value = "inuharm_12_overtime")
private Integer inuharm12Overtime;
@TableField(value = "inuharm_13_overtime")
private Integer inuharm13Overtime;
@TableField(value = "inuharm_14_overtime")
private Integer inuharm14Overtime;
@TableField(value = "inuharm_15_overtime")
private Integer inuharm15Overtime;
@TableField(value = "inuharm_16_overtime")
private Integer inuharm16Overtime;
@TableField(value = "i_neg_overtime")
private Integer iNegOvertime;
}

View File

@@ -0,0 +1,82 @@
package com.njcn.algorithm.pojo.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.util.Date;
/**
* Description:
* Date: 2023/5/16 16:25【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@TableName(value = "cs_equipment_alarm")
public class CsEquipmentAlarmVO extends BaseEntity {
/**
* id
*/
private String id;
/**
* 项目Id
*/
private String projectId;
/**
* 项目名称
*/
private String projectName;
/**
* 设备id
*/
private String equipmentId;
/**
* 设备名称
*/
private String equipmentName;
/**
* 告警信息
*/
private String alarmMsg;
/**
* 告警级别(字典表)
*/
private String alarmLevel;
/**
* 告警级别名称
*/
private String alarmLevelName;
/**
* 开始时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime startTime;
/**
* 结束时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime endTime;
}

View File

@@ -0,0 +1,68 @@
package com.njcn.algorithm.pojo.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
*
* Description:
* Date: 2023/5/17 15:40【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class CsEquipmentTransferVO extends BaseEntity {
/**
* id
*/
private String id;
/**
* 项目Id
*/
private String projectId;
private String projectName;
/**
* 移交/恢复设备id集用分割
*/
private String equipmentIds;
private String equipmentNames;
/**
* 发起人
*/
private String promoter;
/**
* transferor
*/
private String transferor;
/**
* 事件类型(权限转移,数据恢复)
*/
private String eventType;
/**
* 备注
*/
private String remark;
/**
* 状态(0:删除 1:未注册 2:注册 3:接入)
*/
private Boolean status;
}

View File

@@ -0,0 +1,152 @@
package com.njcn.algorithm.pojo.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* Description:
* Date: 2023/5/17 10:51【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class CsEventDetailVO {
private String projectId;
private String projectName;
private String subId;
private String subName;
/**
* 暂时事件ID
*/
private String eventId;
/**
* 监测点ID
*/
private String measurementPointId;
private String lineName;
/**
* 统计指标类型
*/
private String eventType;
/**
* 暂降原因字典表PQS_Dicdata
*/
private String advanceReason;
/**
* 暂降类型字典表PQS_Dicdata
*/
private String advanceType;
/**
* 事件关联分析表Guid
*/
private String eventassIndex;
private Double dqTime;
/**
* 特征值计算更新时间外键PQS_Relevance的Time字段
*/
private Date dealTime;
/**
* 默认事件个数为0
*/
private Integer num;
/**
* 波形文件是否从装置招到本地(0未招1已招)默认值为0
*/
private String fileFlag;
/**
* 特征值计算标志0未处理1已处理; 2已处理无结果;3计算失败默认值为0
*/
private String dealFlag;
/**
* 处理结果第一条事件发生时间(读comtra文件获取)
*/
private Date firstTime;
/**
* 处理结果第一条事件暂降类型字典表PQS_Dicdata
*/
private String firstType;
/**
* 处理结果第一条事件发生时间毫秒(读comtra文件获取)
*/
private BigDecimal firstMs;
/**
* 暂降能量
*/
private Double energy;
/**
* 暂降严重度
*/
private Double severity;
/**
* 暂降源与监测位置关系 Upper:上游Lower :下游Unknown :未知;为空则是未计算
*/
private String sagsource;
/**
* 开始时间
*/
private Date startTime;
/**
* 持续时间,单位秒
*/
private BigDecimal duration;
/**
* 特征幅值
*/
private BigDecimal featureAmplitude;
/**
* 相别
*/
private String phase;
/**
* 事件描述
*/
private String eventDescribe;
/**
* 波形路径
*/
private String wavePath;
/**
* 暂态事件上送时间
*/
private Date createTime;
private Double transientValue;
}

View File

@@ -0,0 +1,179 @@
package com.njcn.algorithm.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
*
* Description:
* Date: 2023/5/17 13:45【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class CsStatLimitRateDVO {
private String projectId;
private String projectName;
private String subId;
private String subName;
private Date timeId;
private String myIndex;
private String lineName;
private String phasicType;
private Integer allTime;
private Integer flickerAllTime;
private Integer freqDevOvertime;
private Integer voltageDevOvertime;
private Integer ubalanceOvertime;
private Integer flickerOvertime;
private Integer uaberranceOvertime;
private Integer uharm2Overtime;
private Integer uharm3Overtime;
private Integer uharm4Overtime;
private Integer uharm5Overtime;
private Integer uharm6Overtime;
private Integer uharm7Overtime;
private Integer uharm8Overtime;
private Integer uharm9Overtime;
private Integer uharm10Overtime;
private Integer uharm11Overtime;
private Integer uharm12Overtime;
private Integer uharm13Overtime;
private Integer uharm14Overtime;
private Integer uharm15Overtime;
private Integer uharm16Overtime;
private Integer uharm17Overtime;
private Integer uharm18Overtime;
private Integer uharm19Overtime;
private Integer uharm20Overtime;
private Integer uharm21Overtime;
private Integer uharm22Overtime;
private Integer uharm23Overtime;
private Integer uharm24Overtime;
private Integer uharm25Overtime;
private Integer iharm2Overtime;
private Integer iharm3Overtime;
private Integer iharm4Overtime;
private Integer iharm5Overtime;
private Integer iharm6Overtime;
private Integer iharm7Overtime;
private Integer iharm8Overtime;
private Integer iharm9Overtime;
private Integer iharm10Overtime;
private Integer iharm11Overtime;
private Integer iharm12Overtime;
private Integer iharm13Overtime;
private Integer iharm14Overtime;
private Integer iharm15Overtime;
private Integer iharm16Overtime;
private Integer iharm17Overtime;
private Integer iharm18Overtime;
private Integer iharm19Overtime;
private Integer iharm20Overtime;
private Integer iharm21Overtime;
private Integer iharm22Overtime;
private Integer iharm23Overtime;
private Integer iharm24Overtime;
private Integer iharm25Overtime;
private Integer inuharm1Overtime;
private Integer inuharm2Overtime;
private Integer inuharm3Overtime;
private Integer inuharm4Overtime;
private Integer inuharm5Overtime;
private Integer inuharm6Overtime;
private Integer inuharm7Overtime;
private Integer inuharm8Overtime;
private Integer inuharm9Overtime;
private Integer inuharm10Overtime;
private Integer inuharm11Overtime;
private Integer inuharm12Overtime;
private Integer inuharm13Overtime;
private Integer inuharm14Overtime;
private Integer inuharm15Overtime;
private Integer inuharm16Overtime;
private Integer iNegOvertime;
}

View File

@@ -0,0 +1,34 @@
package com.njcn.algorithm.pojo.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* Description:
* Date: 2023/5/18 9:14【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class ThdDataVO {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime time;
private String LineId;
private String position;
private String Phase;
private String StatMethod;
private String statisticalIndex;
private String statisticalName;
private Double statisticalData;
}

View File

@@ -0,0 +1,133 @@
package com.njcn.algorithm.utils;
import com.njcn.algorithm.pojo.vo.ThdDataVO;
import org.apache.commons.lang3.StringUtils;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
public class ReflectUtils {
/**
* 通过字段名从对象或对象的父类中得到字段的值
* @param object 对象实例
* @param fieldName 字段名
* @return 字段对应的值
* @throws Exception
*/
public static Object getValue(Object object, String fieldName) {
if (object == null) {
return null;
}
if (StringUtils.isBlank(fieldName)) {
return null;
}
Field field = null;
Class<?> clazz = object.getClass();
for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
try {
field = clazz.getDeclaredField(fieldName);
field.setAccessible(true);
return field.get(object);
} catch (Exception e) {
//这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
//如果这里的异常打印或者往外抛则就不会执行clazz = clazz.getSuperclass(),最后就不会进入到父类中了
}
}
return null;
}
/**
* 通过字段名从对象或对象的父类中得到字段的值调用字典的get方法
* @param object 对象实例
* @param fieldName 字段名
* @return 字段对应的值
* @throws Exception
*/
public static Object getValueOfGet(Object object, String fieldName) throws Exception {
if (object == null) {
return null;
}
if (StringUtils.isBlank(fieldName)) {
return null;
}
Field field = null;
Class<?> clazz = object.getClass();
for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
try {
field = clazz.getDeclaredField(fieldName);
field.setAccessible(true);
PropertyDescriptor pd = new PropertyDescriptor(field.getName(), clazz);
//获得get方法
Method getMethod = pd.getReadMethod();
//执行get方法返回一个Object
return getMethod.invoke(object);
} catch (Exception e) {
//这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
//如果这里的异常打印或者往外抛则就不会执行clazz = clazz.getSuperclass(),最后就不会进入到父类中了
}
}
return null;
}
/**
* 通过字段名从对象或对象的父类中得到字段的值调用字典的get方法可以取出复杂的对象的值
* @param object 对象实例
* @param fieldName 字段名
* @return 字段对应的值
* @throws Exception
*/
public static Object getValueOfGetIncludeObjectFeild(Object object, String fieldName)
throws Exception {
if (object == null) {
return null;
}
if (StringUtils.isBlank(fieldName)) {
return null;
}
if(HashMap.class.equals(object.getClass())){
return ((Map)object).get(fieldName);
}
Field field = null;
Class<?> clazz = object.getClass();
for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
try {
if (fieldName.contains(".")) {
// 如operatorUser.name、operatorUser.org.name递归调用
String[] splitFiledName = fieldName.split("\\.");
return getValueOfGetIncludeObjectFeild(
getValueOfGetIncludeObjectFeild(object, splitFiledName[0]),
splitFiledName[1]);
}
field = clazz.getDeclaredField(fieldName);
field.setAccessible(true);
PropertyDescriptor pd = new PropertyDescriptor(field.getName(), clazz);
//获得get方法
Method getMethod = pd.getReadMethod();
//执行get方法返回一个Object
return getMethod.invoke(object);
} catch (Exception e) {
//这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
//如果这里的异常打印或者往外抛则就不会执行clazz = clazz.getSuperclass(),最后就不会进入到父类中了
}
}
return null;
}
public static void main(String[] args) throws Exception {
ThdDataVO t = new ThdDataVO();
t.setLineId("222");
System.out.println(ReflectUtils.getValue(t,"LineId"));
}
}

View File

@@ -68,6 +68,24 @@
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>pqs-influx</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>4.9.0</version>
</dependency>
</dependencies>
<artifactId>algorithm-boot</artifactId>

View File

@@ -9,10 +9,12 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.DependsOn;
@Slf4j
@MapperScan("com.njcn.**.mapper")
@EnableFeignClients(basePackages = "com.njcn")
@DependsOn("proxyMapperRegister")
@SpringBootApplication(scanBasePackages = "com.njcn")
public class
AlgorithmBootApplication {

View File

@@ -0,0 +1,57 @@
package com.njcn.algorithm.controller.Equipment;
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
import com.njcn.algorithm.pojo.param.CsEquipmentTransferAddParm;
import com.njcn.algorithm.pojo.po.CsEquipmentTransferPO;
import com.njcn.algorithm.service.CsEquipmentTransferPOService;
import com.njcn.common.pojo.annotation.OperateInfo;
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.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* (cs_equipment_transfer)表控制层
*
* @author xxxxx
*/
@Slf4j
@RestController
@RequestMapping("/EquipmentTransfer")
@Api(tags = " 设备转移/恢复")
@AllArgsConstructor
public class CsEquipmentTransferPOController extends BaseController {
private final CsEquipmentTransferPOService csEquipmentTransferPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/addEquipmentTransfer")
@ApiOperation("新增设备转移申请")
@ApiImplicitParam(name = "csEquipmentTransferAddParm", value = "新增项目参数", required = true)
public HttpResult<Boolean> add(@RequestBody @Validated CsEquipmentTransferAddParm csEquipmentTransferAddParm){
String methodDescribe = getMethodDescribe("add");
Boolean flag = csEquipmentTransferPOService.add (csEquipmentTransferAddParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/passEquipmentTransfer")
@ApiOperation("设备转移申请通过")
@ApiImplicitParam(name = "ids", value = "设备转移申请id", required = true)
public HttpResult<Boolean> pass(@RequestParam("ids") List<String> ids){
String methodDescribe = getMethodDescribe("add");
Boolean flag = csEquipmentTransferPOService.pass (ids);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
}
}

View File

@@ -0,0 +1,65 @@
package com.njcn.algorithm.controller.alarm;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.algorithm.pojo.param.CsDevModelAddParm;
import com.njcn.algorithm.pojo.param.CsDevModelQueryParm;
import com.njcn.algorithm.pojo.param.CsEquipmentAlarmAddParm;
import com.njcn.algorithm.pojo.param.CsEquipmentAlarmPageParm;
import com.njcn.algorithm.pojo.po.CsDevModelPO;
import com.njcn.algorithm.pojo.vo.CsDevModelPageVO;
import com.njcn.algorithm.pojo.vo.CsEquipmentAlarmVO;
import com.njcn.algorithm.service.CsEquipmentAlarmPOService;
import com.njcn.common.pojo.annotation.OperateInfo;
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.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Description:
* Date: 2023/5/16 16:33【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Slf4j
@RestController
@RequestMapping("/EquipmentAlarm")
@Api(tags = "设备警告")
@AllArgsConstructor
public class CsEquipmentAlarmController extends BaseController {
private final CsEquipmentAlarmPOService csEquipmentAlarmPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/add")
@ApiOperation("新增设备警告")
@ApiImplicitParam(name = "csEquipmentAlarmAddParm", value = "新增设备警告参数", required = true)
public HttpResult<CsEquipmentAlarmVO> add(@RequestBody @Validated CsEquipmentAlarmAddParm csEquipmentAlarmAddParm){
String methodDescribe = getMethodDescribe("add");
CsEquipmentAlarmVO csEquipmentAlarmVO = csEquipmentAlarmPOService.add (csEquipmentAlarmAddParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csEquipmentAlarmVO, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPage")
@ApiOperation("设备警告分页查询")
@ApiImplicitParam(name = "csEquipmentAlarmPageParm", value = "设备警告查询参数", required = true)
public HttpResult<IPage<CsEquipmentAlarmVO>> queryPage(@RequestBody @Validated CsEquipmentAlarmPageParm csEquipmentAlarmPageParm ){
String methodDescribe = getMethodDescribe("queryPage");
IPage<CsEquipmentAlarmVO> page = csEquipmentAlarmPOService.queryPage (csEquipmentAlarmPageParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
}

View File

@@ -0,0 +1,47 @@
package com.njcn.algorithm.controller.alarm;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.algorithm.pojo.param.CsEquipmentAlarmPageParm;
import com.njcn.algorithm.pojo.param.CsEventDetailPageParm;
import com.njcn.algorithm.pojo.vo.CsEquipmentAlarmVO;
import com.njcn.algorithm.pojo.vo.CsEventDetailVO;
import com.njcn.algorithm.service.CsEventDetailPOService;
import com.njcn.common.pojo.annotation.OperateInfo;
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.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* (cs_event_detail)表控制层
*
* @author xxxxx
*/
@Slf4j
@RestController
@RequestMapping("/EventAlarm")
@Api(tags = "暂态警告")
@AllArgsConstructor
public class CsEventDetailPOController extends BaseController {
private final CsEventDetailPOService csEventDetailPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPage")
@ApiOperation("暂态警告分页查询")
@ApiImplicitParam(name = "csEventDetailPageParm", value = "暂态警告查询参数", required = true)
public HttpResult<IPage<CsEventDetailVO>> queryPage(@RequestBody @Validated CsEventDetailPageParm csEventDetailPageParm ){
String methodDescribe = getMethodDescribe("queryPage");
IPage<CsEventDetailVO> page = csEventDetailPOService.queryPage (csEventDetailPageParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
}

View File

@@ -0,0 +1,45 @@
package com.njcn.algorithm.controller.alarm;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.algorithm.pojo.param.CsStatLimitRatePageParm;
import com.njcn.algorithm.pojo.vo.CsStatLimitRateDVO;
import com.njcn.algorithm.service.CsStatLimitRateDPOService;
import com.njcn.common.pojo.annotation.OperateInfo;
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.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* (cs_stat_limit_rate_d)表控制层
*
* @author xxxxx
*/
@Slf4j
@RestController
@RequestMapping("/LimitRateAlarm")
@Api(tags = "稳态警告")
@AllArgsConstructor
public class CsStatLimitRateDPOController extends BaseController {
private final CsStatLimitRateDPOService csStatLimitRateDPOService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPage")
@ApiOperation("设备模板分页查询")
@ApiImplicitParam(name = "csStatLimitRatePageParm", value = "设备警告查询参数", required = true)
public HttpResult<IPage<CsStatLimitRateDVO>> queryPage(@RequestBody @Validated CsStatLimitRatePageParm csStatLimitRatePageParm ){
String methodDescribe = getMethodDescribe("queryPage");
IPage<CsStatLimitRateDVO> page = csStatLimitRateDPOService.queryPage (csStatLimitRatePageParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
}

View File

@@ -0,0 +1,89 @@
package com.njcn.algorithm.controller.dataset;
import com.njcn.algorithm.pojo.param.CsDataEffectiveQueryParm;
import com.njcn.algorithm.pojo.param.ThdDataQueryParm;
import com.njcn.algorithm.pojo.vo.AppBaseInformationVO;
import com.njcn.algorithm.pojo.vo.CsDataEffectiveVO;
import com.njcn.algorithm.pojo.vo.ThdDataVO;
import com.njcn.algorithm.service.StableDataService;
import com.njcn.common.pojo.annotation.OperateInfo;
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.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Description:
* Date: 2023/5/18 8:51【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Slf4j
@RestController
@RequestMapping("/stable")
@Api(tags = "稳态数据展示")
@AllArgsConstructor
public class StableDataController extends BaseController {
private final StableDataService stableDataService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryFisrtThdData")
@ApiOperation("查询谐波畸变率实时数据")
@ApiImplicitParams({
@ApiImplicitParam(name = "devId", value = "设备id", required = true),
@ApiImplicitParam(name = "statisticalName", value = "统计指标name", required = true)
})
public HttpResult<List<ThdDataVO>> queryFisrtThdData(@RequestParam("devId") String devId, @RequestParam("statisticalName") String statisticalName) {
String methodDescribe = getMethodDescribe("queryThdData");
List<ThdDataVO> list = stableDataService.queryThdData(devId, statisticalName);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryThdDataByTime")
@ApiOperation("查询时间段内谐波畸变率")
@ApiImplicitParam(name = "thdDataQueryParm", value = "查询参数", required = true)
public HttpResult<List<ThdDataVO>> queryThdDataByTime(@RequestBody @Validated ThdDataQueryParm thdDataQueryParm) {
String methodDescribe = getMethodDescribe("queryThdDataByTime");
List<ThdDataVO> list = stableDataService.queryThdDataByTime(thdDataQueryParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryFisrtThdContent")
@ApiOperation("查询谐波含量实时数据")
@ApiImplicitParams({
@ApiImplicitParam(name = "devId", value = "设备id", required = true),
@ApiImplicitParam(name = "statisticalName", value = "统计指标name", required = true)
})
public HttpResult<List<ThdDataVO>> queryFisrtThdContent(@RequestParam("devId") String devId, @RequestParam("statisticalName") String statisticalName) {
String methodDescribe = getMethodDescribe("queryFisrtThdContent");
List<ThdDataVO> list = stableDataService.queryFisrtThdContent(devId, statisticalName);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryThdContentByTime")
@ApiOperation("查询时间段内谐波畸变率")
@ApiImplicitParam(name = "thdDataQueryParm", value = "查询参数", required = true)
public HttpResult<List<ThdDataVO>> queryThdContentByTime(@RequestBody @Validated ThdDataQueryParm thdDataQueryParm) {
String methodDescribe = getMethodDescribe("queryThdContentByTime");
List<ThdDataVO> list = stableDataService.queryThdContentByTime(thdDataQueryParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
}

View File

@@ -29,19 +29,25 @@ public interface AppProjectMapper extends MppBaseMapper<AppProjectPO> {
// "\tb.file_path topologyDiagramPath,\n" +
// "\ta.lng lng,\n" +
// "\ta.lat lat,\n" +
"\ta.`status` STATUS,\n" +
"\tc.name engineering_name,\n" +
"\ta.description description,\n"+
"\ta.engineering_id engineering_id,\n" +
"\ta.`status` STATUS,\n" +
"\ta.create_by create_by,\n" +
"\ta.create_time create_time,\n" +
"\ta.update_by update_by,\n" +
"\ta.update_time update_time\n" +
"FROM\n" +
"\tcs_project a\n" +
"LEFT JOIN cs_topology_diagram b ON a.id = b.project_id\n" +
"LEFT JOIN cs_engineering c on a.engineering_id=c.id \n" +
"WHERE\n" +
"\t1 = 1 AND a.status=\"1\"\n" ,
"<when test='temp.projectId!=null and temp.projectId!=\"\"'>",
"AND a.id = #{temp.projectId} "+
"</when>",
"<when test='temp.engineeringId!=null and temp.engineeringId!=\"\"'>",
"AND a.engineering_id = #{temp.engineeringId} "+
"</when>",
"<when test='temp.endTime!=null and temp.endTime!=\"\"'>",
"AND a.create_time &lt;= #{temp.endTime}" +
"</when>",
@@ -51,6 +57,7 @@ public interface AppProjectMapper extends MppBaseMapper<AppProjectPO> {
"<when test='temp.searchValue!=null and temp.searchValue!=\"\"'>",
"AND a.`name` like concat('%',#{temp.searchValue},'%')",
"</when>",
" order by a.create_time desc",
"</script>"}
)
Page<AppProjectVO> getPageVo(Page<AppProjectVO> returnpage, @Param("temp")AppProjectQueryParm appProjectQueryParm);

View File

@@ -0,0 +1,14 @@
package com.njcn.algorithm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.algorithm.pojo.po.CsEquipmentAlarmPO;
/**
* Description:
* Date: 2023/5/16 16:25【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEquipmentAlarmPOMapper extends BaseMapper<CsEquipmentAlarmPO> {
}

View File

@@ -0,0 +1,15 @@
package com.njcn.algorithm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.algorithm.pojo.po.CsEquipmentTransferPO;
/**
*
* Description:
* Date: 2023/5/17 15:40【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEquipmentTransferPOMapper extends BaseMapper<CsEquipmentTransferPO> {
}

View File

@@ -0,0 +1,19 @@
package com.njcn.algorithm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.algorithm.pojo.param.CsEventDetailPageParm;
import com.njcn.algorithm.pojo.po.CsEventDetailPO;
import com.njcn.algorithm.pojo.vo.CsEventDetailVO;
import org.apache.ibatis.annotations.Param;
/**
* Description:
* Date: 2023/5/17 10:51【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEventDetailPOMapper extends BaseMapper<CsEventDetailPO> {
Page<CsEventDetailVO> queryPage(Page<CsEventDetailVO> returnpage,@Param("csEventDetailPageParm") CsEventDetailPageParm csEventDetailPageParm);
}

View File

@@ -0,0 +1,15 @@
package com.njcn.algorithm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.algorithm.pojo.po.CsLinePO;
/**
*
* Description:
* Date: 2023/5/18 14:01【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsLinePOMapper extends BaseMapper<CsLinePO> {
}

View File

@@ -0,0 +1,20 @@
package com.njcn.algorithm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.algorithm.pojo.param.CsStatLimitRatePageParm;
import com.njcn.algorithm.pojo.po.CsStatLimitRateDPO;
import com.njcn.algorithm.pojo.vo.CsStatLimitRateDVO;
import org.apache.ibatis.annotations.Param;
/**
*
* Description:
* Date: 2023/5/17 13:45【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsStatLimitRateDPOMapper extends BaseMapper<CsStatLimitRateDPO> {
Page<CsStatLimitRateDVO> queryPage(Page<CsStatLimitRateDVO> returnpage,@Param("csStatLimitRatePageParm") CsStatLimitRatePageParm csStatLimitRatePageParm);
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.algorithm.mapper.CsEquipmentAlarmPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsEquipmentAlarmPO">
<!--@mbg.generated-->
<!--@Table cs_equipment_alarm-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="equipment_id" jdbcType="VARCHAR" property="equipmentId" />
<result column="alarm_msg" jdbcType="VARCHAR" property="alarmMsg" />
<result column="alarm_level" jdbcType="VARCHAR" property="alarmLevel" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="status" jdbcType="BIT" property="status" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, project_id, equipment_id, alarm_msg, alarm_level, start_time, end_time, `status`,
create_by, create_time, update_by, update_time
</sql>
</mapper>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.algorithm.mapper.CsEquipmentTransferPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsEquipmentTransferPO">
<!--@mbg.generated-->
<!--@Table cs_equipment_transfer-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="equipment_ids" jdbcType="VARCHAR" property="equipmentIds" />
<result column="promoter" jdbcType="VARCHAR" property="promoter" />
<result column="transferor" jdbcType="VARCHAR" property="transferor" />
<result column="event_type" jdbcType="VARCHAR" property="eventType" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="status" jdbcType="BIT" property="status" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, project_id, equipment_ids, promoter, transferor, event_type, remark, `status`,
create_by, create_time, update_by, update_time
</sql>
</mapper>

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.algorithm.mapper.CsEventDetailPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsEventDetailPO">
<!--@mbg.generated-->
<!--@Table cs_event_detail-->
<id column="event_id" jdbcType="CHAR" property="eventId" />
<result column="measurement_point_id" jdbcType="VARCHAR" property="measurementPointId" />
<result column="event_type" jdbcType="CHAR" property="eventType" />
<result column="advance_reason" jdbcType="CHAR" property="advanceReason" />
<result column="advance_type" jdbcType="CHAR" property="advanceType" />
<result column="eventass_index" jdbcType="VARCHAR" property="eventassIndex" />
<result column="dq_time" jdbcType="DOUBLE" property="dqTime" />
<result column="deal_time" jdbcType="TIMESTAMP" property="dealTime" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="file_flag" jdbcType="BIT" property="fileFlag" />
<result column="deal_flag" jdbcType="BIT" property="dealFlag" />
<result column="first_time" jdbcType="TIMESTAMP" property="firstTime" />
<result column="first_type" jdbcType="VARCHAR" property="firstType" />
<result column="first_ms" jdbcType="DECIMAL" property="firstMs" />
<result column="energy" jdbcType="DOUBLE" property="energy" />
<result column="severity" jdbcType="DOUBLE" property="severity" />
<result column="sagsource" jdbcType="VARCHAR" property="sagsource" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="duration" jdbcType="DECIMAL" property="duration" />
<result column="feature_amplitude" jdbcType="DECIMAL" property="featureAmplitude" />
<result column="phase" jdbcType="VARCHAR" property="phase" />
<result column="event_describe" jdbcType="VARCHAR" property="eventDescribe" />
<result column="wave_path" jdbcType="VARCHAR" property="wavePath" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="transient_value" jdbcType="DOUBLE" property="transientValue" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
event_id, measurement_point_id, event_type, advance_reason, advance_type, eventass_index,
dq_time, deal_time, num, file_flag, deal_flag, first_time, first_type, first_ms,
energy, severity, sagsource, start_time, duration, feature_amplitude, phase, event_describe,
wave_path, create_time, transient_value
</sql>
<select id="queryPage" resultType="com.njcn.algorithm.pojo.vo.CsEventDetailVO">
SELECT
temp.*, cs.*
FROM
cs_event_detail cs
INNER JOIN (
SELECT
a.line_id,
a. NAME line_name,
c.id project_id,
c. NAME project_name
FROM
cs_line a,
cs_project_equipment b,
cs_project c
WHERE
1 = 1
AND c.id = b.project_id
AND b.equipment_id = a.dev_id
<if test="csEventDetailPageParm.projectId != null and csEventDetailPageParm.projectId != ''">
AND c.id = #{csEventDetailPageParm.projectId }
</if>
) temp ON cs.measurement_point_id = temp.line_id
where 1=1
<if test="csEventDetailPageParm.startTime != null and csEventDetailPageParm.startTime != ''">
AND cs.start_time &gt;= #{csEventDetailPageParm.startTime }
</if>
<if test="csEventDetailPageParm.endTime != null and csEventDetailPageParm.endTime != ''">
AND cs.start_time &lt;= #{csEventDetailPageParm.endTime }
</if>
</select>
</mapper>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.algorithm.mapper.CsLinePOMapper">
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsLinePO">
<!--@mbg.generated-->
<!--@Table cs_line-->
<id column="line_id" jdbcType="VARCHAR" property="lineId" />
<result column="dev_id" jdbcType="VARCHAR" property="devId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="position" jdbcType="VARCHAR" property="position" />
<result column="vol_grade" jdbcType="VARCHAR" property="volGrade" />
<result column="pt_ratio" jdbcType="DECIMAL" property="ptRatio" />
<result column="ct_ratio" jdbcType="DECIMAL" property="ctRatio" />
<result column="status" jdbcType="BIT" property="status" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
line_id, dev_id, `name`, `position`, vol_grade, pt_ratio, ct_ratio, `status`, create_by,
create_time, update_by, update_time
</sql>
</mapper>

View File

@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.algorithm.mapper.CsStatLimitRateDPOMapper">
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsStatLimitRateDPO">
<!--@mbg.generated-->
<!--@Table cs_stat_limit_rate_d-->
<id column="time_id" jdbcType="TIMESTAMP" property="timeId" />
<id column="my_index" jdbcType="VARCHAR" property="myIndex" />
<id column="phasic_type" jdbcType="VARCHAR" property="phasicType" />
<result column="all_time" jdbcType="INTEGER" property="allTime" />
<result column="flicker_all_time" jdbcType="INTEGER" property="flickerAllTime" />
<result column="freq_dev_overtime" jdbcType="INTEGER" property="freqDevOvertime" />
<result column="voltage_dev_overtime" jdbcType="INTEGER" property="voltageDevOvertime" />
<result column="ubalance_overtime" jdbcType="INTEGER" property="ubalanceOvertime" />
<result column="flicker_overtime" jdbcType="INTEGER" property="flickerOvertime" />
<result column="uaberrance_overtime" jdbcType="INTEGER" property="uaberranceOvertime" />
<result column="uharm_2_overtime" jdbcType="INTEGER" property="uharm2Overtime" />
<result column="uharm_3_overtime" jdbcType="INTEGER" property="uharm3Overtime" />
<result column="uharm_4_overtime" jdbcType="INTEGER" property="uharm4Overtime" />
<result column="uharm_5_overtime" jdbcType="INTEGER" property="uharm5Overtime" />
<result column="uharm_6_overtime" jdbcType="INTEGER" property="uharm6Overtime" />
<result column="uharm_7_overtime" jdbcType="INTEGER" property="uharm7Overtime" />
<result column="uharm_8_overtime" jdbcType="INTEGER" property="uharm8Overtime" />
<result column="uharm_9_overtime" jdbcType="INTEGER" property="uharm9Overtime" />
<result column="uharm_10_overtime" jdbcType="INTEGER" property="uharm10Overtime" />
<result column="uharm_11_overtime" jdbcType="INTEGER" property="uharm11Overtime" />
<result column="uharm_12_overtime" jdbcType="INTEGER" property="uharm12Overtime" />
<result column="uharm_13_overtime" jdbcType="INTEGER" property="uharm13Overtime" />
<result column="uharm_14_overtime" jdbcType="INTEGER" property="uharm14Overtime" />
<result column="uharm_15_overtime" jdbcType="INTEGER" property="uharm15Overtime" />
<result column="uharm_16_overtime" jdbcType="INTEGER" property="uharm16Overtime" />
<result column="uharm_17_overtime" jdbcType="INTEGER" property="uharm17Overtime" />
<result column="uharm_18_overtime" jdbcType="INTEGER" property="uharm18Overtime" />
<result column="uharm_19_overtime" jdbcType="INTEGER" property="uharm19Overtime" />
<result column="uharm_20_overtime" jdbcType="INTEGER" property="uharm20Overtime" />
<result column="uharm_21_overtime" jdbcType="INTEGER" property="uharm21Overtime" />
<result column="uharm_22_overtime" jdbcType="INTEGER" property="uharm22Overtime" />
<result column="uharm_23_overtime" jdbcType="INTEGER" property="uharm23Overtime" />
<result column="uharm_24_overtime" jdbcType="INTEGER" property="uharm24Overtime" />
<result column="uharm_25_overtime" jdbcType="INTEGER" property="uharm25Overtime" />
<result column="iharm_2_overtime" jdbcType="INTEGER" property="iharm2Overtime" />
<result column="iharm_3_overtime" jdbcType="INTEGER" property="iharm3Overtime" />
<result column="iharm_4_overtime" jdbcType="INTEGER" property="iharm4Overtime" />
<result column="iharm_5_overtime" jdbcType="INTEGER" property="iharm5Overtime" />
<result column="iharm_6_overtime" jdbcType="INTEGER" property="iharm6Overtime" />
<result column="iharm_7_overtime" jdbcType="INTEGER" property="iharm7Overtime" />
<result column="iharm_8_overtime" jdbcType="INTEGER" property="iharm8Overtime" />
<result column="iharm_9_overtime" jdbcType="INTEGER" property="iharm9Overtime" />
<result column="iharm_10_overtime" jdbcType="INTEGER" property="iharm10Overtime" />
<result column="iharm_11_overtime" jdbcType="INTEGER" property="iharm11Overtime" />
<result column="iharm_12_overtime" jdbcType="INTEGER" property="iharm12Overtime" />
<result column="iharm_13_overtime" jdbcType="INTEGER" property="iharm13Overtime" />
<result column="iharm_14_overtime" jdbcType="INTEGER" property="iharm14Overtime" />
<result column="iharm_15_overtime" jdbcType="INTEGER" property="iharm15Overtime" />
<result column="iharm_16_overtime" jdbcType="INTEGER" property="iharm16Overtime" />
<result column="iharm_17_overtime" jdbcType="INTEGER" property="iharm17Overtime" />
<result column="iharm_18_overtime" jdbcType="INTEGER" property="iharm18Overtime" />
<result column="iharm_19_overtime" jdbcType="INTEGER" property="iharm19Overtime" />
<result column="iharm_20_overtime" jdbcType="INTEGER" property="iharm20Overtime" />
<result column="iharm_21_overtime" jdbcType="INTEGER" property="iharm21Overtime" />
<result column="iharm_22_overtime" jdbcType="INTEGER" property="iharm22Overtime" />
<result column="iharm_23_overtime" jdbcType="INTEGER" property="iharm23Overtime" />
<result column="iharm_24_overtime" jdbcType="INTEGER" property="iharm24Overtime" />
<result column="iharm_25_overtime" jdbcType="INTEGER" property="iharm25Overtime" />
<result column="inuharm_1_overtime" jdbcType="INTEGER" property="inuharm1Overtime" />
<result column="inuharm_2_overtime" jdbcType="INTEGER" property="inuharm2Overtime" />
<result column="inuharm_3_overtime" jdbcType="INTEGER" property="inuharm3Overtime" />
<result column="inuharm_4_overtime" jdbcType="INTEGER" property="inuharm4Overtime" />
<result column="inuharm_5_overtime" jdbcType="INTEGER" property="inuharm5Overtime" />
<result column="inuharm_6_overtime" jdbcType="INTEGER" property="inuharm6Overtime" />
<result column="inuharm_7_overtime" jdbcType="INTEGER" property="inuharm7Overtime" />
<result column="inuharm_8_overtime" jdbcType="INTEGER" property="inuharm8Overtime" />
<result column="inuharm_9_overtime" jdbcType="INTEGER" property="inuharm9Overtime" />
<result column="inuharm_10_overtime" jdbcType="INTEGER" property="inuharm10Overtime" />
<result column="inuharm_11_overtime" jdbcType="INTEGER" property="inuharm11Overtime" />
<result column="inuharm_12_overtime" jdbcType="INTEGER" property="inuharm12Overtime" />
<result column="inuharm_13_overtime" jdbcType="INTEGER" property="inuharm13Overtime" />
<result column="inuharm_14_overtime" jdbcType="INTEGER" property="inuharm14Overtime" />
<result column="inuharm_15_overtime" jdbcType="INTEGER" property="inuharm15Overtime" />
<result column="inuharm_16_overtime" jdbcType="INTEGER" property="inuharm16Overtime" />
<result column="i_neg_overtime" jdbcType="INTEGER" property="iNegOvertime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
time_id, my_index, phasic_type, all_time, flicker_all_time, freq_dev_overtime, voltage_dev_overtime,
ubalance_overtime, flicker_overtime, uaberrance_overtime, uharm_2_overtime, uharm_3_overtime,
uharm_4_overtime, uharm_5_overtime, uharm_6_overtime, uharm_7_overtime, uharm_8_overtime,
uharm_9_overtime, uharm_10_overtime, uharm_11_overtime, uharm_12_overtime, uharm_13_overtime,
uharm_14_overtime, uharm_15_overtime, uharm_16_overtime, uharm_17_overtime, uharm_18_overtime,
uharm_19_overtime, uharm_20_overtime, uharm_21_overtime, uharm_22_overtime, uharm_23_overtime,
uharm_24_overtime, uharm_25_overtime, iharm_2_overtime, iharm_3_overtime, iharm_4_overtime,
iharm_5_overtime, iharm_6_overtime, iharm_7_overtime, iharm_8_overtime, iharm_9_overtime,
iharm_10_overtime, iharm_11_overtime, iharm_12_overtime, iharm_13_overtime, iharm_14_overtime,
iharm_15_overtime, iharm_16_overtime, iharm_17_overtime, iharm_18_overtime, iharm_19_overtime,
iharm_20_overtime, iharm_21_overtime, iharm_22_overtime, iharm_23_overtime, iharm_24_overtime,
iharm_25_overtime, inuharm_1_overtime, inuharm_2_overtime, inuharm_3_overtime, inuharm_4_overtime,
inuharm_5_overtime, inuharm_6_overtime, inuharm_7_overtime, inuharm_8_overtime, inuharm_9_overtime,
inuharm_10_overtime, inuharm_11_overtime, inuharm_12_overtime, inuharm_13_overtime,
inuharm_14_overtime, inuharm_15_overtime, inuharm_16_overtime, i_neg_overtime
</sql>
<select id="queryPage" resultType="com.njcn.algorithm.pojo.vo.CsStatLimitRateDVO">
SELECT
temp.*, cs.*
FROM
cs_stat_limit_rate_d cs
INNER JOIN (
SELECT
a.line_id,
a. NAME line_name,
c.id project_id,
c. NAME project_name
FROM
cs_line a,
cs_project_equipment b,
cs_project c
WHERE
1 = 1
AND c.id = b.project_id
AND b.equipment_id = a.dev_id
<if test="csStatLimitRatePageParm.projectId != null and csStatLimitRatePageParm.projectId != ''">
AND c.id = #{csStatLimitRatePageParm.projectId }
</if>
) temp ON cs.my_index = temp.line_id
where 1=1
<if test="csStatLimitRatePageParm.startTime != null and csStatLimitRatePageParm.startTime != ''">
AND cs.time_id &gt;= #{csStatLimitRatePageParm.startTime }
</if>
<if test="csStatLimitRatePageParm.endTime != null and csStatLimitRatePageParm.endTime != ''">
AND cs.time_id &lt;= #{csStatLimitRatePageParm.endTime }
</if>
</select>
</mapper>

View File

@@ -0,0 +1,30 @@
package com.njcn.algorithm.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.algorithm.pojo.param.CsEquipmentAlarmAddParm;
import com.njcn.algorithm.pojo.param.CsEquipmentAlarmPageParm;
import com.njcn.algorithm.pojo.po.CsEquipmentAlarmPO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.algorithm.pojo.vo.CsEquipmentAlarmVO;
/**
*
* Description:
* Date: 2023/5/16 16:24【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEquipmentAlarmPOService extends IService<CsEquipmentAlarmPO>{
/**
* @Description: 新增设备警告
* @Param:
* @return: com.njcn.algorithm.pojo.vo.CsEquipmentAlarmVO
* @Author: clam
* @Date: 2023/5/17
*/
CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm);
IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
}

View File

@@ -0,0 +1,35 @@
package com.njcn.algorithm.service;
import com.njcn.algorithm.pojo.param.CsEquipmentTransferAddParm;
import com.njcn.algorithm.pojo.po.CsEquipmentTransferPO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
*
* Description:
* Date: 2023/5/17 15:40【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEquipmentTransferPOService extends IService<CsEquipmentTransferPO>{
/**
* @Description: add
* @Param:
* @return: java.lang.Boolean
* @Author: clam
* @Date: 2023/5/17
*/
Boolean add(CsEquipmentTransferAddParm csEquipmentTransferAddParm);
/**
* @Description: 设备转移申请通过
* @Param:
* @return: java.lang.Boolean
* @Author: clam
* @Date: 2023/5/17
*/
Boolean pass(List<String> ids);
}

View File

@@ -0,0 +1,21 @@
package com.njcn.algorithm.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.algorithm.pojo.param.CsEventDetailPageParm;
import com.njcn.algorithm.pojo.po.CsEventDetailPO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.algorithm.pojo.vo.CsEventDetailVO;
/**
*
* Description:
* Date: 2023/5/17 10:49【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEventDetailPOService extends IService<CsEventDetailPO>{
IPage<CsEventDetailVO> queryPage(CsEventDetailPageParm csEventDetailPageParm);
}

View File

@@ -0,0 +1,20 @@
package com.njcn.algorithm.service;
import com.njcn.algorithm.pojo.po.CsLinePO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
*
* Description:
* Date: 2023/5/18 14:01【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsLinePOService extends IService<CsLinePO>{
List<CsLinePO> queryByDevId(String devId);
}

View File

@@ -0,0 +1,21 @@
package com.njcn.algorithm.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.algorithm.pojo.param.CsStatLimitRatePageParm;
import com.njcn.algorithm.pojo.po.CsStatLimitRateDPO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.algorithm.pojo.vo.CsStatLimitRateDVO;
/**
*
* Description:
* Date: 2023/5/17 13:45【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsStatLimitRateDPOService extends IService<CsStatLimitRateDPO>{
IPage<CsStatLimitRateDVO> queryPage(CsStatLimitRatePageParm csStatLimitRatePageParm);
}

View File

@@ -0,0 +1,29 @@
package com.njcn.algorithm.service;
import com.njcn.algorithm.pojo.param.ThdDataQueryParm;
import com.njcn.algorithm.pojo.vo.ThdDataVO;
import java.util.List;
/**
* Description:
* Date: 2023/5/18 14:39【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface StableDataService {
List<ThdDataVO> queryThdData(String devId, String statisticalName);
/**
* @Description: 查询时间段内谐波畸变率
* @Param:
* @return: java.util.List<com.njcn.algorithm.pojo.vo.ThdDataVO>
* @Author: clam
* @Date: 2023/5/23
*/
List<ThdDataVO> queryThdDataByTime(ThdDataQueryParm thdDataQueryParm);
List<ThdDataVO> queryFisrtThdContent(String devId, String statisticalName);
List<ThdDataVO> queryThdContentByTime(ThdDataQueryParm thdDataQueryParm);
}

View File

@@ -104,26 +104,27 @@ public class AppProjectServiceImpl extends MppServiceImpl<AppProjectMapper, AppP
Page<AppProjectVO> returnpage = new Page<> (appProjectQueryParm.getCurrentPage ( ), appProjectQueryParm.getPageSize ( ));
returnpage = appProjectMapper.getPageVo (returnpage, appProjectQueryParm);
Page<AppProjectPO> appProjectPOPage = new Page<> (appProjectQueryParm.getCurrentPage ( ), appProjectQueryParm.getPageSize ( ));
QueryWrapper<AppProjectPO> queryWrapper = new QueryWrapper ( );
queryWrapper.eq ("status", "1").
eq (StringUtils.isNotBlank (appProjectQueryParm.getProjectId ( )), "id", appProjectQueryParm.getProjectId ( )).
le (StringUtils.isNotBlank (appProjectQueryParm.getEndTime ( )), "create_time", appProjectQueryParm.getEndTime ( )).
ge (StringUtils.isNotBlank (appProjectQueryParm.getStartTime ( )), "create_time", appProjectQueryParm.getStartTime ( )).
like (StringUtils.isNotBlank (appProjectQueryParm.getSearchValue ( )), "name", appProjectQueryParm.getSearchValue ( ));
Page<AppProjectPO> appProjectPOPage1 = appProjectMapper.selectPage (appProjectPOPage, queryWrapper);
List<AppProjectVO> collect = appProjectPOPage1.getRecords ( ).stream ( ).map (temp -> {
AppProjectVO vo = new AppProjectVO ( );
BeanUtils.copyProperties (temp, vo);
AppTopologyDiagramQueryParm appTopologyDiagramQueryParm = new AppTopologyDiagramQueryParm ( );
appTopologyDiagramQueryParm.setProjectId (vo.getId ( ));
List<AppTopologyDiagramVO> appTopologyDiagramVOList = appTopologyDiagramService.queryAppTopologyDiagram (appTopologyDiagramQueryParm);
List<String> collect1 = appTopologyDiagramVOList.stream ( ).map (AppTopologyDiagramVO::getFilePath).collect (Collectors.toList ( ));
vo.setTopologyDiagramPaths (collect1);
return vo;
}
).collect (Collectors.toList ( ));
// Page<AppProjectPO> appProjectPOPage = new Page<> (appProjectQueryParm.getCurrentPage ( ), appProjectQueryParm.getPageSize ( ));
// QueryWrapper<AppProjectPO> queryWrapper = new QueryWrapper ( );
// queryWrapper.eq ("status", "1").
// eq (StringUtils.isNotBlank (appProjectQueryParm.getProjectId ( )), "id", appProjectQueryParm.getProjectId ( )).
// eq (StringUtils.isNotBlank (appProjectQueryParm.getEngineeringId ( )), "engineering_id", appProjectQueryParm.getEngineeringId ( )).
// le (StringUtils.isNotBlank (appProjectQueryParm.getEndTime ( )), "create_time", appProjectQueryParm.getEndTime ( )).
// ge (StringUtils.isNotBlank (appProjectQueryParm.getStartTime ( )), "create_time", appProjectQueryParm.getStartTime ( )).
// like (StringUtils.isNotBlank (appProjectQueryParm.getSearchValue ( )), "name", appProjectQueryParm.getSearchValue ( ));
// Page<AppProjectPO> appProjectPOPage1 = appProjectMapper.selectPage (appProjectPOPage, queryWrapper);
// List<AppProjectVO> collect = appProjectPOPage1.getRecords ( ).stream ( ).map (temp -> {
// AppProjectVO vo = new AppProjectVO ( );
// BeanUtils.copyProperties (temp, vo);
// AppTopologyDiagramQueryParm appTopologyDiagramQueryParm = new AppTopologyDiagramQueryParm ( );
// appTopologyDiagramQueryParm.setProjectId (vo.getId ( ));
// List<AppTopologyDiagramVO> appTopologyDiagramVOList = appTopologyDiagramService.queryAppTopologyDiagram (appTopologyDiagramQueryParm);
// List<String> collect1 = appTopologyDiagramVOList.stream ( ).map (AppTopologyDiagramVO::getFilePath).collect (Collectors.toList ( ));
// vo.setTopologyDiagramPaths (collect1);
// return vo;
// }
//
// ).collect (Collectors.toList ( ));
return returnpage;
}
}

View File

@@ -0,0 +1,99 @@
package com.njcn.algorithm.service.impl;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.algorithm.mapper.AppProjectMapper;
import com.njcn.algorithm.mapper.CsEquipmentDeliveryMapper;
import com.njcn.algorithm.pojo.param.CsEquipmentAlarmAddParm;
import com.njcn.algorithm.pojo.param.CsEquipmentAlarmPageParm;
import com.njcn.algorithm.pojo.po.AppProjectPO;
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
import com.njcn.algorithm.pojo.vo.CsEdDataVO;
import com.njcn.algorithm.pojo.vo.CsEquipmentAlarmVO;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.pojo.po.DictData;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.mapper.CsEquipmentAlarmPOMapper;
import com.njcn.algorithm.pojo.po.CsEquipmentAlarmPO;
import com.njcn.algorithm.service.CsEquipmentAlarmPOService;
import org.springframework.transaction.annotation.Transactional;
/**
*
* Description:
* Date: 2023/5/16 16:24【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class CsEquipmentAlarmPOServiceImpl extends ServiceImpl<CsEquipmentAlarmPOMapper, CsEquipmentAlarmPO> implements CsEquipmentAlarmPOService{
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
private final AppProjectMapper appProjectMapper;
private final DicDataFeignClient dicDataFeignClient;
@Override
@Transactional(rollbackFor = {Exception.class})
public CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm) {
CsEquipmentAlarmPO csEquipmentAlarmPO = new CsEquipmentAlarmPO();
BeanUtils.copyProperties(csEquipmentAlarmAddParm,csEquipmentAlarmPO);
csEquipmentAlarmPO.setStatus("1");
this.save(csEquipmentAlarmPO);
CsEquipmentAlarmVO csEquipmentAlarmVO = new CsEquipmentAlarmVO();
this.poToVO(csEquipmentAlarmPO, csEquipmentAlarmVO);
log.info("新增设备警告:{}", csEquipmentAlarmVO.toString());
return csEquipmentAlarmVO;
}
@Override
public IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm) {
Page<CsEquipmentAlarmVO> returnpage = new Page<> (csEquipmentAlarmPageParm.getCurrentPage ( ), csEquipmentAlarmPageParm.getPageSize ( ));
Page<CsEquipmentAlarmPO> queryPage = new Page<> (csEquipmentAlarmPageParm.getCurrentPage ( ), csEquipmentAlarmPageParm.getPageSize ( ));
QueryWrapper<CsEquipmentAlarmPO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status", "1");
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getProjectId()),CsEquipmentAlarmPO.COL_PROJECT_ID,csEquipmentAlarmPageParm.getProjectId());
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getEquipmentId()),CsEquipmentAlarmPO.COL_EQUIPMENT_ID,csEquipmentAlarmPageParm.getEquipmentId());
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getAlarmLevel()),CsEquipmentAlarmPO.COL_ALARM_LEVEL,csEquipmentAlarmPageParm.getAlarmLevel());
queryWrapper.ge(Objects.nonNull(csEquipmentAlarmPageParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmPageParm.getStartTime());
queryWrapper.le(Objects.nonNull(csEquipmentAlarmPageParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmPageParm.getEndTime());
queryWrapper.orderByDesc("create_time");
Page<CsEquipmentAlarmPO> csEquipmentAlarmPOPage = this.getBaseMapper().selectPage(queryPage, queryWrapper);
List<CsEquipmentAlarmVO> collect = csEquipmentAlarmPOPage.getRecords().stream().map(temp -> {
CsEquipmentAlarmVO csEquipmentAlarmVO = new CsEquipmentAlarmVO();
this.poToVO(temp, csEquipmentAlarmVO);
return csEquipmentAlarmVO;
}).collect(Collectors.toList());
returnpage.setRecords(collect);
return returnpage;
}
private void poToVO(CsEquipmentAlarmPO csEquipmentAlarmPO, CsEquipmentAlarmVO csEquipmentAlarmVO) {
BeanUtils.copyProperties(csEquipmentAlarmPO,csEquipmentAlarmVO);
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(csEquipmentAlarmPO.getEquipmentId());
csEquipmentAlarmVO.setEquipmentName(csEquipmentDeliveryPO.getName());
DictData data = dicDataFeignClient.getDicDataById(csEquipmentAlarmPO.getAlarmLevel()).getData();
csEquipmentAlarmVO.setAlarmLevelName(data.getName());
AppProjectPO appProjectPO = appProjectMapper.selectById(csEquipmentAlarmPO.getProjectId());
csEquipmentAlarmVO.setProjectName(appProjectPO.getName());
}
}

View File

@@ -0,0 +1,58 @@
package com.njcn.algorithm.service.impl;
import com.njcn.algorithm.pojo.param.CsEquipmentTransferAddParm;
import com.njcn.common.pojo.enums.common.DataStateEnum;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.mapper.CsEquipmentTransferPOMapper;
import com.njcn.algorithm.pojo.po.CsEquipmentTransferPO;
import com.njcn.algorithm.service.CsEquipmentTransferPOService;
import org.springframework.transaction.annotation.Transactional;
/**
*
* Description:
* Date: 2023/5/17 15:40【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class CsEquipmentTransferPOServiceImpl extends ServiceImpl<CsEquipmentTransferPOMapper, CsEquipmentTransferPO> implements CsEquipmentTransferPOService{
@Override
@Transactional(rollbackFor = {Exception.class})
public Boolean add(CsEquipmentTransferAddParm csEquipmentTransferAddParm) {
CsEquipmentTransferPO csEquipmentTransferPO = new CsEquipmentTransferPO();
BeanUtils.copyProperties(csEquipmentTransferAddParm, csEquipmentTransferPO);
csEquipmentTransferPO.setStatus(DataStateEnum.ENABLE.getCode());
boolean save = this.save(csEquipmentTransferPO);
log.info("插入成功");
return save;
}
@Override
@Transactional(rollbackFor = {Exception.class})
public Boolean pass(List<String> ids) {
ids.forEach(id -> {
CsEquipmentTransferPO csEquipmentTransferPO = this.getById(id);
String equipmentIds = csEquipmentTransferPO.getEquipmentIds();
String[] split = equipmentIds.split(",");
this.updateById(csEquipmentTransferPO);
log.info("更新成功");
});
return null;
}
}

View File

@@ -0,0 +1,36 @@
package com.njcn.algorithm.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.algorithm.pojo.param.CsEventDetailPageParm;
import com.njcn.algorithm.pojo.vo.CsEquipmentAlarmVO;
import com.njcn.algorithm.pojo.vo.CsEventDetailVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.mapper.CsEventDetailPOMapper;
import com.njcn.algorithm.pojo.po.CsEventDetailPO;
import com.njcn.algorithm.service.CsEventDetailPOService;
/**
*
* Description:
* Date: 2023/5/17 10:49【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class CsEventDetailPOServiceImpl extends ServiceImpl<CsEventDetailPOMapper, CsEventDetailPO> implements CsEventDetailPOService{
@Override
public IPage<CsEventDetailVO> queryPage(CsEventDetailPageParm csEventDetailPageParm) {
Page<CsEventDetailVO> returnpage = new Page<> (csEventDetailPageParm.getCurrentPage ( ), csEventDetailPageParm.getPageSize ( ));
returnpage = this.getBaseMapper().queryPage(returnpage,csEventDetailPageParm);
return returnpage;
}
}

View File

@@ -0,0 +1,29 @@
package com.njcn.algorithm.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.mapper.CsLinePOMapper;
import com.njcn.algorithm.pojo.po.CsLinePO;
import com.njcn.algorithm.service.CsLinePOService;
/**
*
* Description:
* Date: 2023/5/18 14:01【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> implements CsLinePOService{
@Override
public List<CsLinePO> queryByDevId(String devId) {
QueryWrapper<CsLinePO> queryWrapper = new QueryWrapper();
queryWrapper.eq("dev_id", devId);
List<CsLinePO> csLinePOList = this.list(queryWrapper);
return csLinePOList;
}
}

View File

@@ -0,0 +1,32 @@
package com.njcn.algorithm.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.algorithm.pojo.param.CsStatLimitRatePageParm;
import com.njcn.algorithm.pojo.vo.CsEventDetailVO;
import com.njcn.algorithm.pojo.vo.CsStatLimitRateDVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.mapper.CsStatLimitRateDPOMapper;
import com.njcn.algorithm.pojo.po.CsStatLimitRateDPO;
import com.njcn.algorithm.service.CsStatLimitRateDPOService;
/**
*
* Description:
* Date: 2023/5/17 13:45【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
public class CsStatLimitRateDPOServiceImpl extends ServiceImpl<CsStatLimitRateDPOMapper, CsStatLimitRateDPO> implements CsStatLimitRateDPOService{
@Override
public IPage<CsStatLimitRateDVO> queryPage(CsStatLimitRatePageParm csStatLimitRatePageParm) {
Page<CsStatLimitRateDVO> returnpage = new Page<> (csStatLimitRatePageParm.getCurrentPage ( ), csStatLimitRatePageParm.getPageSize ( ));
returnpage = this.getBaseMapper().queryPage(returnpage,csStatLimitRatePageParm);
return returnpage;
}
}

View File

@@ -0,0 +1,163 @@
package com.njcn.algorithm.service.impl;
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
import com.njcn.algorithm.constant.DataParam;
import com.njcn.algorithm.enums.AlgorithmResponseEnum;
import com.njcn.algorithm.pojo.param.ThdDataQueryParm;
import com.njcn.algorithm.pojo.po.CsLinePO;
import com.njcn.algorithm.pojo.vo.ThdDataVO;
import com.njcn.algorithm.service.CsLinePOService;
import com.njcn.algorithm.service.StableDataService;
import com.njcn.algorithm.utils.ReflectUtils;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.influx.pojo.po.HarmonicRatioData;
import com.njcn.influx.pojo.po.PowerQualityData;
import com.njcn.influx.service.HaronicRatioService;
import com.njcn.influx.service.PowerQualityService;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* Description:
* Date: 2023/5/18 14:39【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
public class StableDataServiceImpl implements StableDataService {
private final CsLinePOService csLinePOService;
private final PowerQualityService PowerQualityService;
private final HaronicRatioService haronicRatioService;
@Override
public List<ThdDataVO> queryThdData(String devId, String statisticalName) {
List<ThdDataVO> thdDataVOList = new ArrayList<>();
List<CsLinePO> csLinePOList = csLinePOService.queryByDevId(devId);
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
List<PowerQualityData> firstPowerQuality = PowerQualityService.getFirstPowerQuality(collect, statisticalName);
csLinePOList.forEach(temp->{
DataParam.phases.forEach(phase->{
DataParam.statMethods.forEach(method -> {
ThdDataVO thdDataVO = new ThdDataVO();
thdDataVO.setLineId(temp.getLineId());
thdDataVO.setPosition(temp.getPosition());
thdDataVO.setStatisticalName(statisticalName);
thdDataVO.setPhase(phase);
thdDataVO.setStatMethod(method);
Double statisticalValue = 0.00;
List<PowerQualityData> collect1 = firstPowerQuality.stream().filter(powerQualityData -> Objects.equals(powerQualityData.getPhase(), phase) &&
Objects.equals(powerQualityData.getStatMethod(), method)
).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(collect1)){
statisticalValue= (Double) ReflectUtils.getValue(collect1.get(0), statisticalName);
}
thdDataVO.setStatisticalData(statisticalValue);
thdDataVOList.add(thdDataVO);
});
});
});
return thdDataVOList;
}
@Override
public List<ThdDataVO> queryThdDataByTime(ThdDataQueryParm thdDataQueryParm) {
List<ThdDataVO> thdDataVOList = new ArrayList<>();
List<CsLinePO> csLinePOList = csLinePOService.queryByDevId(thdDataQueryParm.getDevId());
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
List<PowerQualityData> firstPowerQuality = PowerQualityService.getPowerQuality(collect, thdDataQueryParm.getStatisticalName(), thdDataQueryParm.getStartTime(), thdDataQueryParm.getEndTime());
csLinePOList.forEach(temp->{
DataParam.phases.forEach(phase->{
DataParam.statMethods.forEach(method -> {
ThdDataVO thdDataVO = new ThdDataVO();
thdDataVO.setLineId(temp.getLineId());
thdDataVO.setPosition(temp.getPosition());
thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName());
thdDataVO.setPhase(phase);
thdDataVO.setStatMethod(method);
Double statisticalValue = 0.00;
List<PowerQualityData> collect1 = firstPowerQuality.stream().filter(powerQualityData -> Objects.equals(powerQualityData.getPhase(), phase) &&
Objects.equals(powerQualityData.getStatMethod(), method)
).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(collect1)){
statisticalValue= (Double) ReflectUtils.getValue(collect1.get(0), thdDataQueryParm.getStatisticalName());
}
thdDataVO.setStatisticalData(statisticalValue);
thdDataVOList.add(thdDataVO);
});
});
});
return thdDataVOList;
}
@Override
public List<ThdDataVO> queryFisrtThdContent(String devId, String statisticalName) {
List<ThdDataVO> thdDataVOList = new ArrayList<>();
List<CsLinePO> csLinePOList = csLinePOService.queryByDevId(devId);
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
List<HarmonicRatioData> harmonicRatioList = haronicRatioService.getFirstHaronicRatio(collect, statisticalName);
harmonicRatioList.forEach(temp->{
ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(statisticalName);
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position);
Double statisticalValue = 0.00;
statisticalValue= (Double) ReflectUtils.getValue(temp, statisticalName);
thdDataVO.setStatisticalData(statisticalValue);
thdDataVOList.add(thdDataVO);
});
return thdDataVOList;
}
@Override
public List<ThdDataVO> queryThdContentByTime(ThdDataQueryParm thdDataQueryParm) {
List<ThdDataVO> thdDataVOList = new ArrayList<>();
List<CsLinePO> csLinePOList = csLinePOService.queryByDevId(thdDataQueryParm.getDevId());
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
List<HarmonicRatioData> harmonicRatioList = haronicRatioService.getHaronicRatio(collect, thdDataQueryParm.getStatisticalName(),thdDataQueryParm.getStartTime(), thdDataQueryParm.getEndTime());
harmonicRatioList.forEach(temp->{
ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName());
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position);
Double statisticalValue = 0.00;
statisticalValue= (Double) ReflectUtils.getValue(temp, thdDataQueryParm.getStatisticalName());
thdDataVO.setStatisticalData(statisticalValue);
thdDataVOList.add(thdDataVO);
});
return thdDataVOList;
}
}

View File

@@ -0,0 +1,172 @@
> 前言:
>
> 为了方便开发中使用influx时序数据库摒弃了在代码中拼接查询sql语句确保查询结果的准确性之余提高代码的阅读性。同时优化处理了部分开发过程遇到的问题
>
> * 时区问题:开发者无需关注,默认为 tz('Asia/Shanghai')
> * 返回的Instant类型的时间在序列化到前端页面时格式不对添加@JsonSerialize(using = InstantDateSerializer.class)处理解决
> * 同时由于influx针对or查询时超过100个连接是性能会有比较严重的影响提供了influx的正则表达式的查询方法InfluxQueryWrapper.regular(),此方案还待测试检查
#### 1、快速上手
目前没有采用泛型的方式,是因为想返回实体更灵活,可以指定任意想要映射的实体。
```java
//两个构造方法:
/***
* 返回和查询用的同一个实体
* @param measurement 查询目标表
*/
public InfluxQueryWrapper(Class measurement) {
this.measurement = measurement;
this.resultEntity = measurement;
this.initSql();
}
/***
* 返回和查询用的不是同一个实体
* @param measurement 查询目标表
* @param resultEntity 返回映射实体
*/
public InfluxQueryWrapper(Class measurement, Class resultEntity) {
this.measurement = measurement;
this.resultEntity = resultEntity;
this.initSql();
}
```
初始化完成后便已经确定目标measurementinflux表名以及返回实体。
###### 示例:
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
//生成 select * from "data_flicker" tz('Asia/Shanghai')
```
#### 2、函数使用
##### 2.1、select
select(ICFunction<T, R>... fieldsStr):此函数指定查询返回的那几个字段
###### 示例:
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
influxQueryWrapper.select(DataFlicker::getTime);
//生成 select time from "data_flicker" tz('Asia/Shanghai')
```
##### 2.2、count统计
count(ICFunction<T, R> columnName):累计总数;
count(ICFunction<T, R> columnName, ICFunction<T, R> resultName):累计总数,返回属性名不同
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
influxQueryWrapper.count(DataFlicker::getTime,StatisticsResult::getValue);
//生成 select COUNT("time") as value from "data_flicker" tz('Asia/Shanghai')
```
> 类似的还有mean平均值、median中位数、mode最常出现的值、spread最大与最小值的差、sum求和、abs绝对值、max最大值、min最小值
##### 2.3、top最大值的几条记录
top(ICFunction<T, R> columnName, int num):最大值的一个结果集合
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
influxQueryWrapper.top(DataFlicker::getTime,5);
//生成最大的前5某个属性的集合
//select TOP("time",5) as value from "data_flicker" tz('Asia/Shanghai')
```
> 类似的还有bottom最小值的几条记录
##### 2.4、maxSamePrefixAndSuffix针对前缀或后缀相同的属性批量处理最大值
maxSamePrefixAndSuffix(String prefix, String suffix, List<Object> diffContent):开发过程中遇到表字段前后缀一致时,需要批量处理的。
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
influxQueryWrapper.maxSamePrefixAndSuffix("v_","",timesList);
//生成最大的前5某个属性的集合
//select MAX("v_1") as v_1,MAX("v_2") as v_2,MAX("v_3") as v_3,MAX("v_4") as v_4 as value from "data_v" tz('Asia/Shanghai')
```
> 类似的还有minSamePrefixAndSuffix针对前缀或后缀相同的属性批量处理最小值
##### 2.5、percentile百分之最大值
目前灿能项目常用于cp95最大值
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
influxQueryWrapper.percentile(DataFlicker::getTime,95);
//select PERCENTILE("time",95) as value from "data_flicker" tz('Asia/Shanghai')
```
##### 2.6、between区间
between(ICFunction<T, R> fieldName, Object val1, Object val2):作为条件区间语句生成
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
influxQueryWrapper.between(DataFlicker::getTime,"2022-04-30 16:00:00","2022-05-30 16:00:00");
//select * from "data_flicker" where time >='2022-04-30 16:00:00' AND time <='2022-05-30 16:00:00' tz('Asia/Shanghai')
```
##### 2.7、eq等于
eq(ICFunction<T, R> columnName, Object columnValue)指定某字段等于xxx
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
influxQueryWrapper.eq(DataFlicker::getTime,"2022-05-30 16:00:00");
//select * from "data_flicker" where time ='2022-04-30 16:00:00' tz('Asia/Shanghai')
```
> 类似的还有ne不等于、gt大于、ge大于等于、lt小于、le小于等于
##### 2.8、or拼接多条件
or(ICFunction<T, R> fieldName, List<Object> columnValues)查询某字段等于集合内的值时的结果类似于关系数据库的in函数
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
influxQueryWrapper.or(DataV::getLineId,lineList);
//select * from "data_v" where (line_id = "111" or line_id = "222") tz('Asia/Shanghai')
```
##### 2.9、regular正则模糊查询
regular(ICFunction<T, R> fieldName, List<String> columnValues)查询条件有多个选项时效果等同于关系型数据库的in同时or的内容如果超过100个选项时会带来严重的性能问题查询很慢可以调整为正则模糊查询
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
influxQueryWrapper.regular(DataV::getLineId,lineList);
//select * from "data_v" where line_id =~/^111|222|333$/ tz('Asia/Shanghai')
```
##### 2.10、groupBy分组
> influxdb只能针对tag去分组
groupBy(ICFunction<T, R>... columnName)以tag去分组
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
influxQueryWrapper.groupBy(DataV::getLineId,DataV::getGualityFlag);
//select * from "data_v" group by line_id,quality_flag tz('Asia/Shanghai')
```
##### 2.11、timeDesc以时间降序
```java
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
influxQueryWrapper.timeDesc();
//select * from "data_v" order by time desc tz('Asia/Shanghai')
```
> 类似的还有timeAsc以时间升序

View File

@@ -28,5 +28,13 @@ public interface ServerInfo {
String ALGORITHM_BOOT = "algorithm-boot";
String CS_SYSTEM_BOOT = "cs_system_boot";
String CS_WARN_BOOT = "cs_warn_boot";
String CS_EVENT_BOOT = "cs_event_boot";
String CS_HARMONIC_BOOT = "cs_harmonic_boot";
String CS_REPORT_BOOT = "cs_report_boot";
}

View File

@@ -66,7 +66,11 @@ public class Knife4jSwaggerConfig {
"com.njcn.process.controller",
"com.njcn.advance.controller",
"com.njcn.algorithm.controller",
"com.njcn.access.controller"
"com.njcn.access.controller",
"com.njcn.csdevice.controller",
"com.njcn.cswarn.controller",
"com.njcn.csharmonic.controller",
"com.njcn.cssystem.controller"
)
.collect(Collectors.toList());
List<GrantType> grantTypes = new ArrayList<>();

View File

@@ -0,0 +1,23 @@
package com.njcn.influx.imapper;
import com.njcn.influx.base.InfluxDbBaseMapper;
import com.njcn.influx.pojo.po.HarmonicRatioData;
import com.njcn.influx.pojo.po.PowerQualityData;
import com.njcn.influx.query.InfluxQueryWrapper;
import java.util.List;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
* @createTime 2023/5/5 14:39
*/
public interface HaronicRatioMapper extends InfluxDbBaseMapper<PowerQualityData> {
List<HarmonicRatioData> getFirstHaronicRatio(InfluxQueryWrapper influxQueryWrapper);
List<HarmonicRatioData> getHaronicRatio(InfluxQueryWrapper influxQueryWrapper);
}

View File

@@ -0,0 +1,22 @@
package com.njcn.influx.imapper;
import com.njcn.influx.base.InfluxDbBaseMapper;
import com.njcn.influx.pojo.po.PowerQualityData;
import com.njcn.influx.query.InfluxQueryWrapper;
import java.util.List;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
* @createTime 2023/5/5 14:39
*/
public interface PowerQualityMapper extends InfluxDbBaseMapper<PowerQualityData> {
List<PowerQualityData> getFirstPowerQuality(InfluxQueryWrapper influxQueryWrapper);
List<PowerQualityData> getPowerQuality(InfluxQueryWrapper influxQueryWrapper);
}

View File

@@ -0,0 +1,529 @@
package com.njcn.influx.pojo.po;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.njcn.common.utils.serializer.InstantDateSerializer;
import lombok.Data;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;
import java.time.Instant;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
*/
@Data
@Measurement(name = "harmonic_ratio_data")
public class HarmonicRatioData {
@Column(name = "time")
@JsonSerialize(using = InstantDateSerializer.class)
private Instant time;
@Column(name = "LineId")
private String lineId;
@Column(name = "Phase")
private String phase;
@Column(name = "Stat_Method")
private String statMethod;
/**
* 2次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H2VLmt")
private Double H2VLmt;
/**
* 3次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H3VLmt")
private Double H3VLmt;
/**
* 4次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H4VLmt")
private Double H4VLmt;
/**
* 5次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H5VLmt")
private Double H5VLmt;
/**
* 6次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H6VLmt")
private Double H6VLmt;
/**
* 7次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H7VLmt")
private Double H7VLmt;
/**
* 8次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H8VLmt")
private Double H8VLmt;
/**
* 9次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H9VLmt")
private Double H9VLmt;
/**
* 10次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H10VLmt")
private Double H10VLmt;
/**
* 11次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H11VLmt")
private Double H11VLmt;
/**
* 12次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H12VLmt")
private Double H12VLmt;
/**
* 13次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H13VLmt")
private Double H13VLmt;
/**
* 14次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H14VLmt")
private Double H14VLmt;
/**
* 15次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H15VLmt")
private Double H15VLmt;
/**
* 16次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H16VLmt")
private Double H16VLmt;
/**
* 17次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H17VLmt")
private Double H17VLmt;
/**
* 18次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H18VLmt")
private Double H18VLmt;
/**
* 19次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H19VLmt")
private Double H19VLmt;
/**
* 20次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H20VLmt")
private Double H20VLmt;
/**
* 21次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H21VLmt")
private Double H21VLmt;
/**
* 22次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H22VLmt")
private Double H22VLmt;
/**
* 23次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H23VLmt")
private Double H23VLmt;
/**
* 24次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H24VLmt")
private Double H24VLmt;
/**
* 25次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H25VLmt")
private Double H25VLmt;
/**
* 26次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H26VLmt")
private Double H26VLmt;
/**
* 27次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H27VLmt")
private Double H27VLmt;
/**
* 28次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H28VLmt")
private Double H28VLmt;
/**
* 29次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H29VLmt")
private Double H29VLmt;
/**
* 30次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H30VLmt")
private Double H30VLmt;
/**
* 31次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H31VLmt")
private Double H31VLmt;
/**
* 32次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H32VLmt")
private Double H32VLmt;
/**
* 33次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H33VLmt")
private Double H33VLmt;
/**
* 34次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H34VLmt")
private Double H34VLmt;
/**
* 35次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H35VLmt")
private Double H35VLmt;
/**
* 36次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H36VLmt")
private Double H36VLmt;
/**
* 37次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H37VLmt")
private Double H37VLmt;
/**
* 38次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H38VLmt")
private Double H38VLmt;
/**
* 39次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H39VLmt")
private Double H39VLmt;
/**
* 40次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H40VLmt")
private Double H40VLmt;
/**
* 41次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H41VLmt")
private Double H41VLmt;
/**
* 42次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H42VLmt")
private Double H42VLmt;
/**
* 43次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H43VLmt")
private Double H43VLmt;
/**
* 44次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H44VLmt")
private Double H44VLmt;
/**
* 45次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H45VLmt")
private Double H45VLmt;
/**
* 46次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H46VLmt")
private Double H46VLmt;
/**
* 47次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H47VLmt")
private Double H47VLmt;
/**
* 48次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H48VLmt")
private Double H48VLmt;
/**
* 49次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H49VLmt")
private Double H49VLmt;
/**
* 50次谐波电压含有率越限定值,单位:%
*/
@Column(name = "H50VLmt")
private Double H50VLmt;
/**
* 2次谐波电流越限定值,单位:A
*/
@Column(name = "H2ALmt")
private Double H2ALmt;
/**
* 3次谐波电流越限定值,单位:A
*/
@Column(name = "H3ALmt")
private Double H3ALmt;
/**
* 4次谐波电流越限定值,单位:A
*/
@Column(name = "H4ALmt")
private Double H4ALmt;
/**
* 5次谐波电流越限定值,单位:A
*/
@Column(name = "H5ALmt")
private Double H5ALmt;
/**
* 6次谐波电流越限定值,单位:A
*/
@Column(name = "H6ALmt")
private Double H6ALmt;
/**
* 7次谐波电流越限定值,单位:A
*/
@Column(name = "H7ALmt")
private Double H7ALmt;
/**
* 8次谐波电流越限定值,单位:A
*/
@Column(name = "H8ALmt")
private Double H8ALmt;
/**
* 9次谐波电流越限定值,单位:A
*/
@Column(name = "H9ALmt")
private Double H9ALmt;
/**
* 10次谐波电流越限定值,单位:A
*/
@Column(name = "H10ALmt")
private Double H10ALmt;
/**
* 11次谐波电流越限定值,单位:A
*/
@Column(name = "H11ALmt")
private Double H11ALmt;
/**
* 12次谐波电流越限定值,单位:A
*/
@Column(name = "H12ALmt")
private Double H12ALmt;
/**
* 13次谐波电流越限定值,单位:A
*/
@Column(name = "H13ALmt")
private Double H13ALmt;
/**
* 14次谐波电流越限定值,单位:A
*/
@Column(name = "H14ALmt")
private Double H14ALmt;
/**
* 15次谐波电流越限定值,单位:A
*/
@Column(name = "H15ALmt")
private Double H15ALmt;
/**
* 16次谐波电流越限定值,单位:A
*/
@Column(name = "H16ALmt")
private Double H16ALmt;
/**
* 17次谐波电流越限定值,单位:A
*/
@Column(name = "H17ALmt")
private Double H17ALmt;
/**
* 18次谐波电流越限定值,单位:A
*/
@Column(name = "H18ALmt")
private Double H18ALmt;
/**
* 19次谐波电流越限定值,单位:A
*/
@Column(name = "H19ALmt")
private Double H19ALmt;
/**
* 20次谐波电流越限定值,单位:A
*/
@Column(name = "H20ALmt")
private Double H20ALmt;
/**
* 21次谐波电流越限定值,单位:A
*/
@Column(name = "H21ALmt")
private Double H21ALmt;
/**
* 22次谐波电流越限定值,单位:A
*/
@Column(name = "H22ALmt")
private Double H22ALmt;
/**
* 23次谐波电流越限定值,单位:A
*/
@Column(name = "H23ALmt")
private Double H23ALmt;
/**
* 24次谐波电流越限定值,单位:A
*/
@Column(name = "H24ALmt")
private Double H24ALmt;
/**
* 25次谐波电流越限定值,单位:A
*/
@Column(name = "H25ALmt")
private Double H25ALmt;
/**
* 26次谐波电流越限定值,单位:A
*/
@Column(name = "H26ALmt")
private Double H26ALmt;
/**
* 27次谐波电流越限定值,单位:A
*/
@Column(name = "H27ALmt")
private Double H27ALmt;
/**
* 28次谐波电流越限定值,单位:A
*/
@Column(name = "H28ALmt")
private Double H28ALmt;
/**
* 29次谐波电流越限定值,单位:A
*/
@Column(name = "H29ALmt")
private Double H29ALmt;
/**
* 30次谐波电流越限定值,单位:A
*/
@Column(name = "H30ALmt")
private Double H30ALmt;
/**
* 31次谐波电流越限定值,单位:A
*/
@Column(name = "H31ALmt")
private Double H31ALmt;
/**
* 32次谐波电流越限定值,单位:A
*/
@Column(name = "H32ALmt")
private Double H32ALmt;
/**
* 33次谐波电流越限定值,单位:A
*/
@Column(name = "H33ALmt")
private Double H33ALmt;
/**
* 34次谐波电流越限定值,单位:A
*/
@Column(name = "H34ALmt")
private Double H34ALmt;
/**
* 35次谐波电流越限定值,单位:A
*/
@Column(name = "H35ALmt")
private Double H35ALmt;
/**
* 36次谐波电流越限定值,单位:A
*/
@Column(name = "H36ALmt")
private Double H36ALmt;
/**
* 37次谐波电流越限定值,单位:A
*/
@Column(name = "H37ALmt")
private Double H37ALmt;
/**
* 38次谐波电流越限定值,单位:A
*/
@Column(name = "H38ALmt")
private Double H38ALmt;
/**
* 39次谐波电流越限定值,单位:A
*/
@Column(name = "H39ALmt")
private Double H39ALmt;
/**
* 40次谐波电流越限定值,单位:A
*/
@Column(name = "H40ALmt")
private Double H40ALmt;
/**
* 41次谐波电流越限定值,单位:A
*/
@Column(name = "H41ALmt")
private Double H41ALmt;
/**
* 42次谐波电流越限定值,单位:A
*/
@Column(name = "H42ALmt")
private Double H42ALmt;
/**
* 43次谐波电流越限定值,单位:A
*/
@Column(name = "H43ALmt")
private Double H43ALmt;
/**
* 44次谐波电流越限定值,单位:A
*/
@Column(name = "H44ALmt")
private Double H44ALmt;
/**
* 45次谐波电流越限定值,单位:A
*/
@Column(name = "H45ALmt")
private Double H45ALmt;
/**
* 46次谐波电流越限定值,单位:A
*/
@Column(name = "H46ALmt")
private Double H46ALmt;
/**
* 47次谐波电流越限定值,单位:A
*/
@Column(name = "H47ALmt")
private Double H47ALmt;
/**
* 48次谐波电流越限定值,单位:A
*/
@Column(name = "H48ALmt")
private Double H48ALmt;
/**
* 49次谐波电流越限定值,单位:A
*/
@Column(name = "H49ALmt")
private Double H49ALmt;
/**
* 50次谐波电流越限定值,单位:A
*/
@Column(name = "H50ALmt")
private Double H50ALmt;
}

View File

@@ -0,0 +1,347 @@
package com.njcn.influx.pojo.po;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.njcn.common.utils.serializer.InstantDateSerializer;
import lombok.Data;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;
import java.time.Instant;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
*/
@Data
@Measurement(name = "power_quality_data")
public class PowerQualityData {
@Column(name = "time")
@JsonSerialize(using = InstantDateSerializer.class)
private Instant time;
@Column(name = "LineId")
private String lineId;
@Column(name = "Phase")
private String phase;
@Column(name = "Stat_Method")
private String statMethod;
/**
* 频率
*/
@Column(name = "Hz")
private Double Hz;
/**
* 相电压总有效值
*/
@Column(name = "PhV")
private Double PhV;
/**
* 线电压总有效值
*/
@Column(name = "PPV")
private Double PPV;
/**
* 电流总有效值
*/
@Column(name = "A")
private Double A;
/**
* 频率偏差
*/
@Column(name = "HzDev")
private Double HzDev;
/**
* 相电压偏差
*/
@Column(name = "PhVDev")
private Double PhVDev;
/**
* 线电压偏差
*/
@Column(name = "PPVDev")
private Double PPVDev;
/**
* 正序、负序、零序电压
*/
@Column(name = "SeqV")
private Double SeqV;
/**
* 电压负序不平衡度
*/
@Column(name = "ImbNgV")
private Double ImbNgV;
/**
* 电压零序不平衡度
*/
@Column(name = "ImbZroV")
private Double ImbZroV;
/**
* 正序、负序、零序电流
*/
@Column(name = "SeqA")
private Double SeqA;
/**
* 电流负序不平衡度
*/
@Column(name = "ImbNgA")
private Double ImbNgA;
/**
* 电流零序不平衡度
*/
@Column(name = "ImbZroA")
private Double ImbZroA;
/**
* 相电压基波有效值
*/
@Column(name = "HFundPhV")
private Double HFundPhV;
/**
* 线电压基波有效值
*/
@Column(name = "HFundPPV")
private Double HFundPPV;
/**
* 相电压基波有效值相角
*/
@Column(name = "FundPhVAng")
private Double FundPhVAng ;
/**
* 线电压基波有效值相角
*/
@Column(name = "FundPPVAng")
private Double FundPPVAng;
/**
* 电流基波有效值
*/
@Column(name = "FundA")
private Double FundA ;
/**
* 电流基波相角
*/
@Column(name = "FundAAng")
private Double FundAAng;
/**
* 相电压谐波总畸变率
*/
@Column(name = "ThdPhV")
private Double ThdPhV;
/**
* 线电压谐波总畸变率
*/
@Column(name = "ThdPPV")
private Double ThdPPV;
/**
* 相电压总偶次谐波畸变率
*/
@Column(name = "ThdEvnPhV")
private Double ThdEvnPhV;
/**
* 线电压总偶次谐波畸变率
*/
@Column(name = "ThdEvnPPV")
private Double ThdEvnPPV;
/**
* 相电压总奇次谐波畸变率
*/
@Column(name = "ThdOddPhV")
private Double ThdOddPhV;
/**
* 线电压总奇次谐波畸变率
*/
@Column(name = "ThdOddPPV")
private Double ThdOddPPV;
/**
* 相电压谐波(间谐波)含有率序列
*/
@Column(name = "HRPhV")
private Double HRPhV;
/**
* 相电压谐波(间谐波)相角序列
*/
@Column(name = "HRPhVAng")
private Double HRPhVAng;
/**
* 线电压谐波(间谐波)含有率序列
*/
@Column(name = "HRPPV")
private Double HRPPV;
/**
* 线电压谐波(间谐波)相角序列
*/
@Column(name = "HRPPVAng")
private Double HRPPVAng;
/**
* 电流总谐波畸变率
*/
@Column(name = "ThdA")
private Double ThdA;
/**
* 电流总偶次谐波畸变率
*/
@Column(name = "ThdEvnA")
private Double ThdEvnA;
/**
* 电流总奇次谐波畸变率
*/
@Column(name = "ThdOddA")
private Double ThdOddA;
/**
* 谐波(间谐波)电流有效值
*/
@Column(name = "HA")
private Double HA;
/**
* 谐波(间谐波)电流相角序列
*/
@Column(name = "HAAng")
private Double HAAng;
/**
* 相电压电压变动幅度
*/
@Column(name = "PhFluc")
private Double PhFluc;
/**
* 线电压电压变动幅度
*/
@Column(name = "PPFluc")
private Double PPFluc;
/**
* 相电压电压变动频度
*/
@Column(name = "PhFlucf")
private Double PhFlucf;
/**
* 线电压电压变动频度
*/
@Column(name = "PPFlucf")
private Double PPFlucf;
/**
* 有功功率
*/
@Column(name = "W")
private Double W;
/**
* 无功功率
*/
@Column(name = "VAr")
private Double VAr;
/**
* 视在功率
*/
@Column(name = "VA")
private Double VA;
/**
* 基波有功功率
*/
@Column(name = "FundW")
private Double FundW;
/**
* 基波无功功率
*/
@Column(name = "FundVAr")
private Double FundVAr;
/**
* 基波视在功率
*/
@Column(name = "FundVA")
private Double FundVA;
/**
* 功率因数
*/
@Column(name = "PF")
private Double PF;
/**
* 位移功率因数
*/
@Column(name = "DF")
private Double DF;
/**
* 三相总有功功率
*/
@Column(name = "TotW")
private Double TotW;
/**
* 三相总无功功率
*/
@Column(name = "TotVAr")
private Double TotVAr;
/**
* 三相总视在功率
*/
@Column(name = "TotVA")
private Double TotVA;
/**
* 三相功率因数
*/
@Column(name = "TotPF")
private Double TotPF;
/**
* 三相位移功率因数
*/
@Column(name = "TotDF")
private Double TotDF;
/**
* 谐波有功功率序列
*/
@Column(name = "HW")
private Double HW;
/**
* 谐波无功功率序列
*/
@Column(name = "HVAr")
private Double HVAr;
/**
* 谐波视在功率序列
*/
@Column(name = "HVA")
private Double HVA;
/**
* 三相总谐波有功功率
*/
@Column(name = "TotHW")
private Double TotHW;
/**
* 三相总谐波无功功率
*/
@Column(name = "TotHVAr")
private Double TotHVAr;
/**
* 三相总谐波视在功率
*/
@Column(name = "TotHVA")
private Double TotHVA;
/**
* 相电压短时闪变
*/
@Column(name = "PhPst")
private Double PhPst;
/**
* 线电压短时闪变
*/
@Column(name = "PPPst")
private Double PPPst;
/**
* 相电压长时闪变
*/
@Column(name = "PhPlt")
private Double PhPlt;
/**
* 线电压长时闪变
*/
@Column(name = "PPPlt")
private Double PPPlt;
/**
* 最大需量
*/
@Column(name = "MaxDemand")
private Double MaxDemand;
}

View File

@@ -0,0 +1,26 @@
package com.njcn.influx.service;
import com.njcn.influx.pojo.po.HarmonicRatioData;
import com.njcn.influx.pojo.po.PowerQualityData;
import java.util.List;
public interface HaronicRatioService {
/**
* @Description: 获取指标最新数据
* @Param:
* @return: java.util.List<com.njcn.influx.pojo.po.PowerQualityData>
* @Author: clam
* @Date: 2023/5/23
*/
List<HarmonicRatioData> getFirstHaronicRatio(List<String> lineIds,String columnName);
/**
* @Description: 获取指标时间断内数据
* @Param:
* @return: java.util.List<com.njcn.influx.pojo.po.PowerQualityData>
* @Author: clam
* @Date: 2023/5/23
*/
List<HarmonicRatioData> getHaronicRatio(List<String> lineIds, String columnName, String startTime, String endTime);
}

View File

@@ -0,0 +1,25 @@
package com.njcn.influx.service;
import com.njcn.influx.pojo.po.PowerQualityData;
import java.util.List;
public interface PowerQualityService {
/**
* @Description: 获取指标最新数据
* @Param:
* @return: java.util.List<com.njcn.influx.pojo.po.PowerQualityData>
* @Author: clam
* @Date: 2023/5/23
*/
List<PowerQualityData> getFirstPowerQuality(List<String> lineIds,String columnName);
/**
* @Description: 获取指标时间断内数据
* @Param:
* @return: java.util.List<com.njcn.influx.pojo.po.PowerQualityData>
* @Author: clam
* @Date: 2023/5/23
*/
List<PowerQualityData> getPowerQuality(List<String> lineIds,String columnName, String startTime, String endTime);
}

View File

@@ -0,0 +1,49 @@
package com.njcn.influx.service.impl;
import com.njcn.influx.imapper.HaronicRatioMapper;
import com.njcn.influx.pojo.po.HarmonicRatioData;
import com.njcn.influx.pojo.po.PowerQualityData;
import com.njcn.influx.query.InfluxQueryWrapper;
import com.njcn.influx.service.HaronicRatioService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Description:
* Date: 2023/5/24 9:22【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
public class HaronicRatioServiceImpl implements HaronicRatioService {
private final HaronicRatioMapper haronicRatioMapper;
@Override
public List<HarmonicRatioData> getFirstHaronicRatio(List<String> lineIds, String columnName) {
List<HarmonicRatioData> result1 ;
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(HarmonicRatioData.class);
influxQueryWrapper.or(HarmonicRatioData::getLineId, lineIds)
.last(columnName,columnName).groupBy(HarmonicRatioData::getLineId, HarmonicRatioData::getStatMethod, HarmonicRatioData::getPhase);
result1 = haronicRatioMapper.getHaronicRatio(influxQueryWrapper);
return result1;
}
@Override
public List<HarmonicRatioData> getHaronicRatio(List<String> lineIds, String columnName, String startTime, String endTime) {
List<HarmonicRatioData> result1;
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(HarmonicRatioData.class);
influxQueryWrapper.or(HarmonicRatioData::getLineId, lineIds)
.percentile(columnName, 95)
.between(HarmonicRatioData::getTime, startTime, endTime)
.groupBy(HarmonicRatioData::getLineId,HarmonicRatioData::getStatMethod,HarmonicRatioData::getPhase);
result1 = haronicRatioMapper.getHaronicRatio(influxQueryWrapper);
return result1;
}
}

View File

@@ -0,0 +1,49 @@
package com.njcn.influx.service.impl;
import com.njcn.influx.imapper.PowerQualityMapper;
import com.njcn.influx.pojo.po.PowerQualityData;
import com.njcn.influx.query.InfluxQueryWrapper;
import com.njcn.influx.service.PowerQualityService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Description:
* Date: 2023/5/18 16:12【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
@RequiredArgsConstructor
public class PowerQualityServiceImpl implements PowerQualityService {
private final PowerQualityMapper powerQualityMapper;
@Override
public List<PowerQualityData> getFirstPowerQuality(List<String> lineIds,String columnName) {
List<PowerQualityData> result1 ;
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(PowerQualityData.class);
influxQueryWrapper.or(PowerQualityData::getLineId, lineIds)
.last(columnName,columnName).groupBy(PowerQualityData::getLineId, PowerQualityData::getStatMethod, PowerQualityData::getPhase);
result1 = powerQualityMapper.getFirstPowerQuality(influxQueryWrapper);
return result1;
}
@Override
public List<PowerQualityData> getPowerQuality(List<String> lineIds,String columnName, String startTime, String endTime) {
List<PowerQualityData> result1;
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(PowerQualityData.class);
influxQueryWrapper.or(PowerQualityData::getLineId, lineIds)
.percentile(columnName, 95)
.between(PowerQualityData::getTime, startTime, endTime)
.groupBy(PowerQualityData::getLineId,PowerQualityData::getStatMethod,PowerQualityData::getPhase);
result1 = powerQualityMapper.getPowerQuality(influxQueryWrapper);
return result1;
}
}

View File

@@ -341,6 +341,20 @@ public enum DicDataEnum {
GROUND_AC("AC两相接地", "Ground_AC"),
GROUND_ABC("三相接地", "Ground_ABC"),
TYPE_REST("其他", "Type_Rest"),
/**
* 监测点位置
*/
LOAD_SIDE("负载侧", "Load_Side"),
GRID_SIDE("电网侧", "Grid_Side"),
OUTPUT_SIDE("输出侧", "Output_Side"),
/**
* 警告级别
*/
ALARM("告警", "Alarm"),
FAULT("故障", "Fault"),
;
private final String name;

View File

@@ -70,6 +70,10 @@ public enum DicDataTypeEnum {
PRIMARY_TYPE("一级业务类型","Primary_Type"),
DEV_CLASS("终端类型(治理)","Dev_Class"),
CS_STATISTICAL_TYPE("治理统计类型","Cs_Statistical_Type"),
LINE_POSITION("监测点位置","Line_Position"),
ALARM_LEVEL("警告级别","Alarm_Level"),
;