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);