人工交互分析beta日志文件没有创建导致无法上传的问题修改

This commit is contained in:
qiaoqinzheng 2024-01-18 11:41:04 +08:00
parent 3f0b7137f1
commit e34725f446

View File

@ -4037,9 +4037,19 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
{
String logPathName = analyses_absolute_LogPath.substring(0, analyses_absolute_LogPath.lastIndexOf(StringPool.SLASH));
String logFileName = analyses_absolute_LogPath.substring(analyses_absolute_LogPath.lastIndexOf(StringPool.SLASH)+1);
String logFilePath = parameterProperties.getLogFilePath() + File.separator + DateUtils.formatDate(new Date(), "yyyy-MM-dd") + File.separator + betaDataFile.getSampleFileName().replace("PHD", "log");
File logFile = new File(logFilePath);
//获取日志的文件存放路径
String logFilePath = parameterProperties.getLogFilePath() + File.separator + DateUtils.formatDate(new Date(), "yyyy-MM-dd");
//判断文件路径是否存在
File logPath = new File(logFilePath);
if (!logPath.exists()) {
logPath.mkdirs();
}
File logFile = new File(logFilePath + File.separator +logFileName);
try {
//判断日志文件是否存在 如果不存在创建一个空的文件 上传到ftp
if (!logFile.exists()) {
FileUtil.writeString("", logFile, "UTF-8");
}
FileInputStream in = new FileInputStream(logFile);
ftpUtil.saveFile(logPathName, logFileName, in);
} catch (FileNotFoundException e) {