初始版本提交
This commit is contained in:
@@ -8,8 +8,10 @@ import com.njcn.event.file.component.WaveFileComponent;
|
|||||||
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
import com.njcn.event.file.pojo.enums.WaveFileResponseEnum;
|
import com.njcn.event.file.pojo.enums.WaveFileResponseEnum;
|
||||||
import com.njcn.gather.event.devcie.mapper.PqLinedetailMapper;
|
import com.njcn.gather.event.devcie.mapper.PqLinedetailMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
import com.njcn.gather.event.devcie.pojo.po.PqLinedetail;
|
import com.njcn.gather.event.devcie.pojo.po.PqLinedetail;
|
||||||
|
import com.njcn.gather.event.devcie.service.PqDeviceService;
|
||||||
import com.njcn.gather.event.devcie.service.PqLineService;
|
import com.njcn.gather.event.devcie.service.PqLineService;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.MonitorTerminalParam;
|
import com.njcn.gather.event.transientes.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||||
@@ -17,6 +19,7 @@ import com.njcn.gather.event.transientes.service.EventGateService;
|
|||||||
import com.njcn.gather.event.transientes.service.PqsEventdetailService;
|
import com.njcn.gather.event.transientes.service.PqsEventdetailService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -37,21 +40,28 @@ import java.util.stream.Stream;
|
|||||||
public class EventGateServiceImpl implements EventGateService {
|
public class EventGateServiceImpl implements EventGateService {
|
||||||
|
|
||||||
private final PqsEventdetailService pqsEventdetailService;
|
private final PqsEventdetailService pqsEventdetailService;
|
||||||
|
private final PqDeviceService pqDeviceService;
|
||||||
private final WaveFileComponent waveFileComponent;
|
private final WaveFileComponent waveFileComponent;
|
||||||
private final PqLineService pqLineService;
|
private final PqLineService pqLineService;
|
||||||
private final PqLinedetailMapper pqLinedetailMapper;
|
private final PqLinedetailMapper pqLinedetailMapper;
|
||||||
|
@Value("${WAVEPATH}")
|
||||||
|
private String WAVEPATH;
|
||||||
@Override
|
@Override
|
||||||
public WaveDataDTO getTransientAnalyseWave(MonitorTerminalParam param) {
|
public WaveDataDTO getTransientAnalyseWave(MonitorTerminalParam param) {
|
||||||
WaveDataDTO waveDataDTO;
|
WaveDataDTO waveDataDTO;
|
||||||
//获取暂降事件
|
//获取暂降事件
|
||||||
PqsEventdetail eventDetail = pqsEventdetailService.getById(param.getId());
|
PqsEventdetail eventDetail = pqsEventdetailService.getById(param.getId());
|
||||||
|
Integer lineid = eventDetail.getLineid();
|
||||||
|
PqLine pqLine = pqLineService.getById(lineid);
|
||||||
|
PqLinedetail pqLinedetail = pqLinedetailMapper.selectById(lineid);
|
||||||
|
PqDevice device = pqDeviceService.getById(pqLine.getDevIndex());
|
||||||
String waveName = eventDetail.getWavename();
|
String waveName = eventDetail.getWavename();
|
||||||
String cfgPath, datPath;
|
String cfgPath, datPath;
|
||||||
if (StrUtil.isBlank(waveName)) {
|
if (StrUtil.isBlank(waveName)) {
|
||||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
cfgPath = "D:\\10.98.182.99\\"+waveName+".CFG";
|
cfgPath = WAVEPATH+"/"+device.getIp()+"/"+waveName+".CFG";
|
||||||
datPath = "D:\\10.98.182.99\\"+waveName+".DAT";
|
datPath = WAVEPATH+"/"+device.getIp()+"/"+waveName+".DAT";
|
||||||
log.info("本地磁盘波形文件路径----" + cfgPath);
|
log.info("本地磁盘波形文件路径----" + cfgPath);
|
||||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||||
@@ -61,9 +71,7 @@ public class EventGateServiceImpl implements EventGateService {
|
|||||||
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||||
|
|
||||||
waveDataDTO = waveFileComponent.getValidData(waveDataDTO);
|
waveDataDTO = waveFileComponent.getValidData(waveDataDTO);
|
||||||
Integer lineid = eventDetail.getLineid();
|
|
||||||
PqLine pqLine = pqLineService.getById(lineid);
|
|
||||||
PqLinedetail pqLinedetail = pqLinedetailMapper.selectById(lineid);
|
|
||||||
waveDataDTO.setPtType(pqLinedetail.getPttype());
|
waveDataDTO.setPtType(pqLinedetail.getPttype());
|
||||||
waveDataDTO.setPt(pqLine.getPt1()/ pqLine.getPt2());
|
waveDataDTO.setPt(pqLine.getPt1()/ pqLine.getPt2());
|
||||||
waveDataDTO.setCt(pqLine.getCt1()/ pqLine.getCt2());
|
waveDataDTO.setCt(pqLine.getCt1()/ pqLine.getCt2());
|
||||||
|
|||||||
@@ -97,6 +97,6 @@ threadPool:
|
|||||||
maxPoolSize: 20
|
maxPoolSize: 20
|
||||||
queueCapacity: 500
|
queueCapacity: 500
|
||||||
keepAliveSeconds: 60
|
keepAliveSeconds: 60
|
||||||
WAVETYPE:
|
WAVEPATH: D:/comtrade
|
||||||
LIST: 1,3
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user