beta增加页面折线图缓存信息内容

This commit is contained in:
qiaoqinzheng 2023-11-10 13:59:21 +08:00
parent 42d8b1bb45
commit 6a51ac30fc
3 changed files with 199 additions and 6 deletions

View File

@ -258,21 +258,45 @@ public class PHDFileUtil extends AbstractLogOrReport {
betaDataFile.setSampleBoundary(boundaryList);
betaDataFile.setSampleHistogramDataList(histogramDataList);
betaDataFile.setSampleHistogramDataDList(histogramDataDList);
betaDataFile.setSampleGammaOriginalSeriseData(gammaOriginalSeriseData);
betaDataFile.setSampleGammaProjectedSeriseData(gammaProjectedSeriseData);
betaDataFile.setSampleGammaEnergyList(gammaEnergyList);
betaDataFile.setSampleBetaOriginalSeriseData(betaOriginalSeriseData);
betaDataFile.setSampleBetaProjectedSeriseData(betaProjectedSeriseData);
betaDataFile.setSampleBetaEnergyList(betaEnergyList);
} else if (type.equalsIgnoreCase("gas")) {
betaDataFile.setGasSpectrumData(spectrumData);
betaDataFile.setGasBoundary(boundaryList);
betaDataFile.setGasHistogramDataList(histogramDataList);
betaDataFile.setGasHistogramDataDList(histogramDataDList);
betaDataFile.setGasGammaOriginalSeriseData(gammaOriginalSeriseData);
betaDataFile.setGasGammaProjectedSeriseData(gammaProjectedSeriseData);
betaDataFile.setGasGammaEnergyList(gammaEnergyList);
betaDataFile.setGasBetaOriginalSeriseData(betaOriginalSeriseData);
betaDataFile.setGasBetaProjectedSeriseData(betaProjectedSeriseData);
betaDataFile.setGasBetaEnergyList(betaEnergyList);
} else if (type.equalsIgnoreCase("det")) {
betaDataFile.setDetSpectrumData(spectrumData);
betaDataFile.setDetBoundary(boundaryList);
betaDataFile.setDetHistogramDataList(histogramDataList);
betaDataFile.setDetHistogramDataDList(histogramDataDList);
betaDataFile.setDetGammaOriginalSeriseData(gammaOriginalSeriseData);
betaDataFile.setDetGammaProjectedSeriseData(gammaProjectedSeriseData);
betaDataFile.setDetGammaEnergyList(gammaEnergyList);
betaDataFile.setDetBetaOriginalSeriseData(betaOriginalSeriseData);
betaDataFile.setDetBetaProjectedSeriseData(betaProjectedSeriseData);
betaDataFile.setSampleBetaEnergyList(betaEnergyList);
} else if (type.equalsIgnoreCase("qc")) {
betaDataFile.setQcSpectrumData(spectrumData);
betaDataFile.setQcBoundary(boundaryList);
betaDataFile.setQcHistogramDataList(histogramDataList);
betaDataFile.setQcHistogramDataDList(histogramDataDList);
betaDataFile.setQcGammaOriginalSeriseData(gammaOriginalSeriseData);
betaDataFile.setQcGammaProjectedSeriseData(gammaProjectedSeriseData);
betaDataFile.setQcGammaEnergyList(gammaEnergyList);
betaDataFile.setQcBetaOriginalSeriseData(betaOriginalSeriseData);
betaDataFile.setQcBetaProjectedSeriseData(betaProjectedSeriseData);
betaDataFile.setQcBetaEnergyList(betaEnergyList);
}
} catch (ParseException e) {
throw new RuntimeException(e);

View File

@ -141,6 +141,58 @@ public class BetaDataFile implements Serializable {
private List<HistogramData> qcHistogramDataDList;
private List<List<Double>> gammaNewEnergyList;
private List<List<Double>> betaNewEnergyList;
private List<SeriseData> sampleGammaOriginalSeriseData;
private List<SeriseData> sampleGammaProjectedSeriseData;
private List<List<Double>> sampleGammaEnergyList;
private List<SeriseData> sampleBetaOriginalSeriseData;
private List<SeriseData> sampleBetaProjectedSeriseData;
private List<List<Double>> sampleBetaEnergyList;
private List<SeriseData> gasGammaOriginalSeriseData;
private List<SeriseData> gasGammaProjectedSeriseData;
private List<List<Double>> gasGammaEnergyList;
private List<SeriseData> gasBetaOriginalSeriseData;
private List<SeriseData> gasBetaProjectedSeriseData;
private List<List<Double>> gasBetaEnergyList;
private List<SeriseData> detGammaOriginalSeriseData;
private List<SeriseData> detGammaProjectedSeriseData;
private List<List<Double>> detGammaEnergyList;
private List<SeriseData> detBetaOriginalSeriseData;
private List<SeriseData> detBetaProjectedSeriseData;
private List<List<Double>> detBetaEnergyList;
private List<SeriseData> qcGammaOriginalSeriseData;
private List<SeriseData> qcGammaProjectedSeriseData;
private List<List<Double>> qcGammaEnergyList;
private List<SeriseData> qcBetaOriginalSeriseData;
private List<SeriseData> qcBetaProjectedSeriseData;
private List<List<Double>> qcBetaEnergyList;
//存储分析结果信息
private List<GardsXeResults> xeDataList;
private List<GardsCalibrationSpectrum> gammaCalibrationSpectrumList;
@ -184,6 +236,8 @@ public class BetaDataFile implements Serializable {
bBetaEnergyValidGas = false;
bGammaEnergyValidDet = false;
bBetaEnergyValidDet = false;
gammaNewEnergyList = new LinkedList<>();
betaNewEnergyList = new LinkedList<>();
xeResultsSpectrumList = new LinkedList<>();
sampleBoundary = new LinkedList<>();

View File

@ -663,31 +663,67 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
List<Boundary> boundaryList = new LinkedList<>();
List<HistogramData> histogramDataList = new LinkedList<>();
List<HistogramData> histogramDataDList = new LinkedList<>();
List<SeriseData> betaOriginalSeriseData = new LinkedList<>();
List<SeriseData> betaProjectedSeriseData = new LinkedList<>();
List<List<Double>> betaEnergyList = new LinkedList<>();
List<SeriseData> gammaOriginalSeriseData = new LinkedList<>();
List<SeriseData> gammaProjectedSeriseData = new LinkedList<>();
List<List<Double>> gammaEnergyList = new LinkedList<>();
if (type.equalsIgnoreCase("sample")) {
spectrumData = betaDataFile.getSampleSpectrumData();
boundaryList = betaDataFile.getSampleBoundary();
histogramDataList = betaDataFile.getSampleHistogramDataList();
histogramDataDList = betaDataFile.getSampleHistogramDataDList();
betaOriginalSeriseData = betaDataFile.getSampleBetaOriginalSeriseData();
betaProjectedSeriseData = betaDataFile.getSampleBetaProjectedSeriseData();
betaEnergyList = betaDataFile.getSampleBetaEnergyList();
gammaOriginalSeriseData = betaDataFile.getSampleGammaOriginalSeriseData();
gammaProjectedSeriseData = betaDataFile.getSampleGammaProjectedSeriseData();
gammaEnergyList = betaDataFile.getSampleGammaEnergyList();
} else if (type.equalsIgnoreCase("gas")) {
spectrumData = betaDataFile.getGasSpectrumData();
boundaryList = betaDataFile.getGasBoundary();
histogramDataList = betaDataFile.getGasHistogramDataList();
histogramDataDList = betaDataFile.getGasHistogramDataDList();
betaOriginalSeriseData = betaDataFile.getGasBetaOriginalSeriseData();
betaProjectedSeriseData = betaDataFile.getGasBetaProjectedSeriseData();
betaEnergyList = betaDataFile.getGasBetaEnergyList();
gammaOriginalSeriseData = betaDataFile.getGasGammaOriginalSeriseData();
gammaProjectedSeriseData = betaDataFile.getGasGammaProjectedSeriseData();
gammaEnergyList = betaDataFile.getGasGammaEnergyList();
} else if (type.equalsIgnoreCase("det")) {
spectrumData = betaDataFile.getDetSpectrumData();
boundaryList = betaDataFile.getDetBoundary();
histogramDataList = betaDataFile.getDetHistogramDataList();
histogramDataDList = betaDataFile.getDetHistogramDataDList();
betaOriginalSeriseData = betaDataFile.getDetBetaOriginalSeriseData();
betaProjectedSeriseData = betaDataFile.getDetBetaProjectedSeriseData();
betaEnergyList = betaDataFile.getDetBetaEnergyList();
gammaOriginalSeriseData = betaDataFile.getDetGammaOriginalSeriseData();
gammaProjectedSeriseData = betaDataFile.getDetGammaProjectedSeriseData();
gammaEnergyList = betaDataFile.getDetGammaEnergyList();
} else if (type.equalsIgnoreCase("qc")) {
spectrumData = betaDataFile.getQcSpectrumData();
boundaryList = betaDataFile.getQcBoundary();
histogramDataList = betaDataFile.getQcHistogramDataList();
histogramDataDList = betaDataFile.getQcHistogramDataDList();
betaOriginalSeriseData = betaDataFile.getQcBetaOriginalSeriseData();
betaProjectedSeriseData = betaDataFile.getQcBetaProjectedSeriseData();
betaEnergyList = betaDataFile.getQcBetaEnergyList();
gammaOriginalSeriseData = betaDataFile.getQcGammaOriginalSeriseData();
gammaProjectedSeriseData = betaDataFile.getQcGammaProjectedSeriseData();
gammaEnergyList = betaDataFile.getQcGammaEnergyList();
}
map.put("spectrumData", spectrumData);
map.put("Boundary", boundaryList);
map.put("histogramDataList", histogramDataList);
map.put("histogramDataDList", histogramDataDList);
map.put("gammaOriginalData", gammaOriginalSeriseData);
map.put("gammaProjectedData", gammaProjectedSeriseData);
map.put("gammaEnergyData", gammaEnergyList);
map.put("betaOriginalData", betaOriginalSeriseData);
map.put("betaProjectedData", betaProjectedSeriseData);
map.put("betaEnergyData", betaEnergyList);
return map;
}
@ -2501,6 +2537,8 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
}
List<Double> energys = EnergySpectrumHandler.GetFileFittingData(channels,fittingPara);
List<SeriseData> newLineSeries = new LinkedList<>();
List<List<Double>> energyList = new LinkedList<>();
energyList.add(energys);
for (int i=0; i<channels.size(); ++i) {
SeriseData seriseData = new SeriseData();
seriseData.setX(channels.get(i));
@ -2537,10 +2575,12 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
betaDataFile.setBetaList(tempPoints);
betaDataFile.setBetaFittingPara(fittingParaStr);
betaDataFile.setBetaFittingParaToUi(fittingParaToUiStr);
betaDataFile.setBetaNewEnergyList(energyList);
} else if (tabName.equalsIgnoreCase("gamma")) {
betaDataFile.setGammaList(tempPoints);
betaDataFile.setGammaFittingPara(fittingParaStr);
betaDataFile.setGammaFittingParaToUi(fittingParaToUiStr);
betaDataFile.setGammaNewEnergyList(energyList);
}
} else {
List<Double> fittingPara = new LinkedList<>();
@ -2581,6 +2621,8 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
}
List<Double> energys = EnergySpectrumHandler.GetFileFittingData(channels,fittingPara);
List<SeriseData> newLineSeries = new LinkedList<>();
List<List<Double>> energyList = new LinkedList<>();
energyList.add(energys);
for (int i=0; i<channels.size(); ++i) {
SeriseData seriseData = new SeriseData();
seriseData.setX(channels.get(i));
@ -2600,10 +2642,12 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
betaDataFile.setBetaList(tempPoints);
betaDataFile.setBetaFittingPara(fittingParaStr);
betaDataFile.setBetaFittingParaToUi(fittingParaToUiStr);
betaDataFile.setBetaNewEnergyList(energyList);
} else if (tabName.equalsIgnoreCase("gamma")) {
betaDataFile.setGammaList(tempPoints);
betaDataFile.setGammaFittingPara(fittingParaStr);
betaDataFile.setGammaFittingParaToUi(fittingParaToUiStr);
betaDataFile.setGammaNewEnergyList(energyList);
}
}
result.setSuccess(true);
@ -2664,11 +2708,12 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Map<String, Object> map = new HashMap<>();
//获取当前登陆的用户名
String userName = JwtUtil.getUserNameByToken(request);
//获取当前操作的文件名称
String currentFileName = analyseData.getCurrentFileName();
//获取缓存信息
Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
if ("CurrentSpectrum".equals(analyseData.getApplyType())) {
String sampleFileName = analyseData.getSampleFileNames().get(0);
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
BetaDataFile betaDataFile = cache.getIfPresent(currentFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) {
result.error500("Load basic file information first!");
return result;
@ -2680,9 +2725,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
result.setResult(map);
} else if ("AllSpectrum".equals(analyseData.getApplyType())) {
//获取当前选中的文件名称
String currentFileName = analyseData.getCurrentFileName();
String currentQCFileName = analyseData.getCurrentQCFileName();
map = BetaGammaAnalyzeAllProcess(analyseData, userName, currentFileName, currentQCFileName);
map = BetaGammaAnalyzeAllProcess(analyseData, userName, currentFileName);
if (CollectionUtils.isNotEmpty(map)) {
map.put("bProcessed", true);
map.put("savedAnalysisResult", true);
@ -2728,12 +2771,30 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
spectrum_group.b_c2e = bc2e;
if (analyseData.isSampleData()) {
betaDataFile.setBBetaEnergyValidSample(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getBetaNewEnergyList())) {
betaDataFile.setSampleBetaEnergyList(betaDataFile.getBetaNewEnergyList());
xeMap.put("sampleBetaEnergyData", betaDataFile.getBetaNewEnergyList());
}
}
if (analyseData.isGasBgData()) {
betaDataFile.setBBetaEnergyValidGas(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getBetaNewEnergyList())) {
betaDataFile.setGasBetaEnergyList(betaDataFile.getBetaNewEnergyList());
xeMap.put("gasBetaEnergyData", betaDataFile.getBetaNewEnergyList());
}
}
if (analyseData.isDetBgData()) {
betaDataFile.setBBetaEnergyValidDet(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getBetaNewEnergyList())) {
betaDataFile.setDetBetaEnergyList(betaDataFile.getBetaNewEnergyList());
xeMap.put("detBetaEnergyData", betaDataFile.getBetaNewEnergyList());
}
}
if (analyseData.isQcData()) {
if (CollectionUtils.isNotEmpty(betaDataFile.getBetaNewEnergyList())) {
betaDataFile.setQcBetaEnergyList(betaDataFile.getBetaNewEnergyList());
xeMap.put("qcBetaEnergyData", betaDataFile.getBetaNewEnergyList());
}
}
}
//判断是否对gamma页面进行过分析
@ -2750,12 +2811,30 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
spectrum_group.g_c2e = gc2e;
if (analyseData.isSampleData()) {
betaDataFile.setBGammaEnergyValidSample(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) {
betaDataFile.setSampleGammaEnergyList(betaDataFile.getGammaNewEnergyList());
xeMap.put("sampleGammaEnergyData", betaDataFile.getGammaNewEnergyList());
}
}
if (analyseData.isGasBgData()) {
betaDataFile.setBGammaEnergyValidGas(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) {
betaDataFile.setGasGammaEnergyList(betaDataFile.getGammaNewEnergyList());
xeMap.put("gasGammaEnergyData", betaDataFile.getGammaNewEnergyList());
}
}
if (analyseData.isDetBgData()) {
betaDataFile.setBGammaEnergyValidDet(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) {
betaDataFile.setDetGammaEnergyList(betaDataFile.getGammaNewEnergyList());
xeMap.put("detGammaEnergyData", betaDataFile.getGammaNewEnergyList());
}
}
if (analyseData.isQcData()) {
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) {
betaDataFile.setQcGammaEnergyList(betaDataFile.getGammaNewEnergyList());
xeMap.put("qcGammaEnergyData", betaDataFile.getGammaNewEnergyList());
}
}
}
//判断是否勾选了sample
@ -2840,7 +2919,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
return xeMap;
}
private Map<String, Object> BetaGammaAnalyzeAllProcess(AnalyseData analyseData, String userName, String currentFileName, String currentQCFileName){
private Map<String, Object> BetaGammaAnalyzeAllProcess(AnalyseData analyseData, String userName, String currentFileName){
//从本地缓存获取beta gamma的数组
Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
//返回最终结果用的map
@ -2891,12 +2970,30 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
spectrum_group.b_c2e = bc2e;
if (analyseData.isSampleData()) {
sampleBetaData.setBBetaEnergyValidSample(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getBetaNewEnergyList())) {
sampleBetaData.setSampleBetaEnergyList(betaDataFile.getBetaNewEnergyList());
xeMap.put("sampleBetaEnergyData", betaDataFile.getBetaNewEnergyList());
}
}
if (analyseData.isGasBgData()) {
sampleBetaData.setBBetaEnergyValidGas(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getBetaNewEnergyList())) {
sampleBetaData.setGasBetaEnergyList(betaDataFile.getBetaNewEnergyList());
xeMap.put("gasBetaEnergyData", betaDataFile.getBetaNewEnergyList());
}
}
if (analyseData.isDetBgData()) {
sampleBetaData.setBBetaEnergyValidDet(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getBetaNewEnergyList())) {
sampleBetaData.setDetBetaEnergyList(betaDataFile.getBetaNewEnergyList());
xeMap.put("detBetaEnergyData", betaDataFile.getBetaNewEnergyList());
}
}
if (analyseData.isQcData()) {
if (CollectionUtils.isNotEmpty(betaDataFile.getBetaNewEnergyList())) {
sampleBetaData.setQcBetaEnergyList(betaDataFile.getBetaNewEnergyList());
xeMap.put("qcBetaEnergyData", betaDataFile.getBetaNewEnergyList());
}
}
}
if (analyseData.isGammaEnergyValid()) {
@ -2912,12 +3009,30 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
spectrum_group.g_c2e = gc2e;
if (analyseData.isSampleData()) {
sampleBetaData.setBGammaEnergyValidSample(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) {
sampleBetaData.setSampleGammaEnergyList(betaDataFile.getGammaNewEnergyList());
xeMap.put("sampleGammaEnergyData", betaDataFile.getGammaNewEnergyList());
}
}
if (analyseData.isGasBgData()) {
sampleBetaData.setBGammaEnergyValidGas(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) {
sampleBetaData.setGasGammaEnergyList(betaDataFile.getGammaNewEnergyList());
xeMap.put("gasGammaEnergyData", betaDataFile.getGammaNewEnergyList());
}
}
if (analyseData.isDetBgData()) {
sampleBetaData.setBGammaEnergyValidDet(true);
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) {
sampleBetaData.setDetGammaEnergyList(betaDataFile.getGammaNewEnergyList());
xeMap.put("detGammaEnergyData", betaDataFile.getGammaNewEnergyList());
}
}
if (analyseData.isQcData()) {
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) {
sampleBetaData.setQcGammaEnergyList(betaDataFile.getGammaNewEnergyList());
xeMap.put("qcGammaEnergyData", betaDataFile.getGammaNewEnergyList());
}
}
}
spectrum_group.BgCalPara.bApplyNewCalicSample = analyseData.isSampleData();