1.灿能云接口移植
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.njcn.cloud.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
* 类的介绍:短信配置获取实体
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/8/25 15:19
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@Order(10)
|
||||
public class Message {
|
||||
|
||||
/**
|
||||
* accessKeyId
|
||||
*/
|
||||
@Value("${message.access-key}")
|
||||
private String accessKeyId;
|
||||
|
||||
/**
|
||||
* accessKeySecret
|
||||
*/
|
||||
@Value("${message.secret-key}")
|
||||
private String accessKeySecret;
|
||||
|
||||
/**
|
||||
* 短信签名
|
||||
*/
|
||||
@Value("${message.auto-graph}")
|
||||
private String autoGraph;
|
||||
|
||||
/**
|
||||
* 连接时间参数
|
||||
*/
|
||||
@Value("${message.connect-time}")
|
||||
private String time;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.cloud.enums.app;
|
||||
|
||||
/**
|
||||
* @description: 暂态消息返回枚举
|
||||
* @author: denghuajun
|
||||
* @time: 2019-10-18 10:25:42
|
||||
**/
|
||||
|
||||
public enum EventMsgCodeEnum {
|
||||
TRANSIENT_TYPE(1, "暂态系统"),
|
||||
STEADY_TYPE(2, "稳态系统"),
|
||||
GETDETAIL_SUCCESS(10101, "获取暂态消息成功"),
|
||||
GETDETAIL_FALL(10102, "获取暂态消息失败"),
|
||||
GETBASEDETAIL_SUCCESS(10103, "获取暂态事件基本信息成功"),
|
||||
GETBASEDETAIL_FALL(10104, "获取暂态事件基本信息失败"),
|
||||
GETEIGVALUEDETAIL_SUCCESS(10105, "获取暂态事件特征幅值成功"),
|
||||
GETEIGVALUEDETAIL_FALL(10106, "获取暂态事件特征幅值失败"),
|
||||
GETWAVEDETAIL_SUCCESS(10107, "获取暂态事件波形成功"),
|
||||
GETWAVEDETAIL_FALL(10108, "获取暂态事件波形失败"),
|
||||
GETEVADETAIL_SUCCESS(10109, "更新暂态事件评价成功"),
|
||||
GETEVADETAIL_FALL(10110, "更新暂态事件评价失败"),
|
||||
USERID_WRONG(10111, "用户索引非法"),
|
||||
eventDetailIndex_WRONG(10112, "暂降事件ID非法"),
|
||||
CLEANMSGINFO_SUCCESS(10113, "清空消息成功"),
|
||||
CLEANMSGINFO_FALL(10114, "清空消息失败"),
|
||||
|
||||
|
||||
REPORTLIST_SUCCESS(10501, "报告查询成功"),
|
||||
REPORTLIST_FAIL(10502, "报告查询失败"),
|
||||
CUSTOMREPORT_SUCCESS(10503, "自定义申请报告成功"),
|
||||
CUSTOMREPORT_FAIL(10504, "自定义申请报告失败"),
|
||||
EVENTDETAILREPORTAPPLY_SUCCESS(10505, "暂降事件报告申请成功"),
|
||||
EVENTDETAILREPORTAPPLY_FAIL(10506, "暂降事件报告申请失败"),
|
||||
EVENTDETAILREPORTDOWNLOAD_SUCCESS(10507, "暂降事件报告下载成功"),
|
||||
EVENTDETAILREPORTDOWNLOAD_FAIL(10508, "暂降事件报告下载失败"),
|
||||
EVENTDETAILREPORTDOWNLOAD_NOT_FAIL(10513, "暂降事件报告下载失败,为查询到暂降信息"),
|
||||
EVENTDETAILREPORTDOWNLOAD_ERROR(10509, "报告下载未审核"),
|
||||
MARKETINGUSERINFO_SUCCESS(10510, "获取营销人员信息成功"),
|
||||
MARKETINGUSERINFO_FAIL(10511, "获取营销人员信息失败"),
|
||||
EVENTDETAILREPORTAPPLY_NODATA(10512, "事件暂无波形");
|
||||
|
||||
|
||||
EventMsgCodeEnum(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EventMsgCodeEnum{" +
|
||||
"code=" + code +
|
||||
", msg='" + msg + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.njcn.cloud.enums.app;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @date: 2019/10/25 10:49
|
||||
*/
|
||||
public class ReturnCode implements Serializable {
|
||||
|
||||
public static int RETURN_SUCCESS=10000;
|
||||
|
||||
public static int RETURN_FAIL=10001;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.njcn.cloud.enums.app;
|
||||
|
||||
/**
|
||||
* @description: 稳态越限返回指标
|
||||
* @author: gbl
|
||||
**/
|
||||
|
||||
public enum SteadyMsgCodeEnum {
|
||||
|
||||
GETSTATE_SUCCESS(10201, "获取稳态越限列表成功"),
|
||||
GETSTATE_FALL(10202, "获取稳态越限列表失败"),
|
||||
|
||||
GETSTATEINFO_SUCCESS(10203, "获取稳态越限列表详细信息成功"),
|
||||
GETSTATEINFO_FALL(10204, "获取稳态越限列表详细信息失败"),
|
||||
|
||||
GETTARGET_SUCCESS(10205, "获取稳态越限涉及指标成功"),
|
||||
GETTARGET_FALL(10206, "获取稳态越限涉及指标失败"),
|
||||
|
||||
GETTARGETURL_SUCCESS(10207, "获取稳态越限指标图形成功"),
|
||||
GETTARGETURL_FALL(10208, "获取稳态越限指标图形失败");
|
||||
|
||||
|
||||
SteadyMsgCodeEnum(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SteadyMsgCodeEnum{" +
|
||||
"code=" + code +
|
||||
", msg='" + msg + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.njcn.cloud.enums.app;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 指标编码
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 13:57
|
||||
*/
|
||||
public enum TypeCodeEnum {
|
||||
FLICKET_ALLTIME(1, "Flicket_AllTime"),
|
||||
FREQ_DEV_OVERTIME(2, "频率偏差越限"),
|
||||
VOLTAGE_DEV_OVERTIME(3, "电压偏差越限"),
|
||||
UBALANCE_OVERTIME(4, "电压不平衡越限"),
|
||||
FLICKER_OVERTIME(5, "闪变越限"),
|
||||
UABERRANCE_OVERTIME(6, "电压谐波畸变率越限"),
|
||||
UHARM_2_OVERTIME(7, "2次电压谐波含有率越限"),
|
||||
UHARM_3_OVERTIME(8, "3次电压谐波含有率越限"),
|
||||
UHARM_4_OVERTIME(9, "4次电压谐波含有率越限"),
|
||||
UHARM_5_OVERTIME(10, "5次电压谐波含有率越限"),
|
||||
UHARM_6_OVERTIME(11, "6次电压谐波含有率越限"),
|
||||
UHARM_7_OVERTIME(12, "7次电压谐波含有率越限"),
|
||||
UHARM_8_OVERTIME(13, "8次电压谐波含有率越限"),
|
||||
UHARM_9_OVERTIME(14, "9次电压谐波含有率越限"),
|
||||
UHARM_10_OVERTIME(15, "10次电压谐波含有率越限"),
|
||||
UHARM_11_OVERTIME(16, "11次电压谐波含有率越限"),
|
||||
UHARM_12_OVERTIME(17, "12次电压谐波含有率越限"),
|
||||
UHARM_13_OVERTIME(18, "13次电压谐波含有率越限"),
|
||||
UHARM_14_OVERTIME(19, "14次电压谐波含有率越限"),
|
||||
UHARM_15_OVERTIME(20, "15次电压谐波含有率越限"),
|
||||
UHARM_16_OVERTIME(21, "16次电压谐波含有率越限"),
|
||||
UHARM_17_OVERTIME(22, "17次电压谐波含有率越限"),
|
||||
UHARM_18_OVERTIME(23, "18次电压谐波含有率越限"),
|
||||
UHARM_19_OVERTIME(24, "19次电压谐波含有率越限"),
|
||||
UHARM_20_OVERTIME(25, "20次电压谐波含有率越限"),
|
||||
UHARM_21_OVERTIME(26, "21次电压谐波含有率越限"),
|
||||
UHARM_22_OVERTIME(27, "22次电压谐波含有率越限"),
|
||||
UHARM_23_OVERTIME(28, "23次电压谐波含有率越限"),
|
||||
UHARM_24_OVERTIME(29, "24次电压谐波含有率越限"),
|
||||
UHARM_25_OVERTIME(30, "25次电压谐波含有率越限"),
|
||||
IHARM_2_OVERTIME(31, "2次电流谐波幅值越限"),
|
||||
IHARM_3_OVERTIME(32, "3次电流谐波幅值越限"),
|
||||
IHARM_4_OVERTIME(33, "4次电流谐波幅值越限"),
|
||||
IHARM_5_OVERTIME(34, "5次电流谐波幅值越限"),
|
||||
IHARM_6_OVERTIME(35, "6次电流谐波幅值越限"),
|
||||
IHARM_7_OVERTIME(36, "7次电流谐波幅值越限"),
|
||||
IHARM_8_OVERTIME(37, "8次电流谐波幅值越限"),
|
||||
IHARM_9_OVERTIME(38, "9次电流谐波幅值越限"),
|
||||
IHARM_10_OVERTIME(39, "10次电流谐波幅值越限"),
|
||||
IHARM_11_OVERTIME(40, "11次电流谐波幅值越限"),
|
||||
IHARM_12_OVERTIME(41, "12次电流谐波幅值越限"),
|
||||
IHARM_13_OVERTIME(42, "13次电流谐波幅值越限"),
|
||||
IHARM_14_OVERTIME(43, "14次电流谐波幅值越限"),
|
||||
IHARM_15_OVERTIME(44, "15次电流谐波幅值越限"),
|
||||
IHARM_16_OVERTIME(45, "16次电流谐波幅值越限"),
|
||||
IHARM_17_OVERTIME(46, "17次电流谐波幅值越限"),
|
||||
IHARM_18_OVERTIME(47, "18次电流谐波幅值越限"),
|
||||
IHARM_19_OVERTIME(48, "19次电流谐波幅值越限"),
|
||||
IHARM_20_OVERTIME(49, "20次电流谐波幅值越限"),
|
||||
IHARM_21_OVERTIME(50, "21次电流谐波幅值越限"),
|
||||
IHARM_22_OVERTIME(51, "22次电流谐波幅值越限"),
|
||||
IHARM_23_OVERTIME(52, "23次电流谐波幅值越限"),
|
||||
IHARM_24_OVERTIME(53, "24次电流谐波幅值越限"),
|
||||
IHARM_25_OVERTIME(54, "25次电流谐波幅值越限");
|
||||
|
||||
private int code;
|
||||
|
||||
private String type;
|
||||
|
||||
TypeCodeEnum(int code, String type){
|
||||
this.code = code;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(int code){
|
||||
for (TypeCodeEnum typeCodeEnum : TypeCodeEnum.values()) {
|
||||
if (typeCodeEnum.code==code) {
|
||||
return typeCodeEnum.type;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static int getCodeByMsg(String type){
|
||||
for (TypeCodeEnum typeCodeEnum : TypeCodeEnum.values()) {
|
||||
if (typeCodeEnum.type.equalsIgnoreCase(type)) {
|
||||
return typeCodeEnum.code;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TypeCodeEnum{" +
|
||||
"code=" + code +
|
||||
", type='" + type + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.njcn.cloud.enums.app;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @date: 2019/10/17 14:07
|
||||
*
|
||||
* 用户返回标识枚举
|
||||
*/
|
||||
public enum UserCodeEnum {
|
||||
|
||||
|
||||
LOGIN_SUCCESS(10002,"登录成功"),
|
||||
LOGIN_FAIL(10003,"登录失败"),
|
||||
LOGIN_WRONG_PWD(10004,"用户名密码错误"),
|
||||
LOGIN_LOCKED(10005,"用户被锁定"),
|
||||
KEY_WRONG(10006,"登录密码/验证码为空"),
|
||||
PHONE_WRONG(10007,"手机号非法"),
|
||||
DEVCODE_WRONG(10008,"设备码非法"),
|
||||
CODE_WRONG(10009,"验证码为空"),
|
||||
USERID_WRONG(10010,"用户索引非法"),
|
||||
PASSWORD_WRONG(10011,"密码非法"),
|
||||
REGIST_SUCCESS(10012,"注册成功"),
|
||||
REGIST_FAIL(10013,"注册失败"),
|
||||
REGIST_PHONE_FAIL(10014,"该号码已注册"),
|
||||
SETPWD_SUCCESS(10015,"设置密码成功"),
|
||||
SETPWD_FAIL(10016,"设置密码失败"),
|
||||
RESETPWD_SUCCESS(10017,"重置密码成功"),
|
||||
RESETPWD_FAIL(10018,"重置密码失败"),
|
||||
REFERRAL_CODE_ERROR(10019,"推荐码非法"),
|
||||
UPDATE_ROLE_SUCCESS(10020,"角色升级成功"),
|
||||
UPDATE_ROLE_FAIL(10021,"角色升级失败"),
|
||||
CODE_TYPE_ERROR(10022,"验证码类型非法"),
|
||||
SEND_CODE_SUCCESS(10023,"验证码发送成功"),
|
||||
SEND_CODE_FAIL(10024,"验证码发送失败"),
|
||||
CODE_ERROR(10025,"验证码错误"),
|
||||
REST_PHONE_SUCCESS(10026,"重置手机号成功"),
|
||||
REST_PHONE_FAIL(10027,"重置手机号失败"),
|
||||
NO_APPINFOSET(10028,"用户无消息配置"),
|
||||
SET_INFO_SUCCESS(10029,"用户设置消息成功"),
|
||||
SET_INFO_FAIL(10030,"用户设置消息失败"),
|
||||
|
||||
NO_USER(10031,"用户不存在"),
|
||||
NO_MAIN_USER(10032,"用户缺失系统账户"),
|
||||
NO_USER_SETTING(10033,"用户缺失配置信息"),
|
||||
GET_MESSAGE_SUCCESS(10034,"获取消息配置成功"),
|
||||
GET_MESSAGE_FAIL(10035,"获取消息配置失败"),
|
||||
MESSAGE_CODE_RIGHT(10036,"验证码正确"),
|
||||
MESSAGE_CODE_WRONG(10037,"验证码错误"),
|
||||
|
||||
NO_USER_FOCUS(10038,"无用户关注"),
|
||||
EVENT_MSG_SUCCESS(10039,"暂态消息推送成功"),
|
||||
EVENT_MSG_FAIL(10040,"暂态消息推送失败"),
|
||||
REPEAT_EVENT_INFO(10041,"该事件已推送"),
|
||||
|
||||
STEADY_MSG_SUCCESS(10039,"稳态消息推送成功"),
|
||||
STEADY_MSG_FAIL(10040,"稳态消息推送失败"),
|
||||
|
||||
INVALID_PARAMETER(10041,"参数非法"),
|
||||
|
||||
DEVICE_MSG_SUCCESS(10039,"终端消息推送成功"),
|
||||
DEVICE_MSG_FAIL(10040,"终端消息推送失败"),
|
||||
NOT_NULL_USER_INDEX(11001,"用户编号不能为空"),
|
||||
|
||||
;
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
UserCodeEnum(int code,String msg){
|
||||
this.code=code;
|
||||
this.msg=msg;
|
||||
}
|
||||
|
||||
public int getCode(){
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg(){
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(int code){
|
||||
for (UserCodeEnum userCodeEnum : UserCodeEnum.values()) {
|
||||
if (userCodeEnum.code==code) {
|
||||
return userCodeEnum.msg;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
public static int getCodeByMsg(String msg){
|
||||
for (UserCodeEnum userCodeEnum : UserCodeEnum.values()) {
|
||||
if (userCodeEnum.msg.equalsIgnoreCase(msg)) {
|
||||
return userCodeEnum.code;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.cloud.enums.app;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @date: 2019/10/28 15:11
|
||||
*/
|
||||
public enum UserLevelEnum {
|
||||
|
||||
HOST_USER("0","主用户"),NORMAL_USER("1","普通用户"),VIP1_USER("2","用户VIP1");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
UserLevelEnum(String code,String msg){
|
||||
this.code=code;
|
||||
this.msg=msg;
|
||||
}
|
||||
|
||||
public String getCode(){
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg(){
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code){
|
||||
for (UserLevelEnum userLevelEnum : UserLevelEnum.values()) {
|
||||
if (userLevelEnum.code.equalsIgnoreCase(code)) {
|
||||
return userLevelEnum.msg;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
public static String getCodeByMsg(String msg){
|
||||
for (UserLevelEnum userLevelEnum : UserLevelEnum.values()) {
|
||||
if (userLevelEnum.msg.equalsIgnoreCase(msg)) {
|
||||
return userLevelEnum.code;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
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-01
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_event_info")
|
||||
@ApiModel(value = "AppEventInfo对象", description = "暂态消息详情")
|
||||
public class AppEventInfo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("(关联表PQS_EventDetail)事件总表Guid")
|
||||
@TableId("EventDetail_Index")
|
||||
private String eventdetailIndex;
|
||||
|
||||
@ApiModelProperty("对系统是否有影响(0:无;1:有)")
|
||||
@TableField("Evaluate")
|
||||
private Integer evaluate;
|
||||
|
||||
@ApiModelProperty("(关联app_user表User_Index)暂态评价人")
|
||||
@TableField("User_Index")
|
||||
private String userIndex;
|
||||
|
||||
@ApiModelProperty("评价时间")
|
||||
@TableField("Update_Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("瞬时波形资源路径")
|
||||
@TableField("InstantWave_Path")
|
||||
private String instantwavePath;
|
||||
|
||||
@ApiModelProperty("RMS资源路径")
|
||||
@TableField("RmsWave_Path")
|
||||
private String rmswavePath;
|
||||
|
||||
@ApiModelProperty("报告状态(1-成功,2-失败,3-成功待审核,4-失败待审核,自定义状态)")
|
||||
@TableField("Report_State")
|
||||
private Integer reportState;
|
||||
|
||||
@ApiModelProperty("报告的资源路径")
|
||||
@TableField("Report_Path")
|
||||
private String reportPath;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.cloud.pojo.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
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>
|
||||
* app暂态消息表
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-10-31
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_event_msg")
|
||||
@ApiModel(value = "AppEventMsg对象", description = "app暂态消息表")
|
||||
public class AppEventMsg {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("暂态消息Guid")
|
||||
@TableField("EventMsg_Index")
|
||||
private String eventmsgIndex;
|
||||
|
||||
@ApiModelProperty("(关联app_user表User_Index)权限用户id")
|
||||
@TableField("User_Index")
|
||||
private String userIndex;
|
||||
|
||||
@ApiModelProperty("(关联表PQS_EventDetail)事件总表Guid")
|
||||
@TableField("EventDetail_Index")
|
||||
private LocalDateTime eventdetailIndex;
|
||||
|
||||
@ApiModelProperty("读取状态(0:未读,1:已读,2:删除)")
|
||||
@TableField("state")
|
||||
private String state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
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-02
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_report")
|
||||
@ApiModel(value = "AppReport对象", description = "报告信息")
|
||||
public class AppReport {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("报告表Guid")
|
||||
@TableId("Report_Index")
|
||||
private String reportIndex;
|
||||
|
||||
@ApiModelProperty("报告名称")
|
||||
@TableField("Report_Name")
|
||||
private String reportName;
|
||||
|
||||
@ApiModelProperty("(关联Pq_Line的Line_Index)")
|
||||
@TableField("Line_Index")
|
||||
private String lineIndex;
|
||||
|
||||
@ApiModelProperty("(关联app_user表User_Index)自定义报表时填值")
|
||||
@TableField("User_Index")
|
||||
private String userIndex;
|
||||
|
||||
@ApiModelProperty("报告生成时间")
|
||||
@TableField("Update_Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("报告内容的起始时间")
|
||||
@TableField("Start_Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("报告内容的结束时间")
|
||||
@TableField("End_Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty("系统类型(1-暂态,2-稳态)")
|
||||
@TableField("System_Type")
|
||||
private Integer systemType;
|
||||
|
||||
@ApiModelProperty("报告类型(1-周报,2-月报,5-自定义)")
|
||||
@TableField("Report_Type")
|
||||
private Integer reportType;
|
||||
|
||||
@ApiModelProperty("报告的资源路径")
|
||||
@TableField("Report_Path")
|
||||
private String reportPath;
|
||||
|
||||
@ApiModelProperty("报告状态(1-成功,2-失败,3-待审核,4-删除)")
|
||||
@TableField("State")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty("记录报告生成失败次数")
|
||||
@TableField("Error_Count")
|
||||
private Integer errorCount;
|
||||
|
||||
@ApiModelProperty("暂态报告部门guid")
|
||||
@TableField("Depts_Index")
|
||||
private String deptsIndex;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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-10-31
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_send_msg")
|
||||
@ApiModel(value = "AppSendMsg对象", description = "手机短信存储表")
|
||||
public class AppSendMsg {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
@TableField("Phone")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("发送信息")
|
||||
@TableField("Message")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty("发送时间")
|
||||
@TableField("Send_Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
@ApiModelProperty("发送状态")
|
||||
@TableField("Send_Status")
|
||||
private String sendStatus;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
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-03
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_steady_ass")
|
||||
@ApiModel(value = "AppSteadyAss对象", description = "稳态消息详情")
|
||||
public class AppSteadyAss {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("稳态消息列表Guid")
|
||||
@TableField("Steady_Index")
|
||||
private String steadyIndex;
|
||||
|
||||
@ApiModelProperty("监测点Guid")
|
||||
@TableField("Line_Index")
|
||||
private String lineIndex;
|
||||
|
||||
@ApiModelProperty("统计时间")
|
||||
@TableField("Time_Id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeId;
|
||||
|
||||
|
||||
}
|
||||
@@ -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-03
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_steady_msg")
|
||||
@ApiModel(value = "AppSteadyMsg对象", description = "稳态消息")
|
||||
public class AppSteadyMsg {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("稳态消息列表Guid")
|
||||
@TableId("Steady_Index")
|
||||
private String steadyIndex;
|
||||
|
||||
@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("越限监测点数")
|
||||
@TableField("Line_Num")
|
||||
private Integer lineNum;
|
||||
|
||||
@ApiModelProperty("读取状态(0:未读,1:已读,2:删除)")
|
||||
@TableField("State")
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
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-03
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_steady_url")
|
||||
@ApiModel(value = "AppSteadyUrl对象", description = "稳态图形信息")
|
||||
public class AppSteadyUrl {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("监测点Guid")
|
||||
@TableField("Line_Index")
|
||||
private String lineIndex;
|
||||
|
||||
@ApiModelProperty("统计时间")
|
||||
@TableField("Time_Id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeId;
|
||||
|
||||
@ApiModelProperty("越线Code")
|
||||
@TableField("Type_Code")
|
||||
private Integer typeCode;
|
||||
|
||||
@ApiModelProperty("越线次数")
|
||||
@TableField("Limit_Num")
|
||||
private Integer limitNum;
|
||||
|
||||
@ApiModelProperty("监测点Guid")
|
||||
@TableField("Steady_Path")
|
||||
private String steadyPath;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
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 java.time.LocalDateTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-10-31
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("app_user")
|
||||
@ApiModel(value = "AppUser对象", description = "用户信息表")
|
||||
public class AppUser {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("用户表GUID")
|
||||
@TableId("user_index")
|
||||
private String userIndex;
|
||||
|
||||
@ApiModelProperty("用户别名")
|
||||
@TableField("Name")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("登录名")
|
||||
@TableField("Login_Name")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty("登录密码")
|
||||
@TableField("Password")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
@TableField("Phone")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("邮箱")
|
||||
@TableField("Email")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty("注册时间")
|
||||
@TableField("Register_Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime registerTime;
|
||||
|
||||
@ApiModelProperty("密码有效期字段(初始化的时候跟注册时间一样)")
|
||||
@TableField("Psd_Validity")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime psdValidity;
|
||||
|
||||
@ApiModelProperty("最后一次登录时间")
|
||||
@TableField("Login_Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime loginTime;
|
||||
|
||||
@ApiModelProperty("用户状态 0:删除; 1:正常; 2锁定;")
|
||||
@TableField("State")
|
||||
private Boolean state;
|
||||
|
||||
@ApiModelProperty("密码错误次数")
|
||||
@TableField("Login_Error_Times")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Integer loginErrorTimes;
|
||||
|
||||
@ApiModelProperty("第一次登陆错误的时间")
|
||||
@TableField("Login_First_Error_Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime loginFirstErrorTime;
|
||||
|
||||
@ApiModelProperty("营销人员名称(只针对主用户)")
|
||||
@TableField("Sem_Name")
|
||||
private String semName;
|
||||
|
||||
@ApiModelProperty("营销人员手机(只针对主用户)")
|
||||
@TableField("Sem_Phone")
|
||||
private String semPhone;
|
||||
|
||||
@ApiModelProperty("推荐码(新增主用户时候生成)")
|
||||
@TableField("Referral_Code")
|
||||
private String referralCode;
|
||||
|
||||
@ApiModelProperty("设备码")
|
||||
@TableField("Dev_Code")
|
||||
private String devCode;
|
||||
|
||||
@ApiModelProperty("用户类型")
|
||||
@TableField("User_Type")
|
||||
private String userType;
|
||||
|
||||
@ApiModelProperty("用户等级")
|
||||
@TableField("User_Level")
|
||||
private String userLevel;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
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,27 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.cloud.pojo.dto.AppSteadyMsg;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 稳态消息
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-11-03
|
||||
*/
|
||||
@Data
|
||||
public class AppSteadyMsgVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("稳态越线列表")
|
||||
private Page<AppSteadyMsg> page;
|
||||
|
||||
@ApiModelProperty("未读条数")
|
||||
private Integer unstate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 14:19
|
||||
*/
|
||||
@Data
|
||||
public class EventEigDetailVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 输出参数
|
||||
* 持续时间(单位秒)
|
||||
* hold_time_rms 有效值算法持续时间
|
||||
* hold_time_dq dq变换算法持续时间
|
||||
* 波形起始点(单位度)
|
||||
* POW_a A相波形起始点
|
||||
* POW_b B相波形起始点
|
||||
* POW_c C相波形起始点
|
||||
* 跳变段电压变化率(单位V/S)
|
||||
* Voltagechange_Va A相跳变段电压变化率
|
||||
* Voltagechange_Vb B相跳变段电压变化率
|
||||
* Voltagechange_Vc C相跳变段电压变化率
|
||||
* 分段信息
|
||||
* SEG_T_num 分段数目
|
||||
* SEG_T0_idx 原始分段位置
|
||||
* SEG_T_idx 修正分段位置
|
||||
* 有效值分段信息
|
||||
* SEG_RMS_T_num 分段数目
|
||||
* SEG_RMS_T_idx 分段位置
|
||||
* 特征幅值(单位V)
|
||||
* u_min_num 特征值个数
|
||||
* ua_min A相电压特征值
|
||||
* ub_min B相电压特征值
|
||||
* uc_min C相电压特征值
|
||||
* u3_min 三相电压特征值
|
||||
* order_min_idx 最小值位置
|
||||
* 相位跳变(单位度)
|
||||
* angle_diff_ap A相相位正跳变
|
||||
* angle_diff_bp B相相位正跳变
|
||||
* angle_diff_cp C相相位正跳变
|
||||
* angle_diff_an A相相位负跳变
|
||||
* angle_diff_bn B相相位负跳变
|
||||
* angle_diff_cn C相相位负跳变
|
||||
* bph_max_value 不平衡度(单位%)
|
||||
*/
|
||||
public float hold_time_dq;
|
||||
public float pow_a;
|
||||
public float pow_b;
|
||||
public float pow_c;
|
||||
public float voltagechange_Va;
|
||||
public float voltagechange_Vb;
|
||||
public float voltagechange_Vc;
|
||||
public float ua_min;
|
||||
public float ub_min;
|
||||
public float uc_min;
|
||||
public float angle_diff_ap;
|
||||
public float angle_diff_bp;
|
||||
public float angle_diff_cp;
|
||||
public float bph_max_value;
|
||||
public String sagReason; // 暂降原因描述,数据库获取
|
||||
public String sagType; // 暂降类型描述,数据库获取
|
||||
private Integer pttype;
|
||||
|
||||
@Data
|
||||
public static class Detail{
|
||||
List<EventEigDetailVO> list;
|
||||
Integer backNumber;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 13:17
|
||||
*/
|
||||
@Data
|
||||
public class EventInfoDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("供电公司名称")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String bdzName;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty("电压等级")
|
||||
private String scale;
|
||||
|
||||
@ApiModelProperty("ip")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("暂降事件id")
|
||||
private String eventDetailIndex;
|
||||
|
||||
@ApiModelProperty("触发时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("持续时间")
|
||||
private Float persistTime;
|
||||
|
||||
@ApiModelProperty("处理结果第一条事件发生时间毫秒")
|
||||
private Long ms;
|
||||
|
||||
@ApiModelProperty("特征幅值")
|
||||
private Float eventValue;
|
||||
|
||||
@ApiModelProperty("报告状态")
|
||||
private int report;
|
||||
|
||||
@ApiModelProperty("评价")
|
||||
private int evaluate;
|
||||
|
||||
@ApiModelProperty("报告路径")
|
||||
private String reportPath;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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.util.Date;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @return: null
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 9:56
|
||||
*/
|
||||
@Data
|
||||
public class EventMsgDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("监测点Id")
|
||||
private String lineIndex;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("暂降事件id")
|
||||
private String eventDetailIndex;
|
||||
|
||||
@ApiModelProperty("触发时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date timeID;
|
||||
|
||||
@ApiModelProperty("持续时间")
|
||||
private Float persistTime;
|
||||
|
||||
@ApiModelProperty("毫秒数")
|
||||
private Long ms;
|
||||
|
||||
@ApiModelProperty("特征幅值")
|
||||
private Float eventValue;
|
||||
|
||||
@ApiModelProperty("终端信息")
|
||||
private String lineInfo;
|
||||
|
||||
@ApiModelProperty("暂态消息")
|
||||
private String eventMsgIndex;
|
||||
|
||||
@ApiModelProperty("读取状态")
|
||||
private int state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 15:18
|
||||
*/
|
||||
@Data
|
||||
public class EventWaveDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("暂降事件id")
|
||||
private String eventDetailIndex;
|
||||
|
||||
@ApiModelProperty("瞬时波形URL")
|
||||
private String instantWaveUrl;
|
||||
|
||||
@ApiModelProperty("RMS波形URL")
|
||||
private String rmsWaveUrl;
|
||||
|
||||
@Data
|
||||
public static class Detail{
|
||||
@ApiModelProperty("暂降事件id")
|
||||
private String eventID;
|
||||
|
||||
@ApiModelProperty("监测点id")
|
||||
private String measurementPointId;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String measurementPointName;
|
||||
|
||||
@ApiModelProperty("波形地址")
|
||||
private String wavePath;
|
||||
|
||||
@ApiModelProperty("ip")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("pt变比")
|
||||
private Double pt;
|
||||
|
||||
@ApiModelProperty("ct变比")
|
||||
private Double ct;
|
||||
|
||||
@ApiModelProperty("接线方式")
|
||||
private Integer ptType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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,31 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import com.njcn.cloud.pojo.dto.AppSteadyAss;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/3 11:40
|
||||
*/
|
||||
@Data
|
||||
public class SteadyMsgDetailVO extends AppSteadyAss {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String subName;
|
||||
|
||||
@ApiModelProperty("越线次数")
|
||||
private Integer limitNum;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String describe;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description:稳态越限指标
|
||||
* @author gbl
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class SteadyTargetVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("指标编码")
|
||||
private Integer typeCode;
|
||||
|
||||
@ApiModelProperty("指标名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty("越线次数")
|
||||
private Integer limitNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.cloud.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2023/11/1 9:56
|
||||
*/
|
||||
@Data
|
||||
public class UserVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("角色名称")
|
||||
private String roleName;
|
||||
|
||||
@ApiModelProperty("角色码")
|
||||
private String roleCode;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.njcn.cloud.utils;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.security.Security;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @date: 2019/10/28 14:37
|
||||
*/
|
||||
public class AESUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AESUtil.class);
|
||||
|
||||
private static final String key ="f81804778c89c779";
|
||||
|
||||
private static final String EncryptAlg ="AES";
|
||||
|
||||
private static final String Cipher_Mode="AES/ECB/PKCS5Padding";
|
||||
|
||||
private static final String Encode="UTF-8";
|
||||
|
||||
private static final int Secret_Key_Size=16;
|
||||
|
||||
private static final String Key_Encode="UTF-8";
|
||||
|
||||
/**
|
||||
* @param content 加密内容
|
||||
* @return aes加密后 转base64
|
||||
*/
|
||||
public static String aesPKCS5PaddingEncrypt(String content) throws Exception {
|
||||
try {
|
||||
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
|
||||
Cipher cipher = Cipher.getInstance(Cipher_Mode);
|
||||
byte[] realKey=getSecretKey(key);
|
||||
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(realKey,EncryptAlg));
|
||||
byte[] data=cipher.doFinal(content.getBytes(Encode));
|
||||
String result=new Base64().encodeToString(data);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
throw new Exception("AES加密失败:content=" +content +" key="+key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* AES/ECB/PKCS7Padding 解密
|
||||
* @param content 解密内容
|
||||
* @return 先转base64 再解密
|
||||
*/
|
||||
public static String aesPKCS5PaddingDecrypt(String content) throws Exception {
|
||||
try {
|
||||
byte[] decodeBytes=Base64.decodeBase64(content);
|
||||
Cipher cipher = Cipher.getInstance(Cipher_Mode);
|
||||
byte[] realKey=getSecretKey(key);
|
||||
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(realKey,EncryptAlg));
|
||||
byte[] realBytes=cipher.doFinal(decodeBytes);
|
||||
return new String(realBytes, Encode);
|
||||
} catch (Exception e) {
|
||||
throw new Exception("AES解密失败:Aescontent = " +e.fillInStackTrace(),e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对密钥key进行处理:如密钥长度不够位数的则 以指定paddingChar 进行填充;
|
||||
* 此处用空格字符填充,也可以 0 填充,具体可根据实际项目需求做变更
|
||||
* @param key
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static byte[] getSecretKey(String key) throws Exception{
|
||||
final byte paddingChar=' ';
|
||||
|
||||
byte[] realKey = new byte[Secret_Key_Size];
|
||||
byte[] byteKey = key.getBytes(Key_Encode);
|
||||
for (int i =0;i<realKey.length;i++){
|
||||
if (i<byteKey.length){
|
||||
realKey[i] = byteKey[i];
|
||||
}else {
|
||||
realKey[i] = paddingChar;
|
||||
}
|
||||
}
|
||||
|
||||
return realKey;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.njcn.cloud.utils;
|
||||
|
||||
public class RedisDB {
|
||||
|
||||
/**
|
||||
* 保存数据库查询的数据
|
||||
* 除非用户数据改动才会发生更新的数据
|
||||
* 如:用户的角色、用户的部门、部门下能查看的监测点、变电站、终端、供电公司的索引等
|
||||
* 时间为:永久
|
||||
* 清除:角色、部门、部门下的等等在用户操作下进行增删改的时候清除缓存
|
||||
*/
|
||||
final static public int PERSISTENCE_QUERY = 10;
|
||||
|
||||
/***
|
||||
* 72小时,避免短信盗刷
|
||||
*/
|
||||
final static public int THREE_DAYS = 3600 * 72;
|
||||
final static public String SMS_IP = "smsIP:";
|
||||
final static public String SMS_PHONE = "smsPhone:";
|
||||
final static public String SMS_DEV_CODE = "smsDevCode:";
|
||||
|
||||
/**
|
||||
* 保存数据库查询的数据(短时间内不会更新的数据内容)
|
||||
* 比如:event_detail表中关联状态,当前日、月的暂降事件
|
||||
* 时间为:2小时
|
||||
*/
|
||||
final static public int LONG_TIME_QUERY = 9;
|
||||
final static public int LONG_TIME = 7200;
|
||||
|
||||
/**
|
||||
* 保存数据库查询的数据(时效性不长的数据内容)
|
||||
* 比如:用户登录后的用户信息的保存
|
||||
* 时间为:30分钟
|
||||
*/
|
||||
final static public int SHORT_TIME_QUERY = 8;
|
||||
final static public int SHORT_TIME = 1800;
|
||||
|
||||
|
||||
final static public int ONE_DAY_QUERY = 6;
|
||||
final static public int ONE_DAY_TIME = 3600 * 24;
|
||||
|
||||
|
||||
/**
|
||||
* 保存持久库key中的值,方便清除
|
||||
*/
|
||||
final static public int PER_KEY = 7;
|
||||
final static public String CON_DATA = "conData";
|
||||
final static public String DIC_DATA = "dicData";
|
||||
final static public String ROLE_DATA = "roleData";
|
||||
|
||||
/**
|
||||
* 保存归一化数据
|
||||
* MTRANS : 保存变压器矩阵数据
|
||||
*/
|
||||
final static public int NORMALIZ = 12;
|
||||
final static public String MTRANS = "MTRANS";
|
||||
final static public String EVENTASSOBJECT = "EVENTASSOBJECT";
|
||||
final static public String NODESORT = "NODESORT";
|
||||
|
||||
/**
|
||||
* shiro的Session存放的库
|
||||
* shiro摧毁session的时候,也会清理对应的redis中的session
|
||||
*/
|
||||
final static public int SESSION_DB = 1;
|
||||
final static public int SESSION_DB_TIME = 3600;
|
||||
|
||||
/**
|
||||
* 存放用户与sessionID对应关系的分片
|
||||
*/
|
||||
final static public int USER_SESSION = 2;
|
||||
|
||||
|
||||
/**
|
||||
* app短信验证码
|
||||
*/
|
||||
final static public int CODE_DB = 11;
|
||||
final static public int CODE_DB_TIME = 300;
|
||||
|
||||
/**
|
||||
* author:xuyang
|
||||
* 区域稳态指标超标
|
||||
* 告警变电站明细
|
||||
* 监测点稳态超标
|
||||
* 报表导出参数
|
||||
*/
|
||||
final static public int REPORTID = 15;
|
||||
final static public String AREAREPORTNAME = "AREAREPORT";
|
||||
final static public String MONITORREPORTNAME = "MONITORREPORT";
|
||||
final static public String SUBREPORTNAME = "SUBREPORT";
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.njcn.cloud.utils;
|
||||
|
||||
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.exceptions.ClientException;
|
||||
import com.aliyuncs.http.MethodType;
|
||||
import com.aliyuncs.profile.DefaultProfile;
|
||||
import com.aliyuncs.profile.IClientProfile;
|
||||
import com.njcn.cloud.config.Message;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.user.enums.MessageEnum;
|
||||
import com.njcn.user.enums.UserResponseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/8/25 13:51
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@AllArgsConstructor
|
||||
public class SmsUtil {
|
||||
|
||||
private final Message message;
|
||||
|
||||
/**
|
||||
* 短信API产品名称(短信产品名固定,无需修改)
|
||||
*/
|
||||
private static final String PRODUCT = "Dysmsapi";
|
||||
|
||||
/**
|
||||
* 短信API产品域名(接口地址固定,无需修改)
|
||||
*/
|
||||
private static final String DOMAIN = "dysmsapi.aliyuncs.com";
|
||||
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
private static final String AREA = "cn-hangzhou";
|
||||
|
||||
/**
|
||||
* 超时时间参数
|
||||
*/
|
||||
private static final String DEFAULTCONNECTTIMEOUT = "sun.net.client.defaultConnectTimeout";
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private static final String DEFAULTREADTIMEOUT = "sun.net.client.defaultReadTimeout";
|
||||
|
||||
|
||||
public static String getMessageTemplate(String type) {
|
||||
String msgTemplate = null;
|
||||
switch (type) {
|
||||
case "0":
|
||||
msgTemplate = MessageEnum.getTemplateByCode(0);
|
||||
break;
|
||||
case "1":
|
||||
msgTemplate = MessageEnum.getTemplateByCode(1);
|
||||
break;
|
||||
case "2":
|
||||
msgTemplate = MessageEnum.getTemplateByCode(2);
|
||||
break;
|
||||
case "3":
|
||||
msgTemplate = MessageEnum.getTemplateByCode(3);
|
||||
break;
|
||||
case "4":
|
||||
msgTemplate = MessageEnum.getTemplateByCode(4);
|
||||
break;
|
||||
case "5":
|
||||
msgTemplate = MessageEnum.getTemplateByCode(5);
|
||||
break;
|
||||
case "6":
|
||||
msgTemplate = MessageEnum.getTemplateByCode(6);
|
||||
break;
|
||||
case "7":
|
||||
msgTemplate = MessageEnum.getTemplateByCode(7);
|
||||
break;
|
||||
case "8":
|
||||
msgTemplate = MessageEnum.getTemplateByCode(8);
|
||||
break;
|
||||
default:
|
||||
throw new BusinessException(UserResponseEnum.CODE_TYPE_ERROR);
|
||||
}
|
||||
return msgTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
* @param phone 手机号
|
||||
* @param template 模板号
|
||||
* @param param 短信模板中定义的参数名称
|
||||
* @param value 参数实际值
|
||||
* @return sendSmsResponse 发送消息结果
|
||||
* @throws ClientException
|
||||
*/
|
||||
public SendSmsResponse sendSms(String phone, String template, String param, String value) throws ClientException {
|
||||
System.setProperty(DEFAULTCONNECTTIMEOUT, message.getTime());
|
||||
System.setProperty(DEFAULTREADTIMEOUT, message.getTime());
|
||||
//初始化ascClient,暂时不支持多region(请勿修改)
|
||||
IClientProfile profile = DefaultProfile.getProfile(AREA, message.getAccessKeyId(), message.getAccessKeySecret());
|
||||
DefaultProfile.addEndpoint(AREA, AREA, PRODUCT, DOMAIN);
|
||||
IAcsClient acsClient = new DefaultAcsClient(profile);
|
||||
SendSmsRequest request = new SendSmsRequest();
|
||||
request.setMethod(MethodType.POST);
|
||||
request.setPhoneNumbers(phone);
|
||||
//必填:短信签名-可在短信控制台中找到
|
||||
request.setSignName(message.getAutoGraph());
|
||||
//必填:短信模板-可在短信控制台中找到,发送国际/港澳台消息时,请使用国际/港澳台短信模版
|
||||
request.setTemplateCode(template);
|
||||
String code = "{\""+param+"\":\"" + value + "\"}";
|
||||
request.setTemplateParam(code);
|
||||
//请求失败这里会抛ClientException异常
|
||||
return acsClient.getAcsResponse(request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,344 @@
|
||||
package com.njcn.cloud.utils;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.njcn.cloud.pojo.vo.EventEigDetailVO;
|
||||
import com.njcn.cloud.pojo.vo.EventInfoDetailVO;
|
||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||
import org.apache.poi.util.Units;
|
||||
import org.apache.poi.xwpf.usermodel.*;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.*;
|
||||
import sun.misc.BASE64Decoder;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
public class WordUtil {
|
||||
private List<byte[]> listPic;
|
||||
private XWPFDocument document;
|
||||
private List<EventEigDetailVO> eventDetailEigenvalue;
|
||||
private EventInfoDetailVO eventInfoList;
|
||||
|
||||
public void setEventInfoList(EventInfoDetailVO eventInfoList) {
|
||||
this.eventInfoList = eventInfoList == null ? new EventInfoDetailVO() : eventInfoList;
|
||||
}
|
||||
|
||||
public void setEventDetailEigenvalue(List<EventEigDetailVO> eventDetailEigenvalue) {
|
||||
this.eventDetailEigenvalue = eventDetailEigenvalue == null ? new ArrayList<>() : eventDetailEigenvalue;
|
||||
}
|
||||
|
||||
public XWPFDocument getDocument() {
|
||||
return document;
|
||||
}
|
||||
|
||||
public WordUtil() {
|
||||
this.document = new XWPFDocument();
|
||||
listPic = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void translate(String... strPic) {
|
||||
BASE64Decoder decoder = new BASE64Decoder();
|
||||
|
||||
for (int i = 0; i < strPic.length; i++) {
|
||||
try {
|
||||
byte[] buffer = decoder.decodeBuffer(strPic[i]);
|
||||
listPic.add(buffer);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void createReport() throws IOException, InvalidFormatException {
|
||||
setHeadingStyle(this.document);
|
||||
|
||||
// 添加标题
|
||||
XWPFParagraph titleParagraph = getCenterParagraph(this.document);
|
||||
addLine(titleParagraph, 11);
|
||||
// 设置段落居中
|
||||
XWPFRun titleParagraphBigRun = titleParagraph.createRun();
|
||||
addParagraph(titleParagraphBigRun, "宋体", 28, "000000", "暂降事件报告", true);
|
||||
addLine(titleParagraph, 17);
|
||||
XWPFRun titleParagraphDateRun = titleParagraph.createRun();
|
||||
addParagraph(titleParagraphDateRun, "宋体", 16, "000000", "南京灿能电力自动化股份有限公司", false);
|
||||
addLine(titleParagraph, 1);
|
||||
titleParagraphDateRun = titleParagraph.createRun();
|
||||
addParagraph(titleParagraphDateRun, "宋体", 14, "000000", "生成时间:" + getRightNow(), false);
|
||||
addLine(titleParagraph, 8);
|
||||
titleParagraph = getLeftParagraph(this.document);
|
||||
titleParagraphDateRun = titleParagraph.createRun();
|
||||
addParagraph(titleParagraphDateRun, "宋体", 10, "000000", "【申明】本公司保留对报告的修改权,恕不另行通知,敬请关注最新版本。", false);
|
||||
createTitle(document, "1. 基本信息", "标题 1", 0, 15);
|
||||
XWPFParagraph introductionContentParagraph = getLeftParagraph(document);
|
||||
introductionContentParagraph.setIndentationFirstLine(200);
|
||||
XWPFRun introductionContentRun = introductionContentParagraph.createRun();
|
||||
String time = LocalDateTimeUtil.format(eventInfoList.getTimeID(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
|
||||
addParagraph(introductionContentRun, "宋体", 11, "000000",
|
||||
eventInfoList.getGdName() + "," + eventInfoList.getBdzName() + ",网络参数:" +
|
||||
eventInfoList.getIp() + "," + eventInfoList.getLineName() + "于" + time + "发生暂降事件,特征幅值:"
|
||||
+ String.valueOf(eventInfoList.getEventValue()) + "%,持续时间:" + eventInfoList.getPersistTime() + "s。",
|
||||
false);
|
||||
createTitle(document, "2. 波形图", "标题 1", 0, 15);
|
||||
if(listPic.size() == 2){
|
||||
createTitle(document, "2.1 瞬时波形图", "标题 2", 200, 11);
|
||||
createPic(document, "瞬时波形", listPic.get(0));
|
||||
createTitle(document, "2.2 RMS波形图", "标题 2", 200, 11);
|
||||
createPic(document, "RMS波形", listPic.get(1));
|
||||
}else{
|
||||
createTitle(document, "2.1 瞬时波形图", "标题 2", 200, 11);
|
||||
createPic(document, "瞬时波形1", listPic.get(0));
|
||||
createPic(document, "瞬时波形2", listPic.get(1));
|
||||
createTitle(document, "2.2 RMS波形图", "标题 2", 200, 11);
|
||||
createPic(document, "RMS波形3", listPic.get(2));
|
||||
createPic(document, "RMS波形4", listPic.get(3));
|
||||
}
|
||||
createTitle(document, "3. 多特征值", "标题 1", 0, 15);
|
||||
|
||||
XWPFParagraph value = getLeftParagraph(document);
|
||||
XWPFRun valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "事件总分段数:" + this.eventDetailEigenvalue.size(),
|
||||
false);
|
||||
addLine(value, 1);
|
||||
|
||||
if (this.eventDetailEigenvalue.size() == 0) {
|
||||
return;
|
||||
}
|
||||
valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "暂降原因:" + this.eventDetailEigenvalue.get(0).getSagReason(),
|
||||
false);
|
||||
addLine(value, 1);
|
||||
|
||||
for (int i = 0; i < this.eventDetailEigenvalue.size(); i++) {
|
||||
valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "分段" + (i + 1) + "多特征值",
|
||||
true);
|
||||
addLine(value, 1);
|
||||
valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "波形起始点相位(°):" + (this.eventDetailEigenvalue.get(0).getPttype() == 0 ? "A" : "AB") + "相" + this.eventDetailEigenvalue.get(i).getPow_a()
|
||||
+ " " + (this.eventDetailEigenvalue.get(0).getPttype() == 0 ? "B" : "BC") + "相" + this.eventDetailEigenvalue.get(i).getPow_b() + " " + ((this.eventDetailEigenvalue.get(0).getPttype() == 2) ? "" : ((this.eventDetailEigenvalue.get(0).getPttype() == 0 ? "C" : "CA") + "相" + this.eventDetailEigenvalue.get(i).getPow_c())),
|
||||
false);
|
||||
addLine(value, 1);
|
||||
valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "跳变段电压变化率(V/ms):" + (this.eventDetailEigenvalue.get(0).getPttype() == 0 ? "A" : "AB") + "相" + this.eventDetailEigenvalue.get(i).getVoltagechange_Va()
|
||||
+ " " + (this.eventDetailEigenvalue.get(0).getPttype() == 0 ? "B" : "BC") + "相" + this.eventDetailEigenvalue.get(i).getVoltagechange_Vb() + " " + ((this.eventDetailEigenvalue.get(0).getPttype() == 2) ? "" : ((this.eventDetailEigenvalue.get(0).getPttype() == 0 ? "C" : "CA") + "相" + this.eventDetailEigenvalue.get(i).getVoltagechange_Vc())),
|
||||
false);
|
||||
addLine(value, 1);
|
||||
valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "相位跳变(°):" + (this.eventDetailEigenvalue.get(0).getPttype() == 0 ? "A" : "AB") + "相" + this.eventDetailEigenvalue.get(i).getAngle_diff_ap()
|
||||
+ " " + (this.eventDetailEigenvalue.get(0).getPttype() == 0 ? "B" : "BC") + "相" + this.eventDetailEigenvalue.get(i).getAngle_diff_bp() + " " + ((this.eventDetailEigenvalue.get(0).getPttype() == 2) ? "" : ((this.eventDetailEigenvalue.get(0).getPttype() == 0 ? "C" : "CA") + "相" + this.eventDetailEigenvalue.get(i).getAngle_diff_cp())),
|
||||
false);
|
||||
/*addLine(value, 1);
|
||||
valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "特征幅值(V):A相" + this.eventDetailEigenvalue.get(i).getUa_min()
|
||||
+ " B相" + this.eventDetailEigenvalue.get(i).getUb_min() + " C相" + this.eventDetailEigenvalue.get(i).getUc_min(),
|
||||
false);*/
|
||||
/*addLine(value, 1);
|
||||
valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "持续时间(ms):" + this.eventDetailEigenvalue.get(i).getHold_time_dq(),
|
||||
false);*/
|
||||
addLine(value, 1);
|
||||
valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "三相电压不平衡度(%):" + this.eventDetailEigenvalue.get(i).getBph_max_value(),
|
||||
false);
|
||||
addLine(value, 1);
|
||||
valuex = value.createRun();
|
||||
addParagraph(valuex, "宋体", 11, "000000", "暂降类型:" + this.eventDetailEigenvalue.get(i).getSagType(),
|
||||
false);
|
||||
addLine(value, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void createPic(XWPFDocument document, String name, byte[] base64Info) throws IOException, InvalidFormatException {
|
||||
XWPFParagraph picParagraph = getCenterParagraph(document);
|
||||
XWPFRun createRun = picParagraph.createRun();
|
||||
InputStream in = new ByteArrayInputStream(base64Info);
|
||||
createRun.addPicture(in, 5, name, Units.toEMU(410), Units.toEMU(400));
|
||||
}
|
||||
|
||||
public void createTitle(XWPFDocument document, String message, String style, int line, int fontSize) {
|
||||
XWPFParagraph summaeTableParagraph = getLeftParagraph(document);
|
||||
summaeTableParagraph.setStyle(style);
|
||||
summaeTableParagraph.setIndentationFirstLine(line);
|
||||
XWPFRun summaeTableRun = summaeTableParagraph.createRun();
|
||||
addParagraph(summaeTableRun, "宋体", fontSize, "000000", message, false);
|
||||
}
|
||||
|
||||
public void setParagraphStyle(XWPFParagraph paragraph) {
|
||||
paragraph.setSpacingBefore(100);
|
||||
paragraph.setSpacingAfter(100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回指定格式的段落 居中型
|
||||
*
|
||||
* @param document 文档对象
|
||||
*/
|
||||
public XWPFParagraph getCenterParagraph(XWPFDocument document) {
|
||||
XWPFParagraph paragraph = document.createParagraph();
|
||||
setParagraphStyle(paragraph);
|
||||
paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
paragraph.setVerticalAlignment(TextAlignment.CENTER);
|
||||
return paragraph;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回指定格式的段落 居左型
|
||||
*
|
||||
* @param document 文档对象
|
||||
*/
|
||||
public XWPFParagraph getLeftParagraph(XWPFDocument document) {
|
||||
XWPFParagraph paragraph = document.createParagraph();
|
||||
setParagraphStyle(paragraph);
|
||||
paragraph.setAlignment(ParagraphAlignment.LEFT);
|
||||
return paragraph;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加换行符
|
||||
*
|
||||
* @param paragraph 指定段落
|
||||
* @param amount 行数
|
||||
*/
|
||||
public void addLine(XWPFParagraph paragraph, Integer amount) {
|
||||
XWPFRun run = paragraph.createRun();
|
||||
run.setFontSize(11);
|
||||
for (int i = 0; i < amount; i++) {
|
||||
run.addCarriageReturn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加段落文本
|
||||
*
|
||||
* @param run 文本执行对象
|
||||
* @param fontFamily 字体类型
|
||||
* @param fontSize 字体大小
|
||||
* @param backgroundColor 字体颜色
|
||||
* @param bold 是否加粗
|
||||
*/
|
||||
public void addParagraph(XWPFRun run, String fontFamily, Integer fontSize, String backgroundColor, String message, boolean bold) {
|
||||
run.setText(message);
|
||||
run.setColor(backgroundColor);
|
||||
run.setFontSize(fontSize);
|
||||
run.setFontFamily(fontFamily);
|
||||
run.setBold(bold);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 增加自定义标题样式。这里用的是stackoverflow的源码
|
||||
*
|
||||
* @param docxDocument 目标文档
|
||||
* @param strStyleId 样式名称
|
||||
* @param headingLevel 样式级别
|
||||
*/
|
||||
public void addCustomHeadingStyle(XWPFDocument docxDocument, String strStyleId, int headingLevel) {
|
||||
|
||||
CTStyle ctStyle = CTStyle.Factory.newInstance();
|
||||
ctStyle.setStyleId(strStyleId);
|
||||
|
||||
CTString styleName = CTString.Factory.newInstance();
|
||||
styleName.setVal(strStyleId);
|
||||
ctStyle.setName(styleName);
|
||||
|
||||
CTDecimalNumber indentNumber = CTDecimalNumber.Factory.newInstance();
|
||||
indentNumber.setVal(BigInteger.valueOf(headingLevel));
|
||||
|
||||
// lower number > style is more prominent in the formats bar
|
||||
ctStyle.setUiPriority(indentNumber);
|
||||
|
||||
CTOnOff onoffnull = CTOnOff.Factory.newInstance();
|
||||
ctStyle.setUnhideWhenUsed(onoffnull);
|
||||
|
||||
// style shows up in the formats bar
|
||||
ctStyle.setQFormat(onoffnull);
|
||||
|
||||
// style defines a heading of the given level
|
||||
CTPPr ppr = CTPPr.Factory.newInstance();
|
||||
ppr.setOutlineLvl(indentNumber);
|
||||
ctStyle.setPPr(ppr);
|
||||
|
||||
XWPFStyle style = new XWPFStyle(ctStyle);
|
||||
|
||||
// is a null op if already defined
|
||||
XWPFStyles styles = docxDocument.createStyles();
|
||||
|
||||
style.setType(STStyleType.PARAGRAPH);
|
||||
styles.addStyle(style);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置文档中标题格式
|
||||
*/
|
||||
public void setHeadingStyle(XWPFDocument document) {
|
||||
addCustomHeadingStyle(document, "标题 1", 1);
|
||||
addCustomHeadingStyle(document, "标题 2", 2);
|
||||
addCustomHeadingStyle(document, "标题 3", 3);
|
||||
addCustomHeadingStyle(document, "标题 4", 4);
|
||||
addCustomHeadingStyle(document, "标题 5", 5);
|
||||
addCustomHeadingStyle(document, "标题 6", 6);
|
||||
addCustomHeadingStyle(document, "标题 7", 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给表格添加一行数据
|
||||
*
|
||||
* @param paragraph 段落对象
|
||||
* @param row 行对象
|
||||
* @param data 不定长度的数据
|
||||
*/
|
||||
public void setExcelContent(XWPFParagraph paragraph, XWPFTableRow row, String... data) {
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
XWPFRun run = paragraph.createRun();
|
||||
run.setFontFamily("宋体");
|
||||
run.setText(data[i]);
|
||||
row.getCell(i).setParagraph(paragraph);
|
||||
paragraph.removeRun(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加表头标题一行数据
|
||||
*
|
||||
* @param paragraph 段落对象
|
||||
* @param row 行对象
|
||||
* @param data 不定长度的数据
|
||||
*/
|
||||
public void setExcelHeadContent(XWPFParagraph paragraph, XWPFTableRow row, String... data) {
|
||||
XWPFRun run = paragraph.createRun();
|
||||
run.setFontFamily("宋体");
|
||||
run.setBold(true);
|
||||
run.setText(data[0]);
|
||||
row.getCell(0).setParagraph(paragraph);
|
||||
paragraph.removeRun(0);
|
||||
for (int i = 1; i < data.length; i++) {
|
||||
XWPFRun run1 = paragraph.createRun();
|
||||
run1.setFontFamily("宋体");
|
||||
run1.setBold(true);
|
||||
run1.setText(data[i]);
|
||||
row.addNewTableCell().setParagraph(paragraph);
|
||||
paragraph.removeRun(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前的日期
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getRightNow() {
|
||||
Calendar rightNow = Calendar.getInstance();
|
||||
Integer year = rightNow.get(Calendar.YEAR);
|
||||
Integer month = rightNow.get(Calendar.MONTH) + 1;
|
||||
Integer day = rightNow.get(rightNow.DAY_OF_MONTH);
|
||||
return year + "年" + month + "月" + day + "日";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user