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 0242ec63..eb3e8acc 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 @@ -2665,9 +2665,9 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(rowFormat(nuclideTitle, nuclideData)); strBuffer.append(System.lineSeparator()); for (int i=0; i gammaCalibrationSpectrumEList = new LinkedList<>(); + List gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi(); + if (betaDataFile.isBGammaEnergyValidSample()) { + GardsCalibrationSpectrum gammaCalibrationS = new GardsCalibrationSpectrum(); + gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + gammaCalibrationS.setCoeff1(Double.valueOf(gammaFittingParaToUi.get(0))); + gammaCalibrationS.setCoeff2(Double.valueOf(gammaFittingParaToUi.get(1))); + gammaCalibrationS.setCoeff3(Double.valueOf(gammaFittingParaToUi.get(2))); + gammaCalibrationSpectrumEList.add(gammaCalibrationS); + } else { + GardsCalibrationSpectrum gammaCalibrationS = new GardsCalibrationSpectrum(); + if (bgAnalyseResult.s_g_fitting_e_c.size() < 0) { + gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + gammaCalibrationS.setCoeff1(Double.valueOf(gammaFittingParaToUi.get(0))); + gammaCalibrationS.setCoeff2(Double.valueOf(gammaFittingParaToUi.get(1))); + gammaCalibrationS.setCoeff3(Double.valueOf(gammaFittingParaToUi.get(2))); + } else { + gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + gammaCalibrationS.setCoeff1(bgAnalyseResult.s_g_fitting_e_c.get(0)); + gammaCalibrationS.setCoeff2(bgAnalyseResult.s_g_fitting_e_c.get(1)); + gammaCalibrationS.setCoeff3(bgAnalyseResult.s_g_fitting_e_c.get(2)); + } + gammaCalibrationSpectrumEList.add(gammaCalibrationS); + } + if (betaDataFile.isBGammaEnergyValidGas()) { + GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum(); + gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + gammaCalibrationG.setCoeff1(Double.valueOf(gammaFittingParaToUi.get(0))); + gammaCalibrationG.setCoeff2(Double.valueOf(gammaFittingParaToUi.get(1))); + gammaCalibrationG.setCoeff3(Double.valueOf(gammaFittingParaToUi.get(2))); + gammaCalibrationSpectrumEList.add(gammaCalibrationG); + } else { + GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum(); + if (bgAnalyseResult.g_g_fitting_e_c.size() < 0) { + gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + gammaCalibrationG.setCoeff1(Double.valueOf(gammaFittingParaToUi.get(0))); + gammaCalibrationG.setCoeff2(Double.valueOf(gammaFittingParaToUi.get(1))); + gammaCalibrationG.setCoeff3(Double.valueOf(gammaFittingParaToUi.get(2))); + } else { + gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + gammaCalibrationG.setCoeff1(bgAnalyseResult.g_g_fitting_e_c.get(0)); + gammaCalibrationG.setCoeff2(bgAnalyseResult.g_g_fitting_e_c.get(1)); + gammaCalibrationG.setCoeff3(bgAnalyseResult.g_g_fitting_e_c.get(2)); + } + + gammaCalibrationSpectrumEList.add(gammaCalibrationG); + } + if (betaDataFile.isBGammaEnergyValidDet()) { + GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum(); + gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + gammaCalibrationD.setCoeff1(Double.valueOf(gammaFittingParaToUi.get(0))); + gammaCalibrationD.setCoeff2(Double.valueOf(gammaFittingParaToUi.get(1))); + gammaCalibrationD.setCoeff3(Double.valueOf(gammaFittingParaToUi.get(2))); + gammaCalibrationSpectrumEList.add(gammaCalibrationD); + } else { + GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum(); + if (bgAnalyseResult.d_g_fitting_e_c.size() < 0) { + gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + gammaCalibrationD.setCoeff1(Double.valueOf(gammaFittingParaToUi.get(0))); + gammaCalibrationD.setCoeff2(Double.valueOf(gammaFittingParaToUi.get(1))); + gammaCalibrationD.setCoeff3(Double.valueOf(gammaFittingParaToUi.get(2))); + } else { + gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + gammaCalibrationD.setCoeff1(bgAnalyseResult.d_g_fitting_e_c.get(0)); + gammaCalibrationD.setCoeff2(bgAnalyseResult.d_g_fitting_e_c.get(1)); + gammaCalibrationD.setCoeff3(bgAnalyseResult.d_g_fitting_e_c.get(2)); + } + gammaCalibrationSpectrumEList.add(gammaCalibrationD); + } + betaDataFile.setGammaCalibrationSpectrumEList(gammaCalibrationSpectrumEList); + + //处理BetaCalibration数据 List betaCalibrationSpectrumList = new LinkedList<>(); List betaFittingPara = betaDataFile.getBetaFittingPara(); @@ -969,6 +1043,78 @@ public class PHDFileUtil extends AbstractLogOrReport { betaCalibrationSpectrumList.add(betaCalibrationD); } betaDataFile.setBetaCalibrationSpectrumList(betaCalibrationSpectrumList); + + //处理BetaCalibration数据 + List betaCalibrationSpectrumEList = new LinkedList<>(); + List betaFittingParaToUi = betaDataFile.getBetaFittingParaToUi(); + if (betaDataFile.isBBetaEnergyValidSample()) { + GardsCalibrationSpectrum betaCalibrationS = new GardsCalibrationSpectrum(); + betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + betaCalibrationS.setCoeff1(Double.valueOf(betaFittingParaToUi.get(0))); + betaCalibrationS.setCoeff2(Double.valueOf(betaFittingParaToUi.get(1))); + betaCalibrationS.setCoeff3(Double.valueOf(betaFittingParaToUi.get(2))); + betaCalibrationSpectrumEList.add(betaCalibrationS); + } else { + GardsCalibrationSpectrum betaCalibrationS = new GardsCalibrationSpectrum(); + if (bgAnalyseResult.s_b_fitting_c_e.size() < 0) { + betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + betaCalibrationS.setCoeff1(Double.valueOf(betaFittingParaToUi.get(0))); + betaCalibrationS.setCoeff2(Double.valueOf(betaFittingParaToUi.get(1))); + betaCalibrationS.setCoeff3(Double.valueOf(betaFittingParaToUi.get(2))); + } else { + betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + betaCalibrationS.setCoeff1(bgAnalyseResult.s_b_fitting_c_e.get(0)); + betaCalibrationS.setCoeff2(bgAnalyseResult.s_b_fitting_c_e.get(1)); + betaCalibrationS.setCoeff3(bgAnalyseResult.s_b_fitting_c_e.get(2)); + } + betaCalibrationSpectrumEList.add(betaCalibrationS); + } + if (betaDataFile.isBBetaEnergyValidGas()) { + GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum(); + betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + betaCalibrationG.setCoeff1(Double.valueOf(betaFittingParaToUi.get(0))); + betaCalibrationG.setCoeff2(Double.valueOf(betaFittingParaToUi.get(1))); + betaCalibrationG.setCoeff3(Double.valueOf(betaFittingParaToUi.get(2))); + betaCalibrationSpectrumEList.add(betaCalibrationG); + } else { + GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum(); + if (bgAnalyseResult.g_b_fitting_c_e.size() < 0) { + betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + betaCalibrationG.setCoeff1(Double.valueOf(betaFittingParaToUi.get(0))); + betaCalibrationG.setCoeff2(Double.valueOf(betaFittingParaToUi.get(1))); + betaCalibrationG.setCoeff3(Double.valueOf(betaFittingParaToUi.get(2))); + } else { + betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + betaCalibrationG.setCoeff1(bgAnalyseResult.g_b_fitting_c_e.get(0)); + betaCalibrationG.setCoeff2(bgAnalyseResult.g_b_fitting_c_e.get(1)); + betaCalibrationG.setCoeff3(bgAnalyseResult.g_b_fitting_c_e.get(2)); + } + betaCalibrationSpectrumEList.add(betaCalibrationG); + } + if (betaDataFile.isBBetaEnergyValidDet()) { + GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum(); + betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + betaCalibrationD.setCoeff1(Double.valueOf(betaFittingParaToUi.get(0))); + betaCalibrationD.setCoeff2(Double.valueOf(betaFittingParaToUi.get(1))); + betaCalibrationD.setCoeff3(Double.valueOf(betaFittingParaToUi.get(2))); + betaCalibrationSpectrumEList.add(betaCalibrationD); + } else { + GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum(); + if (bgAnalyseResult.d_b_fitting_c_e.size() < 0) { + betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + betaCalibrationD.setCoeff1(Double.valueOf(betaFittingParaToUi.get(0))); + betaCalibrationD.setCoeff2(Double.valueOf(betaFittingParaToUi.get(1))); + betaCalibrationD.setCoeff3(Double.valueOf(betaFittingParaToUi.get(2))); + } else { + betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + betaCalibrationD.setCoeff1(bgAnalyseResult.d_b_fitting_c_e.get(0)); + betaCalibrationD.setCoeff2(bgAnalyseResult.d_b_fitting_c_e.get(1)); + betaCalibrationD.setCoeff3(bgAnalyseResult.d_b_fitting_c_e.get(2)); + } + betaCalibrationSpectrumEList.add(betaCalibrationD); + } + betaDataFile.setBetaCalibrationSpectrumEList(betaCalibrationSpectrumEList); + //存储roiChannel数据 List roiChannelsSpectrumList = new LinkedList<>(); for (int i=0; i xeDataList; private List gammaCalibrationSpectrumList; + private List gammaCalibrationSpectrumEList; + private List betaCalibrationSpectrumList; + private List betaCalibrationSpectrumEList; + private List roiChannelsSpectrumList; private List roiResultsSpectrumList; + private List gammaCalibrationPairsList; + + private List betaCalibrationPairsList; + public BetaDataFile() { sampleFilePathName = ""; sampleFileName = ""; @@ -185,6 +190,16 @@ public class BetaDataFile implements Serializable { betaFittingParaToUiOld = new LinkedList<>(); gammaFittingParaOld = new LinkedList<>(); gammaFittingParaToUiOld = new LinkedList<>(); + + xeDataList = new LinkedList<>(); + gammaCalibrationSpectrumList = new LinkedList<>(); + gammaCalibrationSpectrumEList = new LinkedList<>(); + betaCalibrationSpectrumList = new LinkedList<>(); + betaCalibrationSpectrumEList = new LinkedList<>(); + roiChannelsSpectrumList = new LinkedList<>(); + roiResultsSpectrumList = new LinkedList<>(); + gammaCalibrationPairsList = new LinkedList<>(); + betaCalibrationPairsList = new LinkedList<>(); } } 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 c774fa9c..cd670af6 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 @@ -3787,9 +3787,6 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi result.error500("Please select the parse file first!"); return result; } - //分析gamma文件 - Map nuclideLinesMap = (Map) redisUtil.get(userName+"-"+phd.getHeader().getSystem_type());//GetNuclideLines(nuclides); - gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap); //生成对应报告内容 String reportContent = gammaFileUtil.GetReportContent(phd, userName, false, "log"); result.setSuccess(true); 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 e3727678..60cb2504 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 @@ -317,6 +317,12 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements Map resultMap = new HashMap<>(); //页面展示结果数组 List xeResultsSpectrumList = new LinkedList<>(); + List gammaCalibrationSpectrumList= new LinkedList<>(); + List betaCalibrationSpectrumList = new LinkedList<>(); + List roiChannelsSpectrumList = new LinkedList<>(); + List roiResultsSpectrumList = new LinkedList<>(); + List gammaCalibrationPairsList = new LinkedList<>(); + List betaCalibrationPairsList = new LinkedList<>(); //判断sampleId是否为空 if (Objects.isNull(sampleId)){ result.error500("Please select a piece of data"); @@ -328,9 +334,19 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements dbName = "RNAUTO"; analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, "RNAUTO"); xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults(dbName, analysisID, sampleId); + gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNAUTO", analysisID, sampleId); + betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNAUTO", analysisID, sampleId); + roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNAUTO", analysisID, sampleId); + roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNAUTO", analysisID, sampleId); } else if (dbName.equalsIgnoreCase("man")){ dbName = "RNMAN"; analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, userName); + gammaCalibrationPairsList = spectrumAnalysisMapper.ReadGammaFitChannelEnergy(analysisID, sampleId); + gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNMAN", analysisID, sampleId); + betaCalibrationPairsList = spectrumAnalysisMapper.ReadBetaFitChannelEnergy(analysisID, sampleId); + betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNMAN", analysisID, sampleId); + roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNMAN", analysisID, sampleId); + roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNMAN", analysisID, sampleId); xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults(dbName, analysisID, sampleId); }else { result.error500("The database type does not exist"); @@ -475,6 +491,12 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr()))); } } + betaDataFile.setGammaCalibrationSpectrumList(gammaCalibrationSpectrumList); + betaDataFile.setBetaCalibrationSpectrumList(betaCalibrationSpectrumList); + betaDataFile.setRoiChannelsSpectrumList(roiChannelsSpectrumList); + betaDataFile.setRoiResultsSpectrumList(roiResultsSpectrumList); + betaDataFile.setGammaCalibrationPairsList(gammaCalibrationPairsList); + betaDataFile.setBetaCalibrationPairsList(betaCalibrationPairsList); betaDataFile.setXeResultsSpectrumList(xeResultsSpectrumList); betaDataFile.setSaveAnalysisResult(true); resultMap.put("XeData", xeResultsSpectrumList); @@ -765,37 +787,34 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements GardsCalibrationSpectrum gammaCalibrationParamS = new GardsCalibrationSpectrum(); GardsCalibrationSpectrum gammaCalibrationParamG = new GardsCalibrationSpectrum(); GardsCalibrationSpectrum gammaCalibrationParamD = new GardsCalibrationSpectrum(); + GardsCalibrationSpectrum gammaCalibrationParamES = new GardsCalibrationSpectrum(); + GardsCalibrationSpectrum gammaCalibrationParamEG = new GardsCalibrationSpectrum(); + GardsCalibrationSpectrum gammaCalibrationParamED = new GardsCalibrationSpectrum(); + GardsCalibrationSpectrum betaCalibrationParamS = new GardsCalibrationSpectrum(); GardsCalibrationSpectrum betaCalibrationParamG = new GardsCalibrationSpectrum(); GardsCalibrationSpectrum betaCalibrationParamD = new GardsCalibrationSpectrum(); - BgCalibratePara BgCalPara = null; + GardsCalibrationSpectrum betaCalibrationParamES = new GardsCalibrationSpectrum(); + GardsCalibrationSpectrum betaCalibrationParamEG = new GardsCalibrationSpectrum(); + GardsCalibrationSpectrum betaCalibrationParamED = new GardsCalibrationSpectrum(); - rrrLogInfo.setSampleFilePath(betaDataFile.getSampleFilePathName()); - rrrLogInfo.setGasFilePath(betaDataFile.getGasFilePathName()); - rrrLogInfo.setDetFilePath(betaDataFile.getDetFilePathName()); - List betaFittingPara = new LinkedList<>(); - List gammaFittingPara = new LinkedList<>(); - if (Objects.nonNull(betaDataFile)) { - betaFittingPara = betaDataFile.getBetaFittingPara(); - gammaFittingPara = betaDataFile.getGammaFittingPara(); - BgCalPara = betaDataFile.getBgPara(); - rrrLogInfo.setBGammaEnergyValidSample(betaDataFile.isBGammaEnergyValidSample()); - rrrLogInfo.setBBetaEnergyValidSample(betaDataFile.isBBetaEnergyValidSample()); - rrrLogInfo.setBGammaEnergyValidGas(betaDataFile.isBGammaEnergyValidGas()); - rrrLogInfo.setBBetaEnergyValidGas(betaDataFile.isBBetaEnergyValidGas()); - rrrLogInfo.setBGammaEnergyValidDet(betaDataFile.isBGammaEnergyValidDet()); - rrrLogInfo.setBBetaEnergyValidDet(betaDataFile.isBBetaEnergyValidDet()); - } - //对当前文件内容进行分析 - boolean bRet = analyzeRRR(rrrLogInfo, BgCalPara, betaFittingPara, gammaFittingPara); StringBuffer strBuffer = new StringBuffer(); - if (bRet) { + //判断 + if (betaDataFile.isSaveAnalysisResult()) { //对分析后的内容进行数据获取 - List channelsSpectrums = rrrLogInfo.getRoiChannelsSpectrumList(); - List resultsSpectrums = rrrLogInfo.getRoiResultsSpectrumList(); - List xeResultsSpectrums = rrrLogInfo.getXeResultsSpectrumList(); + List channelsSpectrums = betaDataFile.getRoiChannelsSpectrumList(); + List resultsSpectrums = betaDataFile.getRoiResultsSpectrumList(); + List xeResultsSpectrums = betaDataFile.getXeResultsSpectrumList(); + for (int i=0; i gammaCalibrationParamList = rrrLogInfo.getGammaCalibrationParamList(); + List gammaCalibrationParamList = betaDataFile.getGammaCalibrationSpectrumList(); + List gammaCalibrationSpectrumEList = betaDataFile.getGammaCalibrationSpectrumEList(); for (int i=0; i betaCalibrationParamList = rrrLogInfo.getBetaCalibrationParamList(); + List betaCalibrationParamList = betaDataFile.getBetaCalibrationSpectrumList(); + List betaCalibrationSpectrumEList = betaDataFile.getBetaCalibrationSpectrumEList(); for (int i=0; i betaFittingPara, List gammaFittingPara) { + public boolean analyzeRRR(RRRLogInfo rrrLogInfo, BgCalibratePara BgCalPara, List betaFittingPara, List gammaFittingPara, List betaFittingParaToUi, List gammaFittingParaToUi) { boolean bRet = true; File sampleTmp = null; File gasTmp = null;