人工交互模块保存文件代码,文件路径\改为/匹配,避免文件被覆盖为0KB的问题

This commit is contained in:
qiaoqinzheng 2024-03-15 11:20:21 +08:00
parent 29821e708d
commit 8d7bee4735
2 changed files with 5 additions and 5 deletions

View File

@ -3232,7 +3232,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
sampleTmp = new File(fileAnlyse.getTmpFilePath());
//sample文件的存储路径
String saveSamplePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + middleData.analyses_save_filePath;
if (Objects.nonNull(sampleTmp) && !saveSamplePath.equals(fileAnlyse.getTmpFilePath())) {
if (Objects.nonNull(sampleTmp) && !saveSamplePath.equals(fileAnlyse.getTmpFilePath().replace(StringPool.BACK_SLASH, StringPool.SLASH))) {
bRet = ftpUtil.saveFile(saveSamplePath, new FileInputStream(sampleTmp));
}
} catch (FileNotFoundException e) {

View File

@ -4278,7 +4278,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
if (StringUtils.isNotBlank(sampleFilePathName)) {
//sample文件的saveFile存储路径
String saveSamplePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + sampleFilePathName;
if (StringUtils.isNotBlank(betaDataFile.getSampleTmpPath()) && !saveSamplePath.equals(betaDataFile.getSampleTmpPath())) {
if (StringUtils.isNotBlank(betaDataFile.getSampleTmpPath()) && !saveSamplePath.equals(betaDataFile.getSampleTmpPath().replace(StringPool.BACK_SLASH, StringPool.SLASH))) {
File sampleTmp = new File(betaDataFile.getSampleTmpPath());
ftpUtil.saveFile(saveSamplePath, new FileInputStream(sampleTmp));
}
@ -4286,7 +4286,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
if (StringUtils.isNotBlank(gasFilePathName)) {
//gas文件的saveFile存储路径
String saveGasPath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + gasFilePathName;
if (StringUtils.isNotBlank(betaDataFile.getGasTmpPath()) && !saveGasPath.equals(betaDataFile.getGasTmpPath())) {
if (StringUtils.isNotBlank(betaDataFile.getGasTmpPath()) && !saveGasPath.equals(betaDataFile.getGasTmpPath().replace(StringPool.BACK_SLASH, StringPool.SLASH))) {
File gasTmp = new File(betaDataFile.getGasTmpPath());
ftpUtil.saveFile(saveGasPath, new FileInputStream(gasTmp));
}
@ -4294,7 +4294,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
if (StringUtils.isNotBlank(detFilePathName)) {
//det文件的saveFile存储路径
String saveDetPath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + detFilePathName;
if (StringUtils.isNotBlank(betaDataFile.getDetTmpPath()) && !saveDetPath.equals(betaDataFile.getDetTmpPath())) {
if (StringUtils.isNotBlank(betaDataFile.getDetTmpPath()) && !saveDetPath.equals(betaDataFile.getDetTmpPath().replace(StringPool.BACK_SLASH, StringPool.SLASH))) {
File detTmp = new File(betaDataFile.getDetTmpPath());
ftpUtil.saveFile(saveDetPath, new FileInputStream(detTmp));
}
@ -4302,7 +4302,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
if (StringUtils.isNotBlank(qcFilePathName)) {
//qc文件的saveFile存储路径
String saveQcPath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + qcFilePathName;
if (StringUtils.isNotBlank(betaDataFile.getQcTmpPath()) && !saveQcPath.equals(betaDataFile.getQcTmpPath())) {
if (StringUtils.isNotBlank(betaDataFile.getQcTmpPath()) && !saveQcPath.equals(betaDataFile.getQcTmpPath().replace(StringPool.BACK_SLASH, StringPool.SLASH))) {
File qcTmp = new File(betaDataFile.getQcTmpPath());
ftpUtil.saveFile(saveQcPath, new FileInputStream(qcTmp));
}