diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/PHDFile.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/PHDFile.java index f0fe0b17..bb637270 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/PHDFile.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/PHDFile.java @@ -16,6 +16,10 @@ public class PHDFile implements Serializable { private String tmpFilePath; + private String analyMessage; + + private boolean analyFlag; + private boolean isValid; // 是否有效谱 private boolean bAnalyed; // 记录是否被分析 @@ -181,6 +185,8 @@ public class PHDFile implements Serializable { userId = ""; xmlFilePath = ""; tmpFilePath = ""; + analyMessage = ""; + analyFlag = true; bAnalyed = false; isValid = true; analy_start_time = ""; 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 2d500215..3da16c3f 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 @@ -1335,191 +1335,200 @@ public class GammaFileUtil extends AbstractLogOrReport { } String strValue = CalValuesHandler.analyseSpectrum(phdStr, nuclideLinesMap, phd.getTmpFilePath(), analysisProcess); Map parseMap = JSON.parseObject(strValue, Map.class); - for (Map.Entry entry:parseMap.entrySet()) { - if (entry.getKey().equalsIgnoreCase("bAnalyed")) { - boolean value = JSON.parseObject(JSON.toJSONString(entry.getValue()), Boolean.class); - phd.setBAnalyed(value); - } - if (entry.getKey().equalsIgnoreCase("mapEnerPara")) { - HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); - Map value = new HashMap<>(); - for (Map.Entry objectEntry:jsonMap.entrySet()) { - String key = objectEntry.getKey(); - ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); - value.put(key, entryValue); + boolean analyFlag = JSON.parseObject(JSON.toJSONString(parseMap.get("analyFlag")), Boolean.class); + phd.setAnalyFlag(analyFlag); + String analyMessage = JSON.parseObject(JSON.toJSONString(parseMap.get("analyMessage")), String.class); + phd.setAnalyMessage(analyMessage); + if (analyFlag) { + for (Map.Entry entry:parseMap.entrySet()) { + if (entry.getKey().equalsIgnoreCase("bAnalyed")) { + boolean value = JSON.parseObject(JSON.toJSONString(entry.getValue()), Boolean.class); + phd.setBAnalyed(value); } - phd.setMapEnerPara(value); - } - if (entry.getKey().equalsIgnoreCase("mapResoPara")) { - HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); - Map value = new HashMap<>(); - for (Map.Entry objectEntry:jsonMap.entrySet()) { - String key = objectEntry.getKey(); - ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); - value.put(key, entryValue); + if (entry.getKey().equalsIgnoreCase("mapEnerPara")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); + value.put(key, entryValue); + } + phd.setMapEnerPara(value); } - phd.setMapResoPara(value); - } - if (entry.getKey().equalsIgnoreCase("mapEffiPara")) { - HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); - Map value = new HashMap<>(); - for (Map.Entry objectEntry:jsonMap.entrySet()) { - String key = objectEntry.getKey(); - ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); - value.put(key, entryValue); + if (entry.getKey().equalsIgnoreCase("mapResoPara")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); + value.put(key, entryValue); + } + phd.setMapResoPara(value); } - phd.setMapEffiPara(value); - } - if (entry.getKey().equalsIgnoreCase("mapTotEPara")) { - HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); - Map value = new HashMap<>(); - for (Map.Entry objectEntry:jsonMap.entrySet()) { - String key = objectEntry.getKey(); - ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); - value.put(key, entryValue); + if (entry.getKey().equalsIgnoreCase("mapEffiPara")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); + value.put(key, entryValue); + } + phd.setMapEffiPara(value); } - phd.setMapTotEPara(value); - } - if (entry.getKey().equalsIgnoreCase("para_stepRatio")) { - ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); - phd.setPara_stepRatio(value); - } - if (entry.getKey().equalsIgnoreCase("para_tail")) { - ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); - phd.setPara_tail(value); - } - if (entry.getKey().equalsIgnoreCase("para_tailAlpha")) { - ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); - phd.setPara_tailAlpha(value); - } - if (entry.getKey().equalsIgnoreCase("para_tailRight")) { - ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); - phd.setPara_tailRight(value); - } - if (entry.getKey().equalsIgnoreCase("para_tailRightAlpha")) { - ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); - phd.setPara_tailRightAlpha(value); - } - if (entry.getKey().equalsIgnoreCase("newEner")) { - String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); - phd.setNewEner(value); - } - if (entry.getKey().equalsIgnoreCase("newReso")) { - String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); - phd.setNewReso(value); - } - if (entry.getKey().equalsIgnoreCase("mapEnerKD")) { - HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); - Map value = new HashMap<>(); - for (Map.Entry objectEntry:jsonMap.entrySet()) { - String key = objectEntry.getKey(); - GEnergyBlock entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), GEnergyBlock.class); - value.put(key, entryValue); + if (entry.getKey().equalsIgnoreCase("mapTotEPara")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); + value.put(key, entryValue); + } + phd.setMapTotEPara(value); } - phd.setMapEnerKD(value); - } - if (entry.getKey().equalsIgnoreCase("mapResoKD")) { - HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); - Map value = new HashMap<>(); - for (Map.Entry objectEntry:jsonMap.entrySet()) { - String key = objectEntry.getKey(); - GResolutionBlock entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), GResolutionBlock.class); - value.put(key, entryValue); + if (entry.getKey().equalsIgnoreCase("para_stepRatio")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_stepRatio(value); } - phd.setMapResoKD(value); - } - if (entry.getKey().equalsIgnoreCase("vEnergy")) { - List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); - phd.setVEnergy(value); - } - if (entry.getKey().equalsIgnoreCase("vBase")) { - List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); - phd.setVBase(value); - } - if (entry.getKey().equalsIgnoreCase("vLc")) { - List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); - phd.setVLc(value); - } - if (entry.getKey().equalsIgnoreCase("vScac")) { - List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); - phd.setVScac(value); - } - if (entry.getKey().equalsIgnoreCase("vPeak")) { - List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), PeakInfo.class); - phd.setVPeak(value); - } - if (entry.getKey().equalsIgnoreCase("baseCtrls")) { - BaseControls value = JSON.parseObject(JSON.toJSONString(entry.getValue()), BaseControls.class); - phd.setBaseCtrls(value); - } - if (entry.getKey().equalsIgnoreCase("usedEner")) { - String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); - phd.setUsedEner(value); - } - if (entry.getKey().equalsIgnoreCase("usedEnerKD")) { - GEnergyBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GEnergyBlock.class); - phd.setUsedEnerKD(value); - } - if (entry.getKey().equalsIgnoreCase("usedEnerPara")) { - ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); - phd.setUsedEnerPara(value); - } - if (entry.getKey().equalsIgnoreCase("usedReso")) { - String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); - phd.setUsedReso(value); - } - if (entry.getKey().equalsIgnoreCase("usedResoKD")) { - GResolutionBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GResolutionBlock.class); - phd.setUsedResoKD(value); - } - if (entry.getKey().equalsIgnoreCase("usedResoPara")) { - ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); - phd.setUsedResoPara(value); - } - if (entry.getKey().equalsIgnoreCase("usedEffi")) { - String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); - phd.setUsedEffi(value); - } - if (entry.getKey().equalsIgnoreCase("usedEffiKD")) { - GEfficiencyBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GEfficiencyBlock.class); - phd.setUsedEffiKD(value); - } - if (entry.getKey().equalsIgnoreCase("usedEffiPara")) { - ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); - phd.setUsedEffiPara(value); - } - if (entry.getKey().equalsIgnoreCase("usedTotE")) { - String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); - phd.setUsedTotE(value); - } - if (entry.getKey().equalsIgnoreCase("usedTotEKD")) { - TotaleffBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), TotaleffBlock.class); - phd.setUsedTotEKD(value); - } - if (entry.getKey().equalsIgnoreCase("usedTotEPara")) { - ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); - phd.setUsedTotEPara(value); - } - if (entry.getKey().equalsIgnoreCase("mapNucActMda")) { - TreeMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), TreeMap.class); - Map value = new TreeMap<>(); - for (Map.Entry objectEntry:jsonMap.entrySet()) { - String key = objectEntry.getKey(); - NuclideActMda entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), NuclideActMda.class); - value.put(key, entryValue); + if (entry.getKey().equalsIgnoreCase("para_tail")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_tail(value); + } + if (entry.getKey().equalsIgnoreCase("para_tailAlpha")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_tailAlpha(value); + } + if (entry.getKey().equalsIgnoreCase("para_tailRight")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_tailRight(value); + } + if (entry.getKey().equalsIgnoreCase("para_tailRightAlpha")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_tailRightAlpha(value); + } + if (entry.getKey().equalsIgnoreCase("newEner")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setNewEner(value); + } + if (entry.getKey().equalsIgnoreCase("newReso")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setNewReso(value); + } + if (entry.getKey().equalsIgnoreCase("mapEnerKD")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + GEnergyBlock entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), GEnergyBlock.class); + value.put(key, entryValue); + } + phd.setMapEnerKD(value); + } + if (entry.getKey().equalsIgnoreCase("mapResoKD")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + GResolutionBlock entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), GResolutionBlock.class); + value.put(key, entryValue); + } + phd.setMapResoKD(value); + } + if (entry.getKey().equalsIgnoreCase("vEnergy")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); + phd.setVEnergy(value); + } + if (entry.getKey().equalsIgnoreCase("vBase")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); + phd.setVBase(value); + } + if (entry.getKey().equalsIgnoreCase("vLc")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); + phd.setVLc(value); + } + if (entry.getKey().equalsIgnoreCase("vScac")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); + phd.setVScac(value); + } + if (entry.getKey().equalsIgnoreCase("vPeak")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), PeakInfo.class); + phd.setVPeak(value); + } + if (entry.getKey().equalsIgnoreCase("baseCtrls")) { + BaseControls value = JSON.parseObject(JSON.toJSONString(entry.getValue()), BaseControls.class); + phd.setBaseCtrls(value); + } + if (entry.getKey().equalsIgnoreCase("usedEner")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setUsedEner(value); + } + if (entry.getKey().equalsIgnoreCase("usedEnerKD")) { + GEnergyBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GEnergyBlock.class); + phd.setUsedEnerKD(value); + } + if (entry.getKey().equalsIgnoreCase("usedEnerPara")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setUsedEnerPara(value); + } + if (entry.getKey().equalsIgnoreCase("usedReso")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setUsedReso(value); + } + if (entry.getKey().equalsIgnoreCase("usedResoKD")) { + GResolutionBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GResolutionBlock.class); + phd.setUsedResoKD(value); + } + if (entry.getKey().equalsIgnoreCase("usedResoPara")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setUsedResoPara(value); + } + if (entry.getKey().equalsIgnoreCase("usedEffi")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setUsedEffi(value); + } + if (entry.getKey().equalsIgnoreCase("usedEffiKD")) { + GEfficiencyBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GEfficiencyBlock.class); + phd.setUsedEffiKD(value); + } + if (entry.getKey().equalsIgnoreCase("usedEffiPara")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setUsedEffiPara(value); + } + if (entry.getKey().equalsIgnoreCase("usedTotE")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setUsedTotE(value); + } + if (entry.getKey().equalsIgnoreCase("usedTotEKD")) { + TotaleffBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), TotaleffBlock.class); + phd.setUsedTotEKD(value); + } + if (entry.getKey().equalsIgnoreCase("usedTotEPara")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setUsedTotEPara(value); + } + if (entry.getKey().equalsIgnoreCase("mapNucActMda")) { + TreeMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), TreeMap.class); + Map value = new TreeMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + NuclideActMda entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), NuclideActMda.class); + value.put(key, entryValue); + } + phd.setMapNucActMda(value); } - phd.setMapNucActMda(value); } - } - BeanUtils.copyProperties(phd.getSetting(), phd.getUsedSetting()); + BeanUtils.copyProperties(phd.getSetting(), phd.getUsedSetting()); - for (PeakInfo peak:phd.getVPeak()) { - if (StringUtils.isBlank(peak.recoilBetaChan)) { - peak.recoilBetaChan = "nan"; - } - if (StringUtils.isBlank(peak.recoilDeltaChan)) { - peak.recoilDeltaChan = "nan"; + for (PeakInfo peak:phd.getVPeak()) { + if (StringUtils.isBlank(peak.recoilBetaChan)) { + peak.recoilBetaChan = "nan"; + } + if (StringUtils.isBlank(peak.recoilDeltaChan)) { + peak.recoilDeltaChan = "nan"; + } } + } else { + log.error("AnalyseSpectrum(): {}", analyMessage); + return false; } } catch (JsonProcessingException e){ e.printStackTrace(); @@ -3206,16 +3215,20 @@ public class GammaFileUtil extends AbstractLogOrReport { String anylseEnd; anylseBegin = DateUtils.formatDate(new Date(), "yyyy/MM/dd HH:mm:ss"); bRet = AnalyseSpectrum(fileAnlyse,nucline); - RunQC(fileAnlyse); - fileAnlyse.setEfficiencyParam(fileAnlyse.getUsedEffiPara().getP()); - fileAnlyse.setEfficiencyEnergy(fileAnlyse.getUsedEffiKD().getG_energy()); - fileAnlyse.setEfficiencyCurRow(0); - //缓存中获取计算mdc使用的核素信息 - Map nuclideLinesMDCMap = (Map) redisUtil.get("AllNuclideMap"); - getNuclideMDCValue(fileAnlyse, fileAnlyse.getMdcInfoMap(), nuclideLinesMDCMap); - anylseEnd = DateUtils.formatDate(new Date(), "yyyy/MM/dd HH:mm:ss"); - middleData.analyses_analysisBegin = anylseBegin; - middleData.analyses_analysisEnd = anylseEnd; + if (bRet) { + RunQC(fileAnlyse); + fileAnlyse.setEfficiencyParam(fileAnlyse.getUsedEffiPara().getP()); + fileAnlyse.setEfficiencyEnergy(fileAnlyse.getUsedEffiKD().getG_energy()); + fileAnlyse.setEfficiencyCurRow(0); + //缓存中获取计算mdc使用的核素信息 + Map nuclideLinesMDCMap = (Map) redisUtil.get("AllNuclideMap"); + getNuclideMDCValue(fileAnlyse, fileAnlyse.getMdcInfoMap(), nuclideLinesMDCMap); + anylseEnd = DateUtils.formatDate(new Date(), "yyyy/MM/dd HH:mm:ss"); + middleData.analyses_analysisBegin = anylseBegin; + middleData.analyses_analysisEnd = anylseEnd; + } else { + return bRet; + } } else if (type.equals(MiddleDataType.InterAction.getType()) && flag.equalsIgnoreCase("save")){ //如果是人工交互分析 则先上传phd对应文件信息 //上传本次文件到ftp人工交互存储路径下 File sampleTmp = null; 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 477fb544..bd0fe6e8 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 @@ -1252,29 +1252,33 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi //分析时将phd的核素map重置 phd.setPhdNuclideMap(nuclideLinesMap); //调用分析算法 - gammaFileUtil.AnalyseSpectrum(phd, 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); - Map map = new HashMap<>(); - gammaFileUtil.UpdateChart(phd, map, colorMap); - // 更新 ‘QC Flags’ 状态 - phd.getQcItems().clear(); - List qcstate = gammaFileUtil.Qcstate(phd); - map.put("QCFlag", qcstate); - 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); - result.setSuccess(true); - result.setResult(map); + boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap); + if (analyseSpectrum) { + // 重新分析各峰值对应的核素信息 +// 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); + Map map = new HashMap<>(); + gammaFileUtil.UpdateChart(phd, map, colorMap); + // 更新 ‘QC Flags’ 状态 + phd.getQcItems().clear(); + List qcstate = gammaFileUtil.Qcstate(phd); + map.put("QCFlag", qcstate); + 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); + result.setSuccess(true); + result.setResult(map); + } else { + result.error500("There is a problem with the current phd file, Analysis failure!"); + } } return result; }