添加暂态事件波形图后台绘图并保存文件服务器
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package com.njcn.echarts.json;
|
package com.njcn.echarts.json;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Console;
|
|
||||||
import com.njcn.echarts.pojo.bo.TolerateData;
|
import com.njcn.echarts.pojo.bo.TolerateData;
|
||||||
import com.njcn.echarts.pojo.constant.PicCommonData;
|
import com.njcn.echarts.pojo.constant.PicCommonData;
|
||||||
import org.icepear.echarts.Option;
|
import org.icepear.echarts.Option;
|
||||||
@@ -8,8 +7,6 @@ import org.icepear.echarts.charts.bar.BarItemStyle;
|
|||||||
import org.icepear.echarts.charts.bar.BarLabel;
|
import org.icepear.echarts.charts.bar.BarLabel;
|
||||||
import org.icepear.echarts.charts.bar.BarSeries;
|
import org.icepear.echarts.charts.bar.BarSeries;
|
||||||
import org.icepear.echarts.charts.line.LineSeries;
|
import org.icepear.echarts.charts.line.LineSeries;
|
||||||
import org.icepear.echarts.charts.pie.PieLabel;
|
|
||||||
import org.icepear.echarts.charts.pie.PieSeries;
|
|
||||||
import org.icepear.echarts.charts.scatter.ScatterSeries;
|
import org.icepear.echarts.charts.scatter.ScatterSeries;
|
||||||
import org.icepear.echarts.components.coord.*;
|
import org.icepear.echarts.components.coord.*;
|
||||||
import org.icepear.echarts.components.coord.cartesian.CategoryAxis;
|
import org.icepear.echarts.components.coord.cartesian.CategoryAxis;
|
||||||
@@ -17,17 +14,14 @@ import org.icepear.echarts.components.coord.cartesian.LogAxis;
|
|||||||
import org.icepear.echarts.components.coord.cartesian.ValueAxis;
|
import org.icepear.echarts.components.coord.cartesian.ValueAxis;
|
||||||
import org.icepear.echarts.components.grid.Grid;
|
import org.icepear.echarts.components.grid.Grid;
|
||||||
import org.icepear.echarts.components.legend.Legend;
|
import org.icepear.echarts.components.legend.Legend;
|
||||||
|
import org.icepear.echarts.components.text.Label;
|
||||||
import org.icepear.echarts.components.title.Title;
|
import org.icepear.echarts.components.title.Title;
|
||||||
import org.icepear.echarts.components.tooltip.Tooltip;
|
import org.icepear.echarts.components.tooltip.Tooltip;
|
||||||
import org.icepear.echarts.components.visualMap.ContinousVisualMap;
|
|
||||||
import org.icepear.echarts.origin.chart.bar.BarItemStyleOption;
|
|
||||||
import org.icepear.echarts.origin.coord.AxisLabelBaseOption;
|
|
||||||
import org.icepear.echarts.origin.util.SeriesOption;
|
import org.icepear.echarts.origin.util.SeriesOption;
|
||||||
import org.icepear.echarts.render.Engine;
|
import org.icepear.echarts.render.Engine;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.text.DecimalFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -264,6 +258,7 @@ public class LineGenerator {
|
|||||||
persistentTimeOption.setSeries(new SeriesOption[]{proportion});
|
persistentTimeOption.setSeries(new SeriesOption[]{proportion});
|
||||||
return ENGINE.renderJsonOption(persistentTimeOption);
|
return ENGINE.renderJsonOption(persistentTimeOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 生成电压暂降,已关联未关联得次数
|
* 生成电压暂降,已关联未关联得次数
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -456,4 +451,70 @@ public class LineGenerator {
|
|||||||
persistentTimeOption.setSeries(new SeriesOption[]{proportion, proportion2, proportion3});
|
persistentTimeOption.setSeries(new SeriesOption[]{proportion, proportion2, proportion3});
|
||||||
return ENGINE.renderJsonOption(persistentTimeOption);
|
return ENGINE.renderJsonOption(persistentTimeOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 准备波形json
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/9/21 9:41
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public static String generateWaveOption(String title, List<List<Float>> aValue, List<List<Float>> bValue, List<List<Float>> cValue, String unit, Float max, Float min, String a, String b, String c, List<String> colors, Boolean isOpen) {
|
||||||
|
DecimalFormat df1 = new DecimalFormat("#.00");
|
||||||
|
DecimalFormat df2 = new DecimalFormat("#");
|
||||||
|
Option instantOption = new Option();
|
||||||
|
//取消渲染动画
|
||||||
|
instantOption.setAnimation(false);
|
||||||
|
//背景色
|
||||||
|
instantOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR);
|
||||||
|
//标题
|
||||||
|
instantOption.setTitle(new Title()
|
||||||
|
.setText(title)
|
||||||
|
.setLeft(PicCommonData.CENTER)
|
||||||
|
.setTextStyle(new Label().setFontSize(14))
|
||||||
|
);
|
||||||
|
//配置颜色
|
||||||
|
instantOption.setColor(colors.toArray(new String[colors.size()]));
|
||||||
|
//配置图例
|
||||||
|
if (isOpen) {
|
||||||
|
instantOption.setLegend(new Legend().setData(new String[]{a, b}).setLeft("10px"));
|
||||||
|
} else {
|
||||||
|
instantOption.setLegend(new Legend().setData(new String[]{a, b, c}).setLeft("10px"));
|
||||||
|
}
|
||||||
|
//上下左右的图内间距
|
||||||
|
instantOption.setGrid(new Grid().setTop("60px").setLeft("55px").setRight("40px").setBottom("10%"));
|
||||||
|
//横坐标
|
||||||
|
instantOption.setXAxis(new ValueAxis().setName("ms")
|
||||||
|
.setMax(df2.format(aValue.get(0).get(0)))
|
||||||
|
.setMin(df2.format(aValue.get(aValue.size() - 1).get(0)))
|
||||||
|
.setSplitLine(new SplitLine().setShow(false))
|
||||||
|
.setAxisLine(new AxisLine().setOnZero(false))
|
||||||
|
.setMinInterval(1)
|
||||||
|
);
|
||||||
|
//纵坐标
|
||||||
|
instantOption.setYAxis(new ValueAxis()
|
||||||
|
.setName(unit)
|
||||||
|
.setMax(df1.format(max * 1.1))
|
||||||
|
.setMin(df1.format(min * 1.1))
|
||||||
|
.setPosition(PicCommonData.LEFT)
|
||||||
|
.setAxisLine(new AxisLine().setShow(false).setOnZero(false))
|
||||||
|
);
|
||||||
|
//数据信息
|
||||||
|
LineSeries aSeries = new LineSeries()
|
||||||
|
.setName(a)
|
||||||
|
.setSmooth(true)
|
||||||
|
.setSymbol("none")
|
||||||
|
.setData(aValue);
|
||||||
|
LineSeries bSeries = new LineSeries()
|
||||||
|
.setName(b)
|
||||||
|
.setSmooth(true)
|
||||||
|
.setSymbol("none")
|
||||||
|
.setData(bValue);
|
||||||
|
LineSeries cSeries = new LineSeries()
|
||||||
|
.setName(c)
|
||||||
|
.setSmooth(true)
|
||||||
|
.setSymbol("none")
|
||||||
|
.setData(cValue);
|
||||||
|
instantOption.setSeries(new LineSeries[]{aSeries, bSeries, cSeries});
|
||||||
|
return ENGINE.renderJsonOption(instantOption);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ public interface PicCommonData {
|
|||||||
*/
|
*/
|
||||||
String CENTER = "center";
|
String CENTER = "center";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绘图定位
|
||||||
|
*/
|
||||||
|
String LEFT = "left";
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* png base64固定前缀
|
* png base64固定前缀
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.springframework.http.ResponseEntity;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -56,6 +57,28 @@ public class DrawPicUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 绘制波形图
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/6/21 11:01
|
||||||
|
* @return String base64数据
|
||||||
|
*/
|
||||||
|
public String drawWavePic(String title, List<List<Float>> aValue, List<List<Float>> bValue, List<List<Float>> cValue, String unit, Float max, Float min, String a, String b, String c, List<String> colors, Boolean isOpen) {
|
||||||
|
return drawWavePic(title, aValue, bValue, cValue, unit, max, min, a, b, c, colors, isOpen, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 绘制波形图
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/6/21 11:01
|
||||||
|
* @return String base64数据
|
||||||
|
*/
|
||||||
|
public String drawWavePic(String title, List<List<Float>> aValue, List<List<Float>> bValue, List<List<Float>> cValue, String unit, Float max, Float min, String a, String b, String c, List<String> colors, Boolean isOpen, int width, int height) {
|
||||||
|
String instantJson = LineGenerator.generateWaveOption(title, aValue, bValue, cValue, unit, max, min, a, b, c, colors, isOpen);
|
||||||
|
return drawPic(instantJson, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 绘制itic曲线图
|
* 绘制itic曲线图
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -334,4 +357,6 @@ public class DrawPicUtil {
|
|||||||
String eventDensityJson = LineGenerator.generateFrequencyOption(xData, dip, interruptions, rise, subtext, xName);
|
String eventDensityJson = LineGenerator.generateFrequencyOption(xData, dip, interruptions, rise, subtext, xName);
|
||||||
return drawPic(eventDensityJson, width, height);
|
return drawPic(eventDensityJson, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,5 +108,10 @@ public interface OssPath {
|
|||||||
*/
|
*/
|
||||||
String RESPONSIBILITY_USER_RESULT_DATA="advance/responsibility/userData/result/";
|
String RESPONSIBILITY_USER_RESULT_DATA="advance/responsibility/userData/result/";
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 事件的波形图片
|
||||||
|
*/
|
||||||
|
String EVENT_WAVE_PIC="event/wave/";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
<module>common-huawei</module>
|
<module>common-huawei</module>
|
||||||
<module>common-oss</module>
|
<module>common-oss</module>
|
||||||
<module>common-mq</module>
|
<module>common-mq</module>
|
||||||
|
<module>common-event</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -32,6 +32,11 @@
|
|||||||
<artifactId>common-microservice</artifactId>
|
<artifactId>common-microservice</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-event</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>pq-device-api</artifactId>
|
<artifactId>pq-device-api</artifactId>
|
||||||
|
|||||||
@@ -16,10 +16,6 @@ public enum EventResponseEnum {
|
|||||||
*/
|
*/
|
||||||
EVENT_COMMON_ERROR("A00650","暂降模块异常"),
|
EVENT_COMMON_ERROR("A00650","暂降模块异常"),
|
||||||
EVENT_NOT_FOUND("A00651","暂降事件或监测点不存在"),
|
EVENT_NOT_FOUND("A00651","暂降事件或监测点不存在"),
|
||||||
ANALYSEWAVE_NOT_FOUND("A00652","波形文件找不到"),
|
|
||||||
WAVE_DATA_INVALID("A00654","波形文件数据缺失"),
|
|
||||||
DAT_DATA_ERROR("A00653","dat文件数据读取失败"),
|
|
||||||
RMS_DATA_ERROR("A00653","rms数据读取失败"),
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
package com.njcn.event.pojo.dto.wave;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yxb
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2022年06月02日 20:03
|
|
||||||
* 模拟量通道记录类
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AnalogDTO implements Serializable {
|
|
||||||
|
|
||||||
// 通道序号
|
|
||||||
private Integer nIndex;
|
|
||||||
// 通道名称
|
|
||||||
private String szChannleName;
|
|
||||||
// 相位名称
|
|
||||||
private String szPhasicName;
|
|
||||||
// 监视的通道名称
|
|
||||||
private String szMonitoredChannleName;
|
|
||||||
// 通道的单位
|
|
||||||
private String szUnitName;
|
|
||||||
// 通道的系数
|
|
||||||
private Float fCoefficent;
|
|
||||||
// 通道的便宜量
|
|
||||||
private Float fOffset;
|
|
||||||
// 起始采样时间的偏移量
|
|
||||||
private Float fTimeOffset;
|
|
||||||
// 采样值的最小值
|
|
||||||
private Integer nMin;
|
|
||||||
// 采样值的最大值
|
|
||||||
private Integer nMax;
|
|
||||||
// 一次变比
|
|
||||||
private Float fPrimary;
|
|
||||||
// 二次变比
|
|
||||||
private Float fSecondary;
|
|
||||||
// 一次值还是二次值标志
|
|
||||||
private String szValueType;
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package com.njcn.event.pojo.dto.wave;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yxb
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2022年06月02日 20:03
|
|
||||||
* CFG配置文件总类
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ComtradeCfgDTO implements Serializable {
|
|
||||||
private Integer nChannelNum;
|
|
||||||
private Integer nPhasic;// 模拟量通道的个数 yxb 2020-12-15
|
|
||||||
private Integer nAnalogNum;// 模拟量通道的个数 WW 2013-05-15
|
|
||||||
private Integer nDigitalNum;// 数字量通道的个数 WW 2013-05-15
|
|
||||||
private Date timeStart;// 暂态记录时间 yxb 2022-06-06
|
|
||||||
private Date timeTrige;// 暂态触发时间 yxb 2022-06-06
|
|
||||||
|
|
||||||
private List<AnalogDTO> lstAnalogDTO;//模拟量通道记录
|
|
||||||
private List<DigitalDTO> lstDigitalDTO;//数字量通道记录
|
|
||||||
|
|
||||||
public Integer nRates;//对应采样次数
|
|
||||||
public List<RateDTO> lstRate;//采样率合集
|
|
||||||
|
|
||||||
// add by sw 暂降触发时间
|
|
||||||
private Date firstTime; // 暂降触发第一次
|
|
||||||
private Integer firstMs; // 暂降触发第一次毫秒
|
|
||||||
|
|
||||||
// 波形前推周波束
|
|
||||||
private Integer nPush = 0;
|
|
||||||
// 最终采样率,计算的时候只用一个采样率
|
|
||||||
private Long finalSampleRate;
|
|
||||||
// 整个波形大小
|
|
||||||
private Long nAllWaveNum = 0L;
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 赋值编码格式(二进制)
|
|
||||||
*/
|
|
||||||
private String strBinType;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package com.njcn.event.pojo.dto.wave;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yxb
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2022年06月02日 20:03
|
|
||||||
* 数字量通道记录类
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class DigitalDTO implements Serializable {
|
|
||||||
|
|
||||||
// 通道序号
|
|
||||||
private Integer nIndex;
|
|
||||||
// 通道名称
|
|
||||||
private String szChannleName;
|
|
||||||
// 相位名称
|
|
||||||
private String szPhasicName;
|
|
||||||
// 监视的通道名称
|
|
||||||
private String szMonitoredChannleName;
|
|
||||||
// 通道的单位
|
|
||||||
private Integer Initial;
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package com.njcn.event.pojo.dto.wave;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yxb
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2022年06月02日 20:03
|
|
||||||
* 特征值计算类
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class EigenvalueDTO implements Serializable {
|
|
||||||
|
|
||||||
//是特征幅值(残余电压百分比)
|
|
||||||
private float amplitude;
|
|
||||||
//是特征幅值(残余电压)
|
|
||||||
private float residualVoltage;
|
|
||||||
//额定定压(动态电压)
|
|
||||||
private float ratedVoltage;
|
|
||||||
//持续时间
|
|
||||||
private float durationTime;
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package com.njcn.event.pojo.dto.wave;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yxb
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2022年06月02日 20:03
|
|
||||||
* 突变量计算类
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class MutationDTO implements Serializable {
|
|
||||||
|
|
||||||
private List<List<Float>> listRms_Offline = new ArrayList<>();//离线数据RMS有效值数据
|
|
||||||
private List<List<Float>> listTBL_Offline = new ArrayList<>();//离线数据突变量数据
|
|
||||||
private double fMinMagA = 99999d;
|
|
||||||
private double fMinMagB = 99999d;
|
|
||||||
private double fMinMagC = 99999d;
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package com.njcn.event.pojo.dto.wave;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yxb
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2022年06月02日 20:03
|
|
||||||
* 采样率类
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class RateDTO implements Serializable {
|
|
||||||
|
|
||||||
// 1秒钟内的采样点数
|
|
||||||
private Long nOneSample;
|
|
||||||
// 总采样点数
|
|
||||||
private Long nSampleNum;
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package com.njcn.event.pojo.dto.wave;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author yxb
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2022年06月02日 20:03
|
|
||||||
* 返回波形数据类
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class WaveDataDTO implements Serializable {
|
|
||||||
|
|
||||||
private ComtradeCfgDTO comtradeCfgDTO;//CFG实体类
|
|
||||||
//波形对应的标题
|
|
||||||
private List<String> waveTitle;
|
|
||||||
//波形对应的值
|
|
||||||
private List<List<Float>> listWaveData;
|
|
||||||
//波形RMS值
|
|
||||||
private List<List<Float>> listRmsData;
|
|
||||||
//RMS最小值
|
|
||||||
private List<List<Float>> listRmsMinData;
|
|
||||||
//波形对应的相别数量
|
|
||||||
private Integer iPhasic;
|
|
||||||
//接线方式(0.星型接法;1.三角型接法;2.开口三角型接法)
|
|
||||||
private Integer ptType;
|
|
||||||
//PT变比
|
|
||||||
private Double pt;
|
|
||||||
//CT变比"
|
|
||||||
private Double ct;
|
|
||||||
}
|
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>system-api</artifactId>
|
<artifactId>system-api</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
|
|||||||
@@ -5,24 +5,18 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
import com.njcn.device.pq.pojo.vo.*;
|
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
|
||||||
import com.njcn.event.service.majornetwork.AutonomeWaveService;
|
import com.njcn.event.service.majornetwork.AutonomeWaveService;
|
||||||
import com.njcn.event.service.majornetwork.LargeScreenService;
|
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
|
|||||||
@@ -8,16 +8,14 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
import com.njcn.event.pojo.param.TransientParam;
|
import com.njcn.event.pojo.param.TransientParam;
|
||||||
import com.njcn.event.pojo.param.WaveFileParam;
|
|
||||||
import com.njcn.event.pojo.po.EventDetailNew;
|
import com.njcn.event.pojo.po.EventDetailNew;
|
||||||
import com.njcn.event.pojo.vo.TransientVO;
|
import com.njcn.event.pojo.vo.TransientVO;
|
||||||
import com.njcn.event.service.majornetwork.TransientService;
|
import com.njcn.event.service.majornetwork.TransientService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.njcn.event.service.majornetwork;
|
package com.njcn.event.service.majornetwork;
|
||||||
|
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
package com.njcn.event.service.majornetwork;
|
package com.njcn.event.service.majornetwork;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
|
||||||
import com.njcn.event.pojo.param.*;
|
import com.njcn.event.pojo.param.*;
|
||||||
import com.njcn.event.pojo.po.EventDetail;
|
|
||||||
import com.njcn.event.pojo.vo.*;
|
import com.njcn.event.pojo.vo.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package com.njcn.event.service.majornetwork.Impl;
|
package com.njcn.event.service.majornetwork.Impl;
|
||||||
|
|
||||||
import com.njcn.common.config.GeneralInfo;
|
import com.njcn.common.config.GeneralInfo;
|
||||||
import com.njcn.event.pojo.dto.wave.AnalogDTO;
|
import com.njcn.event.file.pojo.dto.AnalogDTO;
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
|
import com.njcn.event.file.component.WaveFileComponent;
|
||||||
import com.njcn.event.service.majornetwork.AutonomeWaveService;
|
import com.njcn.event.service.majornetwork.AutonomeWaveService;
|
||||||
import com.njcn.event.utils.WaveUtil;
|
|
||||||
import com.njcn.oss.constant.GeneralConstant;
|
import com.njcn.oss.constant.GeneralConstant;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -32,7 +32,7 @@ public class AutonomeWaveServiceImpl implements AutonomeWaveService {
|
|||||||
|
|
||||||
private final GeneralInfo generalInfo;
|
private final GeneralInfo generalInfo;
|
||||||
|
|
||||||
private final WaveUtil waveUtil;
|
private final WaveFileComponent waveFileComponent;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WaveDataDTO uploadFileAndViewWave(MultipartFile file1, MultipartFile file2) throws IOException {
|
public WaveDataDTO uploadFileAndViewWave(MultipartFile file1, MultipartFile file2) throws IOException {
|
||||||
@@ -59,8 +59,8 @@ public class AutonomeWaveServiceImpl implements AutonomeWaveService {
|
|||||||
datPath = dir + File.separator + fileName2;
|
datPath = dir + File.separator + fileName2;
|
||||||
InputStream cfgInputStream = Files.newInputStream(Paths.get(cfgPath));
|
InputStream cfgInputStream = Files.newInputStream(Paths.get(cfgPath));
|
||||||
InputStream datInputStream = Files.newInputStream(Paths.get(datPath));
|
InputStream datInputStream = Files.newInputStream(Paths.get(datPath));
|
||||||
WaveDataDTO comtrade = waveUtil.getComtrade(cfgInputStream, datInputStream, 1);
|
WaveDataDTO comtrade = waveFileComponent.getComtrade(cfgInputStream, datInputStream, 1);
|
||||||
WaveDataDTO validData = waveUtil.getValidData(comtrade);
|
WaveDataDTO validData = waveFileComponent.getValidData(comtrade);
|
||||||
return countPtCt(validData);
|
return countPtCt(validData);
|
||||||
} else {
|
} else {
|
||||||
//使用本地的波形文件进行测试
|
//使用本地的波形文件进行测试
|
||||||
@@ -72,8 +72,8 @@ public class AutonomeWaveServiceImpl implements AutonomeWaveService {
|
|||||||
datPath = dir + File.separator + fileName1;
|
datPath = dir + File.separator + fileName1;
|
||||||
InputStream cfgInputStream = Files.newInputStream(Paths.get(cfgPath));
|
InputStream cfgInputStream = Files.newInputStream(Paths.get(cfgPath));
|
||||||
InputStream datInputStream = Files.newInputStream(Paths.get(datPath));
|
InputStream datInputStream = Files.newInputStream(Paths.get(datPath));
|
||||||
WaveDataDTO comtrade = waveUtil.getComtrade(cfgInputStream, datInputStream, 1);
|
WaveDataDTO comtrade = waveFileComponent.getComtrade(cfgInputStream, datInputStream, 1);
|
||||||
WaveDataDTO validData = waveUtil.getValidData(comtrade);
|
WaveDataDTO validData = waveFileComponent.getValidData(comtrade);
|
||||||
return countPtCt(validData);
|
return countPtCt(validData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.njcn.device.pq.api.LineFeignClient;
|
|||||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||||
import com.njcn.event.enums.EventResponseEnum;
|
import com.njcn.event.enums.EventResponseEnum;
|
||||||
|
import com.njcn.event.file.pojo.enums.WaveFileResponseEnum;
|
||||||
import com.njcn.event.pojo.constant.Param;
|
import com.njcn.event.pojo.constant.Param;
|
||||||
import com.njcn.event.pojo.param.*;
|
import com.njcn.event.pojo.param.*;
|
||||||
import com.njcn.event.pojo.po.EventDetail;
|
import com.njcn.event.pojo.po.EventDetail;
|
||||||
@@ -1953,7 +1954,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
|||||||
|
|
||||||
// TODO 1
|
// TODO 1
|
||||||
if (!srcCFGFile.exists() && !srcDATFile.exists()) {
|
if (!srcCFGFile.exists() && !srcDATFile.exists()) {
|
||||||
throw new BusinessException(EventResponseEnum.ANALYSEWAVE_NOT_FOUND);
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 1
|
// TODO 1
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.njcn.event.service.majornetwork.Impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -13,13 +12,13 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.device.pms.api.MonitorClient;
|
import com.njcn.device.pms.api.MonitorClient;
|
||||||
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
|
||||||
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
|
import com.njcn.event.file.component.WaveFileComponent;
|
||||||
|
import com.njcn.event.file.pojo.enums.WaveFileResponseEnum;
|
||||||
import com.njcn.event.mapper.distribution.PwRmpEventDetailMapper;
|
import com.njcn.event.mapper.distribution.PwRmpEventDetailMapper;
|
||||||
import com.njcn.event.mapper.majornetwork.RmpEventDetailMapper;
|
import com.njcn.event.mapper.majornetwork.RmpEventDetailMapper;
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
|
||||||
import com.njcn.event.service.majornetwork.RmpEventDetailService;
|
|
||||||
import com.njcn.oss.constant.GeneralConstant;
|
import com.njcn.oss.constant.GeneralConstant;
|
||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||||
@@ -29,18 +28,13 @@ import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
|||||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||||
import com.njcn.event.enums.EventResponseEnum;
|
import com.njcn.event.enums.EventResponseEnum;
|
||||||
import com.njcn.event.mapper.majornetwork.TransientMapper;
|
import com.njcn.event.mapper.majornetwork.TransientMapper;
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
|
||||||
import com.njcn.event.pojo.param.TransientParam;
|
import com.njcn.event.pojo.param.TransientParam;
|
||||||
import com.njcn.event.pojo.param.WaveFileParam;
|
|
||||||
import com.njcn.event.pojo.po.EventDetail;
|
import com.njcn.event.pojo.po.EventDetail;
|
||||||
import com.njcn.event.pojo.po.EventDetailNew;
|
import com.njcn.event.pojo.po.EventDetailNew;
|
||||||
import com.njcn.event.pojo.vo.TransientVO;
|
import com.njcn.event.pojo.vo.TransientVO;
|
||||||
import com.njcn.event.service.majornetwork.EventDetailService;
|
import com.njcn.event.service.majornetwork.EventDetailService;
|
||||||
import com.njcn.event.service.majornetwork.TransientService;
|
import com.njcn.event.service.majornetwork.TransientService;
|
||||||
import com.njcn.event.utils.WaveUtil;
|
|
||||||
import com.njcn.huawei.obs.util.OBSUtil;
|
|
||||||
|
|
||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
|
||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
@@ -48,18 +42,14 @@ import com.njcn.system.pojo.po.DictData;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.influxdb.dto.QueryResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.time.Instant;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -90,7 +80,7 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
|
|
||||||
private final GeneralInfo generalInfo;
|
private final GeneralInfo generalInfo;
|
||||||
|
|
||||||
private final WaveUtil waveUtil;
|
private final WaveFileComponent waveFileComponent;
|
||||||
|
|
||||||
private final MonitorClient monitorClient;
|
private final MonitorClient monitorClient;
|
||||||
|
|
||||||
@@ -184,9 +174,6 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
@Override
|
@Override
|
||||||
public WaveDataDTO getTransientAnalyseWave(MonitorTerminalParam param) {
|
public WaveDataDTO getTransientAnalyseWave(MonitorTerminalParam param) {
|
||||||
WaveDataDTO waveDataDTO;
|
WaveDataDTO waveDataDTO;
|
||||||
//原始数据
|
|
||||||
WaveDataDTO originalData;
|
|
||||||
|
|
||||||
//获取暂降事件
|
//获取暂降事件
|
||||||
RmpEventDetailPO eventDetail = rmpEventDetailMapper.getByEventId(param.getId());
|
RmpEventDetailPO eventDetail = rmpEventDetailMapper.getByEventId(param.getId());
|
||||||
LineDetailDataVO lineDetailData = new LineDetailDataVO();
|
LineDetailDataVO lineDetailData = new LineDetailDataVO();
|
||||||
@@ -200,39 +187,34 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
monitorVO = monitorClient.getMonitorTerminal(param).getData();
|
monitorVO = monitorClient.getMonitorTerminal(param).getData();
|
||||||
ip = monitorVO.getIp();
|
ip = monitorVO.getIp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
System.out.println(eventDetail.getEventId());
|
|
||||||
String waveName = eventDetail.getWavePath();
|
String waveName = eventDetail.getWavePath();
|
||||||
String cfgPath, datPath;
|
String cfgPath, datPath;
|
||||||
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
||||||
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
||||||
InputStream cfgStream = waveUtil.getFileInputStreamByFilePath(cfgPath);
|
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||||
InputStream datStream = waveUtil.getFileInputStreamByFilePath(datPath);
|
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||||
throw new BusinessException(EventResponseEnum.ANALYSEWAVE_NOT_FOUND);
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
originalData = waveUtil.getComtrade(cfgStream, datStream, 1);
|
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||||
// } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
|
||||||
} else {
|
} else {
|
||||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||||
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
|
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
|
||||||
System.out.println("波形路径-------------------" + cfgPath);
|
System.out.println("波形路径-------------------" + cfgPath);
|
||||||
try (
|
try (
|
||||||
|
|
||||||
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath);
|
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath);
|
||||||
InputStream datStream = fileStorageUtil.getFileStream(datPath)
|
InputStream datStream = fileStorageUtil.getFileStream(datPath)
|
||||||
) {
|
) {
|
||||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||||
throw new BusinessException(EventResponseEnum.ANALYSEWAVE_NOT_FOUND);
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
originalData = waveUtil.getComtrade(cfgStream, datStream, 1);
|
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(EventResponseEnum.WAVE_DATA_INVALID);
|
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
waveDataDTO = waveUtil.getValidData(originalData);
|
waveDataDTO = waveFileComponent.getValidData(waveDataDTO);
|
||||||
if (param.getSystemType() == 0) {
|
if (param.getSystemType() == 0) {
|
||||||
waveDataDTO.setPtType(PubUtils.ptTypeName(lineDetailData.getPtType()));
|
waveDataDTO.setPtType(PubUtils.ptTypeName(lineDetailData.getPtType()));
|
||||||
double pt1 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[0]);
|
double pt1 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[0]);
|
||||||
@@ -435,10 +417,10 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
||||||
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
||||||
cfgStream = waveUtil.getFileInputStreamByFilePath(cfgPath);
|
cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||||
datStream = waveUtil.getFileInputStreamByFilePath(datPath);
|
datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||||
throw new BusinessException(EventResponseEnum.ANALYSEWAVE_NOT_FOUND);
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||||
@@ -449,7 +431,7 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
datStream = fileStorageUtil.downloadStream(datPath);
|
datStream = fileStorageUtil.downloadStream(datPath);
|
||||||
|
|
||||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||||
throw new BusinessException(EventResponseEnum.ANALYSEWAVE_NOT_FOUND);
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -468,7 +450,7 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
writeFile(datStream, fileDat);
|
writeFile(datStream, fileDat);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(EventResponseEnum.WAVE_DATA_INVALID);
|
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (cfgStream != null) {
|
if (cfgStream != null) {
|
||||||
|
|||||||
@@ -2,10 +2,8 @@ package com.njcn.event.service.majornetwork;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
import com.njcn.event.pojo.param.TransientParam;
|
import com.njcn.event.pojo.param.TransientParam;
|
||||||
import com.njcn.event.pojo.param.WaveFileParam;
|
|
||||||
import com.njcn.event.pojo.po.EventDetail;
|
|
||||||
import com.njcn.event.pojo.po.EventDetailNew;
|
import com.njcn.event.pojo.po.EventDetailNew;
|
||||||
import com.njcn.event.pojo.vo.TransientVO;
|
import com.njcn.event.pojo.vo.TransientVO;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,13 @@
|
|||||||
package com.njcn.event;
|
package com.njcn.event;
|
||||||
|
|
||||||
import com.njcn.event.enums.EventResponseEnum;
|
import com.njcn.event.enums.EventResponseEnum;
|
||||||
|
import com.njcn.event.file.component.WaveFileComponent;
|
||||||
|
import com.njcn.event.file.pojo.dto.EigenvalueDTO;
|
||||||
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
|
import com.njcn.event.file.pojo.enums.WaveFileResponseEnum;
|
||||||
import com.njcn.event.pojo.PqsEventDetail;
|
import com.njcn.event.pojo.PqsEventDetail;
|
||||||
import com.njcn.event.pojo.PqsOnlinerateAggregate;
|
import com.njcn.event.pojo.PqsOnlinerateAggregate;
|
||||||
import com.njcn.event.pojo.PqsEventDetailCount;
|
import com.njcn.event.pojo.PqsEventDetailCount;
|
||||||
import com.njcn.event.pojo.dto.wave.EigenvalueDTO;
|
|
||||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
|
||||||
import com.njcn.event.utils.WaveUtil;
|
|
||||||
import com.njcn.huawei.obs.util.OBSUtil;
|
import com.njcn.huawei.obs.util.OBSUtil;
|
||||||
import com.njcn.influxdb.config.InfluxDbConfig;
|
import com.njcn.influxdb.config.InfluxDbConfig;
|
||||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||||
@@ -50,7 +51,7 @@ public class EventBootApplicationTest {
|
|||||||
private InfluxDbUtils influxDbUtils;
|
private InfluxDbUtils influxDbUtils;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WaveUtil waveUtil;
|
private WaveFileComponent waveFileComponent;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OBSUtil obsUtil;
|
private OBSUtil obsUtil;
|
||||||
@@ -145,17 +146,17 @@ public class EventBootApplicationTest {
|
|||||||
InputStream datStream =obsUtil.downloadStream(datPath);
|
InputStream datStream =obsUtil.downloadStream(datPath);
|
||||||
|
|
||||||
if(Objects.isNull(cfgStream) || Objects.isNull(datStream)){
|
if(Objects.isNull(cfgStream) || Objects.isNull(datStream)){
|
||||||
throw new FileNotFoundException(EventResponseEnum.ANALYSEWAVE_NOT_FOUND.getMessage());
|
throw new FileNotFoundException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取瞬时波形 //获取原始波形值
|
// 获取瞬时波形 //获取原始波形值
|
||||||
WaveDataDTO waveDataDTO = waveUtil.getComtrade(cfgStream,datStream, 1);
|
WaveDataDTO waveDataDTO = waveFileComponent.getComtrade(cfgStream,datStream, 1);
|
||||||
|
|
||||||
// 获取RMS波形
|
// 获取RMS波形
|
||||||
WaveDataDTO waveDataDTO1 = waveUtil.getValidData(waveDataDTO);
|
WaveDataDTO waveDataDTO1 = waveFileComponent.getValidData(waveDataDTO);
|
||||||
|
|
||||||
// 获取特征值
|
// 获取特征值
|
||||||
List<EigenvalueDTO> lstEigenvalueDTO = waveUtil.getEigenvalue(waveDataDTO, true);
|
List<EigenvalueDTO> lstEigenvalueDTO = waveFileComponent.getEigenvalue(waveDataDTO, true);
|
||||||
System.out.println(1);
|
System.out.println(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user