From f865b1045e4a24cc3cd9f7e6172245e3822cc0bf Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Wed, 8 Nov 2023 08:48:04 +0800 Subject: [PATCH] =?UTF-8?q?gamma=E8=AF=BB=E5=8F=96baseline=EF=BC=8Clc?= =?UTF-8?q?=EF=BC=8Cscac=E6=95=B0=E6=8D=AEnan=E8=B5=8B=E5=80=BCnull=20beta?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD=E5=8F=A5=E4=B8=AD=E6=96=87=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/util/GammaFileUtil.java | 5 ++-- .../service/impl/GammaServiceImpl.java | 20 ++++++------- .../impl/SpectrumAnalysisServiceImpl.java | 30 +++++++++---------- 3 files changed, 26 insertions(+), 29 deletions(-) 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 6081c18a..0242ec63 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 @@ -345,7 +345,7 @@ public class GammaFileUtil extends AbstractLogOrReport { } else if (StringUtils.isNotBlank(strList.get(k)) && strList.get(k).equalsIgnoreCase("nan")) { //如果数据不为空 但 数据匹配任意大小写的nan //结果数组中补充0.0 - vData.add(0.0); + vData.add(null); } } } @@ -386,8 +386,7 @@ public class GammaFileUtil extends AbstractLogOrReport { data.add(d); } else if (StringUtils.isNotBlank(str) && str.equalsIgnoreCase("nan")) { //如果当前数据不为空 但 数据匹配任意大小写的nan - //将0.0填充到 double中 - data.add(0.0); + data.add(null); } } } 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 ee6432de..0d98087d 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 @@ -138,8 +138,6 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi private IGardsQcCheckSpectrumService qcCheckSpectrumService; @Autowired private IGardsAnalySettingSpectrumService analySettingSpectrumService; - @Autowired - private FTPClient ftpClient; @Override public Result initValue(Integer sampleId, String dbName, String samfileName, HttpServletRequest request) { @@ -3685,6 +3683,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH)); String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH) + 1) + ".txt"; // 连接ftp + FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)) { throw new RuntimeException("ftp connection failed"); } @@ -3712,15 +3711,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi throw new RuntimeException(e); } finally { try { -// if (Objects.nonNull(ftpClient)) { -// ftpClient.disconnect(); -// } + if (Objects.nonNull(ftpClient)) { + ftpClient.disconnect(); + } if (ObjectUtil.isNotNull(inputStream)) { inputStream.close(); } if (ObjectUtil.isNotNull(outputStream)) { outputStream.close(); - ftpClient.completePendingCommand(); } } catch (IOException e) { throw new RuntimeException(e); @@ -3735,7 +3733,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH)); String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH) + 1) + ".txt"; // 连接ftp - FTPClient ftpClient = null; + FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)) { throw new RuntimeException("ftp connection failed"); } @@ -3767,15 +3765,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi throw new RuntimeException(e); } finally { try { -// if (Objects.nonNull(ftpClient)) { -// ftpClient.disconnect(); -// } + if (Objects.nonNull(ftpClient)) { + ftpClient.disconnect(); + } if (ObjectUtil.isNotNull(inputStream)) { inputStream.close(); } if (ObjectUtil.isNotNull(outputStream)) { outputStream.close(); - ftpClient.completePendingCommand(); } } catch (IOException e) { throw new RuntimeException(e); @@ -4274,6 +4271,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath.substring(0, logPath.lastIndexOf(StringPool.SLASH)); String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1); // 连接ftp + FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)) { throw new RuntimeException("ftp connection failed"); } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java index aebdfc37..7051e0c9 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java @@ -688,7 +688,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } EnergySpectrumStruct struct = betaDataFile.getSampleStruct(); @@ -759,7 +759,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(rrrLogInfo.getSampleFileName() + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } GardsCalibrationSpectrum gammaCalibrationParamS = new GardsCalibrationSpectrum(); @@ -1224,7 +1224,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } Map> map = new HashMap<>(); @@ -1258,7 +1258,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } if (StringUtils.isNotBlank(betaDataFile.getSampleFilePathName())){ @@ -1348,7 +1348,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } QCResult qcResult = new QCResult(); @@ -1481,7 +1481,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } List xeDataList = betaDataFile.getXeResultsSpectrumList(); @@ -1549,7 +1549,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } //获取qc的分析结果数据 @@ -1654,7 +1654,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } //判断qc的分析结果是否为空 @@ -1762,7 +1762,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } //读取文件信息 @@ -1849,7 +1849,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(extInfo.getSampleFileName() + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } //获取sample文件的文件读取信息 @@ -2117,7 +2117,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } //读取文件信息 @@ -2470,7 +2470,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } Map map = new HashMap<>(); @@ -2618,7 +2618,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } //选择矩形框高度 @@ -2668,7 +2668,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements String sampleFileName = analyseData.getSampleFileNames().get(0); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } map = BetaGammaAnalyzeCurrentProcess(analyseData, betaDataFile); @@ -3231,7 +3231,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { - result.error500("请先加载文件基础信息!"); + result.error500("Load basic file information first!"); return result; } Map map = new HashMap<>();