人工交互模块存储方法,存储数据到数据库文件已经存在的情况下,重复文件提交导致文件大小变成0的问题修改

This commit is contained in:
qiaoqinzheng 2024-03-15 10:24:51 +08:00
parent fb8077531d
commit 17c487ca32
2 changed files with 32 additions and 14 deletions

View File

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

View File

@ -4260,21 +4260,37 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
}
//上传本次文件到ftp人工交互存储路径下
try {
if (StringUtils.isNotBlank(betaDataFile.getSampleTmpPath())) {
File sampleTmp = new File(betaDataFile.getSampleTmpPath());
ftpUtil.saveFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + sampleFilePathName, new FileInputStream(sampleTmp));
{
//sample文件的saveFile存储路径
String saveSamplePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + sampleFilePathName;
if (StringUtils.isNotBlank(betaDataFile.getSampleTmpPath()) && !saveSamplePath.equals(betaDataFile.getSampleTmpPath())) {
File sampleTmp = new File(betaDataFile.getSampleTmpPath());
ftpUtil.saveFile(saveSamplePath, new FileInputStream(sampleTmp));
}
}
if (StringUtils.isNotBlank(betaDataFile.getGasTmpPath())) {
File gasTmp = new File(betaDataFile.getGasTmpPath());
ftpUtil.saveFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + gasFilePathName, new FileInputStream(gasTmp));
{
//gas文件的saveFile存储路径
String saveGasPath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + gasFilePathName;
if (StringUtils.isNotBlank(betaDataFile.getGasTmpPath()) && !saveGasPath.equals(betaDataFile.getGasTmpPath())) {
File gasTmp = new File(betaDataFile.getGasTmpPath());
ftpUtil.saveFile(saveGasPath, new FileInputStream(gasTmp));
}
}
if (StringUtils.isNotBlank(betaDataFile.getDetTmpPath())) {
File detTmp = new File(betaDataFile.getDetTmpPath());
ftpUtil.saveFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + detFilePathName, new FileInputStream(detTmp));
{
//det文件的saveFile存储路径
String saveDetPath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + detFilePathName;
if (StringUtils.isNotBlank(betaDataFile.getDetTmpPath()) && !saveDetPath.equals(betaDataFile.getDetTmpPath())) {
File detTmp = new File(betaDataFile.getDetTmpPath());
ftpUtil.saveFile(saveDetPath, new FileInputStream(detTmp));
}
}
if (StringUtils.isNotBlank(betaDataFile.getQcTmpPath())) {
File qcTmp = new File(betaDataFile.getQcTmpPath());
ftpUtil.saveFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + qcFilePathName, new FileInputStream(qcTmp));
{
//qc文件的saveFile存储路径
String saveQcPath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + qcFilePathName;
if (StringUtils.isNotBlank(betaDataFile.getQcTmpPath()) && !saveQcPath.equals(betaDataFile.getQcTmpPath())) {
File qcTmp = new File(betaDataFile.getQcTmpPath());
ftpUtil.saveFile(saveQcPath, new FileInputStream(qcTmp));
}
}
//分析成功后存储日志文件和报告文件
{