添加暂态事件波形图后台绘图并保存文件服务器
This commit is contained in:
@@ -32,6 +32,11 @@
|
||||
<artifactId>common-microservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-event</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pq-device-api</artifactId>
|
||||
|
||||
@@ -16,10 +16,6 @@ public enum EventResponseEnum {
|
||||
*/
|
||||
EVENT_COMMON_ERROR("A00650","暂降模块异常"),
|
||||
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>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<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.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
||||
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||
import com.njcn.event.service.majornetwork.AutonomeWaveService;
|
||||
import com.njcn.event.service.majornetwork.LargeScreenService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
@@ -45,7 +39,7 @@ public class AutonomeWaveController extends BaseController {
|
||||
@PostMapping("/uploadFileAndViewWave")
|
||||
@ApiOperation("上传文件并且展示波形")
|
||||
public HttpResult<WaveDataDTO> uploadFileAndViewWave(@ApiParam(value = "文件1", required = true) @RequestPart("file1") MultipartFile file1,
|
||||
@ApiParam(value = "文件2", required = true) @RequestPart("file2") MultipartFile file2) throws IOException {
|
||||
@ApiParam(value = "文件2", required = true) @RequestPart("file2") MultipartFile file2) throws IOException {
|
||||
String methodDescribe = getMethodDescribe("uploadFileAndViewWave");
|
||||
WaveDataDTO result = autonomeWaveService.uploadFileAndViewWave(file1, file2);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
@@ -8,16 +8,14 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
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.WaveFileParam;
|
||||
import com.njcn.event.pojo.po.EventDetailNew;
|
||||
import com.njcn.event.pojo.vo.TransientVO;
|
||||
import com.njcn.event.service.majornetwork.TransientService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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 java.io.IOException;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package com.njcn.event.service.majornetwork;
|
||||
|
||||
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.po.EventDetail;
|
||||
import com.njcn.event.pojo.vo.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.njcn.event.service.majornetwork.Impl;
|
||||
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.event.pojo.dto.wave.AnalogDTO;
|
||||
import com.njcn.event.pojo.dto.wave.WaveDataDTO;
|
||||
import com.njcn.event.file.pojo.dto.AnalogDTO;
|
||||
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.utils.WaveUtil;
|
||||
import com.njcn.oss.constant.GeneralConstant;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -32,7 +32,7 @@ public class AutonomeWaveServiceImpl implements AutonomeWaveService {
|
||||
|
||||
private final GeneralInfo generalInfo;
|
||||
|
||||
private final WaveUtil waveUtil;
|
||||
private final WaveFileComponent waveFileComponent;
|
||||
|
||||
@Override
|
||||
public WaveDataDTO uploadFileAndViewWave(MultipartFile file1, MultipartFile file2) throws IOException {
|
||||
@@ -59,8 +59,8 @@ public class AutonomeWaveServiceImpl implements AutonomeWaveService {
|
||||
datPath = dir + File.separator + fileName2;
|
||||
InputStream cfgInputStream = Files.newInputStream(Paths.get(cfgPath));
|
||||
InputStream datInputStream = Files.newInputStream(Paths.get(datPath));
|
||||
WaveDataDTO comtrade = waveUtil.getComtrade(cfgInputStream, datInputStream, 1);
|
||||
WaveDataDTO validData = waveUtil.getValidData(comtrade);
|
||||
WaveDataDTO comtrade = waveFileComponent.getComtrade(cfgInputStream, datInputStream, 1);
|
||||
WaveDataDTO validData = waveFileComponent.getValidData(comtrade);
|
||||
return countPtCt(validData);
|
||||
} else {
|
||||
//使用本地的波形文件进行测试
|
||||
@@ -72,8 +72,8 @@ public class AutonomeWaveServiceImpl implements AutonomeWaveService {
|
||||
datPath = dir + File.separator + fileName1;
|
||||
InputStream cfgInputStream = Files.newInputStream(Paths.get(cfgPath));
|
||||
InputStream datInputStream = Files.newInputStream(Paths.get(datPath));
|
||||
WaveDataDTO comtrade = waveUtil.getComtrade(cfgInputStream, datInputStream, 1);
|
||||
WaveDataDTO validData = waveUtil.getValidData(comtrade);
|
||||
WaveDataDTO comtrade = waveFileComponent.getComtrade(cfgInputStream, datInputStream, 1);
|
||||
WaveDataDTO validData = waveFileComponent.getValidData(comtrade);
|
||||
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.LineDetailDataVO;
|
||||
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.param.*;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
@@ -1953,7 +1954,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
|
||||
// TODO 1
|
||||
if (!srcCFGFile.exists() && !srcDATFile.exists()) {
|
||||
throw new BusinessException(EventResponseEnum.ANALYSEWAVE_NOT_FOUND);
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
}
|
||||
|
||||
// TODO 1
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.njcn.event.service.majornetwork.Impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.device.pms.api.MonitorClient;
|
||||
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.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.majornetwork.RmpEventDetailMapper;
|
||||
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.OssPath;
|
||||
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.event.enums.EventResponseEnum;
|
||||
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.WaveFileParam;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import com.njcn.event.pojo.po.EventDetailNew;
|
||||
import com.njcn.event.pojo.vo.TransientVO;
|
||||
import com.njcn.event.service.majornetwork.EventDetailService;
|
||||
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.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
@@ -48,18 +42,14 @@ import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -90,7 +80,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
|
||||
private final GeneralInfo generalInfo;
|
||||
|
||||
private final WaveUtil waveUtil;
|
||||
private final WaveFileComponent waveFileComponent;
|
||||
|
||||
private final MonitorClient monitorClient;
|
||||
|
||||
@@ -184,9 +174,6 @@ public class TransientServiceImpl implements TransientService {
|
||||
@Override
|
||||
public WaveDataDTO getTransientAnalyseWave(MonitorTerminalParam param) {
|
||||
WaveDataDTO waveDataDTO;
|
||||
//原始数据
|
||||
WaveDataDTO originalData;
|
||||
|
||||
//获取暂降事件
|
||||
RmpEventDetailPO eventDetail = rmpEventDetailMapper.getByEventId(param.getId());
|
||||
LineDetailDataVO lineDetailData = new LineDetailDataVO();
|
||||
@@ -200,39 +187,34 @@ public class TransientServiceImpl implements TransientService {
|
||||
monitorVO = monitorClient.getMonitorTerminal(param).getData();
|
||||
ip = monitorVO.getIp();
|
||||
}
|
||||
|
||||
|
||||
System.out.println(eventDetail.getEventId());
|
||||
String waveName = eventDetail.getWavePath();
|
||||
String cfgPath, datPath;
|
||||
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
||||
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
||||
InputStream cfgStream = waveUtil.getFileInputStreamByFilePath(cfgPath);
|
||||
InputStream datStream = waveUtil.getFileInputStreamByFilePath(datPath);
|
||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||
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);
|
||||
// } else if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||
} else {
|
||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
|
||||
System.out.println("波形路径-------------------" + cfgPath);
|
||||
try (
|
||||
|
||||
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath);
|
||||
InputStream datStream = fileStorageUtil.getFileStream(datPath)
|
||||
) {
|
||||
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) {
|
||||
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) {
|
||||
waveDataDTO.setPtType(PubUtils.ptTypeName(lineDetailData.getPtType()));
|
||||
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) {
|
||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
||||
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
||||
cfgStream = waveUtil.getFileInputStreamByFilePath(cfgPath);
|
||||
datStream = waveUtil.getFileInputStreamByFilePath(datPath);
|
||||
cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||
datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||
throw new BusinessException(EventResponseEnum.ANALYSEWAVE_NOT_FOUND);
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
}
|
||||
} else {
|
||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||
@@ -449,7 +431,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
datStream = fileStorageUtil.downloadStream(datPath);
|
||||
|
||||
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);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(EventResponseEnum.WAVE_DATA_INVALID);
|
||||
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
|
||||
} finally {
|
||||
try {
|
||||
if (cfgStream != null) {
|
||||
|
||||
@@ -2,10 +2,8 @@ package com.njcn.event.service.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.WaveFileParam;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import com.njcn.event.pojo.po.EventDetailNew;
|
||||
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;
|
||||
|
||||
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.PqsOnlinerateAggregate;
|
||||
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.influxdb.config.InfluxDbConfig;
|
||||
import com.njcn.influxdb.utils.InfluxDbUtils;
|
||||
@@ -50,7 +51,7 @@ public class EventBootApplicationTest {
|
||||
private InfluxDbUtils influxDbUtils;
|
||||
|
||||
@Autowired
|
||||
private WaveUtil waveUtil;
|
||||
private WaveFileComponent waveFileComponent;
|
||||
|
||||
@Autowired
|
||||
private OBSUtil obsUtil;
|
||||
@@ -145,17 +146,17 @@ public class EventBootApplicationTest {
|
||||
InputStream datStream =obsUtil.downloadStream(datPath);
|
||||
|
||||
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波形
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user