From 2a6a38c28610551cf2ddc8c17cfabd5239aefe3f Mon Sep 17 00:00:00 2001 From: xiaoguangbin Date: Fri, 19 Jul 2024 17:14:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E6=96=B0beta?= =?UTF-8?q?=E8=B0=B1=E7=9A=84gamma=20reprocessing=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/common/util/SelfStationUtil.java | 101 ++++++------ .../service/impl/SelfStationServiceImpl.java | 155 ++++++++---------- 2 files changed, 115 insertions(+), 141 deletions(-) diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java index e1dc6c1f..61b27367 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java @@ -113,9 +113,13 @@ public class SelfStationUtil extends AbstractLogOrReport { map.put("spectrumData", spectrumData); //计算边界值 + //gamma能量部分的计算参数 道值对应能量 List gEnergy = struct.g_energy; + //gamma能量部分的计算参数 道值 List gCentroidChannel = struct.g_centroid_channel; + //beta能量部分的计算参数 道值对应的能量 List bElectronEnergy = struct.b_electron_energy; + //beta能量部分的计算参数 道值 List bChannel = struct.b_channel; CalcBgBoundaryParam calcBgBoundaryParam = new CalcBgBoundaryParam(); calcBgBoundaryParam.g_e_cal = EnergySpectrumHandler.GetFileFittingPara(gEnergy, gCentroidChannel); @@ -133,6 +137,8 @@ public class SelfStationUtil extends AbstractLogOrReport { List roiBBoundaryStart = bgBoundary.ROI_B_Boundary_start; List roiBBoundaryStop = bgBoundary.ROI_B_Boundary_stop; + SelfStationVueData sampleVueData = selfStationData.getSampleVueData(); + SelfStationVueData detVueData = selfStationData.getDetVueData(); //根据范围1划分 范围1对应的折线图 Map oneMap = statisticsROIList(roiBBoundaryStart.get(0), roiBBoundaryStop.get(0), struct.b_channels, struct.g_channels, struct.h_counts); @@ -141,57 +147,57 @@ public class SelfStationUtil extends AbstractLogOrReport { Integer endChannel = (Integer) oneMap.get("endChannel"); List seriseDataList = (List) oneMap.get("dataList"); if (systemType.equals("sample")) { - selfStationData.getSampleVueData().setROIOneBetaStart(startChannel); - selfStationData.getSampleVueData().setROIOneBetaStop(endChannel); - selfStationData.getSampleVueData().setROIOneList(seriseDataList); - selfStationData.getSampleVueData().setROIOneCounts((List)oneMap.get("counts")); + sampleVueData.setROIOneBetaStart(startChannel); + sampleVueData.setROIOneBetaStop(endChannel); + sampleVueData.setROIOneList(seriseDataList); + sampleVueData.setROIOneCounts((List)oneMap.get("counts")); } else if (systemType.equals("det")) { - selfStationData.getDetVueData().setROIOneBetaStart(startChannel); - selfStationData.getDetVueData().setROIOneBetaStop(endChannel); - selfStationData.getDetVueData().setROIOneList(seriseDataList); - selfStationData.getSampleVueData().setROIOneCounts((List)oneMap.get("counts")); + detVueData.setROIOneBetaStart(startChannel); + detVueData.setROIOneBetaStop(endChannel); + detVueData.setROIOneList(seriseDataList); } map.put("ROIOneStart", roiBBoundaryStart.get(0)); map.put("ROIOneStop", roiBBoundaryStop.get(0)); map.put("ROIOneList", seriseDataList); } //根据范围2划分 范围2对应的折线图 - Map twoMap = statisticsROIList(roiBBoundaryStart.get(1), roiBBoundaryStop.get(1), struct.b_channels, struct.g_channels, struct.h_counts); + Map twoMap = statisticsROIList(roiBBoundaryStart.get(1), roiBBoundaryStop.get(1), + struct.b_channels, struct.g_channels, struct.h_counts); if ( CollectionUtils.isNotEmpty(twoMap) ) { Integer startChannel = (Integer) twoMap.get("startChannel"); Integer endChannel = (Integer) twoMap.get("endChannel"); List seriseDataList = (List) twoMap.get("dataList"); if (systemType.equals("sample")) { - selfStationData.getSampleVueData().setROITwoBetaStart(startChannel); - selfStationData.getSampleVueData().setROITwoBetaStop(endChannel); - selfStationData.getSampleVueData().setROITwoList(seriseDataList); - selfStationData.getSampleVueData().setROITwoCounts((List)twoMap.get("counts")); + sampleVueData.setROITwoBetaStart(startChannel); + sampleVueData.setROITwoBetaStop(endChannel); + sampleVueData.setROITwoList(seriseDataList); + sampleVueData.setROITwoCounts((List)twoMap.get("counts")); } else if (systemType.equals("det")) { - selfStationData.getDetVueData().setROITwoBetaStart(startChannel); - selfStationData.getDetVueData().setROITwoBetaStop(endChannel); - selfStationData.getDetVueData().setROITwoList(seriseDataList); - selfStationData.getSampleVueData().setROITwoCounts((List)twoMap.get("counts")); + detVueData.setROITwoBetaStart(startChannel); + detVueData.setROITwoBetaStop(endChannel); + detVueData.setROITwoList(seriseDataList); + sampleVueData.setROITwoCounts((List)twoMap.get("counts")); } map.put("ROITwoStart", roiBBoundaryStart.get(1)); map.put("ROITwoStop", roiBBoundaryStop.get(1)); map.put("ROITwoList", seriseDataList); } //根据范围3划分 范围3对应的折线图 - Map threeMap = statisticsROIList(roiBBoundaryStart.get(2), roiBBoundaryStop.get(2), struct.b_channels, struct.g_channels, struct.h_counts); + Map threeMap = statisticsROIList(roiBBoundaryStart.get(2), roiBBoundaryStop.get(2), + struct.b_channels, struct.g_channels, struct.h_counts); if ( CollectionUtils.isNotEmpty(threeMap) ) { Integer startChannel = (Integer) threeMap.get("startChannel"); Integer endChannel = (Integer) threeMap.get("endChannel"); List seriseDataList = (List) threeMap.get("dataList"); if (systemType.equals("sample")) { - selfStationData.getSampleVueData().setROIThreeBetaStart(startChannel); - selfStationData.getSampleVueData().setROIThreeBetaStop(endChannel); - selfStationData.getSampleVueData().setROIThreeList(seriseDataList); - selfStationData.getSampleVueData().setROIThreeCounts((List)threeMap.get("counts")); + sampleVueData.setROIThreeBetaStart(startChannel); + sampleVueData.setROIThreeBetaStop(endChannel); + sampleVueData.setROIThreeList(seriseDataList); + sampleVueData.setROIThreeCounts((List)threeMap.get("counts")); } else if (systemType.equals("det")) { - selfStationData.getDetVueData().setROIThreeBetaStart(startChannel); - selfStationData.getDetVueData().setROIThreeBetaStop(endChannel); - selfStationData.getDetVueData().setROIThreeList(seriseDataList); - selfStationData.getSampleVueData().setROIThreeCounts((List)threeMap.get("counts")); + detVueData.setROIThreeBetaStart(startChannel); + detVueData.setROIThreeBetaStop(endChannel); + detVueData.setROIThreeList(seriseDataList); } map.put("ROIThreeStart", roiBBoundaryStart.get(2)); map.put("ROIThreeStop", roiBBoundaryStop.get(2)); @@ -204,15 +210,14 @@ public class SelfStationUtil extends AbstractLogOrReport { Integer endChannel = (Integer) fourMap.get("endChannel"); List seriseDataList = (List) fourMap.get("dataList"); if (systemType.equals("sample")) { - selfStationData.getSampleVueData().setROIFourBetaStart(startChannel); - selfStationData.getSampleVueData().setROIFourBetaStop(endChannel); - selfStationData.getSampleVueData().setROIFourList(seriseDataList); - selfStationData.getSampleVueData().setROIFourCounts((List)fourMap.get("counts")); + sampleVueData.setROIFourBetaStart(startChannel); + sampleVueData.setROIFourBetaStop(endChannel); + sampleVueData.setROIFourList(seriseDataList); + sampleVueData.setROIFourCounts((List)fourMap.get("counts")); } else if (systemType.equals("det")) { - selfStationData.getDetVueData().setROIFourBetaStart(startChannel); - selfStationData.getDetVueData().setROIFourBetaStop(endChannel); - selfStationData.getDetVueData().setROIFourList(seriseDataList); - selfStationData.getSampleVueData().setROIFourCounts((List)fourMap.get("counts")); + detVueData.setROIFourBetaStart(startChannel); + detVueData.setROIFourBetaStop(endChannel); + detVueData.setROIFourList(seriseDataList); } map.put("ROIFourStart", roiBBoundaryStart.get(3)); map.put("ROIFourStop", roiBBoundaryStop.get(3)); @@ -234,15 +239,15 @@ public class SelfStationUtil extends AbstractLogOrReport { Long count = hCounts.get(index.intValue()); if (count > 0){ HistogramData his = new HistogramData(); - his.setG(j); - his.setB(i); + his.setG(i); + his.setB(j); his.setC(count); histogramDataList.add(his); histogramDataDList.add(his); }else { HistogramData his = new HistogramData(); - his.setG(j); - his.setB(i); + his.setG(i); + his.setB(j); his.setC(count); histogramDataDList.add(his); } @@ -250,10 +255,6 @@ public class SelfStationUtil extends AbstractLogOrReport { } map.put("histogramDataList", histogramDataList); // map.put("histogramDataDList", histogramDataDList); - //gamma能量部分的计算参数 道值 -// List gCentroidChannel = struct.g_centroid_channel; - //gamma能量部分的计算参数 道值对应能量 -// List gEnergy = struct.g_energy; //调用算法 传入道值和道值对应的能量 得到计算gamma能量公式的参数 List gammaParam = EnergySpectrumHandler.GetFileFittingPara(gCentroidChannel, gEnergy); //存储需要计算gamma能量的道值 @@ -265,10 +266,6 @@ public class SelfStationUtil extends AbstractLogOrReport { List gammaEnergyList = EnergySpectrumHandler.GetFileFittingData(gchannels, gammaParam); //将gamma能量折线图进行赋值返回 map.put("gammaEnergyData", gammaEnergyList); - //beta能量部分的计算参数 道值 -// List bChannel = struct.b_channel; - //beta能量部分的计算参数 道值对应的能量 -// List bElectronEnergy = struct.b_electron_energy; //调用算法 传入道值和道值对应的能量 得到计算beta能量公式的参数 List betaParam = EnergySpectrumHandler.GetFileFittingPara(bChannel, bElectronEnergy); List bchannels = new ArrayList<>(); @@ -288,12 +285,12 @@ public class SelfStationUtil extends AbstractLogOrReport { gEnergyBlock.setCentroid_channel(struct.g_centroid_channel); gEnergyBlock.setUncertainty(struct.g_uncertainty); gEnergyBlock.setRecord_count(struct.g_record_count); - selfStationData.getSampleVueData().getMapEnerKD().put(CalName.CalPHD.getType(), gEnergyBlock); + sampleVueData.getMapEnerKD().put(CalName.CalPHD.getType(), gEnergyBlock); //计算得到公式的参数 List calEnergyParam = CalValuesHandler.calFitPara("Cal_Energy", 2, struct.g_centroid_channel, struct.g_energy, struct.g_uncertainty); ParameterInfo parameterInfo = new ParameterInfo(); parameterInfo.setP(calEnergyParam); - selfStationData.getSampleVueData().getMapEnerPara().put(CalName.CalPHD.getType(), parameterInfo); + sampleVueData.getMapEnerPara().put(CalName.CalPHD.getType(), parameterInfo); } } //g_Resolution @@ -304,12 +301,12 @@ public class SelfStationUtil extends AbstractLogOrReport { gResolutionBlock.setFWHM(struct.g_r_FWHM); gResolutionBlock.setUncertainty(struct.g_r_uncertainty); gResolutionBlock.setRecord_count(struct.g_r_record_count); - selfStationData.getSampleVueData().getMapResoKD().put(CalName.CalPHD.getType(), gResolutionBlock); + sampleVueData.getMapResoKD().put(CalName.CalPHD.getType(), gResolutionBlock); //计算得到公式的参数 List calEnergyParam = CalValuesHandler.calFitPara("Cal_Resolution", 4, struct.g_r_energy, struct.g_r_FWHM, struct.g_r_uncertainty); ParameterInfo parameterInfo = new ParameterInfo(); parameterInfo.setP(calEnergyParam); - selfStationData.getSampleVueData().getMapResoPara().put(CalName.CalPHD.getType(), parameterInfo); + sampleVueData.getMapResoPara().put(CalName.CalPHD.getType(), parameterInfo); } } //g_Efficiency @@ -320,12 +317,12 @@ public class SelfStationUtil extends AbstractLogOrReport { gEfficiencyBlock.setEfficiency(struct.g_e_efficiency); gEfficiencyBlock.setUncertainty(struct.g_e_uncertainty); gEfficiencyBlock.setRecord_count(struct.g_e_record_count); - selfStationData.getSampleVueData().getMapEffiKD().put(CalName.CalPHD.getType(), gEfficiencyBlock); + sampleVueData.getMapEffiKD().put(CalName.CalPHD.getType(), gEfficiencyBlock); //计算得到公式的参数 List calEnergyParam = CalValuesHandler.calFitPara("Cal_Efficiency", 1, struct.g_e_energy, struct.g_e_efficiency, struct.g_e_uncertainty); ParameterInfo parameterInfo = new ParameterInfo(); parameterInfo.setP(calEnergyParam); - selfStationData.getSampleVueData().getMapEffiPara().put(CalName.CalPHD.getType(), parameterInfo); + sampleVueData.getMapEffiPara().put(CalName.CalPHD.getType(), parameterInfo); } } } catch (ParseException e) { diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java index 5053419b..61805845 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java @@ -1856,6 +1856,9 @@ public class SelfStationServiceImpl implements ISelfStationService { Result result = new Result(); String userName = JwtUtil.getUserNameByToken(request); + // 获取当前角色的颜色配置 + Map colorMap = sysUserColorService.initColor(userName); + //获取自建台站缓存信息 Cache selfCache = selfStationCache.getSelfCache(); SelfStationData selfStationData = selfCache.getIfPresent(fileName + StringPool.DASH + userName); @@ -1864,76 +1867,24 @@ public class SelfStationServiceImpl implements ISelfStationService { return result; } - SelfStationVueData sampleVueData = selfStationData.getSampleVueData(); - // Gamma文件内容转换为PHD实体 + SelfStationVueData sampleVueData = selfStationData.getSampleVueData(); PHDFile phdOne = sampleVueData.getROIOnePHDFile(); PHDFile phdTwo = sampleVueData.getROITwoPHDFile(); PHDFile phdThree = sampleVueData.getROIThreePHDFile(); PHDFile phdFour = sampleVueData.getROIFourPHDFile(); + Map nuclideLinesMap = (Map) redisUtil.get(userName+StringPool.DASH+phdOne.getHeader().getSystem_type()+"-self"); - phdOne.setUserId(processKey); - // 赋值xml文件存放路径 - phdOne.setXmlFilePath(parameterProperties.getFilePath()); - // 获取当前角色的颜色配置 - Map colorMap = sysUserColorService.initColor(userName); - // 分析文件数据 - int flag = gammaFileUtil.AnalyseData(phdOne); - if (flag == 0) { - String warning = "The spectrum needn't Analyed. Maybe:\n" + - "1. It has already Analyed.\n" + - "2. You didn't change any setting or calibration."; - result.error500(warning); - } else { - Map nuclideLinesMap = (Map) redisUtil.get(userName+StringPool.DASH+phdOne.getHeader().getSystem_type()+"-self"); - if (flag == -1) { - //分析时将phd的核素map重置 - phdOne.setPhdNuclideMap(nuclideLinesMap); - //重新计算核素的活度浓度 - gammaFileUtil.NuclidesIdent(phdOne, nuclideLinesMap); - phdOne.setEfficiencyParam(phdOne.getUsedEffiPara().getP()); - phdOne.setEfficiencyEnergy(phdOne.getUsedEffiKD().getG_energy()); - phdOne.setEfficiencyCurRow(0); - // 重新计算峰值 - Map nuclideLinesMDCMap = (Map) redisUtil.get("AllNuclideMap"); - gammaFileUtil.getNuclideMDCValue(phdOne, phdOne.getMdcInfoMap(), nuclideLinesMDCMap); - String warning = "Finish three tasks:\n" + - "\t1.Update efficiencies of all peaks;\n" + - "\t2.Identify nuclides again;\n" + - "\t3.Test QC again."; - result.error500(warning); - } else { - - try { - Map gammaResult = Maps.newHashMap(); - Map map1 = this.gammaAnalyse(phdOne, nuclideLinesMap, colorMap); - Map map2 = this.gammaAnalyse(phdTwo, nuclideLinesMap, colorMap); - Map map3 = this.gammaAnalyse(phdThree, nuclideLinesMap, colorMap); - Map map4 = this.gammaAnalyse(phdFour, nuclideLinesMap, colorMap); - gammaResult.put("ROI1", map1); - gammaResult.put("ROI2", map2); - gammaResult.put("ROI3", map3); - gammaResult.put("ROI4", map4); - - sampleVueData.setUsedEnerKD(phdOne.getUsedEnerKD()); - sampleVueData.setUsedEffiKD(phdOne.getUsedEffiKD()); - sampleVueData.setUsedResoKD(phdOne.getUsedResoKD()); - sampleVueData.setMapEnerKD(phdOne.getMapEnerKD()); - sampleVueData.setMapResoKD(phdOne.getMapResoKD()); - sampleVueData.setMapEffiKD(phdOne.getMapEffiKD()); - sampleVueData.setUsedEnerPara(phdOne.getUsedEnerPara()); - sampleVueData.setUsedEffiPara(phdOne.getUsedEffiPara()); - sampleVueData.setUsedResoPara(phdOne.getUsedResoPara()); - sampleVueData.setMapEnerPara(phdOne.getMapEnerPara()); - sampleVueData.setMapResoPara(phdOne.getMapResoPara()); - sampleVueData.setMapEffiPara(phdOne.getMapEffiPara()); - - result.setSuccess(true); - result.setResult(gammaResult); - } catch (RuntimeException e) { - result.error500(StrUtil.replace(e.getMessage(), "%s", "ROI")); - } - } + Map roiMap = new HashMap<>(); + try { + roiMap.put("ROI1", this.gammaAnalyse(processKey, phdOne, nuclideLinesMap, colorMap)); + roiMap.put("ROI2", this.gammaAnalyse(processKey, phdTwo, nuclideLinesMap, colorMap)); + roiMap.put("ROI3", this.gammaAnalyse(processKey, phdThree, nuclideLinesMap, colorMap)); + roiMap.put("ROI4", this.gammaAnalyse(processKey, phdFour, nuclideLinesMap, colorMap)); + result.setSuccess(true); + result.setResult(roiMap); + } catch (RuntimeException e) { + result.error500(StrUtil.replace(e.getMessage(), "%s", "ROI")); } return result; } @@ -3309,34 +3260,60 @@ public class SelfStationServiceImpl implements ISelfStationService { * @return * @throws RuntimeException */ - private Map gammaAnalyse(PHDFile phd, Map nuclideLinesMap, + private Map gammaAnalyse(String processKey, PHDFile phd, Map nuclideLinesMap, Map colorMap) throws RuntimeException{ - Map map = new HashMap<>(); - - //分析时将phd的核素map重置 - phd.setPhdNuclideMap(nuclideLinesMap); - //调用分析算法 - boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap); - - if (analyseSpectrum) { - - phd.setEfficiencyParam(phd.getUsedEffiPara().getP()); - phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy()); - phd.setEfficiencyCurRow(0); - // 重新计算峰值 - Map nuclideLinesMDCMap = (Map) redisUtil.get("AllNuclideMap"); - gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap); - gammaFileUtil.UpdateChart(phd, map, colorMap); - map.put("bAnalyed", phd.isBAnalyed()); - map.put("peak", phd.getVPeak()); - map.put("BaseCtrls", phd.getBaseCtrls()); - // Bar Chart 柱状图 - List differance = gammaFileUtil.Differance(phd, phd.getVPeak()); - map.put("barChart", differance); + phd.setUserId(processKey); + // 赋值xml文件存放路径 + phd.setXmlFilePath(parameterProperties.getFilePath()); + int flag = gammaFileUtil.AnalyseData(phd); + if (flag == 0) { + String warning = "The spectrum needn't Analyed. Maybe:\n" + + "1. It has already Analyed.\n" + + "2. You didn't change any setting or calibration."; + throw new RuntimeException(warning); } else { - throw new RuntimeException("There is a problem with the current %s phd file, Analysis failure!"); + if (flag == -1) { + //分析时将phd的核素map重置 + phd.setPhdNuclideMap(nuclideLinesMap); + //重新计算核素的活度浓度 + gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap); + phd.setEfficiencyParam(phd.getUsedEffiPara().getP()); + phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy()); + phd.setEfficiencyCurRow(0); + // 重新计算峰值 + Map nuclideLinesMDCMap = (Map) redisUtil.get("AllNuclideMap"); + gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap); + String warning = "Finish three tasks:\n" + + "\t1.Update efficiencies of all peaks;\n" + + "\t2.Identify nuclides again;\n" + + "\t3.Test QC again."; + throw new RuntimeException(warning); + } else { + Map map = new HashMap<>(); + //分析时将phd的核素map重置 + phd.setPhdNuclideMap(nuclideLinesMap); + //调用分析算法 + boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap); + if (analyseSpectrum) { + phd.setEfficiencyParam(phd.getUsedEffiPara().getP()); + phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy()); + phd.setEfficiencyCurRow(0); + // 重新计算峰值 + Map nuclideLinesMDCMap = (Map) redisUtil.get("AllNuclideMap"); + gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap); + gammaFileUtil.UpdateChart(phd, map, colorMap); + map.put("bAnalyed", phd.isBAnalyed()); + map.put("peak", phd.getVPeak()); + map.put("BaseCtrls", phd.getBaseCtrls()); + // Bar Chart 柱状图 + List differance = gammaFileUtil.Differance(phd, phd.getVPeak()); + map.put("barChart", differance); + return map; + } else { + throw new RuntimeException("There is a problem with the current %s phd file, Analysis failure!"); + } + } } - return map; } } From 567b64a34ef21bcca4ad943c711b75bd9b7ab9c9 Mon Sep 17 00:00:00 2001 From: xiaoguangbin Date: Mon, 22 Jul 2024 15:56:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=EF=BC=9A=E5=A2=9E=E5=8A=A0mdcInfoMap-C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jeecg/common/util/SelfStationUtil.java | 7 +++---- .../jeecg/modules/service/impl/GammaServiceImpl.java | 2 ++ .../modules/service/impl/SelfStationServiceImpl.java | 11 ++++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java index 61b27367..d3cb9cef 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java @@ -176,7 +176,6 @@ public class SelfStationUtil extends AbstractLogOrReport { detVueData.setROITwoBetaStart(startChannel); detVueData.setROITwoBetaStop(endChannel); detVueData.setROITwoList(seriseDataList); - sampleVueData.setROITwoCounts((List)twoMap.get("counts")); } map.put("ROITwoStart", roiBBoundaryStart.get(1)); map.put("ROITwoStop", roiBBoundaryStop.get(1)); @@ -894,7 +893,7 @@ public class SelfStationUtil extends AbstractLogOrReport { out.println("MSG_ID " + struct.msg_id + " " + struct.msg_type + "\n" + "DATA_TYPE " + struct.data_type); out.println("#Header 3"); // 解析出的Gamma谱 系统类型暂时使用G - out.println(struct.site_code + " " + struct.detector_code + " G " + + out.println(struct.site_code + " " + struct.detector_code + " C " + struct.sample_geometry + " " + struct.spectrum_quantity); out.println(struct.sample_ref_id); out.println(struct.measurement_id + " " + struct.detector_bk_measurement_id + " 0"); @@ -924,9 +923,9 @@ public class SelfStationUtil extends AbstractLogOrReport { String str = g_counts.get(i).toString(); if(i % 5 == 0) { if (i == 0) { - out.printf(i+""); + out.printf((i+1)+""); } else { - out.printf("\n" + i ); + out.printf("\n" + (i+1) ); } beforeStr = i+""; } 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 55761b08..771047e7 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 @@ -5666,6 +5666,8 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi } if (CollectionUtils.isNotEmpty(mdcInfoMap)) { redisUtil.set("mdcInfoMap-G", mdcInfoMap); + // todo 暂时和气体使用一样的 + redisUtil.set("mdcInfoMap-C", mdcInfoMap); } } } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java index 2004d8e8..1ad3a87e 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java @@ -263,13 +263,13 @@ public class SelfStationServiceImpl implements ISelfStationService { // Gamma文件内容转换为PHD实体 sampleVueData.setROIOneFileName(gammaOneName); - sampleVueData.setROIOnePHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path)); + sampleVueData.setROIOnePHDFile(selfStationUtil.getGammaPHD(gammaOneName, path)); sampleVueData.setROITwoFileName(gammaTwoName); sampleVueData.setROITwoPHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path)); sampleVueData.setROIThreeFileName(gammaThreeName); - sampleVueData.setROIThreePHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path)); + sampleVueData.setROIThreePHDFile(selfStationUtil.getGammaPHD(gammaThreeName, path)); sampleVueData.setROIFourFileName(gammaFourName); - sampleVueData.setROIFourPHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path)); + sampleVueData.setROIFourPHDFile(selfStationUtil.getGammaPHD(gammaFourName, path)); resultMap.put("sample", map); // 初始化Configure @@ -3324,6 +3324,11 @@ public class SelfStationServiceImpl implements ISelfStationService { Map map = new HashMap<>(); //分析时将phd的核素map重置 phd.setPhdNuclideMap(nuclideLinesMap); + //读取redis缓存的计算mdc信息 + Map mdcInfoMap = (Map) redisUtil.get("mdcInfoMap-"+phd.getHeader().getSystem_type()); + if (CollectionUtils.isNotEmpty(mdcInfoMap)) { + phd.setMdcInfoMap(mdcInfoMap); + } //调用分析算法 boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap); if (analyseSpectrum) {