diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java index f038acc5..05eb4419 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -2315,9 +2315,9 @@ public class GammaFileUtil extends AbstractLogOrReport { map.put("AllData", datalist); } - public String GetReportContent(PHDFile phd, boolean bLog) { + public String GetReportContent(PHDFile phd, String userName, boolean bLog) { GStoreMiddleProcessData middleData = new GStoreMiddleProcessData(); - GetInterMiddlData(phd, "", middleData); + GetInterMiddlData(phd, userName, middleData); if(bLog) { return GetLogContent(middleData); } else { diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java index 69d0faa1..23ef5c22 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java @@ -3505,6 +3505,9 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi public void viewARR(Integer sampleId, HttpServletResponse response) { //获取自动处理生成的报告地址 String reportPath = spectrumAnalysisMapper.viewARR(sampleId); + if (StringUtils.isBlank(reportPath)){ + throw new RuntimeException("自动处理程序生成报告不存在!"); + } String pathName = StringPool.SLASH + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH)); String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH)+1)+".txt"; //连接ftp @@ -3615,7 +3618,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi result.error500("Please select the parse file first!"); return result; } - String reportContent = gammaFileUtil.GetReportContent(phd, false); + String reportContent = gammaFileUtil.GetReportContent(phd, userName, false); result.setSuccess(true); result.setResult(reportContent); return result; @@ -3629,7 +3632,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi if (Objects.isNull(phd)) { return; } - String reportContent = gammaFileUtil.GetReportContent(phd, false); + String reportContent = gammaFileUtil.GetReportContent(phd, userName, false); OutputStream fos = null; try { //设置响应类型 @@ -4093,6 +4096,9 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi @Override public void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response) { String logPath = spectrumAnalysisMapper.findAutomaticLogPath(sampleId); + if (StringUtils.isBlank(logPath)){ + throw new RuntimeException("自动处理程序生成日志不存在!"); + } String pathName = StringPool.SLASH + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath.substring(0, logPath.lastIndexOf(StringPool.SLASH)); String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1); //连接ftp @@ -4149,7 +4155,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi result.error500("Please select the parse file first!"); return result; } - String reportContent = gammaFileUtil.GetReportContent(phd, true); + String reportContent = gammaFileUtil.GetReportContent(phd, userName, true); result.setSuccess(true); result.setResult(reportContent); return result;