1.灿能云接口移植,实时数据接口代码调整
This commit is contained in:
@@ -31,7 +31,28 @@
|
||||
<artifactId>common-microservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>4.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>user-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.njcn.cloud.enums.app;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 指标编码
|
||||
@@ -67,11 +66,27 @@ public enum TypeCodeEnum {
|
||||
|
||||
private String type;
|
||||
|
||||
TypeCodeEnum(int code, String type){
|
||||
TypeCodeEnum(int code,String type){
|
||||
this.code = code;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(int code){
|
||||
for (TypeCodeEnum typeCodeEnum : TypeCodeEnum.values()) {
|
||||
if (typeCodeEnum.code==code) {
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.njcn.cloud.pojo.dto;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 终端消息
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-07
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_dev_msg")
|
||||
@ApiModel(value = "AppDevMsg对象", description = "终端消息")
|
||||
public class AppDevMsg {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("终端消息列表Guid")
|
||||
@TableId("DevMsg_Index")
|
||||
private String devmsgIndex;
|
||||
|
||||
@ApiModelProperty("(关联pqs_top_msg表top_Id)消息id")
|
||||
@TableField("Top_Id")
|
||||
private String topId;
|
||||
|
||||
@ApiModelProperty("(关联app_user表User_Index)权限用户id")
|
||||
@TableField("User_Index")
|
||||
private String userIndex;
|
||||
|
||||
@ApiModelProperty("统计时间")
|
||||
@TableField("Time_Id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeId;
|
||||
|
||||
@ApiModelProperty("读取状态(0:未读,1:已读,2:删除)")
|
||||
@TableField("State")
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.njcn.cloud.pojo.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 终端消息详情
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-07
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_dev_msg_ass")
|
||||
@ApiModel(value = "AppDevMsgAss对象", description = "终端消息详情")
|
||||
public class AppDevMsgAss {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("终端消息列表Guid")
|
||||
@TableField("DevMsg_Index")
|
||||
private String devmsgIndex;
|
||||
|
||||
@ApiModelProperty("统计时间")
|
||||
@TableField("Time_Id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeId;
|
||||
|
||||
@ApiModelProperty("(关联pq_device表dev_index)")
|
||||
@TableField("Dev_Index")
|
||||
private Integer devIndex;
|
||||
|
||||
@TableField("Alarm_Num")
|
||||
private Integer alarmNum;
|
||||
|
||||
@TableField("ComOut_NUM")
|
||||
private Integer comoutNum;
|
||||
|
||||
@TableField("Flow_Num")
|
||||
private Float flowNum;
|
||||
|
||||
|
||||
}
|
||||
@@ -4,8 +4,6 @@ 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 java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.cloud.pojo.dto;
|
||||
|
||||
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 java.io.Serializable;
|
||||
@@ -27,7 +28,7 @@ public class AppEventMsg {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("暂态消息Guid")
|
||||
@TableField("EventMsg_Index")
|
||||
@TableId("EventMsg_Index")
|
||||
private String eventmsgIndex;
|
||||
|
||||
@ApiModelProperty("(关联app_user表User_Index)权限用户id")
|
||||
@@ -36,11 +37,11 @@ public class AppEventMsg {
|
||||
|
||||
@ApiModelProperty("(关联表PQS_EventDetail)事件总表Guid")
|
||||
@TableField("EventDetail_Index")
|
||||
private LocalDateTime eventdetailIndex;
|
||||
private String eventdetailIndex;
|
||||
|
||||
@ApiModelProperty("读取状态(0:未读,1:已读,2:删除)")
|
||||
@TableField("state")
|
||||
private String state;
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.njcn.cloud.pojo.dto;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 推送消息设置
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-10
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_info_set")
|
||||
@ApiModel(value = "AppInfoSet对象", description = "推送消息设置")
|
||||
public class AppInfoSet extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("用户索引")
|
||||
@TableId("User_Index")
|
||||
private String userIndex;
|
||||
|
||||
@ApiModelProperty("0:false ;1:true 暂态消息模块")
|
||||
@TableField("Event_Info")
|
||||
private Integer eventInfo;
|
||||
|
||||
@ApiModelProperty("0:false ;1:true 稳态消息模块")
|
||||
@TableField("Target_Info")
|
||||
private Integer targetInfo;
|
||||
|
||||
@ApiModelProperty("0:false ;1:true 终端消息模块")
|
||||
@TableField("Device_Info")
|
||||
private Integer deviceInfo;
|
||||
|
||||
@ApiModelProperty("0:false ;1:true 系统消息模块")
|
||||
@TableField("System_Info")
|
||||
private Integer systemInfo;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.njcn.cloud.pojo.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 部门监测点关系表
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 10:33
|
||||
*/
|
||||
@Data
|
||||
@TableName("pq_dept_line")
|
||||
public class DeptLine {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 监测点Id
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
package com.njcn.cloud.pojo.dto;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-02
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_mp_event_detail")
|
||||
@ApiModel(value = "RMpEventDetail对象", description = "")
|
||||
public class RMpEventDetail {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("暂时事件ID")
|
||||
@TableId("event_id")
|
||||
private String eventId;
|
||||
|
||||
@ApiModelProperty("监测点ID")
|
||||
@TableField("measurement_point_id")
|
||||
private String measurementPointId;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
@TableField("start_time")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("统计指标类型(字典表PQS_Dicdata)")
|
||||
@TableField("event_type")
|
||||
private String eventType;
|
||||
|
||||
@ApiModelProperty("暂降原因(字典表PQS_Dicdata)")
|
||||
@TableField("advance_reason")
|
||||
private String advanceReason;
|
||||
|
||||
@ApiModelProperty("暂降类型(字典表PQS_Dicdata)")
|
||||
@TableField("advance_type")
|
||||
private String advanceType;
|
||||
|
||||
@ApiModelProperty("事件关联分析表Guid")
|
||||
@TableField("eventass_index")
|
||||
private String eventassIndex;
|
||||
|
||||
@TableField("dq_time")
|
||||
private Double dqTime;
|
||||
|
||||
@ApiModelProperty("特征值计算更新时间(外键PQS_Relevance的Time字段)")
|
||||
@TableField("deal_time")
|
||||
private LocalDateTime dealTime;
|
||||
|
||||
@ApiModelProperty("默认事件个数为0")
|
||||
@TableField("num")
|
||||
private Integer num;
|
||||
|
||||
@ApiModelProperty("波形文件是否从装置招到本地(0:未招,1:已招)默认值为0")
|
||||
@TableField("file_flag")
|
||||
private Boolean fileFlag;
|
||||
|
||||
@ApiModelProperty("特征值计算标志(0,未处理;1,已处理; 2,已处理,无结果;3,计算失败)默认值为0")
|
||||
@TableField("deal_flag")
|
||||
private Boolean dealFlag;
|
||||
|
||||
@ApiModelProperty("处理结果第一条事件发生时间(读comtra文件获取)")
|
||||
@TableField("first_time")
|
||||
private LocalDateTime firstTime;
|
||||
|
||||
@ApiModelProperty("处理结果第一条事件暂降类型(字典表PQS_Dicdata)")
|
||||
@TableField("first_type")
|
||||
private String firstType;
|
||||
|
||||
@ApiModelProperty("处理结果第一条事件发生时间毫秒(读comtra文件获取)")
|
||||
@TableField("first_ms")
|
||||
private BigDecimal firstMs;
|
||||
|
||||
@ApiModelProperty("暂降能量")
|
||||
@TableField("energy")
|
||||
private Double energy;
|
||||
|
||||
@ApiModelProperty("暂降严重度")
|
||||
@TableField("severity")
|
||||
private Double severity;
|
||||
|
||||
@ApiModelProperty("暂降源与监测位置关系 Upper:上游;Lower :下游;Unknown :未知;为空则是未计算")
|
||||
@TableField("sagsource")
|
||||
private String sagsource;
|
||||
|
||||
@ApiModelProperty("持续时间,单位秒")
|
||||
@TableField("duration")
|
||||
private BigDecimal duration;
|
||||
|
||||
@ApiModelProperty("特征幅值")
|
||||
@TableField("feature_amplitude")
|
||||
private BigDecimal featureAmplitude;
|
||||
|
||||
@ApiModelProperty("相别")
|
||||
@TableField("phase")
|
||||
private String phase;
|
||||
|
||||
@ApiModelProperty("事件描述")
|
||||
@TableField("event_describe")
|
||||
private String eventDescribe;
|
||||
|
||||
@ApiModelProperty("波形路径")
|
||||
@TableField("wave_path")
|
||||
private String wavePath;
|
||||
|
||||
@ApiModelProperty("暂态事件上送时间")
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField("transient_value")
|
||||
private Double transientValue;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class DevComTJ implements Serializable {
|
||||
|
||||
@ApiModelProperty("所有终端")
|
||||
private Integer allDevCount;
|
||||
|
||||
@ApiModelProperty("异常终端")
|
||||
private Integer errDevCount;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 终端消息详情
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/7 15:26
|
||||
*/
|
||||
@Data
|
||||
public class DevMsgAssInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty("终端Id")
|
||||
private String devIndex;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty("ip")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("供电公司")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String bdzName;
|
||||
|
||||
@ApiModelProperty("")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private int comOutNum;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String flowInfo;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private List<String> devMsgDescribe;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private List<String> alarmInfo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 终端消息详情
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/7 10:59
|
||||
*/
|
||||
@Data
|
||||
public class DevMsgDetailInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty("终端消息id")
|
||||
private String topId;
|
||||
|
||||
@ApiModelProperty("终端Id")
|
||||
private String devIndex;
|
||||
|
||||
@ApiModelProperty("供电公司")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String bdzName;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty("ip")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("统计时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("总告警次数")
|
||||
private Integer allNum;
|
||||
|
||||
@ApiModelProperty("终端告警")
|
||||
private Integer alarmNum;
|
||||
|
||||
@ApiModelProperty("通讯中断")
|
||||
private Integer comOutNum;
|
||||
|
||||
@ApiModelProperty("终端流量百分比")
|
||||
private Float flowNum;
|
||||
|
||||
@ApiModelProperty("中断描述")
|
||||
private List<String> comoutDesc;
|
||||
|
||||
@ApiModelProperty("告警描述")
|
||||
private List<String> alarmDesc;
|
||||
|
||||
@ApiModelProperty("读取状态")
|
||||
private Integer state;
|
||||
public void setComoutDesc(String comoutDesc) {
|
||||
List<String> collect =new ArrayList<>();
|
||||
if(StrUtil.isNotBlank(comoutDesc)){
|
||||
String[] split = comoutDesc.split(",");
|
||||
collect = Arrays.stream(split).sorted().collect(Collectors.toList());
|
||||
}
|
||||
this.comoutDesc = collect;
|
||||
}
|
||||
|
||||
public void setAlarmDesc(String alarmDesc) {
|
||||
List<String> collect =new ArrayList<>();
|
||||
if(StrUtil.isNotBlank(alarmDesc)){
|
||||
String[] split = alarmDesc.split(",");
|
||||
collect = Arrays.stream(split).sorted().collect(Collectors.toList());
|
||||
}
|
||||
this.alarmDesc = collect;
|
||||
}
|
||||
}
|
||||
@@ -43,13 +43,13 @@ public class EventInfoDetailVO implements Serializable {
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("持续时间")
|
||||
private Float persistTime;
|
||||
private Double persistTime;
|
||||
|
||||
@ApiModelProperty("处理结果第一条事件发生时间毫秒")
|
||||
private Long ms;
|
||||
private Double ms;
|
||||
|
||||
@ApiModelProperty("特征幅值")
|
||||
private Float eventValue;
|
||||
private Double eventValue;
|
||||
|
||||
@ApiModelProperty("报告状态")
|
||||
private int report;
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -27,16 +28,16 @@ public class EventMsgDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("触发时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date timeID;
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("持续时间")
|
||||
private Float persistTime;
|
||||
private Double persistTime;
|
||||
|
||||
@ApiModelProperty("毫秒数")
|
||||
private Long ms;
|
||||
private Double ms;
|
||||
|
||||
@ApiModelProperty("特征幅值")
|
||||
private Float eventValue;
|
||||
private Double eventValue;
|
||||
|
||||
@ApiModelProperty("终端信息")
|
||||
private String lineInfo;
|
||||
@@ -45,7 +46,7 @@ public class EventMsgDetailVO implements Serializable {
|
||||
private String eventMsgIndex;
|
||||
|
||||
@ApiModelProperty("读取状态")
|
||||
private int state;
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 监测点信息
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 14:36
|
||||
*/
|
||||
@Data
|
||||
public class LineDetailVO implements Serializable {
|
||||
@ApiModelProperty("供电公司名称")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String subName;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty("监测点Id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("测量间隔(1-10分钟)")
|
||||
private Integer timeInterval;
|
||||
|
||||
@ApiModelProperty("网络参数")
|
||||
private String ip;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class MsgInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty("暂态消息Ids")
|
||||
private List<String> eventMsgList;
|
||||
|
||||
@ApiModelProperty("稳态消息Ids")
|
||||
private List<String> steadyMsgList;
|
||||
|
||||
@ApiModelProperty("终端消息Ids")
|
||||
private List<String> deviceMsgList;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 稳态越限图形数据
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/6 9:30
|
||||
*/
|
||||
@Data
|
||||
public class SteadyUrlData {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("时间")
|
||||
private String time;
|
||||
|
||||
@ApiModelProperty("数值")
|
||||
private Float value;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.cloud.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2023/11/9 9:34
|
||||
*/
|
||||
public class PubUtil {
|
||||
|
||||
public static String lineName(String sagSource,String lineName){
|
||||
if(StrUtil.isNotBlank(sagSource)&&"Upper".equals(sagSource)){
|
||||
return lineName+" (暂降源位置:上游)";
|
||||
}
|
||||
if(StrUtil.isNotBlank(sagSource)&&"Lower".equals(sagSource)){
|
||||
return lineName+" (暂降源位置:下游)";
|
||||
}
|
||||
if(StrUtil.isNotBlank(sagSource)){
|
||||
return lineName+" (暂降源位置:未知)";
|
||||
}
|
||||
return lineName;
|
||||
}
|
||||
}
|
||||
@@ -96,12 +96,11 @@ public class SmsUtil {
|
||||
* 发送消息
|
||||
* @param phone 手机号
|
||||
* @param template 模板号
|
||||
* @param param 短信模板中定义的参数名称
|
||||
* @param value 参数实际值
|
||||
* @param smsValue 短信模板中定义的参数名称
|
||||
* @return sendSmsResponse 发送消息结果
|
||||
* @throws ClientException
|
||||
*/
|
||||
public SendSmsResponse sendSms(String phone, String template, String param, String value) throws ClientException {
|
||||
public SendSmsResponse sendSms(String phone, String template,String smsValue) throws ClientException {
|
||||
System.setProperty(DEFAULTCONNECTTIMEOUT, message.getTime());
|
||||
System.setProperty(DEFAULTREADTIMEOUT, message.getTime());
|
||||
//初始化ascClient,暂时不支持多region(请勿修改)
|
||||
@@ -115,8 +114,7 @@ public class SmsUtil {
|
||||
request.setSignName(message.getAutoGraph());
|
||||
//必填:短信模板-可在短信控制台中找到,发送国际/港澳台消息时,请使用国际/港澳台短信模版
|
||||
request.setTemplateCode(template);
|
||||
String code = "{\""+param+"\":\"" + value + "\"}";
|
||||
request.setTemplateParam(code);
|
||||
request.setTemplateParam(smsValue);
|
||||
//请求失败这里会抛ClientException异常
|
||||
return acsClient.getAcsResponse(request);
|
||||
}
|
||||
|
||||
@@ -72,17 +72,48 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>user-api</artifactId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<artifactId>advance-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pqs-influx</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pq-device-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pqs-influx</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>event-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pqs-influx</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pqs-influx</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>appMainBoot</finalName>
|
||||
|
||||
@@ -5,12 +5,14 @@ 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")
|
||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||
@DependsOn("proxyMapperRegister")
|
||||
public class AppCloudBootApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.cloud.controller.information;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.njcn.cloud.pojo.dto.AppDevMsg;
|
||||
import com.njcn.cloud.pojo.dto.AppEventMsg;
|
||||
import com.njcn.cloud.pojo.dto.AppSteadyMsg;
|
||||
import com.njcn.cloud.pojo.vo.MsgInfo;
|
||||
import com.njcn.cloud.service.user.IAppDevMsgService;
|
||||
import com.njcn.cloud.service.user.IAppEventMsgService;
|
||||
import com.njcn.cloud.service.user.IAppSteadyMsgService;
|
||||
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.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 清理消息
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/8 13:48
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cleanmsg")
|
||||
@Api(tags = "清空消息接口")
|
||||
@RequiredArgsConstructor
|
||||
public class CleanMsgInfoController extends BaseController {
|
||||
|
||||
private final IAppEventMsgService eventMsgService;
|
||||
private final IAppSteadyMsgService steadyMsgMapper;
|
||||
private final IAppDevMsgService devMsgService;
|
||||
/**
|
||||
* 暂态消息获取
|
||||
*/
|
||||
@PostMapping("/clearMsg")
|
||||
@ApiOperation(value = "清空消息接口入口")
|
||||
public HttpResult<Boolean> eventDetailList(@RequestBody MsgInfo param) {
|
||||
String methodDescribe = getMethodDescribe("eventDetailList");
|
||||
List<String> eventMsgList = param.getEventMsgList();
|
||||
List<String> steadyMsgList = param.getSteadyMsgList();
|
||||
List<String> deviceMsgList = param.getDeviceMsgList();
|
||||
//暂态消息
|
||||
if(CollUtil.isNotEmpty(eventMsgList)){
|
||||
eventMsgService.update(new LambdaUpdateWrapper<AppEventMsg>()
|
||||
.set(AppEventMsg::getState,1)
|
||||
.in(AppEventMsg::getEventmsgIndex,eventMsgList)
|
||||
);
|
||||
}
|
||||
//稳态消息
|
||||
if(CollUtil.isNotEmpty(steadyMsgList)){
|
||||
steadyMsgMapper.update(new LambdaUpdateWrapper<AppSteadyMsg>()
|
||||
.set(AppSteadyMsg::getState,1)
|
||||
.in(AppSteadyMsg::getSteadyIndex,steadyMsgList)
|
||||
);
|
||||
}
|
||||
//终端消息
|
||||
if(CollUtil.isNotEmpty(deviceMsgList)){
|
||||
devMsgService.update(new LambdaUpdateWrapper<AppDevMsg>()
|
||||
.set(AppDevMsg::getState,1)
|
||||
.in(AppDevMsg::getDevmsgIndex,eventMsgList)
|
||||
);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.njcn.cloud.controller.information;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.cloud.enums.app.EventMsgCodeEnum;
|
||||
import com.njcn.cloud.pojo.vo.DevComTJ;
|
||||
import com.njcn.cloud.pojo.vo.DevMsgDetailInfo;
|
||||
import com.njcn.cloud.service.user.IAppDevMsgService;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 终端消息业务层
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/7 10:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/deviceMsg")
|
||||
@Api(tags = "终端状态信息接口")
|
||||
@RequiredArgsConstructor
|
||||
public class DevMsgController extends BaseController {
|
||||
|
||||
|
||||
private final IAppDevMsgService devMsgService;
|
||||
|
||||
// /**
|
||||
// * 终端消息列表获取
|
||||
// */
|
||||
// @PostMapping("/deviceMsgList")
|
||||
// @Deprecated
|
||||
// @ApiOperation(value = "终端消息列表入口", notes = "终端消息列表")
|
||||
// public HttpResult<Page<AppDevMsg>> deviceMsgList(@RequestBody BaseParam param) {
|
||||
// String methodDescribe = getMethodDescribe("deviceMsgList");
|
||||
// if (StrUtil.isBlank(param.getSearchValue())) {
|
||||
// throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
||||
// }
|
||||
// Page<AppDevMsg> page = devMsgService.deviceMsgList(param);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 终端列表获取
|
||||
*/
|
||||
@PostMapping("/deviceList")
|
||||
@ApiOperation(value = "终端列表入口", notes = "终端列表")
|
||||
public HttpResult<Page<DevMsgDetailInfo>> deviceList(@RequestBody BaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("deviceList");
|
||||
if (StrUtil.isBlank(param.getSearchValue())) {
|
||||
throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
||||
}
|
||||
Page<DevMsgDetailInfo> page = devMsgService.deviceList(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息状态
|
||||
*/
|
||||
@PostMapping("/updateDevMsgState")
|
||||
@ApiOperation(value = "修改消息状态", notes = "消息状态")
|
||||
public HttpResult<Boolean> updateDevMsgState(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("updateDevMsgState");
|
||||
Boolean aBoolean = devMsgService.updateDevMsgState(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, aBoolean, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端通讯状态统计
|
||||
*/
|
||||
@PostMapping("/getDevComTJ")
|
||||
@ApiOperation(value = "终端通讯状态统计", notes = "终端通讯状态统计")
|
||||
public HttpResult<DevComTJ> getDevComTJ(String deptId) {
|
||||
String methodDescribe = getMethodDescribe("getDevComTJ");
|
||||
DevComTJ devComTJ = devMsgService.getDevComTJ(deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devComTJ, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端通讯信息
|
||||
*/
|
||||
@PostMapping("/getDevComInfo")
|
||||
@ApiOperation(value = "终端通讯信息", notes = "终端通讯信息")
|
||||
public HttpResult<List<DevDetail>> getDevComInfo(String deptId) {
|
||||
String methodDescribe = getMethodDescribe("getDevComInfo");
|
||||
List<DevDetail> devComInfo = devMsgService.getDevComInfo(deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devComInfo, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -117,37 +117,30 @@ public class SteadyMsgController extends BaseController {
|
||||
public HttpResult<AppSteadyUrl> steadyTargetUrl(String lineIndex,String timeID,Integer typeCode) {
|
||||
String methodDescribe = getMethodDescribe("steadyTargetUrl");
|
||||
AppSteadyUrl steadyTargetUrl = steadyAssService.getSteadyTargetUrl(lineIndex, timeID, typeCode);
|
||||
if(StrUtil.isBlank(steadyTargetUrl.getSteadyPath())){
|
||||
steadyTargetUrl = steadyAssService.getUrl(lineIndex, timeID, typeCode);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, steadyTargetUrl, methodDescribe);
|
||||
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * @description: 生成稳态越限指标图形
|
||||
// * @author gbl
|
||||
// * @param lineIndex 监测点ID
|
||||
// * @param timeID 统计时间
|
||||
// * @param typeCode
|
||||
// */
|
||||
// @PostMapping("steadyImage")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "lineIndex", value = "监测点ID", required = true, paramType = "query"),
|
||||
// @ApiImplicitParam(name = "timeID", value = "统计时间", required = true, paramType = "query"),
|
||||
// @ApiImplicitParam(name = "typeCode", value = "指标编码", required = true, paramType = "query")
|
||||
// })
|
||||
// @ApiOperation(value = "生成稳态越限指标图形", notes = "稳态越限图形", response = ResponseData.class)
|
||||
// public ResponseData steadyImage(int lineIndex,Long timeID,int typeCode, HttpServletRequest request) {
|
||||
// ResponseData responseData = new ResponseData();
|
||||
//
|
||||
// try {
|
||||
// SteadyUrl msgs = new SteadyUrl();
|
||||
// String dateTime = PubUtils.timeStamp3Date(timeID,"");
|
||||
// Date time = PubUtils.string2Date(dateTime, "yyyy-MM-dd");
|
||||
// msgs = steadyAssService.getUrl(request,lineIndex,time,typeCode);
|
||||
//
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS,SteadyMsgCodeEnum.GETTARGET_SUCCESS.getCode(), SteadyMsgCodeEnum.GETTARGET_SUCCESS.getMsg(), msgs);
|
||||
// } catch (Exception e) {
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL,SteadyMsgCodeEnum.GETTARGET_FALL.getCode(), SteadyMsgCodeEnum.GETTARGET_FALL.getMsg(), null);
|
||||
// }
|
||||
// return responseData;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @description: 生成稳态越限指标图形
|
||||
* @author gbl
|
||||
* @param lineIndex 监测点ID
|
||||
* @param timeID 统计时间
|
||||
* @param typeCode
|
||||
*/
|
||||
@PostMapping("/steadyImage")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "lineIndex", value = "监测点ID", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "timeID", value = "统计时间", required = true, paramType = "query"),
|
||||
@ApiImplicitParam(name = "typeCode", value = "指标编码", required = true, paramType = "query")
|
||||
})
|
||||
@ApiOperation(value = "生成稳态越限指标图形", notes = "稳态越限图形")
|
||||
public HttpResult<AppSteadyUrl> steadyImage(String lineIndex,String timeID,Integer typeCode) {
|
||||
String methodDescribe = getMethodDescribe("steadyImage");
|
||||
AppSteadyUrl steadyTargetUrl = steadyAssService.getUrl(lineIndex, timeID, typeCode);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, steadyTargetUrl, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
//package com.njcn.cloud.controller.message;
|
||||
//
|
||||
//import com.njcn.enums.app.ReturnCode;
|
||||
//import com.njcn.enums.app.UserCodeEnum;
|
||||
//import com.njcn.pojo.commons.ResponseData;
|
||||
//import com.njcn.utils.PubUtils;
|
||||
//import com.shining.cloud.service.information.EventMsgService;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiImplicitParam;
|
||||
//import io.swagger.annotations.ApiImplicitParams;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import net.sf.json.JSONObject;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.util.StringUtils;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * @author hongawen
|
||||
// * @date: 2019/11/11 14:51
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/msg")
|
||||
//@Api(tags = "内部消息推送")
|
||||
//public class EventMsgPushController {
|
||||
//
|
||||
// private static final Logger logger = LoggerFactory.getLogger(EventMsgPushController.class);
|
||||
//
|
||||
// @Autowired
|
||||
// private EventMsgService eventMsgService;
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 暂态消息推送
|
||||
// */
|
||||
// @PostMapping("sendEventMsg")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "eventDetailIndex", value = "暂降索引", required = true, paramType = "query"),
|
||||
// @ApiImplicitParam(name = "lineId", value = "监测点索引", required = true, paramType = "query"),
|
||||
// })
|
||||
// @ApiOperation(value = "暂态消息推送", notes = "暂态消息推送", response = ResponseData.class)
|
||||
// public ResponseData sendEventMsg(String eventDetailIndex, int lineId, HttpServletRequest request) {
|
||||
// logger.error("推送暂降事件:事件索引:{},监测点ID为:{}",eventDetailIndex,lineId);
|
||||
// ResponseData responseData;
|
||||
// if (StringUtils.isEmpty(eventDetailIndex) || StringUtils.isEmpty(lineId)) {
|
||||
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.INVALID_PARAMETER.getCode(), UserCodeEnum.INVALID_PARAMETER.getMsg(), null);
|
||||
// }
|
||||
// try {
|
||||
// eventMsgService.sendEventMsg(eventDetailIndex, lineId,request);
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.EVENT_MSG_SUCCESS.getCode(), UserCodeEnum.EVENT_MSG_SUCCESS.getMsg(), null);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("暂降消息推送,异常为:" + e.getMessage());
|
||||
// if (e.getMessage().length() < 10) {
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.getCodeByMsg(e.getMessage()), e.getMessage(), null);
|
||||
// } else {
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.EVENT_MSG_FAIL.getCode(), UserCodeEnum.EVENT_MSG_FAIL.getMsg(), null);
|
||||
// }
|
||||
// }
|
||||
// return responseData;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 稳态消息推送
|
||||
// */
|
||||
// @PostMapping("sendSteadyMsg")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "userIndex", value = "用户索引", required = true, paramType = "query"),
|
||||
// @ApiImplicitParam(name = "timeID", value = "统计时间", required = true, paramType = "query"),
|
||||
// @ApiImplicitParam(name = "lineNum", value = "监测点个数", required = true, paramType = "query"),
|
||||
// })
|
||||
// @ApiOperation(value = "稳态消息推送", notes = "稳态消息推送", response = ResponseData.class)
|
||||
// public ResponseData sendSteadyMsg(String userIndex, Long timeID, Integer lineNum) {
|
||||
// ResponseData responseData;
|
||||
// logger.error("稳态消息推送:用户索引:{},统计时间:{},监测点个数:{}",userIndex,timeID,lineNum);
|
||||
// if (StringUtils.isEmpty(userIndex) || StringUtils.isEmpty(timeID) || StringUtils.isEmpty(lineNum)) {
|
||||
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.INVALID_PARAMETER.getCode(), UserCodeEnum.INVALID_PARAMETER.getMsg(), null);
|
||||
// }
|
||||
// try {
|
||||
// String msgIndex = eventMsgService.sendSteadyMsg(userIndex, timeID, lineNum);
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("msgIndex", msgIndex);
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.STEADY_MSG_SUCCESS.getCode(), UserCodeEnum.STEADY_MSG_SUCCESS.getMsg(), jsonObject);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("稳态消息推送,异常为:" + e.getMessage());
|
||||
// if (e.getMessage().length() < 10) {
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.getCodeByMsg(e.getMessage()), e.getMessage(), null);
|
||||
// } else {
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.STEADY_MSG_FAIL.getCode(), UserCodeEnum.STEADY_MSG_FAIL.getMsg(), null);
|
||||
// }
|
||||
// }
|
||||
// return responseData;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 终端消息推送
|
||||
// */
|
||||
// @PostMapping("sendTargetMsg")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "userIndex", value = "用户索引", required = true, paramType = "query"),
|
||||
// @ApiImplicitParam(name = "timeID", value = "统计时间", required = true, paramType = "query"),
|
||||
// @ApiImplicitParam(name = "devNum", value = "终端个数", required = true, paramType = "query"),
|
||||
// @ApiImplicitParam(name = "alarmNum", value = "终端警告次数", paramType = "query"),
|
||||
// @ApiImplicitParam(name = "comOutNum", value = "通讯状态", paramType = "query"),
|
||||
// @ApiImplicitParam(name = "flowNum", value = "流量百分比", paramType = "query"),
|
||||
// @ApiImplicitParam(name = "flag", value = "强制推送标志",required = true, paramType = "query"),
|
||||
// })
|
||||
// @ApiOperation(value = "终端消息推送", notes = "终端消息推送", response = ResponseData.class)
|
||||
// public ResponseData sendTargetMsg(String userIndex, Long timeID,Integer devNum, Integer alarmNum, Integer comOutNum, Float flowNum, int flag) {
|
||||
// logger.error("稳态消息推送:用户索引:{},统计时间:{},终端个数:{}",userIndex,timeID,devNum);
|
||||
// ResponseData responseData;
|
||||
// if (StringUtils.isEmpty(userIndex) || StringUtils.isEmpty(timeID) || StringUtils.isEmpty(flag)) {
|
||||
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.INVALID_PARAMETER.getCode(), UserCodeEnum.INVALID_PARAMETER.getMsg(), null);
|
||||
// }
|
||||
// try {
|
||||
// String msgIndex = eventMsgService.sendTargetMsg(userIndex, timeID, devNum,alarmNum,comOutNum,flowNum,flag);
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("msgIndex", msgIndex);
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.DEVICE_MSG_SUCCESS.getCode(), UserCodeEnum.DEVICE_MSG_SUCCESS.getMsg(), jsonObject);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("终端消息推送,异常为:" + e.getMessage());
|
||||
// if (e.getMessage().length() < 10) {
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.getCodeByMsg(e.getMessage()), e.getMessage(), null);
|
||||
// } else {
|
||||
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.DEVICE_MSG_FAIL.getCode(), UserCodeEnum.DEVICE_MSG_FAIL.getMsg(), null);
|
||||
// }
|
||||
// }
|
||||
// return responseData;
|
||||
// }
|
||||
//
|
||||
//}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.cloud.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.cloud.pojo.dto.AppDevMsg;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 终端消息 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-07
|
||||
*/
|
||||
public interface AppDevMsgMapper extends BaseMapper<AppDevMsg> {
|
||||
|
||||
|
||||
}
|
||||
@@ -2,9 +2,7 @@ package com.njcn.cloud.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.cloud.pojo.dto.AppEventInfo;
|
||||
import com.njcn.cloud.pojo.dto.RMpEventDetail;
|
||||
import com.njcn.cloud.pojo.vo.EventInfoDetailVO;
|
||||
import com.njcn.cloud.pojo.vo.EventWaveDetailVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@@ -26,43 +24,5 @@ public interface AppEventInfoMapper extends BaseMapper<AppEventInfo> {
|
||||
*/
|
||||
EventInfoDetailVO selectEventInfoDetailByID(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* @Description: 获取监测点相别
|
||||
* @param id 暂降事件id
|
||||
* @return: java.lang.Integer
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 14:45
|
||||
*/
|
||||
Integer getLinePtType(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* @Description: 获取波形路径
|
||||
* @param eventId 暂降事件id
|
||||
* @return: java.lang.String
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 15:55
|
||||
*/
|
||||
EventWaveDetailVO.Detail selectWavePath(@Param("id")String eventId);
|
||||
|
||||
/**
|
||||
* @Description: 获取暂态信息
|
||||
* @param id
|
||||
* @return: com.njcn.cloud.pojo.vo.EventInfoDetailVO
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 14:43
|
||||
*/
|
||||
RMpEventDetail selectByID(@Param("id") String id);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 暂态事件基本信息(暂态事件id)
|
||||
* @param id
|
||||
* @return: com.njcn.cloud.pojo.vo.EventInfoDetailVO
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 14:43
|
||||
*/
|
||||
EventInfoDetailVO selectEventDetailByID(@Param("id") String id);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
package com.njcn.cloud.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.cloud.pojo.dto.AppEventMsg;
|
||||
import com.njcn.cloud.pojo.vo.EventMsgDetailVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -18,16 +13,4 @@ import java.util.List;
|
||||
*/
|
||||
public interface AppEventMsgMapper extends BaseMapper<AppEventMsg> {
|
||||
|
||||
/**
|
||||
* @Description: 获取暂态信息
|
||||
* @param page
|
||||
* @param ids
|
||||
* @param userIndex
|
||||
* @return: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.njcn.cloud.pojo.vo.EventMsgDetailVO>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 10:21
|
||||
*/
|
||||
Page<EventMsgDetailVO> selectEventMsgPage(Page page,
|
||||
@Param("ids") List<String> ids,
|
||||
@Param("userIndex") String userIndex);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.cloud.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.cloud.pojo.dto.AppInfoSet;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 推送消息设置 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-10
|
||||
*/
|
||||
public interface AppInfoSetMapper extends BaseMapper<AppInfoSet> {
|
||||
|
||||
}
|
||||
@@ -2,6 +2,10 @@ package com.njcn.cloud.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.cloud.pojo.dto.AppSteadyUrl;
|
||||
import com.njcn.cloud.pojo.vo.SteadyUrlData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +17,45 @@ import com.njcn.cloud.pojo.dto.AppSteadyUrl;
|
||||
*/
|
||||
public interface AppSteadyUrlMapper extends BaseMapper<AppSteadyUrl> {
|
||||
|
||||
//频率偏差
|
||||
List<SteadyUrlData> getFreqDev(@Param("lineIndex")String lineIndex,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime")String endTime);
|
||||
|
||||
//电压偏差
|
||||
List<SteadyUrlData> getVUDev(@Param("lineIndex")String lineIndex,
|
||||
@Param("startTime")String startTime,
|
||||
@Param("endTime")String endTime,
|
||||
@Param("type")String type);
|
||||
|
||||
//电压不平衡
|
||||
List<SteadyUrlData> getVUnbalance(@Param("lineIndex")String lineIndex,
|
||||
@Param("startTime")String startTime,
|
||||
@Param("endTime")String endTime);
|
||||
|
||||
//长闪
|
||||
List<SteadyUrlData> getPLT(@Param("lineIndex")String lineIndex,
|
||||
@Param("startTime")String startTime,
|
||||
@Param("endTime")String endTime,
|
||||
@Param("type")String type);
|
||||
|
||||
//电压谐波畸变率
|
||||
List<SteadyUrlData> getVTHD(@Param("lineIndex")String lineIndex,
|
||||
@Param("startTime")String startTime,
|
||||
@Param("endTime")String endTime,
|
||||
@Param("type")String type);
|
||||
|
||||
//N次电压谐波含有率
|
||||
List<SteadyUrlData> getVHarmRate(@Param("lineIndex")String lineIndex,
|
||||
@Param("startTime")String startTime,
|
||||
@Param("endTime")String endTime,
|
||||
@Param("number")String number,
|
||||
@Param("type")String type);
|
||||
|
||||
//N次电流谐波幅值
|
||||
List<SteadyUrlData> getIHarmPhasic(@Param("lineIndex")String lineIndex,
|
||||
@Param("startTime")String startTime,
|
||||
@Param("endTime")String endTime,
|
||||
@Param("number")String number,
|
||||
@Param("type")String type);
|
||||
}
|
||||
|
||||
@@ -2,11 +2,9 @@ package com.njcn.cloud.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.cloud.pojo.dto.AppUser;
|
||||
import com.njcn.cloud.pojo.dto.DeptLine;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -28,12 +26,4 @@ public interface AppUserMapper extends BaseMapper<AppUser> {
|
||||
User getUserAndApp(@Param("userIndex") String appUserID);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 部门监测点关系表
|
||||
* @param deptID
|
||||
* @return: java.util.List<com.njcn.cloud.pojo.dto.DeptLine>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 10:33
|
||||
*/
|
||||
List<DeptLine> getUserLine(@Param("deptID") String deptID);
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.njcn.cloud.mapper;
|
||||
|
||||
|
||||
import com.njcn.cloud.pojo.vo.LineDetailVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 监测点信息
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 14:38
|
||||
*/
|
||||
public interface LineMapper {
|
||||
|
||||
/**
|
||||
* @Description: 获取监测点集合信息
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 14:37
|
||||
*/
|
||||
List<LineDetailVO> selectByIds(@Param("ids") List<String> ids);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?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.cloud.mapper.AppDevMsgMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -4,130 +4,17 @@
|
||||
|
||||
<select id="selectEventInfoDetailByID" resultType="com.njcn.cloud.pojo.vo.EventInfoDetailVO">
|
||||
SELECT
|
||||
(
|
||||
CASE
|
||||
WHEN sagsource IS NULL THEN
|
||||
line.NAME
|
||||
WHEN sagsource = "Upper" THEN
|
||||
CONCAT( line.NAME, " (暂降源位置:上游)" )
|
||||
WHEN sagsource = "Lower" THEN
|
||||
CONCAT( line.NAME, " (暂降源位置:下游)" ) ELSE CONCAT( line.NAME, " (暂降源位置:未知)" )
|
||||
END
|
||||
) AS lineName,
|
||||
gd.NAME gdName,
|
||||
sub.NAME bdzName,
|
||||
dev.NAME devName,
|
||||
dic.NAME scale,
|
||||
pd.ip ip,
|
||||
detail.event_id AS eventDetailIndex,
|
||||
detail.start_time timeID,
|
||||
detail.first_ms ms,
|
||||
detail.duration persistTime,
|
||||
round( detail.feature_amplitude * 100, 2 ) eventValue,
|
||||
msg.EventDetail_Index AS eventDetailIndex,
|
||||
info.REPORT_STATE report,
|
||||
info.Evaluate evaluate,
|
||||
info.report_Path reportPath
|
||||
FROM
|
||||
app_event_msg msg
|
||||
INNER JOIN app_event_info info ON msg.EventDetail_Index = info.EventDetail_Index
|
||||
INNER JOIN r_mp_event_detail detail ON msg.EventDetail_Index = detail.event_id
|
||||
INNER JOIN pq_line line ON detail.measurement_point_id = line.id
|
||||
INNER JOIN pq_line_detail pld ON line.Id = pld.Id
|
||||
INNER JOIN pq_line vol ON vol.Id = line.Pid
|
||||
INNER JOIN pq_voltage vg ON vg.Id = vol.id
|
||||
INNER JOIN pq_line dev ON dev.Id = vol.Pid
|
||||
INNER JOIN pq_device pd ON pd.Id = dev.Id
|
||||
INNER JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
INNER JOIN pq_line gd ON gd.Id = sub.Pid
|
||||
INNER JOIN pq_line area ON area.Id = gd.Pid
|
||||
INNER JOIN sys_area sys ON area.NAME = sys.id
|
||||
INNER JOIN sys_dict_data dic ON vg.Scale = dic.id
|
||||
<where>
|
||||
<if test="id!=null and id != '' ">
|
||||
AND msg.EventMsg_Index = #{id}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY info.update_time desc
|
||||
</select>
|
||||
<select id="getLinePtType" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
IFNULL(b.PT_Phase_Type ,1)
|
||||
FROM
|
||||
r_mp_event_detail a,
|
||||
pq_line_detail b
|
||||
WHERE
|
||||
a.measurement_point_id = b.Id
|
||||
and
|
||||
a.event_id = #{id}
|
||||
</select>
|
||||
<select id="selectWavePath" resultType="com.njcn.cloud.pojo.vo.EventWaveDetailVO$Detail">
|
||||
SELECT
|
||||
event_id AS eventID,
|
||||
measurement_point_id AS measurementPointId,
|
||||
line.NAME AS measurementPointName,
|
||||
wave_path AS wavePath,
|
||||
pd.ip AS ip,
|
||||
PT1 / PT2 AS pt,
|
||||
CT1 / CT2 AS ct,
|
||||
PT_Type AS ptType
|
||||
FROM
|
||||
r_mp_event_detail a
|
||||
INNER JOIN pq_line line ON a.measurement_point_id = line.id
|
||||
INNER JOIN pq_line_detail pld ON line.Id = pld.Id
|
||||
INNER JOIN pq_line vol ON vol.Id = line.Pid
|
||||
INNER JOIN pq_voltage vg ON vg.Id = vol.id
|
||||
INNER JOIN pq_line dev ON dev.Id = vol.Pid
|
||||
INNER JOIN pq_device pd ON pd.Id = dev.Id
|
||||
WHERE
|
||||
a.event_id = #{id}
|
||||
</select>
|
||||
<select id="selectByID" resultType="com.njcn.cloud.pojo.dto.RMpEventDetail">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
r_mp_event_detail a
|
||||
WHERE
|
||||
a.event_id = #{id}
|
||||
</select>
|
||||
<select id="selectEventDetailByID" resultType="com.njcn.cloud.pojo.vo.EventInfoDetailVO">
|
||||
SELECT
|
||||
(
|
||||
CASE
|
||||
WHEN sagsource IS NULL THEN
|
||||
line.NAME
|
||||
WHEN sagsource = "Upper" THEN
|
||||
CONCAT( line.NAME, " (暂降源位置:上游)" )
|
||||
WHEN sagsource = "Lower" THEN
|
||||
CONCAT( line.NAME, " (暂降源位置:下游)" ) ELSE CONCAT( line.NAME, " (暂降源位置:未知)" )
|
||||
END
|
||||
) AS lineName,
|
||||
gd.NAME gdName,
|
||||
sub.NAME bdzName,
|
||||
dev.NAME devName,
|
||||
dic.NAME scale,
|
||||
pd.ip ip,
|
||||
detail.event_id AS eventDetailIndex,
|
||||
detail.start_time as timeID,
|
||||
detail.first_ms ms,
|
||||
detail.duration persistTime,
|
||||
round( detail.feature_amplitude * 100, 2 ) eventValue
|
||||
FROM
|
||||
r_mp_event_detail detail
|
||||
INNER JOIN pq_line line ON detail.measurement_point_id = line.id
|
||||
INNER JOIN pq_line_detail pld ON line.Id = pld.Id
|
||||
INNER JOIN pq_line vol ON vol.Id = line.Pid
|
||||
INNER JOIN pq_voltage vg ON vg.Id = vol.id
|
||||
INNER JOIN pq_line dev ON dev.Id = vol.Pid
|
||||
INNER JOIN pq_device pd ON pd.Id = dev.Id
|
||||
INNER JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
INNER JOIN pq_line gd ON gd.Id = sub.Pid
|
||||
INNER JOIN pq_line area ON area.Id = gd.Pid
|
||||
INNER JOIN sys_area sys ON area.NAME = sys.id
|
||||
INNER JOIN sys_dict_data dic ON vg.Scale = dic.id
|
||||
<where>
|
||||
<if test="id!=null and id != '' ">
|
||||
AND detail.event_id = #{id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -2,48 +2,4 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.cloud.mapper.AppEventMsgMapper">
|
||||
|
||||
<select id="selectEventMsgPage" resultType="com.njcn.cloud.pojo.vo.EventMsgDetailVO">
|
||||
select
|
||||
line.id as lineIndex,
|
||||
(CASE
|
||||
WHEN sagsource is NULL THEN line.name
|
||||
WHEN sagsource = "Upper" THEN CONCAT(line.name , " (暂降源位置:上游)")
|
||||
WHEN sagsource = "Lower" THEN CONCAT(line.name , " (暂降源位置:下游)")
|
||||
ELSE CONCAT(line.name , " (暂降源位置:未知)")
|
||||
END)as lineName,
|
||||
detail.event_id as eventDetailIndex,
|
||||
detail.start_time timeID,
|
||||
detail.first_ms ms,
|
||||
detail.duration persistTime,
|
||||
round( detail.feature_amplitude * 100, 2 ) eventValue,
|
||||
CONCAT(sys.name,' ',gd.name,' 电压等级:',dic.name,' 网络参数:',pd.ip) lineInfo,
|
||||
msg.eventMsg_Index eventMsgIndex,
|
||||
msg.state
|
||||
from
|
||||
app_event_msg msg
|
||||
INNER JOIN r_mp_event_detail detail ON msg.EventDetail_Index=detail.event_id
|
||||
INNER JOIN pq_line line ON detail.measurement_point_id=line.id
|
||||
INNER JOIN pq_line_detail pld ON line.Id = pld.Id
|
||||
INNER JOIN pq_line vol ON vol.Id = line.Pid
|
||||
INNER JOIN pq_voltage vg ON vg.Id = vol.id
|
||||
INNER JOIN pq_line dev ON dev.Id = vol.Pid
|
||||
INNER JOIN pq_device pd ON pd.Id = dev.Id
|
||||
INNER JOIN pq_line sub ON sub.Id = dev.Pid
|
||||
INNER JOIN pq_line gd ON gd.Id = sub.Pid
|
||||
INNER JOIN pq_line area ON area.Id = gd.Pid
|
||||
INNER JOIN sys_area sys ON area.NAME = sys.id
|
||||
INNER JOIN sys_dict_data dic ON vg.Scale = dic.id
|
||||
<where>
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND line.id IN
|
||||
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userIndex!=null and userIndex != '' ">
|
||||
AND msg.User_Index = #{userIndex}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.cloud.mapper.AppInfoSetMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -2,4 +2,150 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.cloud.mapper.AppSteadyUrlMapper">
|
||||
|
||||
<select id="getFreqDev" resultType="com.njcn.cloud.pojo.vo.SteadyUrlData">
|
||||
SELECT
|
||||
time AS timeId,
|
||||
freq_dev AS `value`
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
AND line_id = #{lineIndex}
|
||||
AND phasic_type = 'T'
|
||||
AND value_type = "MAX"
|
||||
</where>
|
||||
ORDER BY
|
||||
time ASC
|
||||
</select>
|
||||
|
||||
<select id="getVUDev" resultType="com.njcn.cloud.pojo.vo.SteadyUrlData">
|
||||
SELECT
|
||||
time AS timeId,
|
||||
vu_dev AS `value`
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
AND line_id = #{lineIndex}
|
||||
AND phasic_type = 'T'
|
||||
AND value_type = "MAX"
|
||||
</where>
|
||||
ORDER BY
|
||||
time ASC
|
||||
</select>
|
||||
|
||||
<select id="getVUnbalance" resultType="com.njcn.cloud.pojo.vo.SteadyUrlData">
|
||||
SELECT
|
||||
time AS timeId,
|
||||
v_unbalance AS `value`
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
AND line_id = #{lineIndex}
|
||||
AND phasic_type = 'T'
|
||||
AND value_type = "CP95"
|
||||
</where>
|
||||
ORDER BY
|
||||
time ASC
|
||||
</select>
|
||||
|
||||
<select id="getPLT" resultType="com.njcn.cloud.pojo.vo.SteadyUrlData">
|
||||
SELECT
|
||||
time AS timeId,
|
||||
pst AS `value`
|
||||
FROM
|
||||
r_stat_data_flicker_d
|
||||
<where>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
AND line_id = #{lineIndex}
|
||||
AND phasic_type =#{type}
|
||||
</where>
|
||||
ORDER BY
|
||||
time ASC
|
||||
</select>
|
||||
|
||||
<select id="getVTHD" resultType="com.njcn.cloud.pojo.vo.SteadyUrlData">
|
||||
SELECT
|
||||
time AS timeId,
|
||||
v_thd AS `value`
|
||||
FROM
|
||||
r_stat_data_v_d
|
||||
<where>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
AND line_id = #{lineIndex}
|
||||
AND phasic_type = #{type}
|
||||
AND value_type = "MAX"
|
||||
</where>
|
||||
ORDER BY
|
||||
time ASC
|
||||
</select>
|
||||
|
||||
<select id="getVHarmRate" resultType="com.njcn.cloud.pojo.vo.SteadyUrlData">
|
||||
SELECT
|
||||
time AS timeId,
|
||||
v_${number} AS `value`
|
||||
FROM
|
||||
r_stat_data_harmrate_v_d
|
||||
<where>
|
||||
phasic_type = #{type}
|
||||
AND value_type = "CP95"
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
AND line_id = #{lineIndex}
|
||||
</where>
|
||||
ORDER BY
|
||||
time ASC
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getIHarmPhasic" resultType="com.njcn.cloud.pojo.vo.SteadyUrlData">
|
||||
SELECT
|
||||
time AS timeId,
|
||||
i_${number} AS `value`
|
||||
FROM
|
||||
r_stat_data_harmrate_v_d
|
||||
<where>
|
||||
phasic_type = #{type}
|
||||
AND value_type = "CP95"
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and DATE_FORMAT(time, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
||||
</if>
|
||||
AND line_id = #{lineIndex}
|
||||
</where>
|
||||
ORDER BY
|
||||
time ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -10,12 +10,4 @@
|
||||
where
|
||||
id = #{userIndex}
|
||||
</select>
|
||||
<select id="getUserLine" resultType="com.njcn.cloud.pojo.dto.DeptLine">
|
||||
select
|
||||
*
|
||||
from
|
||||
pq_dept_line
|
||||
where
|
||||
id = #{deptID}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?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.cloud.mapper.LineMapper">
|
||||
|
||||
<select id="selectByIds" resultType="com.njcn.cloud.pojo.vo.LineDetailVO">
|
||||
SELECT DISTINCT
|
||||
gd.NAME gdName,
|
||||
substation.NAME subName,
|
||||
device.NAME devName,
|
||||
line.id as lineId,
|
||||
line.NAME lineName,
|
||||
lineDetail.Time_Interval as timeInterval,
|
||||
deviceDetail.ip ip
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_line substation,
|
||||
pq_line gd,
|
||||
pq_device deviceDetail,
|
||||
pq_line_detail lineDetail
|
||||
WHERE
|
||||
line.pid = voltage.id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND line.id = lineDetail.id
|
||||
<if test="ids!=null and ids.size()!=0">
|
||||
AND line.id IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.njcn.cloud.service.impl.user;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.cloud.mapper.AppDevMsgMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.cloud.pojo.dto.AppDevMsg;
|
||||
import com.njcn.cloud.pojo.vo.DevComTJ;
|
||||
import com.njcn.cloud.pojo.vo.DevMsgDetailInfo;
|
||||
import com.njcn.cloud.service.user.IAppDevMsgService;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 终端消息 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-07
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AppDevMsgServiceImpl extends ServiceImpl<AppDevMsgMapper, AppDevMsg> implements IAppDevMsgService {
|
||||
|
||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
|
||||
@Override
|
||||
public Page<AppDevMsg> deviceMsgList(BaseParam param) {
|
||||
Page<AppDevMsg> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<AppDevMsg>()
|
||||
.eq(AppDevMsg::getUserIndex, param.getSearchValue())
|
||||
.orderByDesc(AppDevMsg::getTimeId)
|
||||
);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<DevMsgDetailInfo> deviceList(BaseParam param) {
|
||||
Page<AppDevMsg> page= this.page(new Page(param.getPageNum(), param.getPageSize()),
|
||||
new LambdaQueryWrapper<AppDevMsg>()
|
||||
.eq(AppDevMsg::getUserIndex, param.getSearchValue())
|
||||
.orderByDesc(AppDevMsg::getTimeId)
|
||||
);
|
||||
List<AppDevMsg> records = page.getRecords();
|
||||
List<DevMsgDetailInfo> info=new ArrayList<>();
|
||||
if(CollUtil.isNotEmpty(records)){
|
||||
List<String> topIds = records.stream().map(AppDevMsg::getTopId).collect(Collectors.toList());
|
||||
List<TopMsgPO> data = generalDeviceInfoClient.getTopMsgInfoByIds(topIds).getData();
|
||||
Map<String, TopMsgPO> topMap = data.stream().collect(Collectors.toMap(TopMsgPO::getTopId, Function.identity()));
|
||||
DevMsgDetailInfo msg;
|
||||
for (AppDevMsg record : records) {
|
||||
if(topMap.containsKey(record.getTopId())){
|
||||
TopMsgPO topMsgPO = topMap.get(record.getTopId());
|
||||
msg=new DevMsgDetailInfo();
|
||||
msg.setComoutDesc(topMsgPO.getComOutDesc());
|
||||
msg.setAlarmDesc(topMsgPO.getAlarmDesc());
|
||||
msg.setTopId(topMsgPO.getTopId());
|
||||
msg.setDevIndex(topMsgPO.getDevId());
|
||||
msg.setGdName(topMsgPO.getCityName());
|
||||
msg.setBdzName(topMsgPO.getSubName());
|
||||
msg.setDevName(topMsgPO.getDeviceName());
|
||||
msg.setIp(topMsgPO.getIp());
|
||||
LocalDateTime time = LocalDateTimeUtil.parse(topMsgPO.getTime(), DatePattern.NORM_DATE_PATTERN);
|
||||
msg.setTimeID(time);
|
||||
msg.setAllNum(topMsgPO.getAlarmCount()+topMsgPO.getComOutCount());
|
||||
msg.setAlarmNum(topMsgPO.getAlarmCount());
|
||||
msg.setComOutNum(topMsgPO.getComOutCount());
|
||||
msg.setFlowNum(topMsgPO.getFlowValue());
|
||||
msg.setState(record.getState());
|
||||
info.add(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
Page<DevMsgDetailInfo> pageEvent = BeanUtil.copyProperties(page, Page.class);
|
||||
pageEvent.setRecords(info);
|
||||
return pageEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateDevMsgState(List<String> ids) {
|
||||
return this.update(new LambdaUpdateWrapper<AppDevMsg>()
|
||||
.set(AppDevMsg::getState,1)
|
||||
.in(AppDevMsg::getTopId,ids)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DevComTJ getDevComTJ(String deptId) {
|
||||
DevComTJ devComTJ=new DevComTJ();
|
||||
//根据部门获取监测id
|
||||
List<String> userLine = generalDeviceInfoClient.deptGetRunDev(deptId).getData();
|
||||
List<DevDetail> devDetail = generalDeviceInfoClient.getDevInfoByIds(userLine).getData();
|
||||
if(CollUtil.isNotEmpty(devDetail)){
|
||||
devComTJ.setAllDevCount(devDetail.size());
|
||||
devComTJ.setErrDevCount(Math.toIntExact(devDetail.stream().filter(x -> x.getComFlag() == 0).count()));
|
||||
}else{
|
||||
devComTJ.setAllDevCount(0);
|
||||
devComTJ.setErrDevCount(0);
|
||||
|
||||
}
|
||||
return devComTJ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevDetail> getDevComInfo(String deptId) {
|
||||
List<String> userLine = generalDeviceInfoClient.deptGetRunDev(deptId).getData();
|
||||
List<DevDetail> devDetail = generalDeviceInfoClient.getDevInfoByIds(userLine).getData();
|
||||
devDetail.sort(Collections.reverseOrder(Comparator.comparing(DevDetail::getComFlag)));
|
||||
return devDetail;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.cloud.service.impl.user;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.njcn.advance.api.EventWaveAnalysisFeignClient;
|
||||
@@ -12,12 +13,16 @@ import com.njcn.cloud.pojo.vo.EventWaveDetailVO;
|
||||
import com.njcn.cloud.service.user.IAppEventInfoService;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||
import com.njcn.event.api.EventDetailFeignClient;
|
||||
import com.njcn.event.file.component.WaveFileComponent;
|
||||
import com.njcn.event.file.component.WavePicComponent;
|
||||
import com.njcn.event.file.pojo.bo.WaveDataDetail;
|
||||
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||
import com.njcn.event.file.pojo.enums.WaveFileResponseEnum;
|
||||
import com.njcn.event.file.utils.WaveUtil;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.oss.constant.GeneralConstant;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
@@ -27,8 +32,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -46,15 +53,26 @@ public class AppEventInfoServiceImpl extends ServiceImpl<AppEventInfoMapper, App
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
private final WaveFileComponent waveFileComponent;
|
||||
private final WavePicComponent wavePicComponent;
|
||||
private final EventDetailFeignClient eventDetailFeignClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public EventEigDetailVO.Detail eventDetailEigenvalue(String eventDetailIndex) {
|
||||
EventEigDetailVO.Detail detail=new EventEigDetailVO.Detail();
|
||||
|
||||
List<EventEigDetailVO> eventInfoDetails = new ArrayList<>();
|
||||
EntityAdvancedData entityAdvancedData = eventWaveAnalysisFeignClient.analysis(eventDetailIndex).getData();
|
||||
|
||||
//根据事件获取监测点接线方式
|
||||
Integer ptType = this.getBaseMapper().getLinePtType(eventDetailIndex);
|
||||
Integer ptType=null;
|
||||
List<RmpEventDetailPO> eventDetail = eventDetailFeignClient.getEventDetailByIdsList(Arrays.asList(eventDetailIndex)).getData();
|
||||
List<String> linedIds = eventDetail.stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(linedIds)) {
|
||||
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getLineDetailByIds(linedIds).getData();
|
||||
ptType=lineDetail.get(0).getPtType();
|
||||
}
|
||||
if (entityAdvancedData.backNumber != -1) {
|
||||
detail.setBackNumber( entityAdvancedData.backNumber);
|
||||
for (int i = 0; i < entityAdvancedData.backNumber; i++) {
|
||||
@@ -134,15 +152,18 @@ public class AppEventInfoServiceImpl extends ServiceImpl<AppEventInfoMapper, App
|
||||
@Override
|
||||
public WaveDataDTO analyseWave(String eventId, int iType) {
|
||||
WaveDataDTO waveDataDTO;
|
||||
//获取暂降事件
|
||||
EventWaveDetailVO.Detail eventDetail = this.baseMapper.selectWavePath(eventId);
|
||||
String waveName = eventDetail.getWavePath();
|
||||
List<RmpEventDetailPO> eventDetails = eventDetailFeignClient.getEventDetailByIdsList(Arrays.asList(eventId)).getData();
|
||||
List<String> linedIds = eventDetails.stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
|
||||
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getLineDetailByIds(linedIds).getData();
|
||||
RmpEventDetailPO detail = eventDetails.get(0);
|
||||
LineDetailVO.Detail line = lineDetail.get(0);
|
||||
String waveName = detail.getWavePath();
|
||||
if (StrUtil.isBlank(waveName)) {
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
}
|
||||
try (
|
||||
InputStream cfgStream = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + eventDetail.getIp() + StrUtil.SLASH + waveName + GeneralConstant.CFG);
|
||||
InputStream datStream = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + eventDetail.getIp() + StrUtil.SLASH + waveName + GeneralConstant.DAT)
|
||||
InputStream cfgStream = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + line.getIp() + StrUtil.SLASH + waveName + GeneralConstant.CFG);
|
||||
InputStream datStream = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + line.getIp() + StrUtil.SLASH + waveName + GeneralConstant.DAT)
|
||||
) {
|
||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
@@ -152,10 +173,10 @@ public class AppEventInfoServiceImpl extends ServiceImpl<AppEventInfoMapper, App
|
||||
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
|
||||
}
|
||||
waveDataDTO = waveFileComponent.getValidData(waveDataDTO);
|
||||
waveDataDTO.setPtType(eventDetail.getPtType());
|
||||
waveDataDTO.setPt(eventDetail.getPt());
|
||||
waveDataDTO.setCt(eventDetail.getCt());
|
||||
waveDataDTO.setMonitorName(eventDetail.getMeasurementPointName());
|
||||
waveDataDTO.setPtType(line.getPtType());
|
||||
waveDataDTO.setPt(line.getPT1()/line.getPT2());
|
||||
waveDataDTO.setCt(line.getCT1()/line.getCT2());
|
||||
waveDataDTO.setMonitorName(line.getLineName());
|
||||
return waveDataDTO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
package com.njcn.cloud.service.impl.user;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.cloud.enums.app.UserCodeEnum;
|
||||
import com.njcn.cloud.mapper.AppEventInfoMapper;
|
||||
import com.njcn.cloud.mapper.AppEventMsgMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.cloud.mapper.AppUserMapper;
|
||||
import com.njcn.cloud.pojo.dto.AppEventMsg;
|
||||
import com.njcn.cloud.pojo.dto.DeptLine;
|
||||
import com.njcn.cloud.pojo.vo.EventInfoDetailVO;
|
||||
import com.njcn.cloud.pojo.vo.EventMsgDetailVO;
|
||||
import com.njcn.cloud.service.user.IAppEventMsgService;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.cloud.utils.PubUtil;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||
import com.njcn.event.api.EventDetailFeignClient;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -35,33 +41,89 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class AppEventMsgServiceImpl extends ServiceImpl<AppEventMsgMapper, AppEventMsg> implements IAppEventMsgService {
|
||||
|
||||
private final AppUserMapper appUserMapper;
|
||||
private final AppEventInfoMapper appEventInfoMapper;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final EventDetailFeignClient eventDetailFeignClient;
|
||||
|
||||
@Override
|
||||
public Page<EventMsgDetailVO> eventMsgPage(BaseParam param) {
|
||||
String searchValue = param.getSearchValue();
|
||||
//根据用户id获取用户部门
|
||||
//todo 用户id
|
||||
User userAndApp = appUserMapper.getUserAndApp(param.getSearchValue());
|
||||
if(ObjectUtil.isNull(userAndApp)){
|
||||
throw new BusinessException(UserCodeEnum.NO_USER.getMsg());
|
||||
//获取暂态消息信息
|
||||
Page<AppEventMsg> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<AppEventMsg>()
|
||||
.eq(AppEventMsg::getUserIndex, searchValue)
|
||||
.eq(AppEventMsg::getUserIndex, searchValue)
|
||||
);
|
||||
List<AppEventMsg> records = page.getRecords();
|
||||
List<EventMsgDetailVO> info=new ArrayList<>();
|
||||
if(CollUtil.isNotEmpty(records)){
|
||||
Map<String, AppEventMsg> eventMsg = records.stream().collect(Collectors.toMap(AppEventMsg::getEventdetailIndex, Function.identity()));
|
||||
//获取暂态事件id
|
||||
List<String> eventIds = records.stream().map(AppEventMsg::getEventdetailIndex).distinct().collect(Collectors.toList());
|
||||
List<RmpEventDetailPO> eventDetail = eventDetailFeignClient.getEventDetailByIdsList(eventIds).getData();
|
||||
List<String> linedIds = eventDetail.stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
|
||||
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getLineDetailByIds(linedIds).getData();
|
||||
//监测点map
|
||||
Map<String, LineDetailVO.Detail> lineDetailMap = lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getLineId, Function.identity()));
|
||||
EventMsgDetailVO vo;
|
||||
AppEventMsg appEventMsg ;
|
||||
for (RmpEventDetailPO detail : eventDetail) {
|
||||
if(lineDetailMap.containsKey(detail.getLineId())){
|
||||
LineDetailVO.Detail line = lineDetailMap.get(detail.getLineId());
|
||||
vo=new EventMsgDetailVO();
|
||||
vo.setLineIndex(line.getLineId());
|
||||
vo.setLineName(PubUtil.lineName(detail.getSagsource(),line.getLineName()));
|
||||
vo.setEventDetailIndex(detail.getEventId());
|
||||
vo.setTimeID(line.getTimeID());
|
||||
vo.setPersistTime(detail.getDuration());
|
||||
vo.setMs(detail.getFirstMs());
|
||||
vo.setEventValue(detail.getFeatureAmplitude());
|
||||
vo.setLineInfo(line.getAreaName()+" "+line.getGdName()+" 电压等级:"+line.getVoltageLevel()+" 网络参数:"+line.getIp());
|
||||
if(eventMsg.containsKey(detail.getEventId())){
|
||||
appEventMsg = eventMsg.get(detail.getEventId());
|
||||
vo.setEventMsgIndex(appEventMsg.getEventmsgIndex());
|
||||
vo.setState(appEventMsg.getState());
|
||||
info.add(vo);
|
||||
}
|
||||
//根据所查询的部门查询出是部门下监测点信息
|
||||
List<DeptLine> userLine = appUserMapper.getUserLine(userAndApp.getDeptId());
|
||||
List<String> ids = userLine.stream().map(DeptLine::getLineId).collect(Collectors.toList());
|
||||
ids.add("2ec9ef4a375b249abc5314e6b7461cab");
|
||||
return this.getBaseMapper().selectEventMsgPage(new Page<>(param.getPageNum(),param.getPageSize()),ids,searchValue);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Page<EventMsgDetailVO> pageEvent = BeanUtil.copyProperties(page, Page.class);
|
||||
pageEvent.setRecords(info);
|
||||
return pageEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public EventInfoDetailVO eventInfoDetail(String id) {
|
||||
EventInfoDetailVO eventInfoDetailVO = appEventInfoMapper.selectEventInfoDetailByID(id);
|
||||
//查询出
|
||||
EventInfoDetailVO eventInfo = appEventInfoMapper.selectEventInfoDetailByID(id);
|
||||
//查询暂态事件
|
||||
List<RmpEventDetailPO> eventDetail = eventDetailFeignClient.getEventDetailByIdsList(Arrays.asList(eventInfo.getEventDetailIndex())).getData();
|
||||
List<String> linedIds = eventDetail.stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(linedIds)){
|
||||
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getLineDetailByIds(linedIds).getData();
|
||||
LineDetailVO.Detail line = lineDetail.get(0);
|
||||
RmpEventDetailPO detail= eventDetail.get(0);
|
||||
eventInfo.setLineName(PubUtil.lineName(detail.getSagsource(),line.getLineName()));
|
||||
eventInfo.setGdName(line.getGdName());
|
||||
eventInfo.setBdzName(line.getSubName());
|
||||
eventInfo.setDevName(line.getDevName());
|
||||
eventInfo.setScale(line.getVoltageLevel());
|
||||
eventInfo.setIp(line.getIp());
|
||||
eventInfo.setTimeID(detail.getStartTime());
|
||||
eventInfo.setPersistTime(detail.getDuration());
|
||||
eventInfo.setMs(detail.getFirstMs());
|
||||
eventInfo.setEventValue(detail.getFeatureAmplitude());
|
||||
this.update(new LambdaUpdateWrapper<AppEventMsg>()
|
||||
.set(AppEventMsg::getState,1)
|
||||
.eq(AppEventMsg::getEventmsgIndex,id)
|
||||
|
||||
);
|
||||
return eventInfoDetailVO;
|
||||
}
|
||||
return eventInfo;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.cloud.service.impl.user;
|
||||
|
||||
import com.njcn.cloud.mapper.AppInfoSetMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.cloud.pojo.dto.AppInfoSet;
|
||||
import com.njcn.cloud.service.user.IAppInfoSetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 推送消息设置 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-10
|
||||
*/
|
||||
@Service
|
||||
public class AppInfoSetServiceImpl extends ServiceImpl<AppInfoSetMapper, AppInfoSet> implements IAppInfoSetService {
|
||||
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.njcn.cloud.enums.app.EventMsgCodeEnum;
|
||||
import com.njcn.cloud.mapper.AppEventInfoMapper;
|
||||
import com.njcn.cloud.mapper.AppReportMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.cloud.pojo.dto.AppEventInfo;
|
||||
@@ -15,13 +14,18 @@ import com.njcn.cloud.pojo.vo.EventEigDetailVO;
|
||||
import com.njcn.cloud.pojo.vo.EventInfoDetailVO;
|
||||
import com.njcn.cloud.service.user.IAppEventInfoService;
|
||||
import com.njcn.cloud.service.user.IAppReportService;
|
||||
import com.njcn.cloud.utils.PubUtil;
|
||||
import com.njcn.cloud.utils.WordUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.FileUtil;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||
import com.njcn.event.api.EventDetailFeignClient;
|
||||
import com.njcn.event.file.component.WavePicComponent;
|
||||
import com.njcn.event.file.pojo.bo.WaveDataDetail;
|
||||
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||
import com.njcn.event.file.utils.WaveUtil;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -31,6 +35,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.io.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -46,10 +52,10 @@ import java.util.*;
|
||||
public class AppReportServiceImpl extends ServiceImpl<AppReportMapper, AppReport> implements IAppReportService {
|
||||
|
||||
private final IAppEventInfoService appEventInfoService;
|
||||
private final AppEventInfoMapper appEventInfoMapper;
|
||||
private final WavePicComponent wavePicComponent;
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
private final EventDetailFeignClient eventDetailFeignClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public String eventDetailReportApply(String userId, String eventDetailIndex) {
|
||||
@@ -65,9 +71,6 @@ public class AppReportServiceImpl extends ServiceImpl<AppReportMapper, AppReport
|
||||
);
|
||||
if (ObjectUtil.isNull(one)||one.getReportState() != 1) {
|
||||
try {
|
||||
if(ObjectUtil.isNull(one)){
|
||||
one=new AppEventInfo();
|
||||
}
|
||||
Map<String, String> map = this.createEventDetailReport(eventDetailIndex,one);
|
||||
if (map.containsKey("noData")) {
|
||||
return map.get("noData");
|
||||
@@ -76,12 +79,12 @@ public class AppReportServiceImpl extends ServiceImpl<AppReportMapper, AppReport
|
||||
info.setRmswavePath(map.get("rmsPath"));
|
||||
info.setReportState(1);
|
||||
info.setReportPath(map.get("reportPath"));
|
||||
appEventInfoService.save(info);
|
||||
appEventInfoService.saveOrUpdate(info);
|
||||
return "0";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
info.setReportState(2);
|
||||
appEventInfoService.save(info);
|
||||
appEventInfoService.saveOrUpdate(info);
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
@@ -122,16 +125,21 @@ public class AppReportServiceImpl extends ServiceImpl<AppReportMapper, AppReport
|
||||
List<WaveDataDetail> waveDataDetails = WaveUtil.filterWaveData(waveData);
|
||||
WordUtil wordUtil = new WordUtil();
|
||||
//获取瞬时波形
|
||||
String instantPath=appEventInfo.getInstantwavePath();
|
||||
if(StrUtil.isBlank(instantPath)){
|
||||
String instantPath;
|
||||
if(ObjectUtil.isNotNull(appEventInfo)&&StrUtil.isNotBlank(appEventInfo.getInstantwavePath())){
|
||||
instantPath=appEventInfo.getInstantwavePath();
|
||||
}else{
|
||||
instantPath = wavePicComponent.generateImageShun(waveData,waveDataDetails);
|
||||
}
|
||||
InputStream instantStream = fileStorageUtil.getFileStream(instantPath);
|
||||
String imageShun64 = Base64.encode(instantStream);
|
||||
//获取rms波形
|
||||
String rmsPath =appEventInfo.getRmswavePath();
|
||||
if(StrUtil.isBlank(rmsPath)){
|
||||
String rmsPath;
|
||||
if(ObjectUtil.isNotNull(appEventInfo)&&StrUtil.isNotBlank(appEventInfo.getRmswavePath())){
|
||||
rmsPath =appEventInfo.getRmswavePath();
|
||||
}else{
|
||||
rmsPath = wavePicComponent.generateImageRms(waveData,waveDataDetails);
|
||||
|
||||
}
|
||||
InputStream rmsStream = fileStorageUtil.getFileStream(rmsPath);
|
||||
String rmsShun64 = Base64.encode(rmsStream);
|
||||
@@ -145,7 +153,23 @@ public class AppReportServiceImpl extends ServiceImpl<AppReportMapper, AppReport
|
||||
|
||||
}
|
||||
wordUtil.setEventDetailEigenvalue(eventDetailEigenvalue);
|
||||
EventInfoDetailVO eventInfoList = appEventInfoMapper.selectEventDetailByID(eventIndex);
|
||||
EventInfoDetailVO eventInfoList = new EventInfoDetailVO();
|
||||
List<RmpEventDetailPO> eventDetails = eventDetailFeignClient.getEventDetailByIdsList(Arrays.asList(eventIndex)).getData();
|
||||
List<String> linedIds = eventDetails.stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
|
||||
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getLineDetailByIds(linedIds).getData();
|
||||
RmpEventDetailPO detail = eventDetails.get(0);
|
||||
LineDetailVO.Detail line = lineDetail.get(0);
|
||||
eventInfoList.setLineName(PubUtil.lineName(detail.getSagsource(),line.getLineName()));
|
||||
eventInfoList.setGdName(line.getGdName());
|
||||
eventInfoList.setBdzName(line.getSubName());
|
||||
eventInfoList.setDevName(line.getDevName());
|
||||
eventInfoList.setScale(line.getVoltageLevel());
|
||||
eventInfoList.setIp(line.getIp());
|
||||
eventInfoList.setEventDetailIndex(detail.getEventId());
|
||||
eventInfoList.setTimeID(detail.getStartTime());
|
||||
eventInfoList.setPersistTime(detail.getDuration());
|
||||
eventInfoList.setMs(detail.getFirstMs());
|
||||
eventInfoList.setEventValue(detail.getFeatureAmplitude());
|
||||
wordUtil.setEventInfoList(eventInfoList);
|
||||
wordUtil.createReport();
|
||||
|
||||
|
||||
@@ -2,32 +2,37 @@ package com.njcn.cloud.service.impl.user;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.cloud.enums.app.TypeCodeEnum;
|
||||
import com.njcn.cloud.mapper.AppSteadyMsgMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.cloud.mapper.LineMapper;
|
||||
import com.njcn.cloud.mapper.AppSteadyUrlMapper;
|
||||
import com.njcn.cloud.pojo.dto.AppSteadyAss;
|
||||
import com.njcn.cloud.pojo.dto.AppSteadyMsg;
|
||||
import com.njcn.cloud.pojo.dto.AppSteadyUrl;
|
||||
import com.njcn.cloud.pojo.vo.AppSteadyMsgVO;
|
||||
import com.njcn.cloud.pojo.vo.LineDetailVO;
|
||||
import com.njcn.cloud.pojo.vo.SteadyMsgDetailVO;
|
||||
import com.njcn.cloud.pojo.vo.SteadyTargetVO;
|
||||
import com.njcn.cloud.pojo.vo.SteadyUrlData;
|
||||
import com.njcn.cloud.service.user.IAppSteadyAssService;
|
||||
import com.njcn.cloud.service.user.IAppSteadyMsgService;
|
||||
import com.njcn.cloud.service.user.IAppSteadyUrlService;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||
import com.njcn.event.file.component.WavePicComponent;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -43,8 +48,10 @@ import java.util.stream.Collectors;
|
||||
public class AppSteadyMsgServiceImpl extends ServiceImpl<AppSteadyMsgMapper, AppSteadyMsg> implements IAppSteadyMsgService {
|
||||
|
||||
private final IAppSteadyAssService appSteadyAssService;
|
||||
private final AppSteadyUrlMapper steadyUrlDataMapper;
|
||||
private final IAppSteadyUrlService appSteadyUrlService;
|
||||
private final LineMapper lineMapper;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final WavePicComponent wavePicComponent;
|
||||
@Override
|
||||
public AppSteadyMsgVO getSteadyState(BaseParam param) {
|
||||
AppSteadyMsgVO appSteadyMsgVO=new AppSteadyMsgVO();
|
||||
@@ -87,10 +94,13 @@ public class AppSteadyMsgServiceImpl extends ServiceImpl<AppSteadyMsgMapper, App
|
||||
Map<String, List<AppSteadyUrl>> lineMap = lineDetail.stream()
|
||||
.collect(Collectors.groupingBy(x->x.getLineIndex()+"_"+LocalDateTimeUtil.format(x.getTimeId(), DatePattern.UTC_SIMPLE_MS_PATTERN)));
|
||||
List<String> steadyLineIdList = lineMap.keySet().stream().map(x->x.split("_")[0]).collect(Collectors.toList());
|
||||
List<LineDetailVO> lineDetailVOS = lineMapper.selectByIds(steadyLineIdList);
|
||||
|
||||
List<LineDetailVO.Detail> lineDetailVOS = lineFeignClient.getLineDetailByIds(steadyLineIdList).getData();
|
||||
|
||||
|
||||
lineMap.forEach((key,value)->{
|
||||
String[] split = key.split("_");
|
||||
List<LineDetailVO> line = lineDetailVOS.stream().filter(x -> x.getLineId().equals(split[0])).collect(Collectors.toList());
|
||||
List<LineDetailVO.Detail> line = lineDetailVOS.stream().filter(x -> x.getLineId().equals(split[0])).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(line)){
|
||||
SteadyMsgDetailVO detailVO=new SteadyMsgDetailVO();
|
||||
detailVO.setLineName(line.get(0).getLineName());
|
||||
@@ -156,4 +166,604 @@ public class AppSteadyMsgServiceImpl extends ServiceImpl<AppSteadyMsgMapper, App
|
||||
);
|
||||
return one;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppSteadyUrl getUrl(String lineIndex, String timeId, Integer typeCode) {
|
||||
List<List<SteadyUrlData>> result = new ArrayList<>();
|
||||
List<SteadyUrlData> data;
|
||||
List<SteadyUrlData> dataa;
|
||||
List<SteadyUrlData> datab;
|
||||
List<SteadyUrlData> datac;
|
||||
AppSteadyUrl ass = new AppSteadyUrl();
|
||||
String type="";
|
||||
float limit=0;
|
||||
//开始时间
|
||||
String startTime = DateUtil.beginOfDay(DateUtil.parse(timeId)).toString();
|
||||
//结束时间
|
||||
String endTime = DateUtil.endOfDay(DateUtil.parse(timeId)).toString();
|
||||
|
||||
Overlimit overLimit = lineFeignClient.getOverLimitData(lineIndex).getData();
|
||||
|
||||
if(typeCode == TypeCodeEnum.FREQ_DEV_OVERTIME.getCode()){
|
||||
data = steadyUrlDataMapper.getFreqDev(lineIndex,startTime,endTime);
|
||||
type = "频率偏差";
|
||||
limit = overLimit.getFreqDev();
|
||||
result.add(data);
|
||||
}else if(typeCode == TypeCodeEnum.VOLTAGE_DEV_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVUDev(lineIndex,startTime,endTime,"A");
|
||||
datab = steadyUrlDataMapper.getVUDev(lineIndex,startTime,endTime,"B");
|
||||
datac = steadyUrlDataMapper.getVUDev(lineIndex,startTime,endTime,"C");
|
||||
type = "电压偏差";
|
||||
limit = overLimit.getVoltageDev();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UBALANCE_OVERTIME.getCode()){
|
||||
data = steadyUrlDataMapper.getVUnbalance(lineIndex,startTime,endTime);
|
||||
type = "电压不平衡";
|
||||
limit = overLimit.getUbalance();
|
||||
result.add(data);
|
||||
}else if(typeCode == TypeCodeEnum.FLICKER_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getPLT(lineIndex,startTime,endTime,"A");
|
||||
datab = steadyUrlDataMapper.getPLT(lineIndex,startTime,endTime,"B");
|
||||
datac = steadyUrlDataMapper.getPLT(lineIndex,startTime,endTime,"C");
|
||||
type = "长闪";
|
||||
limit = overLimit.getFlicker();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UABERRANCE_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVTHD(lineIndex,startTime,endTime,"A");
|
||||
datab = steadyUrlDataMapper.getVTHD(lineIndex,startTime,endTime,"B");
|
||||
datac = steadyUrlDataMapper.getVTHD(lineIndex,startTime,endTime,"C");
|
||||
type = "电压谐波畸变率";
|
||||
limit = overLimit.getUaberrance();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_2_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"2","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"2","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"2","C");
|
||||
type = "2次电压谐波含有率";
|
||||
limit = overLimit.getUharm2();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_3_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"3","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"3","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"3","C");
|
||||
type = "3次电压谐波含有率";
|
||||
limit = overLimit.getUharm3();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_4_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"4","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"4","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"4","C");
|
||||
type = "4次电压谐波含有率";
|
||||
limit = overLimit.getUharm4();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_5_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"5","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"5","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"5","C");
|
||||
type = "5次电压谐波含有率";
|
||||
limit = overLimit.getUharm5();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_6_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"6","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"6","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"6","C");
|
||||
type = "6次电压谐波含有率";
|
||||
limit = overLimit.getUharm6();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_7_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"7","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"7","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"7","C");
|
||||
type = "7次电压谐波含有率";
|
||||
limit = overLimit.getUharm7();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_8_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"8","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"8","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"8","C");
|
||||
type = "8次电压谐波含有率";
|
||||
limit = overLimit.getUharm8();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_9_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"9","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"9","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"9","C");
|
||||
type = "9次电压谐波含有率";
|
||||
limit = overLimit.getUharm9();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_10_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"10","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"10","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"10","C");
|
||||
type = "10次电压谐波含有率";
|
||||
limit = overLimit.getUharm10();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_11_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"11","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"11","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"11","C");
|
||||
type = "11次电压谐波含有率";
|
||||
limit = overLimit.getUharm11();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_12_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"12","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"12","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"12","C");
|
||||
type = "12次电压谐波含有率";
|
||||
limit = overLimit.getUharm12();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_13_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"13","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"13","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"13","C");
|
||||
type = "13次电压谐波含有率";
|
||||
limit = overLimit.getUharm13();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_14_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"14","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"14","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"14","C");
|
||||
type = "14次电压谐波含有率";
|
||||
limit = overLimit.getUharm14();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_15_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"15","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"15","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"15","C");
|
||||
type = "15次电压谐波含有率";
|
||||
limit = overLimit.getUharm15();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_16_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"16","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"16","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"16","C");
|
||||
type = "16次电压谐波含有率";
|
||||
limit = overLimit.getUharm16();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_17_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"17","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"17","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"17","C");
|
||||
type = "17次电压谐波含有率";
|
||||
limit = overLimit.getUharm17();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_18_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"18","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"18","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"18","C");
|
||||
type = "18次电压谐波含有率";
|
||||
limit = overLimit.getUharm18();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_19_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"19","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"19","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"19","C");
|
||||
type = "19次电压谐波含有率";
|
||||
limit = overLimit.getUharm19();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_20_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"20","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"20","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"20","C");
|
||||
type = "20次电压谐波含有率";
|
||||
limit = overLimit.getUharm20();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_21_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"21","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"21","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"21","C");
|
||||
type = "21次电压谐波含有率";
|
||||
limit = overLimit.getUharm21();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_22_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"22","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"22","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"22","C");
|
||||
type = "22次电压谐波含有率";
|
||||
limit = overLimit.getUharm22();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_23_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"23","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"23","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"23","C");
|
||||
type = "23次电压谐波含有率";
|
||||
limit = overLimit.getUharm23();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_24_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"24","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"24","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"24","C");
|
||||
type = "24次电压谐波含有率";
|
||||
limit = overLimit.getUharm24();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.UHARM_25_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"25","A");
|
||||
datab = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"25","B");
|
||||
datac = steadyUrlDataMapper.getVHarmRate(lineIndex,startTime,endTime,"25","C");
|
||||
type = "25次电压谐波含有率";
|
||||
limit = overLimit.getUharm25();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_2_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"2","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"2","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"2","C");
|
||||
type = "2次电流谐波幅值";
|
||||
limit = overLimit.getIharm2();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_3_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"3","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"3","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"3","C");
|
||||
type = "3次电流谐波幅值";
|
||||
limit = overLimit.getIharm3();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_4_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"4","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"4","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"4","C");
|
||||
type = "4次电流谐波幅值";
|
||||
limit = overLimit.getIharm4();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_5_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"5","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"5","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"5","C");
|
||||
type = "5次电流谐波幅值";
|
||||
limit = overLimit.getIharm5();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_6_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"6","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"6","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"6","C");
|
||||
type = "6次电流谐波幅值";
|
||||
limit = overLimit.getIharm6();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_7_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"7","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"7","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"7","C");
|
||||
type = "7次电流谐波幅值";
|
||||
limit = overLimit.getIharm7();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_8_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"8","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"8","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"8","C");
|
||||
type = "8次电流谐波幅值";
|
||||
limit = overLimit.getIharm8();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_9_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"9","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"9","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"9","C");
|
||||
type = "9次电流谐波幅值";
|
||||
limit = overLimit.getIharm9();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_10_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"10","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"10","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"10","C");
|
||||
type = "10次电流谐波幅值";
|
||||
limit = overLimit.getIharm10();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_11_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"11","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"11","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"11","C");
|
||||
type = "11次电流谐波幅值";
|
||||
limit = overLimit.getIharm11();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_12_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"12","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"12","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"12","C");
|
||||
type = "12次电流谐波幅值";
|
||||
limit = overLimit.getIharm12();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_13_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"13","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"13","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"13","C");
|
||||
type = "13次电流谐波幅值";
|
||||
limit = overLimit.getIharm13();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_14_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"14","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"14","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"14","C");
|
||||
type = "14次电流谐波幅值";
|
||||
limit = overLimit.getIharm14();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_15_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"15","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"15","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"15","C");
|
||||
type = "15次电流谐波幅值";
|
||||
limit = overLimit.getIharm15();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_16_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"16","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"16","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"16","C");
|
||||
type = "16次电流谐波幅值";
|
||||
limit = overLimit.getIharm16();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_17_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"17","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"17","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"17","C");
|
||||
type = "17次电流谐波幅值";
|
||||
limit = overLimit.getIharm17();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_18_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"18","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"18","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"18","C");
|
||||
type = "18次电流谐波幅值";
|
||||
limit = overLimit.getIharm18();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_19_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"19","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"19","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"19","C");
|
||||
type = "19次电流谐波幅值";
|
||||
limit = overLimit.getIharm19();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_20_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"20","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"20","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"20","C");
|
||||
type = "20次电流谐波幅值";
|
||||
limit = overLimit.getIharm20();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_21_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"21","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"21","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"21","C");
|
||||
type = "21次电流谐波幅值";
|
||||
limit = overLimit.getIharm21();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_22_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"22","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"22","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"22","C");
|
||||
type = "22次电流谐波幅值";
|
||||
limit = overLimit.getIharm22();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_23_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"23","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"23","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"23","C");
|
||||
type = "23次电流谐波幅值";
|
||||
limit = overLimit.getIharm23();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_24_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"24","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"24","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"24","C");
|
||||
type = "24次电流谐波幅值";
|
||||
limit = overLimit.getIharm24();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}else if(typeCode == TypeCodeEnum.IHARM_25_OVERTIME.getCode()){
|
||||
dataa = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"25","A");
|
||||
datab = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"25","B");
|
||||
datac = steadyUrlDataMapper.getIHarmPhasic(lineIndex,startTime,endTime,"25","C");
|
||||
type = "25次电流谐波幅值";
|
||||
limit = overLimit.getIharm25();
|
||||
result.add(dataa);
|
||||
result.add(datab);
|
||||
result.add(datac);
|
||||
}
|
||||
|
||||
if(result != null && result.size()>0){
|
||||
String option=saveImg(result,lineIndex,type,limit);
|
||||
if(StrUtil.isBlank(option)){
|
||||
throw new BusinessException("文件上传异常");
|
||||
}
|
||||
appSteadyUrlService.update(new LambdaUpdateWrapper<AppSteadyUrl>()
|
||||
.set(AppSteadyUrl::getSteadyPath,option)
|
||||
.eq(AppSteadyUrl::getTypeCode,typeCode)
|
||||
.eq(AppSteadyUrl::getLineIndex, lineIndex)
|
||||
.eq(AppSteadyUrl::getTimeId, timeId));
|
||||
ass = appSteadyUrlService.getOne(new LambdaQueryWrapper<AppSteadyUrl>()
|
||||
.eq(AppSteadyUrl::getTypeCode,typeCode)
|
||||
.eq(AppSteadyUrl::getLineIndex, lineIndex)
|
||||
.eq(AppSteadyUrl::getTimeId, timeId));
|
||||
};
|
||||
return ass;
|
||||
}
|
||||
|
||||
public String saveImg(List<List<SteadyUrlData>> result, String lineIndex, String typeName, float limit) {
|
||||
// 变量
|
||||
List<List<Object>> values = new ArrayList<>();
|
||||
List<List<Object>> valueA = new ArrayList<>();
|
||||
List<List<Object>> valueB = new ArrayList<>();
|
||||
List<List<Object>> valueC = new ArrayList<>();
|
||||
List<List<Object>> limits = new ArrayList<>();
|
||||
|
||||
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getLineDetailByIds(Arrays.asList(lineIndex)).getData();
|
||||
if(CollUtil.isEmpty(lineDetail)){
|
||||
throw new BusinessException("监测点信息不存在,请检查的监测点编号");
|
||||
|
||||
}
|
||||
Integer ptType = lineDetail.get(0).getPtType();
|
||||
|
||||
String option="";
|
||||
if(result.size() == 1){
|
||||
for(SteadyUrlData tmp:result.get(0)){
|
||||
List<Object> a = new ArrayList() {{
|
||||
add(tmp.getTime());
|
||||
add(tmp.getValue());
|
||||
}};
|
||||
values.add(a);
|
||||
List<Object> aa = new ArrayList() {{
|
||||
add(tmp.getTime());
|
||||
add(limit);
|
||||
}};
|
||||
limits.add(aa);
|
||||
}
|
||||
// 模板参数
|
||||
HashMap<String, List<List<Object>>> datas = new LinkedHashMap<>();
|
||||
datas.put("实际值", values);
|
||||
String limitName="限值(" + limit + ")";
|
||||
// 生成返回地址
|
||||
option = wavePicComponent.generateSteadyTargetImage(typeName,datas,limitName,limits);
|
||||
}else{
|
||||
for(SteadyUrlData tmpA:result.get(0)){
|
||||
List<Object> a = new ArrayList() {{
|
||||
add(tmpA.getTime());
|
||||
add(tmpA.getValue());
|
||||
}};
|
||||
valueA.add(a);
|
||||
List<Object> aa = new ArrayList() {{
|
||||
add(tmpA.getTime());
|
||||
add(limit);
|
||||
}};
|
||||
limits.add(aa);
|
||||
}
|
||||
|
||||
for(SteadyUrlData tmpB:result.get(1)){
|
||||
List<Object> b = new ArrayList() {{
|
||||
add(tmpB.getTime());
|
||||
add(tmpB.getValue());
|
||||
}};
|
||||
valueB.add(b);
|
||||
}
|
||||
|
||||
for(SteadyUrlData tmpC:result.get(2)){
|
||||
List<Object> c = new ArrayList() {{
|
||||
add(tmpC.getTime());
|
||||
add(tmpC.getValue());
|
||||
}};
|
||||
valueC.add(c);
|
||||
}
|
||||
// 模板参数
|
||||
HashMap<String, List<List<Object>>> datas = new LinkedHashMap<>();
|
||||
String limitName="限值(" + limit + ")";
|
||||
// 生成option字符串
|
||||
if(typeName.lastIndexOf("电流谐波幅值") != -1){
|
||||
datas.put("A相",valueA);
|
||||
datas.put("B相",valueB);
|
||||
datas.put("C相",valueC);
|
||||
option = wavePicComponent.generateSteadyTargetImage(typeName,datas,limitName,limits);
|
||||
}else if(ptType == 0){
|
||||
datas.put("A相",valueA);
|
||||
datas.put("B相",valueB);
|
||||
datas.put("C相",valueC);
|
||||
option = wavePicComponent.generateSteadyTargetImage(typeName,datas,limitName,limits);
|
||||
}else if(ptType == 1){
|
||||
datas.put("AB相",valueA);
|
||||
datas.put("BC相",valueB);
|
||||
datas.put("CA相",valueC);
|
||||
option = wavePicComponent.generateSteadyTargetImage(typeName,datas,limitName,limits);
|
||||
}else if(ptType == 2){
|
||||
datas.put("AB相",valueA);
|
||||
datas.put("BC相",valueB);
|
||||
option = wavePicComponent.generateSteadyTargetImage(typeName,datas,limitName,limits);
|
||||
}
|
||||
}
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
package com.njcn.cloud.service.impl.user;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.aliyuncs.DefaultAcsClient;
|
||||
import com.aliyuncs.IAcsClient;
|
||||
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
|
||||
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
||||
import com.aliyuncs.http.MethodType;
|
||||
import com.aliyuncs.profile.DefaultProfile;
|
||||
import com.aliyuncs.profile.IClientProfile;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.cloud.enums.app.UserCodeEnum;
|
||||
import com.njcn.cloud.pojo.dto.AppEventInfo;
|
||||
import com.njcn.cloud.pojo.dto.AppEventMsg;
|
||||
import com.njcn.cloud.pojo.dto.AppInfoSet;
|
||||
import com.njcn.cloud.service.user.IAppEventInfoService;
|
||||
import com.njcn.cloud.service.user.IAppEventMsgService;
|
||||
import com.njcn.cloud.service.user.IAppInfoSetService;
|
||||
import com.njcn.cloud.service.user.MsgService;
|
||||
import com.njcn.cloud.utils.RedisDB;
|
||||
import com.njcn.cloud.utils.SmsUtil;
|
||||
import com.njcn.common.pojo.dto.LogInfoDTO;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.pq.api.DeptLineFeignClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||
import com.njcn.event.api.EventDetailFeignClient;
|
||||
import com.njcn.event.file.component.WavePicComponent;
|
||||
import com.njcn.event.file.pojo.bo.WaveDataDetail;
|
||||
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||
import com.njcn.event.file.utils.WaveUtil;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.UserLogFeignClient;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.security.auth.login.AccountException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2023/11/9 14:39
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MsgServiceImpl implements MsgService {
|
||||
|
||||
private final EventDetailFeignClient eventDetailFeignClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final DeptLineFeignClient deptLineFeignClient;
|
||||
private final UserLogFeignClient userLogFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final IAppEventInfoService appEventInfoService;
|
||||
private final WavePicComponent wavePicComponent;
|
||||
private final IAppInfoSetService appInfoSetService;
|
||||
private final IAppEventMsgService appEventMsgService;
|
||||
private final RedisUtil redisUtil;
|
||||
private final SmsUtil smsUtil;
|
||||
|
||||
/**
|
||||
* 推送暂降消息
|
||||
*
|
||||
* @param eventDetailIndex 暂降事件索引
|
||||
* @param lineId 监测点索引
|
||||
* 1:根据监测点获取绑定的部门
|
||||
* 2:根据部门找到对应的主用户
|
||||
* 3:根据主用户获取所有的app用户
|
||||
* 4:执行推送保存功能
|
||||
*/
|
||||
@Override
|
||||
public void sendEventMsg(String eventDetailIndex, String lineId) throws Exception {
|
||||
List<RmpEventDetailPO> eventDetails = eventDetailFeignClient.getEventDetailByIdsList(Arrays.asList(eventDetailIndex)).getData();
|
||||
if (CollUtil.isEmpty(eventDetails)) {
|
||||
return;
|
||||
}
|
||||
RmpEventDetailPO eventDetail = eventDetails.get(0);
|
||||
if (eventDetail.getFeatureAmplitude() == null || eventDetail.getFeatureAmplitude() >= 0.9) {
|
||||
return;
|
||||
}
|
||||
DeptLine deptLines = deptLineFeignClient.getLineByLineIds(lineId).getData();
|
||||
//查询为空,则无人关注,不做推送处理,但是需要进行日志记录
|
||||
if (ObjectUtil.isNotNull(deptLines)) {
|
||||
noUserFocus(eventDetailIndex, lineId);
|
||||
}
|
||||
//存在则进行筛选用户操作
|
||||
List<String> deptIndexs = deptFeignClient.getUpByDeptIds(deptLines.getId()).getData();
|
||||
//查找出可以推送的用户
|
||||
List<User> appUsers = userFeignClient.getUserByDeptIds(deptIndexs).getData();
|
||||
if (CollectionUtils.isEmpty(appUsers)) {
|
||||
noUserFocus(eventDetailIndex, lineId);
|
||||
}
|
||||
|
||||
AppEventInfo one = appEventInfoService.getOne(new LambdaQueryWrapper<AppEventInfo>()
|
||||
.eq(AppEventInfo::getEventdetailIndex, eventDetailIndex)
|
||||
);
|
||||
if (ObjectUtil.isNotNull(one)) {
|
||||
throw new BusinessException(UserCodeEnum.REPEAT_EVENT_INFO.getMsg());
|
||||
} else {
|
||||
WaveDataDTO waveDataDTO = appEventInfoService.analyseWave(eventDetailIndex, 2);
|
||||
//数据筛选,如果是双路电压的话,会存在2个波形数据
|
||||
List<WaveDataDetail> waveDataDetails = WaveUtil.filterWaveData(waveDataDTO);
|
||||
String instantPath = wavePicComponent.generateImageShun(waveDataDTO, waveDataDetails);
|
||||
String rmsPath = wavePicComponent.generateImageRms(waveDataDTO, waveDataDetails);
|
||||
one.setEventdetailIndex(eventDetailIndex);
|
||||
one.setInstantwavePath(instantPath);
|
||||
one.setRmswavePath(rmsPath);
|
||||
}
|
||||
appEventInfoService.save(one);
|
||||
//获取到设备码开始执行推送并保存库的操作
|
||||
//排重设备ID
|
||||
int phonePushFlag = 0;
|
||||
List<String> codes = new ArrayList<>();
|
||||
for (User appUser : appUsers) {
|
||||
if (!codes.contains(appUser.getDevCode())) {
|
||||
codes.add(appUser.getDevCode());
|
||||
pushEventInfo(eventDetail, appUser, StringUtils.isEmpty(appUser.getDevCode()) ? null : appUser.getDevCode(), phonePushFlag);
|
||||
phonePushFlag = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendSteadyMsg(String userIndex, String timeID, Integer lineNum) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行推送保存消息操作
|
||||
*
|
||||
* @param eventDetail 暂降事件
|
||||
* @param appUser 用户信息
|
||||
* @param devCode 手机唯一标识
|
||||
*/
|
||||
private void pushEventInfo(RmpEventDetailPO eventDetail, User appUser, String devCode, int phonePushFlag) throws Exception {
|
||||
//先根据用户获取推送策略
|
||||
AppInfoSet appInfoSet = appInfoSetService.getById(appUser.getId());
|
||||
if (ObjectUtil.isNotNull(appInfoSet)) {
|
||||
AppEventMsg eventMsg = new AppEventMsg();
|
||||
eventMsg.setEventdetailIndex(eventDetail.getEventId());
|
||||
eventMsg.setUserIndex(appUser.getId());
|
||||
eventMsg.setState(0);
|
||||
//执行保存消息记录操作
|
||||
appEventMsgService.save(eventMsg);
|
||||
if (appInfoSet.getEventInfo() == 1 && StrUtil.isNotBlank(devCode)) {
|
||||
//推送
|
||||
String content = "发生时刻:";
|
||||
//获取监测点信息
|
||||
List<LineDetailVO.Detail> lines = lineFeignClient.getLineDetailByIds(Arrays.asList(eventDetail.getLineId())).getData();
|
||||
if (CollUtil.isNotEmpty(lines)) {
|
||||
LineDetailVO.Detail line = lines.get(0);
|
||||
// String url = getPushUrl();
|
||||
String url = "";
|
||||
String time = LocalDateTimeUtil.format(eventDetail.getStartTime(), DatePattern.NORM_DATETIME_MS_PATTERN);
|
||||
//暂降幅值
|
||||
Float amplitude = PubUtils.floatRound(2, eventDetail.getFeatureAmplitude().floatValue() * 100);
|
||||
//持续时间
|
||||
Float duration = PubUtils.floatRound(2, eventDetail.getDuration().floatValue());
|
||||
content = content + time + ",暂降幅值:" + amplitude + "%," + "持续时间:" + duration + "s。";
|
||||
//todo 推送消息地址
|
||||
// sendMsg(url, devCode, line.getName() + "监测点发生暂态事件", content, "1");
|
||||
//查询主账户是否开启短信通知 根据监测点ID找到部门找到用户
|
||||
if (phonePushFlag == 0) {
|
||||
//添加策略,判断当前该事件是否需要短信推送
|
||||
boolean isPush = judgeEventNeedPush(eventDetail, line);
|
||||
if (isPush) {
|
||||
String message = "{\"line\":\"" + line.getLineName() + "\",\"time\":\"" + time + "\",\"ms\":\"" + eventDetail.getFirstMs() + "\",\"eventvalue\":\"" + amplitude + "\",\"persisttime\":\"" + duration + "\"}";
|
||||
smsUtil.sendSms(appUser.getPhone(), smsUtil.getMessageTemplate("8"), message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
* 1、监测点等级:极重要----则全部发送;
|
||||
* 2、监测点等级:重要----一天内最多通过短信发送10条暂降事件;超过的则暂降小等于80的才发送;
|
||||
* 3、监测点等级:普通----一天内最多通过短信发送3条暂降事件;超过的则暂降小等于80的才发送;
|
||||
* 4、监测点等级:不重要----一天内最多通过短信发送1条暂降事件;超过的则暂降小等于80的才发送;
|
||||
* @author hongawen
|
||||
* @date 2023/7/31 10:15
|
||||
* @param eventDetail 暂降信息
|
||||
* @param lineIndex 监测点索引
|
||||
* @return boolean
|
||||
*/
|
||||
private boolean judgeEventNeedPush(RmpEventDetailPO eventDetail, LineDetailVO.Detail lineIndex) {
|
||||
boolean pushFlag = true;
|
||||
String valueByKey = redisUtil.getStringByKey(RedisDB.ONE_DAY_QUERY, lineIndex.getLineId());
|
||||
if (StrUtil.isBlank(valueByKey)) {
|
||||
//为空,则最近24小时内没有发生暂降推送
|
||||
redisUtil.saveByKeyWithExpire(RedisDB.ONE_DAY_QUERY, lineIndex.getLineId(), "1", RedisDB.ONE_DAY_TIME);
|
||||
} else {
|
||||
//不为空,根据监测点重要程度来区分次数是否达到上限
|
||||
String lineGrade = lineIndex.getLineGrade();
|
||||
if (StrUtil.isBlank(lineGrade)) {
|
||||
lineGrade = "不重要";
|
||||
}
|
||||
if (eventDetail.getFeatureAmplitude() > 0.80f) {
|
||||
int times = Integer.parseInt(valueByKey);
|
||||
switch (lineGrade) {
|
||||
case "重要":
|
||||
if (times >= 10) {
|
||||
pushFlag = false;
|
||||
}
|
||||
break;
|
||||
case "普通":
|
||||
if (times >= 3) {
|
||||
pushFlag = false;
|
||||
}
|
||||
break;
|
||||
case "不重要":
|
||||
if (times >= 1) {
|
||||
pushFlag = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (pushFlag) {
|
||||
times++;
|
||||
long ttl = redisUtil.getExpire(RedisDB.ONE_DAY_QUERY, String.valueOf(lineIndex));
|
||||
redisUtil.saveByKeyWithExpire(RedisDB.ONE_DAY_QUERY, String.valueOf(lineIndex), String.valueOf(times), (int) ttl);
|
||||
}
|
||||
}
|
||||
}
|
||||
return pushFlag;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 无人关注的监测点出现暂降消息处理
|
||||
*
|
||||
* @param eventDetailIndex 暂降索引
|
||||
* @param lineId 监测点索引
|
||||
*/
|
||||
private void noUserFocus(String eventDetailIndex, String lineId) {
|
||||
//进行日志保存
|
||||
LogInfoDTO logInfoDTO = new LogInfoDTO();
|
||||
logInfoDTO.setLoginName(RequestUtil.getLoginName());
|
||||
logInfoDTO.setUserName(RequestUtil.getUserNickname());
|
||||
logInfoDTO.setIp(RequestUtil.getRealIp());
|
||||
logInfoDTO.setOperate(lineId + "的暂降消息" + eventDetailIndex + "无人监听");
|
||||
logInfoDTO.setOperateType("暂降推送");
|
||||
logInfoDTO.setResult(1);
|
||||
logInfoDTO.setLevel(1);
|
||||
logInfoDTO.setType(0);
|
||||
logInfoDTO.setServiceName("app-cloud");
|
||||
logInfoDTO.setUserIndex(RequestUtil.getUserIndex());
|
||||
userLogFeignClient.addUserLog(logInfoDTO);
|
||||
//抛出异常,返回调用者
|
||||
throw new BusinessException(UserCodeEnum.NO_USER_FOCUS.getMsg());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.njcn.cloud.service.user;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.cloud.pojo.dto.AppDevMsg;
|
||||
import com.njcn.cloud.pojo.vo.DevComTJ;
|
||||
import com.njcn.cloud.pojo.vo.DevMsgDetailInfo;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 终端消息 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-07
|
||||
*/
|
||||
public interface IAppDevMsgService extends IService<AppDevMsg> {
|
||||
|
||||
/**
|
||||
* @Description: 终端消息列表获取
|
||||
* @param param
|
||||
* @return: java.util.List<com.njcn.cloud.pojo.dto.AppDevMsg>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/7 10:47
|
||||
*/
|
||||
Page<AppDevMsg> deviceMsgList(BaseParam param);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 终端列表
|
||||
* @param param
|
||||
* @return: java.util.List<com.njcn.cloud.pojo.vo.DevMsgDetailInfo>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/7 11:13
|
||||
*/
|
||||
Page<DevMsgDetailInfo> deviceList(BaseParam param);
|
||||
|
||||
/**
|
||||
* @Description: 修改消息状态
|
||||
* @param ids
|
||||
* @return: java.lang.Boolean
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/8 10:07
|
||||
*/
|
||||
Boolean updateDevMsgState(List<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 终端通讯状态统计
|
||||
* @param deptId
|
||||
* @return: com.njcn.cloud.pojo.vo.DevComTJ
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/8 11:48
|
||||
*/
|
||||
DevComTJ getDevComTJ(String deptId);
|
||||
|
||||
/**
|
||||
* @Description: 终端通讯信息
|
||||
* @param deptId
|
||||
* @return: java.util.List<com.njcn.cloud.pojo.vo.app.DevDetail>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/8 11:48
|
||||
*/
|
||||
List<DevDetail> getDevComInfo(String deptId);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.cloud.service.user;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.cloud.pojo.dto.AppInfoSet;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 推送消息设置 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-10
|
||||
*/
|
||||
public interface IAppInfoSetService extends IService<AppInfoSet> {
|
||||
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import com.njcn.cloud.pojo.vo.SteadyMsgDetailVO;
|
||||
import com.njcn.cloud.pojo.vo.SteadyTargetVO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -22,8 +21,8 @@ import java.util.List;
|
||||
public interface IAppSteadyMsgService extends IService<AppSteadyMsg> {
|
||||
|
||||
/**
|
||||
* @Description: 稳态越线列表
|
||||
* @param param
|
||||
* @Description: 稳态越线列表
|
||||
* @return: com.njcn.cloud.pojo.vo.AppSteadyMsgVO
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 9:24
|
||||
@@ -31,8 +30,8 @@ public interface IAppSteadyMsgService extends IService<AppSteadyMsg> {
|
||||
AppSteadyMsgVO getSteadyState(BaseParam param);
|
||||
|
||||
/**
|
||||
* @Description: 稳态越限列表详细信息
|
||||
* @param steadyIndex
|
||||
* @Description: 稳态越限列表详细信息
|
||||
* @return: java.util.List<com.njcn.cloud.pojo.vo.SteadyMsgDetailVO>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 13:40
|
||||
@@ -40,9 +39,9 @@ public interface IAppSteadyMsgService extends IService<AppSteadyMsg> {
|
||||
List<SteadyMsgDetailVO> getSteadyDetail(String steadyIndex);
|
||||
|
||||
/**
|
||||
* @Description: 获取稳态越限指标
|
||||
* @param lineIndex
|
||||
* @param timeId
|
||||
* @Description: 获取稳态越限指标
|
||||
* @return: java.util.List<com.njcn.cloud.pojo.dto.AppSteadyUrl>
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 16:08
|
||||
@@ -50,13 +49,24 @@ public interface IAppSteadyMsgService extends IService<AppSteadyMsg> {
|
||||
List<SteadyTargetVO> getSteadyTarget(String lineIndex, String timeId);
|
||||
|
||||
/**
|
||||
* @Description: 获取稳态越限指标图形
|
||||
* @param lineIndex
|
||||
* @param timeId
|
||||
* @param typeCode
|
||||
* @Description: 获取稳态越限指标图形
|
||||
* @return: com.njcn.cloud.pojo.dto.AppSteadyUrl
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 16:20
|
||||
*/
|
||||
AppSteadyUrl getSteadyTargetUrl(String lineIndex, String timeId,Integer typeCode);
|
||||
AppSteadyUrl getSteadyTargetUrl(String lineIndex, String timeId, Integer typeCode);
|
||||
|
||||
/**
|
||||
* @param lineIndex
|
||||
* @param timeId
|
||||
* @param typeCode
|
||||
* @Description: 生成稳态越限指标图形
|
||||
* @return: com.njcn.cloud.pojo.dto.AppSteadyUrl
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/6 9:26
|
||||
*/
|
||||
AppSteadyUrl getUrl(String lineIndex, String timeId, Integer typeCode);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.cloud.service.user;
|
||||
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2023/11/9 14:39
|
||||
*/
|
||||
public interface MsgService {
|
||||
|
||||
/**
|
||||
* @Description: 暂态消息推送
|
||||
* @param eventDetailIndex
|
||||
* @param lineId
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/9 14:40
|
||||
*/
|
||||
void sendEventMsg(String eventDetailIndex,String lineId)throws Exception;
|
||||
|
||||
/**
|
||||
* @Description: 稳态消息推送
|
||||
* @param userIndex
|
||||
* @param timeID
|
||||
* @param lineNum
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/10 15:35
|
||||
*/
|
||||
void sendSteadyMsg(String userIndex, String timeID, Integer lineNum);
|
||||
}
|
||||
@@ -23,10 +23,10 @@ spring:
|
||||
discovery:
|
||||
ip: @service.server.url@
|
||||
server-addr: 192.168.1.13:18848
|
||||
namespace: 78588706-e06f-4580-b612-b26d72493fcb
|
||||
namespace: dd46004f-e15b-457c-92d3-4417b8f71be0
|
||||
config:
|
||||
server-addr: 192.168.1.13:18848
|
||||
namespace: 78588706-e06f-4580-b612-b26d72493fcb
|
||||
namespace: dd46004f-e15b-457c-92d3-4417b8f71be0
|
||||
file-extension: yaml
|
||||
shared-configs:
|
||||
- data-id: share-config.yaml
|
||||
|
||||
Reference in New Issue
Block a user