From 6e7b3f8e013d178a8c46a375a0903bba83d279bb Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Wed, 15 Nov 2023 18:54:20 +0800 Subject: [PATCH] =?UTF-8?q?beta=E5=8A=9F=E8=83=BD=E5=A2=9E=E5=8A=A0initVal?= =?UTF-8?q?ue=E6=8E=A5=E5=8F=A3=E6=8F=90=E5=89=8D=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/controller/GammaController.java | 6 --- .../SpectrumAnalysesController.java | 6 +++ .../service/ISpectrumAnalysisService.java | 2 + .../impl/SpectrumAnalysisServiceImpl.java | 41 +++++++++++-------- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/GammaController.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/GammaController.java index 7c448ca5..8acabdbc 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/GammaController.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/GammaController.java @@ -24,12 +24,6 @@ public class GammaController { @Autowired private IGammaService gammaService; - @Autowired - private RedisTemplate redisTemplate; - - @Autowired - private SystemClient systemClient; - @GetMapping("initValue") @ApiOperation(value = "初始化gamma数据", notes = "初始化gamma数据") public Result initValue(Integer sampleId, String dbName, String analyst, String fileName, HttpServletRequest request) { diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java index 289ad2d7..9c6e5263 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java @@ -24,6 +24,12 @@ public class SpectrumAnalysesController { @Autowired private ISpectrumAnalysisService spectrumAnalysisService; + @GetMapping("initValue") + @ApiOperation(value = "初始化数据", notes = "初始化数据") + public Result initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String gasFileName, String detFileName, String qcFileName, HttpServletRequest request) { + return spectrumAnalysisService.initValue(dbName, sampleId, analyst, sampleFileName, gasFileName, detFileName, qcFileName, request); + } + @GetMapping("getDBSearchList") @ApiOperation(value = "查询查询条件数据接口", notes = "查询查询条件数据接口") public Result getDBSearchList(HttpServletRequest request, boolean AllUsers) { diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java index b82d326b..361b7234 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java @@ -14,6 +14,8 @@ import java.util.List; public interface ISpectrumAnalysisService { + Result initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String gasFileName, String detFileName, String qcFileName, HttpServletRequest request); + Result getDBSearchList(HttpServletRequest request, boolean AllUsers); Result getDBSpectrumList(QueryRequest queryRequest, GardsSampleDataSpectrum gardsSampleData, String dbName, String[] menuTypes, boolean AllUsers, boolean CollectStopB, boolean AcqStartB, Date startDate, Date endDate, HttpServletRequest request); 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 166bc21f..b90fb98b 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 @@ -110,6 +110,14 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements private IGardsHistogramSpectrumService histogramService; + @Override + public Result initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String gasFileName, String detFileName, String qcFileName, HttpServletRequest request) { + if (StringUtils.isNotBlank(dbName) && Objects.nonNull(sampleId)) { + return getDBSpectrumChart(dbName, sampleId, analyst, request); + } else { + return getFileSpectrumChart(sampleFileName, gasFileName, detFileName, qcFileName, request); + } + } @Override public Result getDBSearchList(HttpServletRequest request, boolean AllUsers) { @@ -342,24 +350,9 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements if (dbName.equalsIgnoreCase("auto")){ dbName = "RNAUTO"; analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, "RNAUTO"); - xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults(dbName, analysisID, sampleId); - gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNAUTO", analysisID); - betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNAUTO", analysisID); - roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNAUTO", analysisID, sampleId); - roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNAUTO", analysisID, sampleId); } else if (dbName.equalsIgnoreCase("man")){ dbName = "RNMAN"; analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, analyst); - gammaCalibrationPairsList = spectrumAnalysisMapper.ReadGammaFitChannelEnergy(analysisID, sampleId); - betaCalibrationPairsList = spectrumAnalysisMapper.ReadBetaFitChannelEnergy(analysisID, sampleId); - xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults(dbName, analysisID, sampleId); - gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNMAN", analysisID); - betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNMAN", analysisID); - roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNMAN", analysisID, sampleId); - roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNMAN", analysisID, sampleId); - }else { - result.error500("The database type does not exist"); - return result; } File sampleTmp = null; File gasTmp = null; @@ -411,6 +404,21 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements //如果缓存中没有公用变量的数据 if (Objects.isNull(betaDataFile)) { betaDataFile = new BetaDataFile(); + if (dbName.equalsIgnoreCase("RNAUTO")) { + xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults(dbName, analysisID, sampleId); + gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNAUTO", analysisID); + betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNAUTO", analysisID); + roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNAUTO", analysisID, sampleId); + roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNAUTO", analysisID, sampleId); + } else { + gammaCalibrationPairsList = spectrumAnalysisMapper.ReadGammaFitChannelEnergy(analysisID, sampleId); + betaCalibrationPairsList = spectrumAnalysisMapper.ReadBetaFitChannelEnergy(analysisID, sampleId); + xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults(dbName, analysisID, sampleId); + gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNMAN", analysisID); + betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNMAN", analysisID); + roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNMAN", analysisID, sampleId); + roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNMAN", analysisID, sampleId); + } //给公用变量赋值sampleId betaDataFile.setSampleId(String.valueOf(sampleId)); //用于记录文件路径信息 @@ -2984,9 +2992,6 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements } //根据sample文件名称获取当前文件的缓存信息 BetaDataFile sampleBetaData = cache.getIfPresent(sampleFileName + "-" + userName); - if (Objects.isNull(sampleBetaData)) { - sampleBetaData = new BetaDataFile(); - } //将当前文件用到的计算数据同步到需要计算的文件缓存 sampleBetaData.setBetaList(betaList); sampleBetaData.setBetaFittingPara(betaFittingPara);