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