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 + "日";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
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.EventEigDetailVO;
|
||||||
|
import com.njcn.cloud.pojo.vo.EventInfoDetailVO;
|
||||||
|
import com.njcn.cloud.pojo.vo.EventMsgDetailVO;
|
||||||
|
import com.njcn.cloud.pojo.vo.EventWaveDetailVO;
|
||||||
|
import com.njcn.cloud.service.user.IAppEventInfoService;
|
||||||
|
import com.njcn.cloud.service.user.IAppEventMsgService;
|
||||||
|
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.web.controller.BaseController;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 暂态消息业务层
|
||||||
|
* @author: denghuajun
|
||||||
|
* @time: 2019-10-17 14:33:55
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/eventmsg")
|
||||||
|
@Api(tags = "暂态消息接口")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class EventMsgController extends BaseController {
|
||||||
|
|
||||||
|
private final IAppEventMsgService eventMsgService;
|
||||||
|
private final IAppEventInfoService eventInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂态消息获取
|
||||||
|
*/
|
||||||
|
@PostMapping("/eventDetailList")
|
||||||
|
@ApiOperation(value = "暂态消息获取入口", notes = "暂态消息")
|
||||||
|
public HttpResult<Page<EventMsgDetailVO>> eventDetailList(@RequestBody BaseParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventDetailList");
|
||||||
|
if (StrUtil.isBlank(param.getSearchValue())) {
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
||||||
|
}
|
||||||
|
Page<EventMsgDetailVO> page = eventMsgService.eventMsgPage(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂态事件基本信息获取
|
||||||
|
*/
|
||||||
|
@PostMapping("/eventDetailBaseInfo")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "eventMsgIndex", value = "暂态消息id", required = true, paramType = "query"),
|
||||||
|
})
|
||||||
|
@ApiOperation(value = "暂态事件基本信息入口", notes = "暂态事件基本信息")
|
||||||
|
public HttpResult<EventInfoDetailVO> eventDetailBaseInfo(String eventMsgIndex) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventDetailBaseInfo");
|
||||||
|
if (StrUtil.isBlank(eventMsgIndex)) {
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.eventDetailIndex_WRONG.getMsg());
|
||||||
|
}
|
||||||
|
EventInfoDetailVO eventInfoList = eventMsgService.eventInfoDetail(eventMsgIndex);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eventInfoList, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂态事件特征幅值
|
||||||
|
*/
|
||||||
|
@PostMapping("/eventDetailEigenvalue")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "eventDetailIndex", value = "暂降事件id", required = true, paramType = "query"),
|
||||||
|
})
|
||||||
|
@ApiOperation(value = "暂态事件特征幅值入口", notes = "暂态事件特征幅值")
|
||||||
|
public HttpResult<EventEigDetailVO.Detail> eventDetailEigenvalue(String eventDetailIndex) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventDetailEigenvalue");
|
||||||
|
if (StrUtil.isBlank(eventDetailIndex)) {
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.eventDetailIndex_WRONG.getMsg());
|
||||||
|
}
|
||||||
|
EventEigDetailVO.Detail detail = eventInfoService.eventDetailEigenvalue(eventDetailIndex);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, detail, methodDescribe);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂态事件波形图
|
||||||
|
*/
|
||||||
|
@PostMapping("/eventDetailWave")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "eventDetailIndex", value = "暂降事件id", required = true, paramType = "query"),
|
||||||
|
})
|
||||||
|
@ApiOperation(value = "暂态事件波形图入口", notes = "暂态事件波形图")
|
||||||
|
public HttpResult<EventWaveDetailVO> eventDetailWave(String eventDetailIndex) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventDetailWave");
|
||||||
|
if (StrUtil.isBlank(eventDetailIndex)) {
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.eventDetailIndex_WRONG.getMsg());
|
||||||
|
}
|
||||||
|
EventWaveDetailVO vo = eventInfoService.eventDetailWave(eventDetailIndex);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂态评价
|
||||||
|
*/
|
||||||
|
@PostMapping("/eventDetailEvaluate")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "eventDetailIndex", value = "暂降事件id", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "evaluate", value = "暂态评价", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
|
||||||
|
})
|
||||||
|
@ApiOperation(value = "暂态评价入口", notes = "暂态评价获取")
|
||||||
|
public HttpResult<Boolean> eventDetailEvaluate(String eventDetailIndex, int evaluate, String userId) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventDetailEvaluate");
|
||||||
|
if (StrUtil.isBlank(eventDetailIndex)) {
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.eventDetailIndex_WRONG.getMsg());
|
||||||
|
}
|
||||||
|
Boolean aBoolean = eventInfoService.eventDetailEvaluate(eventDetailIndex, evaluate, userId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, aBoolean, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
package com.njcn.cloud.controller.information;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.njcn.cloud.enums.app.EventMsgCodeEnum;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSteadyUrl;
|
||||||
|
import com.njcn.cloud.pojo.vo.AppSteadyMsgVO;
|
||||||
|
import com.njcn.cloud.pojo.vo.SteadyMsgDetailVO;
|
||||||
|
import com.njcn.cloud.pojo.vo.SteadyTargetVO;
|
||||||
|
import com.njcn.cloud.service.user.IAppSteadyMsgService;
|
||||||
|
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.web.controller.BaseController;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
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: gbl
|
||||||
|
* @time: 2019-11-27
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/steadymsg")
|
||||||
|
@Api(tags = "稳态消息接口")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SteadyMsgController extends BaseController {
|
||||||
|
|
||||||
|
private final IAppSteadyMsgService steadyAssService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 稳态越限列表
|
||||||
|
* @param param
|
||||||
|
* @return: com.njcn.common.pojo.response.HttpResult<com.njcn.cloud.pojo.vo.AppSteadyMsgVO>
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/3 15:02
|
||||||
|
*/
|
||||||
|
@PostMapping("steadyState")
|
||||||
|
@ApiOperation(value = "稳态越限列表", notes = "稳态越限列表")
|
||||||
|
public HttpResult<AppSteadyMsgVO> steadyState(@RequestBody BaseParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventDetailList");
|
||||||
|
if (StrUtil.isBlank(param.getSearchValue())) {
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
||||||
|
}
|
||||||
|
AppSteadyMsgVO steadyState = steadyAssService.getSteadyState(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, steadyState, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 稳态越限列表详细信息
|
||||||
|
* @param steadyIndex 稳态越限列表ID
|
||||||
|
* @return:
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/3 15:02
|
||||||
|
*/
|
||||||
|
@PostMapping("steadyStateInfo")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "steadyIndex", value = "稳态越限列表ID", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
@ApiOperation(value = "稳态越限列表详细信息", notes = "稳态越限详细信息")
|
||||||
|
public HttpResult<List<SteadyMsgDetailVO>> steadyStateInfo(String steadyIndex) {
|
||||||
|
String methodDescribe = getMethodDescribe("steadyStateInfo");
|
||||||
|
List<SteadyMsgDetailVO> steadyDetail = steadyAssService.getSteadyDetail(steadyIndex);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, steadyDetail, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 稳态越限涉及指标
|
||||||
|
* @param lineIndex
|
||||||
|
* @param timeID
|
||||||
|
* @return: ResponseData
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/3 16:23
|
||||||
|
*/
|
||||||
|
@PostMapping("/steadyTarget")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "lineIndex", value = "监测点ID", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "timeID", value = "统计时间", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
@ApiOperation(value = "稳态越限涉及指标", notes = "稳态越限指标")
|
||||||
|
public HttpResult<List<SteadyTargetVO>> steadyTarget(String lineIndex,String timeID) {
|
||||||
|
String methodDescribe = getMethodDescribe("steadyTarget");
|
||||||
|
List<SteadyTargetVO> steadyTarget = steadyAssService.getSteadyTarget(lineIndex, timeID);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, steadyTarget, methodDescribe);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 稳态越限指标图形
|
||||||
|
* @param lineIndex
|
||||||
|
* @param timeID
|
||||||
|
* @param typeCode
|
||||||
|
* @return: com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.cloud.pojo.vo.SteadyTargetVO>>
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/3 16:25
|
||||||
|
*/
|
||||||
|
@PostMapping("/steadyTargetUrl")
|
||||||
|
@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> steadyTargetUrl(String lineIndex,String timeID,Integer typeCode) {
|
||||||
|
String methodDescribe = getMethodDescribe("steadyTargetUrl");
|
||||||
|
AppSteadyUrl steadyTargetUrl = steadyAssService.getSteadyTargetUrl(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;
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.njcn.cloud.controller.report;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.njcn.cloud.enums.app.EventMsgCodeEnum;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppEventInfo;
|
||||||
|
import com.njcn.cloud.service.user.IAppReportService;
|
||||||
|
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.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/report")
|
||||||
|
@Api(tags = "报告查询接口")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ShiningReportController extends BaseController {
|
||||||
|
private final IAppReportService shiningReportService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/eventDetailReportApply")
|
||||||
|
@ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query")
|
||||||
|
, @ApiImplicitParam(name = "eventDetailIndex", value = "暂降事件ID", required = true, paramType = "query")})
|
||||||
|
@ApiOperation(value = "暂降事件报告申请入口", notes = "暂降事件报告申请")
|
||||||
|
public HttpResult<String> eventDetailReportApply(@RequestParam("userId") String userId, @RequestParam("eventDetailIndex") String eventDetailIndex) throws Exception {
|
||||||
|
String methodDescribe = getMethodDescribe("eventDetailReportApply");
|
||||||
|
if (StrUtil.isBlank(eventDetailIndex) && StrUtil.isBlank(userId)) {
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.eventDetailIndex_WRONG.getMsg());
|
||||||
|
}
|
||||||
|
String result = shiningReportService.eventDetailReportApply(userId, eventDetailIndex);
|
||||||
|
if ("2".equals(result)) {
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.EVENTDETAILREPORTAPPLY_NODATA.getMsg());
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/eventDetailReportDownLoad")
|
||||||
|
@ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query")
|
||||||
|
, @ApiImplicitParam(name = "eventDetailIndex", value = "暂降事件ID", required = true, paramType = "query")})
|
||||||
|
@ApiOperation(value = "暂降事件报告下载入口", notes = "暂降事件报告下载")
|
||||||
|
public HttpResult<String> eventDetailReportDownLoad(@RequestParam("userId") String userId, @RequestParam("eventDetailIndex") String eventDetailIndex) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventDetailReportDownLoad");
|
||||||
|
AppEventInfo downLoadPath = shiningReportService.getDownLoadPath(userId, eventDetailIndex);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, downLoadPath.getReportPath(), methodDescribe);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,594 @@
|
|||||||
|
package com.njcn.cloud.controller.user;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.njcn.cloud.enums.app.UserCodeEnum;
|
||||||
|
import com.njcn.cloud.pojo.vo.UserVO;
|
||||||
|
import com.njcn.cloud.service.user.IAppUserService;
|
||||||
|
import com.njcn.cloud.utils.AESUtil;
|
||||||
|
import com.njcn.cloud.utils.RedisDB;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
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/9/19 18:04
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/user")
|
||||||
|
@Api(tags = "用户操作接口")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class UserController extends BaseController {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(UserController.class);
|
||||||
|
|
||||||
|
private final IAppUserService appUserService;
|
||||||
|
|
||||||
|
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取(登录、注册、忘记密码、重新绑定手机)验证码
|
||||||
|
*/
|
||||||
|
@PostMapping("authCode")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "type", value = "验证码类型", required = true, paramType = "query"),
|
||||||
|
})
|
||||||
|
@ApiOperation(value = "获取验证码", notes = "获取验证码")
|
||||||
|
public HttpResult<Boolean> authCode(String phone, String devCode, String type, HttpServletRequest request) {
|
||||||
|
//判断是否为黑客攻击
|
||||||
|
// if (judgeAttachInterface(devCode, request, phone)) {
|
||||||
|
// return HttpResultUtil.assembleResult(UserCodeEnum.SEND_CODE_FAIL.getCode()+"", null, UserCodeEnum.SEND_CODE_FAIL.getMsg());
|
||||||
|
// }
|
||||||
|
System.out.println("获取验证码的请求信息,手机号:" + phone + ",设备码为:" + devCode);
|
||||||
|
try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
appUserService.setMessage(phone, devCode, type);
|
||||||
|
return HttpResultUtil.assembleResult(UserCodeEnum.SEND_CODE_SUCCESS.getCode()+"", null, UserCodeEnum.SEND_CODE_SUCCESS.getMsg());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("发送短信异常,异常为:" + e.getMessage());
|
||||||
|
if (e.getMessage().length() < 10) {
|
||||||
|
return HttpResultUtil.assembleResult(UserCodeEnum.getCodeByMsg(e.getMessage())+"", null, e.getMessage());
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleResult(UserCodeEnum.SEND_CODE_FAIL.getCode()+"", null, UserCodeEnum.SEND_CODE_FAIL.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机app登录入口
|
||||||
|
*/
|
||||||
|
@PostMapping("login")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "type", value = "登录类型", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "key", value = "验证码/密码", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
})
|
||||||
|
@ApiOperation(value = "登录入口", notes = "APP登录")
|
||||||
|
public HttpResult<UserVO> login(String phone, String type, String key, String devCode, HttpServletRequest request) {
|
||||||
|
|
||||||
|
if (StringUtils.isBlank(key)) {
|
||||||
|
return HttpResultUtil.assembleResult(UserCodeEnum.KEY_WRONG.getCode()+"", null, UserCodeEnum.KEY_WRONG.getMsg());
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(devCode)) {
|
||||||
|
return HttpResultUtil.assembleResult(UserCodeEnum.DEVCODE_WRONG.getCode()+"", null, UserCodeEnum.DEVCODE_WRONG.getMsg());
|
||||||
|
}
|
||||||
|
UserVO userResult = new UserVO();
|
||||||
|
logger.info("controller更新手机id:" + devCode);
|
||||||
|
try {
|
||||||
|
devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// TokenManager.appLogin(phone, type, key, devCode, ProjectEnum.APP.getItem());
|
||||||
|
// AppUser appUser = (AppUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
// userResult.setPhone(appUser.getPhone());
|
||||||
|
// userResult.setRoleCode(appUser.getUserLevel());
|
||||||
|
// userResult.setUserName(StringUtils.isEmpty(appUser.getName()) ? null : appUser.getName());
|
||||||
|
// userResult.setRoleName(UserLevelEnum.getMsgByCode(appUser.getUserLevel()));
|
||||||
|
// userResult.setUserId(appUser.getUserIndex());
|
||||||
|
return HttpResultUtil.assembleResult(UserCodeEnum.LOGIN_SUCCESS.getCode()+"", userResult, UserCodeEnum.LOGIN_SUCCESS.getMsg());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("app用户登录异常:" + e.toString());
|
||||||
|
if (e.getMessage().length() < 10) {
|
||||||
|
return HttpResultUtil.assembleResult(UserCodeEnum.getCodeByMsg(e.getMessage())+"", null, e.getMessage());
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleResult(UserCodeEnum.LOGIN_FAIL.getCode()+"", null, UserCodeEnum.LOGIN_FAIL.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 判断当前请求是否为黑客攻击
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/8/25 11:07
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private boolean judgeAttachInterface(String devCode, HttpServletRequest request, String phone) {
|
||||||
|
boolean flag = false;
|
||||||
|
//针对设备码
|
||||||
|
if (judgeDevCode(devCode)) {
|
||||||
|
flag = true;
|
||||||
|
//判断手机号是否在黑名单
|
||||||
|
} else if (judgeSmsPhone(phone)) {
|
||||||
|
flag = true;
|
||||||
|
//针对ip限制,避免盗刷
|
||||||
|
} else if (judgeRequestIp(request)) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 紧急处理,后期app需要加上滑块移动验证
|
||||||
|
* @author hongawen
|
||||||
|
* 加上设备码限制,
|
||||||
|
* 如果同一设备码72小时内超过6次,则立即返回
|
||||||
|
* 如果72小时内超过30次,则彻底封杀该设备码
|
||||||
|
*/
|
||||||
|
private boolean judgeDevCode(String devCode) {
|
||||||
|
boolean flag = true;
|
||||||
|
String valueByPhone = redisUtil.getStringByKey(RedisDB.CODE_DB,RedisDB.SMS_DEV_CODE.concat(devCode));
|
||||||
|
int times = StrUtil.isBlank(valueByPhone) ? 0 : Integer.parseInt(valueByPhone);
|
||||||
|
times++;
|
||||||
|
if (times < 6) {
|
||||||
|
//合理范围内,缓存
|
||||||
|
flag = false;
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisDB.CODE_DB, RedisDB.SMS_DEV_CODE.concat(devCode), String.valueOf(times), RedisDB.THREE_DAYS);
|
||||||
|
} else if (times < 30) {
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisDB.CODE_DB, RedisDB.SMS_DEV_CODE.concat(devCode), String.valueOf(times), RedisDB.THREE_DAYS);
|
||||||
|
} else {
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisDB.CODE_DB, RedisDB.SMS_DEV_CODE.concat(devCode), String.valueOf(times), -1);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
for (int i = 0; i < 100; i++) {
|
||||||
|
testFloop(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void testFloop(int i) {
|
||||||
|
i++;
|
||||||
|
if (i < 6) {
|
||||||
|
System.out.println(i);
|
||||||
|
} else if (i > 30) {
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 判断手机号是否在黑名单
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/8/24 20:06
|
||||||
|
* @param phone 手机号
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private boolean judgeSmsPhone(String phone) {
|
||||||
|
String valueByPhone = redisUtil.getStringByKey(RedisDB.CODE_DB, RedisDB.SMS_PHONE.concat(phone));
|
||||||
|
return !StrUtil.isBlank(valueByPhone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 紧急处理,后期app需要加上滑块移动验证
|
||||||
|
* @author hongawen
|
||||||
|
* 加上ip限制,
|
||||||
|
* 如果同一ip72小时内超过6次,则立即返回
|
||||||
|
* 如果72小时内超过30次,则彻底封杀该ip
|
||||||
|
*/
|
||||||
|
private boolean judgeRequestIp(HttpServletRequest request) {
|
||||||
|
boolean flag = true;
|
||||||
|
//获取过来的ip可能有多个,通过','分割后,取第一个,并且仅仅关心ip的前两个数据范围xxx.xxx.*.*;
|
||||||
|
String clientIpAddress = RequestUtil.getRealIp(request);
|
||||||
|
String ip = RedisDB.SMS_IP + clientIpAddress;
|
||||||
|
String ipValue = redisUtil.getStringByKey(RedisDB.CODE_DB, ip);
|
||||||
|
int times = StrUtil.isBlank(ipValue) ? 0 : Integer.parseInt(ipValue);
|
||||||
|
logger.error("{}来获取短信验证码,最近72小时内,已经请求了{}次", ip, times);
|
||||||
|
times++;
|
||||||
|
if (times < 6) {
|
||||||
|
//合理范围内,缓存
|
||||||
|
flag = false;
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisDB.CODE_DB, ip, String.valueOf(times), RedisDB.THREE_DAYS);
|
||||||
|
} else if (times < 30) {
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisDB.CODE_DB, ip, String.valueOf(times), RedisDB.THREE_DAYS);
|
||||||
|
}else {
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisDB.CODE_DB, ip, String.valueOf(times), -1);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 查找ip前2个255详细信息
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/8/25 9:59
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public static int findNthCharacterIndex(String input, char targetChar, int n) {
|
||||||
|
int count = 0;
|
||||||
|
for (int i = 0; i < input.length(); i++) {
|
||||||
|
if (input.charAt(i) == targetChar) {
|
||||||
|
count++;
|
||||||
|
if (count == n) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 手机app注册
|
||||||
|
// */
|
||||||
|
// @PostMapping("register")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "code", value = "验证码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "注册入口", notes = "用户注册", response = ResponseData.class)
|
||||||
|
// public ResponseData register(String phone, String code, String devCode) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// //参数校验
|
||||||
|
// if (!PubUtils.patternPhone(XssFilterUtil.dealString(phone))) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.PHONE_WRONG.getCode(), UserCodeEnum.PHONE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// if (StringUtils.isBlank(devCode)) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.DEVCODE_WRONG.getCode(), UserCodeEnum.DEVCODE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// UserResult userResult;
|
||||||
|
// logger.info("controller更新手机id:" + devCode);
|
||||||
|
// try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// userResult = appUserService.register(phone, code, devCode);
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.REGIST_SUCCESS.getCode(), UserCodeEnum.REGIST_SUCCESS.getMsg(), userResult);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// 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.REGIST_FAIL.getCode(), UserCodeEnum.REGIST_FAIL.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// logger.error("app用户注册异常:" + e.toString());
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 手机app密码设置
|
||||||
|
// */
|
||||||
|
// @PostMapping("setPsd")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "userId", value = "用户索引", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "设置密码", notes = "设置密码", response = ResponseData.class)
|
||||||
|
// public ResponseData setPsd(String userId, String password, String devCode) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// //参数校验
|
||||||
|
// if (StringUtils.isBlank(userId)) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.USERID_WRONG.getCode(), UserCodeEnum.USERID_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// if (!PubUtils.patternPasswordPhone(XssFilterUtil.dealString(password))) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.PASSWORD_WRONG.getCode(), UserCodeEnum.PASSWORD_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// if (StringUtils.isBlank(devCode)) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.DEVCODE_WRONG.getCode(), UserCodeEnum.DEVCODE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// logger.info("controller更新手机id:" + devCode);
|
||||||
|
// try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// appUserService.setPsd(userId, devCode, password);
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.SETPWD_SUCCESS.getCode(), UserCodeEnum.SETPWD_SUCCESS.getMsg(), null);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("app用户设置密码异常:" + e.toString());
|
||||||
|
// 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.SETPWD_FAIL.getCode(), UserCodeEnum.SETPWD_FAIL.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 手机app登录入口
|
||||||
|
// */
|
||||||
|
// @PostMapping("login")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "type", value = "登录类型", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "key", value = "验证码/密码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "登录入口", notes = "APP登录", response = ResponseData.class)
|
||||||
|
// public ResponseData login(String phone, String type, String key, String devCode, HttpServletRequest request) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// //参数校验
|
||||||
|
// if (!PubUtils.patternPhone(XssFilterUtil.dealString(phone))) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.PHONE_WRONG.getCode(), UserCodeEnum.PHONE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// if (StringUtils.isBlank(key)) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.KEY_WRONG.getCode(), UserCodeEnum.KEY_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// if (StringUtils.isBlank(devCode)) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.DEVCODE_WRONG.getCode(), UserCodeEnum.DEVCODE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// UserResult userResult = new UserResult();
|
||||||
|
// logger.info("controller更新手机id:" + devCode);
|
||||||
|
// try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// TokenManager.appLogin(phone, type, key, devCode, ProjectEnum.APP.getItem());
|
||||||
|
// AppUser appUser = (AppUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
// userResult.setPhone(appUser.getPhone());
|
||||||
|
// userResult.setRoleCode(appUser.getUserLevel());
|
||||||
|
// userResult.setUserName(StringUtils.isEmpty(appUser.getName()) ? null : appUser.getName());
|
||||||
|
// userResult.setRoleName(UserLevelEnum.getMsgByCode(appUser.getUserLevel()));
|
||||||
|
// userResult.setUserId(appUser.getUserIndex());
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.LOGIN_SUCCESS.getCode(), UserCodeEnum.LOGIN_SUCCESS.getMsg(), userResult);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("app用户登录异常:" + e.toString());
|
||||||
|
// 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.LOGIN_FAIL.getCode(), UserCodeEnum.LOGIN_FAIL.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 手机app忘记密码-重置密码
|
||||||
|
// */
|
||||||
|
// @PostMapping("resetPsd")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "code", value = "验证码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "重置密码", notes = "重置密码", response = ResponseData.class)
|
||||||
|
// public ResponseData resetPsd(String phone, String code, String password, String devCode) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// //参数校验
|
||||||
|
// if (!PubUtils.patternPhone(XssFilterUtil.dealString(phone))) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.PHONE_WRONG.getCode(), UserCodeEnum.PHONE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// if (!PubUtils.patternPasswordPhone(XssFilterUtil.dealString(password))) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.PASSWORD_WRONG.getCode(), UserCodeEnum.PASSWORD_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// logger.info("controller更新手机id:" + devCode);
|
||||||
|
// try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// appUserService.resetPsd(phone, code, password, devCode);
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.RESETPWD_SUCCESS.getCode(), UserCodeEnum.RESETPWD_SUCCESS.getMsg(), null);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("忘记密码重置密码异常:" + e.toString());
|
||||||
|
// 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.RESETPWD_FAIL.getCode(), UserCodeEnum.RESETPWD_FAIL.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 手机app已登录修改密码
|
||||||
|
// */
|
||||||
|
// @PostMapping("modifyPsd")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "code", value = "验证码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "修改密码", notes = "修改密码", response = ResponseData.class)
|
||||||
|
// public ResponseData modifyPsd(String userId, String phone, String code, String password, String devCode) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// //参数校验
|
||||||
|
// if (!PubUtils.patternPasswordPhone(XssFilterUtil.dealString(password))) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.PASSWORD_WRONG.getCode(), UserCodeEnum.PASSWORD_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// logger.info("controller更新手机id:" + devCode);
|
||||||
|
// try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// appUserService.modifyPsd(userId, phone, code, password, devCode);
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.RESETPWD_SUCCESS.getCode(), UserCodeEnum.RESETPWD_SUCCESS.getMsg(), null);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("修改密码异常:" + e.toString());
|
||||||
|
// 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.RESETPWD_FAIL.getCode(), UserCodeEnum.RESETPWD_FAIL.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 手机app角色升级
|
||||||
|
// */
|
||||||
|
// @PostMapping("roleUpdate")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "referralCode", value = "推荐码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "角色升级", notes = "角色升级", response = ResponseData.class)
|
||||||
|
// public ResponseData roleUpdate(String userId, String referralCode, String devCode) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// //参数校验
|
||||||
|
// if (StringUtils.isEmpty(referralCode)) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.REFERRAL_CODE_ERROR.getCode(), UserCodeEnum.REFERRAL_CODE_ERROR.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// logger.info("controller更新手机id:" + devCode);
|
||||||
|
// UserResult userResult;
|
||||||
|
// try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// userResult = appUserService.roleUpdate(userId, referralCode, devCode);
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.UPDATE_ROLE_SUCCESS.getCode(), UserCodeEnum.UPDATE_ROLE_SUCCESS.getMsg(), userResult);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("角色升级异常:" + e.toString());
|
||||||
|
// 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.UPDATE_ROLE_FAIL.getCode(), UserCodeEnum.UPDATE_ROLE_FAIL.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 手机app确认旧手机验证码
|
||||||
|
// */
|
||||||
|
// @PostMapping("comfirmCode")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "phone", value = "手机号码号码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "code", value = "短信验证码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "确认旧手机验证码", notes = "确认旧手机验证码", response = ResponseData.class)
|
||||||
|
// public ResponseData comfirmCode(String phone, String devCode, String code) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// //参数校验
|
||||||
|
// if (!PubUtils.patternPhone(XssFilterUtil.dealString(phone))) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.PHONE_WRONG.getCode(), UserCodeEnum.PHONE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// if (StringUtils.isBlank(devCode)) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.DEVCODE_WRONG.getCode(), UserCodeEnum.DEVCODE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// logger.info("controller更新手机id:" + devCode);
|
||||||
|
// try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// appUserService.comfirmCode(phone, devCode, code);
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.MESSAGE_CODE_RIGHT.getCode(), UserCodeEnum.MESSAGE_CODE_RIGHT.getMsg(), null);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("确认旧手机验证码异常:" + e.toString());
|
||||||
|
// 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.MESSAGE_CODE_WRONG.getCode(), UserCodeEnum.MESSAGE_CODE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 手机app重新绑定手机号
|
||||||
|
// */
|
||||||
|
// @PostMapping("rebindPhone")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "phoneNew", value = "新号码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "code", value = "短信验证码", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "devCode", value = "设备码", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "重新绑定手机号", notes = "重新绑定手机号", response = ResponseData.class)
|
||||||
|
// public ResponseData rebindPhone(String userId, String phoneNew, String devCode, String code) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// //参数校验
|
||||||
|
// if (!PubUtils.patternPhone(XssFilterUtil.dealString(phoneNew))) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.PHONE_WRONG.getCode(), UserCodeEnum.PHONE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// if (StringUtils.isBlank(devCode)) {
|
||||||
|
// return PubUtils.assignmentAppResponse(ReturnCode.RETURN_FAIL, UserCodeEnum.DEVCODE_WRONG.getCode(), UserCodeEnum.DEVCODE_WRONG.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// appUserService.rebindPhone(userId, phoneNew, devCode, code);
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.REST_PHONE_SUCCESS.getCode(), UserCodeEnum.REST_PHONE_SUCCESS.getMsg(), null);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("重新绑定手机号异常:" + e.toString());
|
||||||
|
// 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.REST_PHONE_FAIL.getCode(), UserCodeEnum.REST_PHONE_FAIL.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 手机app用户实时消息配置
|
||||||
|
// */
|
||||||
|
// @PostMapping("msgSet")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "eventInfo", value = "暂态消息模块", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "targetInfo", value = "稳态消息模块", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "deviceInfo", value = "终端消息模块", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "systemInfo", value = "系统消息消息模块", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "用户实时消息配置", notes = "用户实时消息配置", response = ResponseData.class)
|
||||||
|
// public ResponseData msgSet(String userId, String eventInfo, String targetInfo, String deviceInfo, String systemInfo) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// try {
|
||||||
|
// appUserService.msgSet(userId, eventInfo, targetInfo, deviceInfo, systemInfo);
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.SET_INFO_SUCCESS.getCode(), UserCodeEnum.SET_INFO_SUCCESS.getMsg(), null);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("用户实时消息配置异常:" + e.toString());
|
||||||
|
// 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.SET_INFO_FAIL.getCode(), UserCodeEnum.SET_INFO_FAIL.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 手机app用户获取消息配置
|
||||||
|
// */
|
||||||
|
// @PostMapping("getMsg")
|
||||||
|
// @ApiImplicitParams({
|
||||||
|
// @ApiImplicitParam(name = "userId", value = "用户ID", required = true, paramType = "query"),
|
||||||
|
// @ApiImplicitParam(name = "devCode", value = "设备ID", required = true, paramType = "query"),
|
||||||
|
// })
|
||||||
|
// @ApiOperation(value = "用户获取消息配置", notes = "用户获取消息配置", response = ResponseData.class)
|
||||||
|
// public ResponseData getMsg(String userId, String devCode) {
|
||||||
|
// ResponseData responseData;
|
||||||
|
// MessageResult messageResult;
|
||||||
|
// try {
|
||||||
|
// devCode = AESUtil.aesPKCS5PaddingDecrypt(devCode);
|
||||||
|
// messageResult = appUserService.getMsg(userId, devCode);
|
||||||
|
// responseData = PubUtils.assignmentAppResponse(ReturnCode.RETURN_SUCCESS, UserCodeEnum.GET_MESSAGE_SUCCESS.getCode(), UserCodeEnum.GET_MESSAGE_SUCCESS.getMsg(), messageResult);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error("用户获取消息配置异常:" + e.toString());
|
||||||
|
// 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.GET_MESSAGE_FAIL.getCode(), UserCodeEnum.GET_MESSAGE_FAIL.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return responseData;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 暂态消息详情 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-01
|
||||||
|
*/
|
||||||
|
public interface AppEventInfoMapper extends BaseMapper<AppEventInfo> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 暂态事件基本信息(暂态消息id)
|
||||||
|
* @param id
|
||||||
|
* @return: com.njcn.cloud.pojo.vo.EventInfoDetailVO
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/1 14:43
|
||||||
|
*/
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
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>
|
||||||
|
* app暂态消息表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-10-31
|
||||||
|
*/
|
||||||
|
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.AppReport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 报告信息 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-02
|
||||||
|
*/
|
||||||
|
public interface AppReportMapper extends BaseMapper<AppReport> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.cloud.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSendMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-10-31
|
||||||
|
*/
|
||||||
|
public interface AppSendMsgMapper extends BaseMapper<AppSendMsg> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.cloud.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSteadyAss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 稳态消息详情 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-03
|
||||||
|
*/
|
||||||
|
public interface AppSteadyAssMapper extends BaseMapper<AppSteadyAss> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.cloud.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSteadyMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 稳态消息 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-03
|
||||||
|
*/
|
||||||
|
public interface AppSteadyMsgMapper extends BaseMapper<AppSteadyMsg> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.cloud.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSteadyUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 稳态图形信息 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-03
|
||||||
|
*/
|
||||||
|
public interface AppSteadyUrlMapper extends BaseMapper<AppSteadyUrl> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
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>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-10-31
|
||||||
|
*/
|
||||||
|
public interface AppUserMapper extends BaseMapper<AppUser> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 根据app用户id获取app所管理的用户信息
|
||||||
|
* @param appUserID
|
||||||
|
* @return: com.njcn.user.pojo.po.User
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/1 10:13
|
||||||
|
*/
|
||||||
|
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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
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,133 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.cloud.mapper.AppEventInfoMapper">
|
||||||
|
|
||||||
|
<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,
|
||||||
|
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>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?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.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.AppReportMapper">
|
||||||
|
|
||||||
|
</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.AppSendMsgMapper">
|
||||||
|
|
||||||
|
</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.AppSteadyAssMapper">
|
||||||
|
|
||||||
|
</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.AppSteadyMsgMapper">
|
||||||
|
|
||||||
|
</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.AppSteadyUrlMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?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.AppUserMapper">
|
||||||
|
|
||||||
|
<select id="getUserAndApp" resultType="com.njcn.user.pojo.po.User">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from
|
||||||
|
sys_user
|
||||||
|
where
|
||||||
|
id = #{userIndex}
|
||||||
|
</select>
|
||||||
|
<select id="getUserLine" resultType="com.njcn.cloud.pojo.dto.DeptLine">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from
|
||||||
|
pq_dept_line
|
||||||
|
where
|
||||||
|
id = #{deptID}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?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,161 @@
|
|||||||
|
package com.njcn.cloud.service.impl.user;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.njcn.advance.api.EventWaveAnalysisFeignClient;
|
||||||
|
import com.njcn.advance.pojo.dto.waveAnalysis.EntityAdvancedData;
|
||||||
|
import com.njcn.cloud.mapper.AppEventInfoMapper;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppEventInfo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.cloud.pojo.vo.EventEigDetailVO;
|
||||||
|
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.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.oss.constant.GeneralConstant;
|
||||||
|
import com.njcn.oss.constant.OssPath;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 暂态消息详情 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-01
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AppEventInfoServiceImpl extends ServiceImpl<AppEventInfoMapper, AppEventInfo> implements IAppEventInfoService {
|
||||||
|
|
||||||
|
private final EventWaveAnalysisFeignClient eventWaveAnalysisFeignClient;
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
private final WaveFileComponent waveFileComponent;
|
||||||
|
private final WavePicComponent wavePicComponent;
|
||||||
|
@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);
|
||||||
|
if (entityAdvancedData.backNumber != -1) {
|
||||||
|
detail.setBackNumber( entityAdvancedData.backNumber);
|
||||||
|
for (int i = 0; i < entityAdvancedData.backNumber; i++) {
|
||||||
|
EventEigDetailVO eventEigDetail = new EventEigDetailVO();
|
||||||
|
eventEigDetail.setHold_time_dq(entityAdvancedData.evt_buf[i].hold_time_dq * 1000);
|
||||||
|
eventEigDetail.setPow_a(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].POW_a));
|
||||||
|
eventEigDetail.setPow_b(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].POW_b));
|
||||||
|
eventEigDetail.setPow_c(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].POW_c));
|
||||||
|
|
||||||
|
eventEigDetail.setVoltagechange_Va(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].Voltagechange_Va / 1000));
|
||||||
|
eventEigDetail.setVoltagechange_Vb(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].Voltagechange_Vb / 1000));
|
||||||
|
eventEigDetail.setVoltagechange_Vc(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].Voltagechange_Vc / 1000));
|
||||||
|
|
||||||
|
|
||||||
|
eventEigDetail.setUa_min(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].ua_min[0]));
|
||||||
|
eventEigDetail.setUb_min(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].ub_min[0]));
|
||||||
|
eventEigDetail.setUc_min(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].ua_min[0]));
|
||||||
|
|
||||||
|
eventEigDetail.setAngle_diff_ap(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].angle_diff_ap[0]));
|
||||||
|
eventEigDetail.setAngle_diff_bp(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].angle_diff_bp[0]));
|
||||||
|
eventEigDetail.setAngle_diff_cp(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].angle_diff_cp[0]));
|
||||||
|
|
||||||
|
eventEigDetail.setBph_max_value(PubUtils.floatRound(2, entityAdvancedData.evt_buf[i].bph_max_value[0]));
|
||||||
|
eventEigDetail.setSagReason(entityAdvancedData.sagReason[0]);//暂降原因,暂降原因都一样
|
||||||
|
eventEigDetail.setSagType(entityAdvancedData.sagType[i]);//暂降类型
|
||||||
|
eventInfoDetails.add(eventEigDetail);
|
||||||
|
eventEigDetail.setPttype(ptType);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
detail.setBackNumber(0);
|
||||||
|
}
|
||||||
|
detail.setList(eventInfoDetails);
|
||||||
|
return detail;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
public EventWaveDetailVO eventDetailWave(String eventDetailIndex) {
|
||||||
|
EventWaveDetailVO vo =new EventWaveDetailVO();
|
||||||
|
AppEventInfo byId = this.getById(eventDetailIndex);
|
||||||
|
vo.setEventDetailIndex(byId.getEventdetailIndex());
|
||||||
|
if(StrUtil.isBlank(byId.getInstantwavePath())){
|
||||||
|
//获取波形数据。然后绘图
|
||||||
|
WaveDataDTO waveDataDTO = this.analyseWave(eventDetailIndex, 2);
|
||||||
|
//数据筛选,如果是双路电压的话,会存在2个波形数据
|
||||||
|
List<WaveDataDetail> waveDataDetails = WaveUtil.filterWaveData(waveDataDTO);
|
||||||
|
String instantPath = wavePicComponent.generateImageShun(waveDataDTO,waveDataDetails);
|
||||||
|
byId.setInstantwavePath(instantPath);
|
||||||
|
if (StrUtil.isBlank(byId.getRmswavePath())) {
|
||||||
|
String rmsPath = wavePicComponent.generateImageRms(waveDataDTO,waveDataDetails);
|
||||||
|
byId.setRmswavePath(rmsPath);
|
||||||
|
}
|
||||||
|
this.updateById(byId);
|
||||||
|
}
|
||||||
|
vo.setInstantWaveUrl(byId.getInstantwavePath());
|
||||||
|
vo.setRmsWaveUrl(byId.getRmswavePath());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
public Boolean eventDetailEvaluate(String eventDetailIndex, Integer evaluate, String userId) {
|
||||||
|
boolean fly = this.update(new LambdaUpdateWrapper<AppEventInfo>()
|
||||||
|
.set(AppEventInfo::getEvaluate, evaluate)
|
||||||
|
.set(AppEventInfo::getUserIndex, userId)
|
||||||
|
.eq(AppEventInfo::getEventdetailIndex, eventDetailIndex)
|
||||||
|
);
|
||||||
|
return fly;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 获取波形数据
|
||||||
|
* @return: com.njcn.event.file.pojo.dto.WaveDataDTO
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/1 15:51
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WaveDataDTO analyseWave(String eventId, int iType) {
|
||||||
|
WaveDataDTO waveDataDTO;
|
||||||
|
//获取暂降事件
|
||||||
|
EventWaveDetailVO.Detail eventDetail = this.baseMapper.selectWavePath(eventId);
|
||||||
|
String waveName = eventDetail.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)
|
||||||
|
) {
|
||||||
|
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||||
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
|
}
|
||||||
|
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, iType);
|
||||||
|
} catch (Exception e) {
|
||||||
|
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());
|
||||||
|
return waveDataDTO;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.njcn.cloud.service.impl.user;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
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.web.pojo.param.BaseParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* app暂态消息表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-10-31
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AppEventMsgServiceImpl extends ServiceImpl<AppEventMsgMapper, AppEventMsg> implements IAppEventMsgService {
|
||||||
|
|
||||||
|
private final AppUserMapper appUserMapper;
|
||||||
|
private final AppEventInfoMapper appEventInfoMapper;
|
||||||
|
@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());
|
||||||
|
}
|
||||||
|
//根据所查询的部门查询出是部门下监测点信息
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
public EventInfoDetailVO eventInfoDetail(String id) {
|
||||||
|
EventInfoDetailVO eventInfoDetailVO = appEventInfoMapper.selectEventInfoDetailByID(id);
|
||||||
|
this.update(new LambdaUpdateWrapper<AppEventMsg>()
|
||||||
|
.set(AppEventMsg::getState,1)
|
||||||
|
.eq(AppEventMsg::getEventmsgIndex,id)
|
||||||
|
|
||||||
|
);
|
||||||
|
return eventInfoDetailVO;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
package com.njcn.cloud.service.impl.user;
|
||||||
|
|
||||||
|
import cn.hutool.core.codec.Base64;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
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;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppReport;
|
||||||
|
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.WordUtil;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.utils.FileUtil;
|
||||||
|
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.oss.constant.OssPath;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 报告信息 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-02
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
public String eventDetailReportApply(String userId, String eventDetailIndex) {
|
||||||
|
AppEventInfo info=new AppEventInfo();
|
||||||
|
info.setEventdetailIndex(eventDetailIndex);
|
||||||
|
info.setEvaluate(0);
|
||||||
|
info.setUserIndex(userId);
|
||||||
|
info.setUpdateTime(LocalDateTime.now());
|
||||||
|
|
||||||
|
AppEventInfo one = appEventInfoService.getOne(new LambdaUpdateWrapper<AppEventInfo>()
|
||||||
|
.eq(AppEventInfo::getEventdetailIndex, eventDetailIndex)
|
||||||
|
.ne(AppEventInfo::getReportState, 4)
|
||||||
|
);
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
info.setInstantwavePath(map.get("instantPath"));
|
||||||
|
info.setRmswavePath(map.get("rmsPath"));
|
||||||
|
info.setReportState(1);
|
||||||
|
info.setReportPath(map.get("reportPath"));
|
||||||
|
appEventInfoService.save(info);
|
||||||
|
return "0";
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
info.setReportState(2);
|
||||||
|
appEventInfoService.save(info);
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AppEventInfo getDownLoadPath(String userId, String eventDetailIndex) {
|
||||||
|
AppEventInfo one = appEventInfoService.getOne(new LambdaQueryWrapper<AppEventInfo>()
|
||||||
|
.eq(AppEventInfo::getUserIndex, userId)
|
||||||
|
.eq(AppEventInfo::getEventdetailIndex, eventDetailIndex)
|
||||||
|
);
|
||||||
|
if(ObjectUtil.isNull(one)){
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.EVENTDETAILREPORTDOWNLOAD_NOT_FAIL.getMsg());
|
||||||
|
}
|
||||||
|
if(one.getReportState() == 3){
|
||||||
|
throw new BusinessException(EventMsgCodeEnum.EVENTDETAILREPORTDOWNLOAD_ERROR.getMsg());
|
||||||
|
}
|
||||||
|
return one;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 生成报告
|
||||||
|
* @param eventIndex
|
||||||
|
* @return: java.lang.String
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/2 14:44
|
||||||
|
*/
|
||||||
|
private Map<String,String> createEventDetailReport(String eventIndex,AppEventInfo appEventInfo) throws Exception {
|
||||||
|
Map<String,String> map=new HashMap<>();
|
||||||
|
WaveDataDTO waveData = appEventInfoService.analyseWave(eventIndex, 2);
|
||||||
|
|
||||||
|
if (waveData.getListWaveData().size() == 0) {
|
||||||
|
map.put("noData","2");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
//数据筛选,如果是双路电压的话,会存在2个波形数据
|
||||||
|
List<WaveDataDetail> waveDataDetails = WaveUtil.filterWaveData(waveData);
|
||||||
|
WordUtil wordUtil = new WordUtil();
|
||||||
|
//获取瞬时波形
|
||||||
|
String instantPath=appEventInfo.getInstantwavePath();
|
||||||
|
if(StrUtil.isBlank(instantPath)){
|
||||||
|
instantPath = wavePicComponent.generateImageShun(waveData,waveDataDetails);
|
||||||
|
}
|
||||||
|
InputStream instantStream = fileStorageUtil.getFileStream(instantPath);
|
||||||
|
String imageShun64 = Base64.encode(instantStream);
|
||||||
|
//获取rms波形
|
||||||
|
String rmsPath =appEventInfo.getRmswavePath();
|
||||||
|
if(StrUtil.isBlank(rmsPath)){
|
||||||
|
rmsPath = wavePicComponent.generateImageRms(waveData,waveDataDetails);
|
||||||
|
}
|
||||||
|
InputStream rmsStream = fileStorageUtil.getFileStream(rmsPath);
|
||||||
|
String rmsShun64 = Base64.encode(rmsStream);
|
||||||
|
|
||||||
|
wordUtil.translate(imageShun64,rmsShun64);
|
||||||
|
List<EventEigDetailVO> eventDetailEigenvalue =new ArrayList<>();
|
||||||
|
List<String> tmpWaveTitle = waveData.getWaveTitle();
|
||||||
|
int picCounts =(tmpWaveTitle.size()-1)/waveData.getIPhasic();
|
||||||
|
if(picCounts == 3){
|
||||||
|
eventDetailEigenvalue = appEventInfoService.eventDetailEigenvalue(eventIndex).getList();
|
||||||
|
|
||||||
|
}
|
||||||
|
wordUtil.setEventDetailEigenvalue(eventDetailEigenvalue);
|
||||||
|
EventInfoDetailVO eventInfoList = appEventInfoMapper.selectEventDetailByID(eventIndex);
|
||||||
|
wordUtil.setEventInfoList(eventInfoList);
|
||||||
|
wordUtil.createReport();
|
||||||
|
|
||||||
|
//临时缓冲区
|
||||||
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
|
//创建临时文件
|
||||||
|
wordUtil.getDocument().write(out);
|
||||||
|
byte[] bookByteAry = out.toByteArray();
|
||||||
|
InputStream in = new ByteArrayInputStream(bookByteAry);
|
||||||
|
String reportPath = fileStorageUtil.uploadStream(in, OssPath.RESPONSIBILITY_APP_REPORT,
|
||||||
|
FileUtil.generateFileName("docx")
|
||||||
|
);
|
||||||
|
map.put("instantPath",instantPath);
|
||||||
|
map.put("rmsPath",rmsPath);
|
||||||
|
map.put("reportPath",reportPath);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.cloud.service.impl.user;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.cloud.mapper.AppSendMsgMapper;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSendMsg;
|
||||||
|
import com.njcn.cloud.service.user.IAppSendMsgService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-10-31
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AppSendMsgServiceImpl extends ServiceImpl<AppSendMsgMapper, AppSendMsg> implements IAppSendMsgService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.cloud.service.impl.user;
|
||||||
|
|
||||||
|
import com.njcn.cloud.mapper.AppSteadyAssMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSteadyAss;
|
||||||
|
import com.njcn.cloud.service.user.IAppSteadyAssService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 稳态消息详情 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-03
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AppSteadyAssServiceImpl extends ServiceImpl<AppSteadyAssMapper, AppSteadyAss> implements IAppSteadyAssService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
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 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.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.service.user.IAppSteadyAssService;
|
||||||
|
import com.njcn.cloud.service.user.IAppSteadyMsgService;
|
||||||
|
import com.njcn.cloud.service.user.IAppSteadyUrlService;
|
||||||
|
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.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 稳态消息 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-03
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AppSteadyMsgServiceImpl extends ServiceImpl<AppSteadyMsgMapper, AppSteadyMsg> implements IAppSteadyMsgService {
|
||||||
|
|
||||||
|
private final IAppSteadyAssService appSteadyAssService;
|
||||||
|
private final IAppSteadyUrlService appSteadyUrlService;
|
||||||
|
private final LineMapper lineMapper;
|
||||||
|
@Override
|
||||||
|
public AppSteadyMsgVO getSteadyState(BaseParam param) {
|
||||||
|
AppSteadyMsgVO appSteadyMsgVO=new AppSteadyMsgVO();
|
||||||
|
Page<AppSteadyMsg> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<AppSteadyMsg>()
|
||||||
|
.eq(AppSteadyMsg::getUserIndex, param.getSearchValue())
|
||||||
|
.orderByDesc(AppSteadyMsg::getTimeId)
|
||||||
|
);
|
||||||
|
int count = this.count(new LambdaQueryWrapper<AppSteadyMsg>()
|
||||||
|
.eq(AppSteadyMsg::getUserIndex, param.getSearchValue())
|
||||||
|
.eq(AppSteadyMsg::getState, 0)
|
||||||
|
|
||||||
|
);
|
||||||
|
appSteadyMsgVO.setPage(page);
|
||||||
|
appSteadyMsgVO.setUnstate(count);
|
||||||
|
return appSteadyMsgVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SteadyMsgDetailVO> getSteadyDetail(String steadyIndex) {
|
||||||
|
//初始化集合
|
||||||
|
List<SteadyMsgDetailVO> msgDetailList = new ArrayList<>();
|
||||||
|
//获取暂态消息详细信息列表
|
||||||
|
List<AppSteadyAss> steadyAssList = appSteadyAssService.list(new LambdaQueryWrapper<AppSteadyAss>()
|
||||||
|
.eq(AppSteadyAss::getSteadyIndex, steadyIndex)
|
||||||
|
);
|
||||||
|
if(CollUtil.isEmpty(steadyAssList)){
|
||||||
|
return msgDetailList;
|
||||||
|
}
|
||||||
|
//获取监测点id集合
|
||||||
|
List<String> lineIds = steadyAssList.stream().map(AppSteadyAss::getLineIndex).distinct().collect(Collectors.toList());
|
||||||
|
//获取统计时间集合
|
||||||
|
List<LocalDateTime> times = steadyAssList.stream().map(AppSteadyAss::getTimeId).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<AppSteadyUrl> lineDetail = appSteadyUrlService.list(new LambdaQueryWrapper<AppSteadyUrl>()
|
||||||
|
.in(AppSteadyUrl::getLineIndex, lineIds)
|
||||||
|
.in(AppSteadyUrl::getTimeId, times)
|
||||||
|
.orderByAsc(AppSteadyUrl::getTypeCode)
|
||||||
|
|
||||||
|
);
|
||||||
|
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);
|
||||||
|
lineMap.forEach((key,value)->{
|
||||||
|
String[] split = key.split("_");
|
||||||
|
List<LineDetailVO> 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());
|
||||||
|
detailVO.setSubName(line.get(0).getSubName());
|
||||||
|
detailVO.setSteadyIndex(steadyIndex);
|
||||||
|
detailVO.setLineIndex(line.get(0).getLineId());
|
||||||
|
detailVO.setTimeId(LocalDateTimeUtil.parse(split[1],DatePattern.UTC_SIMPLE_MS_PATTERN));
|
||||||
|
String describe = "";
|
||||||
|
Integer limitNum = 0;
|
||||||
|
for (AppSteadyUrl appSteadyUrl : value) {
|
||||||
|
String typename = TypeCodeEnum.getMsgByCode(appSteadyUrl.getTypeCode());
|
||||||
|
if(appSteadyUrl.getTypeCode()== 5){
|
||||||
|
describe = describe + typename + appSteadyUrl.getLimitNum() * 120 + "分钟,";
|
||||||
|
}else{
|
||||||
|
describe = describe + typename + appSteadyUrl.getLimitNum() * line.get(0).getTimeInterval() + "分钟,";
|
||||||
|
}
|
||||||
|
limitNum = limitNum + appSteadyUrl.getLimitNum();
|
||||||
|
}
|
||||||
|
if(describe.length() > 0){
|
||||||
|
describe = describe.substring(0, describe.length()-1);
|
||||||
|
}
|
||||||
|
detailVO.setLimitNum(limitNum);
|
||||||
|
detailVO.setDescribe(describe);
|
||||||
|
msgDetailList.add(detailVO);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.update(new LambdaUpdateWrapper<AppSteadyMsg>()
|
||||||
|
.set(AppSteadyMsg::getState,1)
|
||||||
|
.eq(AppSteadyMsg::getState,0)
|
||||||
|
.eq(AppSteadyMsg::getSteadyIndex,steadyIndex)
|
||||||
|
);
|
||||||
|
return msgDetailList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SteadyTargetVO> getSteadyTarget(String lineIndex, String timeId) {
|
||||||
|
List<SteadyTargetVO> info=new ArrayList<>();
|
||||||
|
SteadyTargetVO vo;
|
||||||
|
List<AppSteadyUrl> list = appSteadyUrlService.list(new LambdaQueryWrapper<AppSteadyUrl>()
|
||||||
|
.eq(AppSteadyUrl::getLineIndex, lineIndex)
|
||||||
|
.eq(AppSteadyUrl::getTimeId, timeId)
|
||||||
|
.orderByAsc(AppSteadyUrl::getTypeCode)
|
||||||
|
);
|
||||||
|
if(CollUtil.isNotEmpty(list)){
|
||||||
|
for (AppSteadyUrl appSteadyUrl : list) {
|
||||||
|
vo=new SteadyTargetVO();
|
||||||
|
vo.setTypeCode(appSteadyUrl.getTypeCode());
|
||||||
|
vo.setTypeName(TypeCodeEnum.getMsgByCode(appSteadyUrl.getTypeCode()));
|
||||||
|
vo.setLimitNum(appSteadyUrl.getLimitNum());
|
||||||
|
info.add(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AppSteadyUrl getSteadyTargetUrl(String lineIndex, String timeId,Integer typeCode) {
|
||||||
|
AppSteadyUrl one = appSteadyUrlService.getOne(new LambdaQueryWrapper<AppSteadyUrl>()
|
||||||
|
.eq(AppSteadyUrl::getLineIndex, lineIndex)
|
||||||
|
.eq(AppSteadyUrl::getTimeId, timeId)
|
||||||
|
.eq(AppSteadyUrl::getTypeCode, typeCode)
|
||||||
|
);
|
||||||
|
return one;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.cloud.service.impl.user;
|
||||||
|
|
||||||
|
import com.njcn.cloud.mapper.AppSteadyUrlMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSteadyUrl;
|
||||||
|
import com.njcn.cloud.service.user.IAppSteadyUrlService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 稳态图形信息 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-03
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AppSteadyUrlServiceImpl extends ServiceImpl<AppSteadyUrlMapper, AppSteadyUrl> implements IAppSteadyUrlService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
package com.njcn.cloud.service.impl.user;
|
||||||
|
|
||||||
|
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.cloud.mapper.AppUserMapper;
|
||||||
|
import com.njcn.cloud.enums.app.UserCodeEnum;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSendMsg;
|
||||||
|
import com.njcn.cloud.service.user.IAppSendMsgService;
|
||||||
|
import com.njcn.cloud.service.user.IAppUserService;
|
||||||
|
import com.njcn.cloud.utils.SmsUtil;
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.utils.PubUtils;
|
||||||
|
import com.njcn.redis.pojo.enums.RedisKeyEnum;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.user.enums.MessageEnum;
|
||||||
|
import com.njcn.user.enums.UserResponseEnum;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppUser;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @date: 2019/10/17 11:37
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> implements IAppUserService {
|
||||||
|
|
||||||
|
private final SmsUtil smsUtil;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
private final IAppSendMsgService appSendMsgService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送短信
|
||||||
|
*
|
||||||
|
* @param phone 手机号
|
||||||
|
* @param devCode 设备ID
|
||||||
|
* @param type 短信类型
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void setMessage(String phone, String devCode, String type) {
|
||||||
|
if (!PubUtils.match(PatternRegex.PHONE_REGEX, phone)) {
|
||||||
|
throw new BusinessException(UserResponseEnum.REGISTER_PHONE_WRONG);
|
||||||
|
}
|
||||||
|
String msgTemplate = SmsUtil.getMessageTemplate(type);
|
||||||
|
String vCode = null;
|
||||||
|
SendSmsResponse sendSmsResponse = null;
|
||||||
|
|
||||||
|
//type为4,账号替换为新手机号
|
||||||
|
if (!msgTemplate.equalsIgnoreCase(MessageEnum.REGISTER.getTemplateCode())) {
|
||||||
|
AppUser appUser = this.getOne(new LambdaQueryWrapper<AppUser>()
|
||||||
|
.eq(AppUser::getPhone, phone)
|
||||||
|
.ne(AppUser::getState, 0)
|
||||||
|
);
|
||||||
|
if ("4".equalsIgnoreCase(type)) {
|
||||||
|
//注册,无需判断手机号与设备的匹配
|
||||||
|
if (appUser != null) {
|
||||||
|
throw new BusinessException(UserCodeEnum.REGIST_PHONE_FAIL.getMsg());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (null == appUser) {
|
||||||
|
throw new BusinessException(UserCodeEnum.NO_USER.getMsg());
|
||||||
|
} else {
|
||||||
|
appUser.setDevCode(devCode);
|
||||||
|
this.updateById(appUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
//开始执行短信发送
|
||||||
|
vCode = getMessageCode();
|
||||||
|
sendSmsResponse=new SendSmsResponse();
|
||||||
|
sendSmsResponse.setCode("OK");
|
||||||
|
// sendSmsResponse = smsUtil.sendSms(phone, msgTemplate, "code", vCode);
|
||||||
|
String key = RedisKeyEnum.SMS_LOGIN_KEY.getKey() + phone;
|
||||||
|
if (sendSmsResponse.getCode() != null && "OK".equals(sendSmsResponse.getCode())) {
|
||||||
|
//成功发送短信验证码后,保存进redis,验证码失效为5分钟
|
||||||
|
redisUtil.saveByKeyWithExpire(key, vCode, 300L);
|
||||||
|
} else {
|
||||||
|
throw new BusinessException(UserResponseEnum.SEND_CODE_FAIL);
|
||||||
|
}
|
||||||
|
//短信入库
|
||||||
|
addSendMessage(phone, vCode, sendSmsResponse);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发送短信异常,异常为:" + e.getMessage());
|
||||||
|
//短信入库
|
||||||
|
addSendMessage(phone, vCode, sendSmsResponse);
|
||||||
|
throw new BusinessException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义获取验证码,固定为字母和数字的组合
|
||||||
|
*/
|
||||||
|
private String getMessageCode() {
|
||||||
|
String result = "";
|
||||||
|
char[] numbers = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
|
||||||
|
//填充数字
|
||||||
|
for (int i = 0; i < 6; i++) {
|
||||||
|
int numberIndex = new Random().nextInt(10);
|
||||||
|
result = result + numbers[numberIndex];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证码入库
|
||||||
|
*/
|
||||||
|
public void addSendMessage(String phone, String vCode, SendSmsResponse sendSmsResponse) {
|
||||||
|
AppSendMsg appSendMsg = new AppSendMsg();
|
||||||
|
appSendMsg.setPhone(phone);
|
||||||
|
appSendMsg.setMessage(vCode);
|
||||||
|
appSendMsg.setSendTime(LocalDateTime.now());
|
||||||
|
appSendMsg.setSendStatus(sendSmsResponse.getCode() == null ? "无状态" : sendSmsResponse.getCode());
|
||||||
|
appSendMsgService.save(appSendMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.njcn.cloud.service.user;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppEventInfo;
|
||||||
|
import com.njcn.cloud.pojo.vo.EventEigDetailVO;
|
||||||
|
import com.njcn.cloud.pojo.vo.EventWaveDetailVO;
|
||||||
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 暂态消息详情 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-01
|
||||||
|
*/
|
||||||
|
public interface IAppEventInfoService extends IService<AppEventInfo> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 暂态事件特征幅值
|
||||||
|
* @param eventDetailIndex
|
||||||
|
* @return: java.util.List<com.njcn.cloud.pojo.vo.EventEigDetailVO>
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/1 14:44
|
||||||
|
*/
|
||||||
|
EventEigDetailVO.Detail eventDetailEigenvalue(String eventDetailIndex);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 暂态事件波形图
|
||||||
|
* @param eventDetailIndex
|
||||||
|
* @return: com.njcn.cloud.pojo.vo.EventWaveDetailVO
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/1 16:28
|
||||||
|
*/
|
||||||
|
EventWaveDetailVO eventDetailWave(String eventDetailIndex) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 暂态评价
|
||||||
|
* @param eventDetailIndex
|
||||||
|
* @param evaluate
|
||||||
|
* @param userId
|
||||||
|
* @return: java.lang.Boolean
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/2 14:45
|
||||||
|
*/
|
||||||
|
Boolean eventDetailEvaluate(String eventDetailIndex, Integer evaluate, String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 获取波形数据
|
||||||
|
* @param eventId
|
||||||
|
* @param iType
|
||||||
|
* @return: com.njcn.event.file.pojo.dto.WaveDataDTO
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/2 14:46
|
||||||
|
*/
|
||||||
|
WaveDataDTO analyseWave(String eventId, int iType);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
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.AppEventMsg;
|
||||||
|
import com.njcn.cloud.pojo.vo.EventInfoDetailVO;
|
||||||
|
import com.njcn.cloud.pojo.vo.EventMsgDetailVO;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* app暂态消息表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-10-31
|
||||||
|
*/
|
||||||
|
public interface IAppEventMsgService extends IService<AppEventMsg> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 暂态消息列表
|
||||||
|
* @param param
|
||||||
|
* @return: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.njcn.cloud.pojo.vo.EventMsgDetailVO>
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/1 13:36
|
||||||
|
*/
|
||||||
|
Page<EventMsgDetailVO> eventMsgPage(BaseParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 暂态事件基本信息
|
||||||
|
* @param id 暂态消息id
|
||||||
|
* @return: com.njcn.cloud.pojo.vo.EventInfoDetailVO
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/1 13:35
|
||||||
|
*/
|
||||||
|
EventInfoDetailVO eventInfoDetail(String id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.njcn.cloud.service.user;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppEventInfo;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppReport;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 报告信息 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-02
|
||||||
|
*/
|
||||||
|
public interface IAppReportService extends IService<AppReport> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 报告申请
|
||||||
|
* @param userId
|
||||||
|
* @param eventDetailIndex
|
||||||
|
* @return: int
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/2 14:38
|
||||||
|
*/
|
||||||
|
String eventDetailReportApply(String userId, String eventDetailIndex) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 报告下载入口
|
||||||
|
* @param userId
|
||||||
|
* @param eventDetailIndex
|
||||||
|
* @return: com.njcn.cloud.pojo.dto.AppEventInfo
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/3 8:53
|
||||||
|
*/
|
||||||
|
AppEventInfo getDownLoadPath(String userId, String eventDetailIndex);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.cloud.service.user;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSendMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-10-31
|
||||||
|
*/
|
||||||
|
public interface IAppSendMsgService extends IService<AppSendMsg> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.cloud.service.user;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSteadyAss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 稳态消息详情 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-03
|
||||||
|
*/
|
||||||
|
public interface IAppSteadyAssService extends IService<AppSteadyAss> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.njcn.cloud.service.user;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
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.SteadyMsgDetailVO;
|
||||||
|
import com.njcn.cloud.pojo.vo.SteadyTargetVO;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 稳态消息 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-03
|
||||||
|
*/
|
||||||
|
public interface IAppSteadyMsgService extends IService<AppSteadyMsg> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 稳态越线列表
|
||||||
|
* @param param
|
||||||
|
* @return: com.njcn.cloud.pojo.vo.AppSteadyMsgVO
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/3 9:24
|
||||||
|
*/
|
||||||
|
AppSteadyMsgVO getSteadyState(BaseParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 稳态越限列表详细信息
|
||||||
|
* @param steadyIndex
|
||||||
|
* @return: java.util.List<com.njcn.cloud.pojo.vo.SteadyMsgDetailVO>
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/3 13:40
|
||||||
|
*/
|
||||||
|
List<SteadyMsgDetailVO> getSteadyDetail(String steadyIndex);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 获取稳态越限指标
|
||||||
|
* @param lineIndex
|
||||||
|
* @param timeId
|
||||||
|
* @return: java.util.List<com.njcn.cloud.pojo.dto.AppSteadyUrl>
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/3 16:08
|
||||||
|
*/
|
||||||
|
List<SteadyTargetVO> getSteadyTarget(String lineIndex, String timeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 获取稳态越限指标图形
|
||||||
|
* @param lineIndex
|
||||||
|
* @param timeId
|
||||||
|
* @param typeCode
|
||||||
|
* @return: com.njcn.cloud.pojo.dto.AppSteadyUrl
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/3 16:20
|
||||||
|
*/
|
||||||
|
AppSteadyUrl getSteadyTargetUrl(String lineIndex, String timeId,Integer typeCode);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.cloud.service.user;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppSteadyUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 稳态图形信息 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @since 2023-11-03
|
||||||
|
*/
|
||||||
|
public interface IAppSteadyUrlService extends IService<AppSteadyUrl> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.njcn.cloud.service.user;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.cloud.pojo.dto.AppUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @date: 2019/10/17 11:36
|
||||||
|
*/
|
||||||
|
public interface IAppUserService extends IService<AppUser> {
|
||||||
|
void setMessage(String phone, String devCode, String type);
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user