海南bug修改提交
This commit is contained in:
@@ -92,7 +92,7 @@ public class PqDevice implements Serializable {
|
||||
*/
|
||||
private Date nextTimeCheck;
|
||||
/**
|
||||
* 电镀功能 0关闭 1开启 默认关闭
|
||||
* 电度功能 0关闭 1开启 默认关闭
|
||||
*/
|
||||
private Integer electroplate;
|
||||
/**
|
||||
|
||||
@@ -148,6 +148,8 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
||||
eventDetailNew = BeanUtil.copyProperties(eventDetail, EventDetailNew.class);
|
||||
//监测点id
|
||||
eventDetailNew.setLineId(eventDetail.getMeasurementPointId());
|
||||
//需要转成百分比*100
|
||||
eventDetailNew.setFeatureAmplitude(eventDetail.getFeatureAmplitude()*100);
|
||||
//持续时间
|
||||
eventDetailNew.setDuration(eventDetail.getDuration());
|
||||
//特征幅值
|
||||
|
||||
@@ -204,13 +204,41 @@ 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;
|
||||
log.info("本地磁盘波形文件路径----" + cfgPath);
|
||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
|
||||
//适配文件后缀小写
|
||||
cfgPath2 = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG.toLowerCase();
|
||||
datPath2 = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT.toLowerCase();
|
||||
log.info("本地磁盘波形文件路径----" + cfgPath2);
|
||||
log.info("本地磁盘波形文件路径----" + datPath2);
|
||||
try (
|
||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||
)
|
||||
{
|
||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
|
||||
}
|
||||
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info("大写文件流为空");
|
||||
try {
|
||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath2);
|
||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath2);
|
||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
}
|
||||
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||
} catch (Exception e1) {
|
||||
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
|
||||
}
|
||||
|
||||
}
|
||||
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;
|
||||
@@ -495,22 +523,23 @@ public class TransientServiceImpl implements TransientService {
|
||||
try {
|
||||
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
||||
log.info("cfg-----"+cfgPath);
|
||||
log.info("cfg-----"+datPath);
|
||||
|
||||
//判断文件是否存在
|
||||
boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath);
|
||||
if (!result1) {
|
||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG_LOWER;
|
||||
cfg = GeneralConstant.CFG_LOWER;
|
||||
File file = new File(cfgPath);
|
||||
if(!file.exists()){
|
||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG_LOWER;
|
||||
}
|
||||
|
||||
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
||||
boolean result2 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), datPath);
|
||||
if (!result2) {
|
||||
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT_LOWER;
|
||||
dat = GeneralConstant.DAT_LOWER;
|
||||
File file2 = new File(datPath);
|
||||
if(!file2.exists()){
|
||||
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT_LOWER;
|
||||
}
|
||||
|
||||
log.info("cfg-----"+cfgPath);
|
||||
log.info("cfg-----"+datPath);
|
||||
cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||
datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||
} else {
|
||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||
boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath);
|
||||
|
||||
Reference in New Issue
Block a user