fix:gamma自动处理生成报告

This commit is contained in:
xiaoguangbin 2023-10-12 14:27:04 +08:00
parent a807f410c3
commit f838ba0a08

View File

@ -152,6 +152,22 @@ public class Sample_G_Analysis {
// 生成日志文件 // 生成日志文件
writeLog(middleData.getAnalyses_LogPath(), middleData); writeLog(middleData.getAnalyses_LogPath(), middleData);
// todo 报告文件 // todo 报告文件
String reportContent = gammaFileUtil.GetReportContent(phdFile, false);
String reportPath = StringUtils.substringBeforeLast(middleData.getAnalyses_ReportPath(), StringPool.SLASH);
String reportName = StringUtils.substringAfterLast(middleData.getAnalyses_ReportPath(), StringPool.SLASH) + ".txt";
String savePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + reportPath;
String tempDir = System.getProperty("java.io.tmpdir");
// 创建文件
File reportFile = FileUtil.writeString(reportContent, tempDir + System.currentTimeMillis(), "utf8");
try {
ftpUtil.saveFile(savePath, reportName, new FileInputStream(reportFile));
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
} finally {
if (null != reportFile) {
reportFile.delete();
}
}
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
@ -207,7 +223,7 @@ public class Sample_G_Analysis {
* @param middleData * @param middleData
*/ */
private void writeLog(String logFilePath, GStoreMiddleProcessData middleData) { private void writeLog(String logFilePath, GStoreMiddleProcessData middleData) {
logFilePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + logFilePath; logFilePath = StringPool.SLASH + spectrumPathProperties.getLogPath() + StringPool.SLASH + logFilePath;
String sampleId = middleData.getSample_id(); String sampleId = middleData.getSample_id();
MyLogFormatUtil myLogFormatUtil = new MyLogFormatUtil(); MyLogFormatUtil myLogFormatUtil = new MyLogFormatUtil();
List<String> writes = new LinkedList<>(); List<String> writes = new LinkedList<>();