Merge remote-tracking branch 'origin/station' into station

This commit is contained in:
nieziyan 2023-11-02 14:37:50 +08:00
commit 1db5b534b0
5 changed files with 217 additions and 86 deletions

View File

@ -31,8 +31,16 @@ public class QCResult implements Serializable {
private String xe133MDCStatus; private String xe133MDCStatus;
private String gasBgEvaluationMetrics;
private String gasBgValue;
private boolean gasBgValueAndStatus; private boolean gasBgValueAndStatus;
private String detBgEvaluationMetrics;
private String detBgValue;
private boolean detBgValueAndStatus; private boolean detBgValueAndStatus;
} }

View File

@ -40,8 +40,10 @@ import javax.xml.parsers.ParserConfigurationException;
import java.io.*; import java.io.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Component @Component
@Slf4j @Slf4j
@ -1566,7 +1568,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
double sum_found = 0; // 所有匹配的γ射线能量处效率乘以分支比的和 double sum_found = 0; // 所有匹配的γ射线能量处效率乘以分支比的和
int mainPeakIdx = -1; // 记录核素主γ峰的索引下标 int mainPeakIdx = -1; // 记录核素主γ峰的索引下标
for (int i=0, j=0; i<vEnergy.size(); i++) { for (int i=0, j=0; i<vEnergy.size(); i++) {
for(; j<peakNum; ++j) { for(; j<peakNum; j++) {
if(phd.getVPeak().get(j).energy >= 510 && phd.getVPeak().get(j).energy <= 512) { if(phd.getVPeak().get(j).energy >= 510 && phd.getVPeak().get(j).energy <= 512) {
continue; // 峰中心道能量为511的峰不进行核素识别 continue; // 峰中心道能量为511的峰不进行核素识别
} }
@ -1604,11 +1606,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
} }
if(mainPeakIdx < 0) continue; if(mainPeakIdx < 0) continue;
} }
if (Objects.isNull(phd.getMapNucActMda().get(iter.getKey()))) {
Map<String, NuclideActMda> mapNucActMda = phd.getMapNucActMda(); NuclideActMda ActMda = new NuclideActMda();
mapNucActMda.put(iter.getKey(), new NuclideActMda());
}
NuclideActMda ActMda = phd.getMapNucActMda().get(iter.getKey());
boolean bActBigger = CalculateMDCs(phd, ActMda, mainPeakIdx, lambda, maxFoundYield, 1.0); boolean bActBigger = CalculateMDCs(phd, ActMda, mainPeakIdx, lambda, maxFoundYield, 1.0);
if(rate > 0.8 || bActBigger) { if(rate > 0.8 || bActBigger) {
@ -3610,29 +3609,36 @@ public class GammaFileUtil extends AbstractLogOrReport {
halflife /= 3600; halflife /= 3600;
units = 'H'; units = 'H';
} }
tableNuclideActivity.setHalfLife(halflife+StringPool.SPACE+units); tableNuclideActivity.setHalfLife(NumberFormatUtil.numberFormat(String.valueOf(halflife))+StringPool.SPACE+units);
tableNuclideActivity.setEnergy(nuc.getVEnergy().get(nuc.getCalculateIdx()).toString()); tableNuclideActivity.setEnergy(NumberFormatUtil.numberFormat(String.valueOf(nuc.getVEnergy().get(nuc.getCalculateIdx()))));
tableNuclideActivity.setYield(String.valueOf(nuc.getVYield().get(nuc.getCalculateIdx())*100)); tableNuclideActivity.setYield(NumberFormatUtil.numberFormat(String.valueOf(nuc.getVYield().get(nuc.getCalculateIdx())*100)));
String str_effi = (nuc.getEfficiency() <= 0 ? "null" : String.valueOf(nuc.getEfficiency())); String str_effi = (nuc.getEfficiency() <= 0 ? "null" : NumberFormatUtil.numberFormat(String.valueOf(nuc.getEfficiency())));
tableNuclideActivity.setEfficiency(str_effi); tableNuclideActivity.setEfficiency(str_effi);
String str_act = (nuc.getActivity() <= 0 ? "null" : String.valueOf(nuc.getActivity())); String str_act = (nuc.getActivity() <= 0 ? "null" : NumberFormatUtil.numberFormat(String.valueOf(nuc.getActivity())));
tableNuclideActivity.setActivity(str_act); tableNuclideActivity.setActivity(str_act);
String str_act_err = (nuc.getActivity() <= 0 ? "null" : String.valueOf(nuc.getAct_err() / nuc.getActivity() * 100)); String str_act_err = (nuc.getActivity() <= 0 ? "null" : NumberFormatUtil.numberFormat(String.valueOf(nuc.getAct_err() / nuc.getActivity() * 100)));
tableNuclideActivity.setActErr(str_act_err); tableNuclideActivity.setActErr(str_act_err);
String str_mda = (nuc.getMda() <= 0 ? "null" : String.valueOf(nuc.getMda())); String str_mda = (nuc.getMda() <= 0 ? "null" : NumberFormatUtil.numberFormat(String.valueOf(nuc.getMda())));
tableNuclideActivity.setMda(str_mda); tableNuclideActivity.setMda(str_mda);
if (nuc.getConcentration() > 1000000) {
String str_con = (nuc.getConcentration() <= 0 ? "null" : String.valueOf(nuc.getConcentration())); DecimalFormat decimalFormat = new DecimalFormat("0.###E0");
nuc.setConcentration(Double.valueOf(decimalFormat.format(nuc.getConcentration())));
}
String str_con = (nuc.getConcentration() <= 0 ? "null" : NumberFormatUtil.numberFormat(String.valueOf(nuc.getConcentration())));
tableNuclideActivity.setConc(str_con); tableNuclideActivity.setConc(str_con);
if (nuc.getMdc() > 1000000) {
String str_mdc = (nuc.getMdc() <= 0 ? "null" : String.valueOf(nuc.getMdc())); DecimalFormat decimalFormat = new DecimalFormat("0.###E0");
nuc.setConcentration(Double.valueOf(decimalFormat.format(nuc.getMdc())));
}
String str_mdc = (nuc.getMdc() <= 0 ? "null" : NumberFormatUtil.numberFormat(String.valueOf(nuc.getMdc())));
tableNuclideActivity.setMdc(str_mdc); tableNuclideActivity.setMdc(str_mdc);
nuclideActivityList.add(tableNuclideActivity); nuclideActivityList.add(tableNuclideActivity);
} }
nuclideActivityList = nuclideActivityList.stream().sorted(Comparator.comparing(TableNuclideActivity::getNuclide)).collect(Collectors.toList());
map.put("table", nuclideActivityList); map.put("table", nuclideActivityList);
return map; return map;
} }
@ -4274,7 +4280,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
for(int i=0; i<g_ener.getG_energy().size(); i++) { for(int i=0; i<g_ener.getG_energy().size(); i++) {
String g_energy = RightFill(String.format("%.9f", g_ener.getG_energy().get(i)), 16); String g_energy = RightFill(String.format("%.9f", g_ener.getG_energy().get(i)), 16);
String centroid_channel = RightFill(String.format("%.9f", g_ener.getCentroid_channel().get(i)), 16); String centroid_channel = RightFill(String.format("%.9f", g_ener.getCentroid_channel().get(i)), 16);
String uncertainty = RightFill(String.format("%.9f", g_ener.getUncertainty().get(i).isNaN() ? 0.5 : g_ener.getUncertainty().get(i)), 16); String uncertainty = RightFill(String.format("%.9f", Objects.nonNull(g_ener.getUncertainty().get(i)) ? (g_ener.getUncertainty().get(i).isNaN()?0.5 : g_ener.getUncertainty().get(i)):0.5), 16);
String energy = "%s %s %s"; String energy = "%s %s %s";
spectrum.append(rowFormat(energy, g_energy, centroid_channel, uncertainty)); spectrum.append(rowFormat(energy, g_energy, centroid_channel, uncertainty));
//换行 //换行
@ -4291,7 +4297,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
for(int i=0; i<g_reso.getFWHM().size(); i++) { for(int i=0; i<g_reso.getFWHM().size(); i++) {
String g_energy = RightFill(String.format("%.9f", g_reso.getG_energy().get(i)), 16); String g_energy = RightFill(String.format("%.9f", g_reso.getG_energy().get(i)), 16);
String fwhm = RightFill(String.format("%.9f", g_reso.getFWHM().get(i)), 16); String fwhm = RightFill(String.format("%.9f", g_reso.getFWHM().get(i)), 16);
String uncertainty = RightFill(String.format("%.9f", g_reso.getUncertainty().get(i).isNaN() ? 0.5 : g_reso.getUncertainty().get(i)), 16); String uncertainty = RightFill(String.format("%.9f", Objects.nonNull(g_reso.getUncertainty().get(i))? (g_reso.getUncertainty().get(i).isNaN() ? 0.5 : g_reso.getUncertainty().get(i)):0.5), 16);
String reso = "%s %s %s"; String reso = "%s %s %s";
spectrum.append(rowFormat(reso, g_energy, fwhm, uncertainty)); spectrum.append(rowFormat(reso, g_energy, fwhm, uncertainty));
//换行 //换行
@ -4308,7 +4314,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
for(int i=0; i<g_effi.getEfficiency().size(); i++) { for(int i=0; i<g_effi.getEfficiency().size(); i++) {
String g_energy = RightFill(String.format("%.9f", g_effi.getG_energy().get(i)), 16); String g_energy = RightFill(String.format("%.9f", g_effi.getG_energy().get(i)), 16);
String g_efficiency = RightFill(String.format("%.9f", g_effi.getEfficiency().get(i)), 16); String g_efficiency = RightFill(String.format("%.9f", g_effi.getEfficiency().get(i)), 16);
String uncertainty = RightFill(String.format("%.9f", g_effi.getUncertainty().get(i).isNaN() ? 0.5 : g_effi.getUncertainty().get(i)), 16); String uncertainty = RightFill(String.format("%.9f", Objects.nonNull(g_effi.getUncertainty().get(i))?(g_effi.getUncertainty().get(i).isNaN() ? 0.5 : g_effi.getUncertainty().get(i)):0.5), 16);
String efficiency = "%s %s %s"; String efficiency = "%s %s %s";
spectrum.append(rowFormat(efficiency, g_energy, g_efficiency, uncertainty)); spectrum.append(rowFormat(efficiency, g_energy, g_efficiency, uncertainty));
spectrum.append(System.lineSeparator()); spectrum.append(System.lineSeparator());
@ -4325,7 +4331,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
for(int i=0; i<g_totE.getRecord_count(); i++) { for(int i=0; i<g_totE.getRecord_count(); i++) {
String g_energy = RightFill(String.format("%.9f", g_totE.getG_energy().get(i)), 16); String g_energy = RightFill(String.format("%.9f", g_totE.getG_energy().get(i)), 16);
String total_efficiency = RightFill(String.format("%.9f", g_totE.getTotal_efficiency().get(i)), 16); String total_efficiency = RightFill(String.format("%.9f", g_totE.getTotal_efficiency().get(i)), 16);
String uncertainty = RightFill(String.format("%.9f", g_totE.getUncertainty().get(i).isNaN() ? 0.5 : g_totE.getUncertainty().get(i)), 16); String uncertainty = RightFill(String.format("%.9f", Objects.nonNull(g_totE.getUncertainty().get(i))?(g_totE.getUncertainty().get(i).isNaN() ? 0.5 : g_totE.getUncertainty().get(i)):0.5), 16);
String totalEff = "%s %s %s"; String totalEff = "%s %s %s";
spectrum.append(rowFormat(totalEff, g_energy, total_efficiency, uncertainty)); spectrum.append(rowFormat(totalEff, g_energy, total_efficiency, uncertainty));
//换行 //换行

View File

@ -624,34 +624,34 @@ public class PHDFileUtil extends AbstractLogOrReport {
//存入计算后得到的xeData数据 //存入计算后得到的xeData数据
GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum(); GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum();
xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); xe131m.setNuclideName(XeNuclideName.XE_131m.getType());
xe131m.setConc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe131m_con)))); xe131m.setConc(analyseResult.Xe131m_con);
xe131m.setConcErr(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe131m_uncer)))); xe131m.setConcErr(analyseResult.Xe131m_uncer);
xe131m.setLc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.LC_Xe131m)))); xe131m.setLc(analyseResult.LC_Xe131m);
xe131m.setMdc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.MDC_Xe131m)))); xe131m.setMdc(analyseResult.MDC_Xe131m);
xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG); xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG);
xeResultsSpectrumList.add(xe131m); xeResultsSpectrumList.add(xe131m);
GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum(); GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum();
xe133.setNuclideName(XeNuclideName.XE_133.getType()); xe133.setNuclideName(XeNuclideName.XE_133.getType());
xe133.setConc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe133_con)))); xe133.setConc(analyseResult.Xe133_con);
xe133.setConcErr(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe133_uncer)))); xe133.setConcErr(analyseResult.Xe133_uncer);
xe133.setLc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.LC_Xe133)))); xe133.setLc(analyseResult.LC_Xe133);
xe133.setMdc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.MDC_Xe133)))); xe133.setMdc(analyseResult.MDC_Xe133);
xe133.setNidFlag(analyseResult.XE_133_NID_FLAG); xe133.setNidFlag(analyseResult.XE_133_NID_FLAG);
xeResultsSpectrumList.add(xe133); xeResultsSpectrumList.add(xe133);
GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum(); GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum();
xe133m.setNuclideName(XeNuclideName.XE_133m.getType()); xe133m.setNuclideName(XeNuclideName.XE_133m.getType());
xe133m.setConc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe133m_con)))); xe133m.setConc(analyseResult.Xe133m_con);
xe133m.setConcErr(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe133m_uncer)))); xe133m.setConcErr(analyseResult.Xe133m_uncer);
xe133m.setLc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.LC_Xe133m)))); xe133m.setLc(analyseResult.LC_Xe133m);
xe133m.setMdc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.MDC_Xe133m)))); xe133m.setMdc(analyseResult.MDC_Xe133m);
xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG); xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG);
xeResultsSpectrumList.add(xe133m); xeResultsSpectrumList.add(xe133m);
GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum(); GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum();
xe135.setNuclideName(XeNuclideName.XE_135.getType()); xe135.setNuclideName(XeNuclideName.XE_135.getType());
xe135.setConc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe135_con)))); xe135.setConc(analyseResult.Xe135_con);
xe135.setConcErr(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe135_uncer)))); xe135.setConcErr(analyseResult.Xe135_uncer);
xe135.setLc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.LC_Xe135)))); xe135.setLc(analyseResult.LC_Xe135);
xe135.setMdc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.MDC_Xe135)))); xe135.setMdc(analyseResult.MDC_Xe135);
xe135.setNidFlag(analyseResult.XE_135_NID_FLAG); xe135.setNidFlag(analyseResult.XE_135_NID_FLAG);
xeResultsSpectrumList.add(xe135); xeResultsSpectrumList.add(xe135);
map.put("XeData", xeResultsSpectrumList); map.put("XeData", xeResultsSpectrumList);

View File

@ -196,14 +196,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
result.error500("Please select the parse file first"); result.error500("Please select the parse file first");
return result; return result;
} }
// 查询当前用户关联的核素信息 Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(fileName+"-"+userName);//GetNuclideLines(nuclides);
List<String> nuclides = new LinkedList<>();
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
nuclides = defaultNuclideSpectrumService.findNuclidesByUserName(userName, systemType);
if (CollectionUtils.isEmpty(nuclides)) {
nuclides = defaultNuclideSpectrumService.findNuclidesByUserName("admin", systemType);
}
Map<String, NuclideLines> nuclideLinesMap = GetNuclideLines(nuclides);
// 解析获取临时文件信息 // 解析获取临时文件信息
File tmpFile = gammaFileUtil.analyzeFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName, fileName); File tmpFile = gammaFileUtil.analyzeFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName, fileName);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -377,16 +370,16 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
phd.setUsedTotEPara(value); phd.setUsedTotEPara(value);
} }
if (entry.getKey().equalsIgnoreCase("mapNucActMda")) { // if (entry.getKey().equalsIgnoreCase("mapNucActMda")) {
HashMap<String, Object> jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); // HashMap<String, Object> jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class);
Map<String, NuclideActMda> value = new HashMap<>(); // Map<String, NuclideActMda> value = new HashMap<>();
for (Map.Entry<String, Object> objectEntry : jsonMap.entrySet()) { // for (Map.Entry<String, Object> objectEntry : jsonMap.entrySet()) {
String key = objectEntry.getKey(); // String key = objectEntry.getKey();
NuclideActMda entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), NuclideActMda.class); // NuclideActMda entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), NuclideActMda.class);
value.put(key, entryValue); // value.put(key, entryValue);
} // }
phd.setMapNucActMda(value); // phd.setMapNucActMda(value);
} // }
} }
BeanUtils.copyProperties(phd.getSetting(), phd.getUsedSetting()); BeanUtils.copyProperties(phd.getSetting(), phd.getUsedSetting());
@ -398,6 +391,8 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
peak.recoilDeltaChan = "1"; peak.recoilDeltaChan = "1";
} }
} }
// 重新分析各峰值对应的核素信息
gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap);
gammaFileUtil.RunQC(phd); gammaFileUtil.RunQC(phd);
result.setResult(phd); result.setResult(phd);
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
@ -1454,33 +1449,36 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
PeakInfo info = phd.getVPeak().get(curRow); PeakInfo info = phd.getVPeak().get(curRow);
//获取当前选中的峰值信息的能量值 //获取当前选中的峰值信息的能量值
double energy = info.energy; double energy = info.energy;
//遍历核素信息 if (CollectionUtils.isNotEmpty(info.nuclides)) {
for (String nuclideName : info.nuclides) { //遍历核素信息
//从缓存信息中获取核素名称 for (int i=0; i<info.nuclides.size(); i++) {
NuclideLines nuclideLines = nuclideMap.get(nuclideName); String nuclideName = info.nuclides.get(i);
//获取最大活度的核素位置 //从缓存信息中获取核素名称
int maxYeildIdx = nuclideLines.maxYeildIdx; NuclideLines nuclideLines = nuclideMap.get(nuclideName);
//获取最大活度对应的核素能量值 //获取最大活度的核素位置
Double maxEnergy = nuclideLines.getVenergy().get(maxYeildIdx); int maxYeildIdx = nuclideLines.maxYeildIdx;
//判断当前选中的峰值信息的能量值 是否在 最大活度对应的核素能量值公差范围内 //获取最大活度对应的核素能量值
if (energy >= maxEnergy-0.5 && energy <= maxEnergy+0.5) { Double maxEnergy = nuclideLines.getVenergy().get(maxYeildIdx);
//则需要删除所有关联的核素信息并 从MapNucAct中移除相关核素内容 //判断当前选中的峰值信息的能量值 是否在 最大活度对应的核素能量值公差范围内
for (PeakInfo peakInfo: phd.getVPeak()) { if (energy >= maxEnergy-0.5 && energy <= maxEnergy+0.5) {
//如果峰的核素名称中包含当前删除的核素 //则需要删除所有关联的核素信息并 从MapNucAct中移除相关核素内容
if (peakInfo.nuclides.contains(nuclideName)) { for (PeakInfo peakInfo: phd.getVPeak()) {
peakInfo.nuclides.remove(nuclideName); //如果峰的核素名称中包含当前删除的核素
if (peakInfo.nuclides.contains(nuclideName)) {
peakInfo.nuclides.remove(nuclideName);
}
} }
//从核素相关map中移除核素信息
phd.getMapNucActMda().remove(nuclideName);
//移除核素信息
nuclideMap.remove(nuclideName);
} }
//从核素相关map中移除核素信息
phd.getMapNucActMda().remove(nuclideName);
//移除核素信息
nuclideMap.remove(nuclideName);
} }
} }
//重新计算核素活度浓度
gammaFileUtil.NuclidesIdent(phd, nuclideMap);
//将当前行从峰数组中移除 //将当前行从峰数组中移除
phd.getVPeak().remove(curRow); phd.getVPeak().remove(curRow);
//重新计算核素活度浓度
gammaFileUtil.NuclidesIdent(phd, nuclideMap);
//重新分析数据 //重新分析数据
gammaFileUtil.PeaksChanged(phd); gammaFileUtil.PeaksChanged(phd);
for (int i = 0; i < phd.getVPeak().size(); i++) { for (int i = 0; i < phd.getVPeak().size(); i++) {
@ -1841,6 +1839,28 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
long span = phd.getSpec().getG_energy_span(); long span = phd.getSpec().getG_energy_span();
List<GardsNuclLinesLib> nuclideTableList = spectrumAnalysisMapper.getNuclideTable(name, span); List<GardsNuclLinesLib> nuclideTableList = spectrumAnalysisMapper.getNuclideTable(name, span);
if (CollectionUtils.isNotEmpty(nuclideTableList)) { if (CollectionUtils.isNotEmpty(nuclideTableList)) {
nuclideTableList.stream().forEach(item-> {
if (Objects.nonNull(item.getEnergy())) {
item.setEnergy(Double.valueOf(String.format("%.3f", item.getEnergy())));
} else {
item.setEnergy(Double.valueOf(String.format("%.3f", 0.0)));
}
if (Objects.nonNull(item.getEnergyUncert())) {
item.setEnergyUncert(Double.valueOf(String.format("%.3f", item.getEnergyUncert())));
} else {
item.setEnergyUncert(Double.valueOf(String.format("%.3f", 0.0)));
}
if (Objects.nonNull(item.getYield())) {
item.setYield(Double.valueOf(String.format("%.3f", item.getYield())));
} else {
item.setYield(Double.valueOf(String.format("%.3f", 0.0)));
}
if (Objects.nonNull(item.getYieldUncert())) {
item.setYieldUncert(Double.valueOf(String.format("%.3f", item.getYieldUncert())));
} else {
item.setYieldUncert(Double.valueOf(String.format("%.3f", 0.0)));
}
});
map.put("table", nuclideTableList); map.put("table", nuclideTableList);
gammaFileUtil.InitChart(nuclideTableList, phd, map, colorMap); gammaFileUtil.InitChart(nuclideTableList, phd, map, colorMap);
} }
@ -3521,16 +3541,18 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
result.error500("Please select the parse file first"); result.error500("Please select the parse file first");
return result; return result;
} }
String temp = phd.getOriTotalCmt().trim(); if (StringUtils.isNotBlank(phd.getOriTotalCmt())) {
if (StringUtils.isNotBlank(temp)) { String temp = phd.getOriTotalCmt().trim();
comments += "Comments From Original Spectrum:\n" + temp; if (StringUtils.isNotBlank(temp)) {
} comments += "Comments From Original Spectrum:\n" + temp;
if (Objects.nonNull(sampleId)) { }
CommentData commentData = spectrumAnalysisMapper.viewComment(sampleId); if (Objects.nonNull(sampleId)) {
if (Objects.nonNull(commentData)) { CommentData commentData = spectrumAnalysisMapper.viewComment(sampleId);
temp = commentData.getComment() == null ? "" : commentData.getComment().trim(); if (Objects.nonNull(commentData)) {
if (StringUtils.isNotBlank(temp)) { temp = commentData.getComment() == null ? "" : commentData.getComment().trim();
comments += "\n\nComments From " + commentData.getAnalyst() + "\n:" + temp; if (StringUtils.isNotBlank(temp)) {
comments += "\n\nComments From " + commentData.getAnalyst() + "\n:" + temp;
}
} }
} }
} }

View File

@ -429,6 +429,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
xeData.setColor("green"); xeData.setColor("green");
xeData.setNidFlag(1); xeData.setNidFlag(1);
} }
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
} }
} }
resultMap.put("XeData", xeResultsSpectrumList); resultMap.put("XeData", xeResultsSpectrumList);
@ -513,6 +516,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
xeData.setColor("green"); xeData.setColor("green");
xeData.setNidFlag(1); xeData.setNidFlag(1);
} }
xeData.setMdc(Double.valueOf(String.format("%.6f", xeData.getMdc())));
xeData.setConc(Double.valueOf(String.format("%.6f", xeData.getConc())));
xeData.setConcErr(Double.valueOf(String.format("%.6f", xeData.getConcErr())));
} }
} }
if (CollectionUtils.isNotEmpty(sampleBoundary)) { if (CollectionUtils.isNotEmpty(sampleBoundary)) {
@ -1511,15 +1517,23 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
// //
String gasMeasurementID = gasSourceData.measurement_id; String gasMeasurementID = gasSourceData.measurement_id;
if (gasMeasurementID.equals(sampleSourceData.gas_bk_measurement_id)){ if (gasMeasurementID.equals(sampleSourceData.gas_bk_measurement_id)){
qcResult.setGasBgValue("Match");
qcResult.setGasBgEvaluationMetrics("Match");
qcResult.setGasBgValueAndStatus(true); qcResult.setGasBgValueAndStatus(true);
}else { }else {
qcResult.setGasBgValue("");
qcResult.setGasBgEvaluationMetrics("");
qcResult.setGasBgValueAndStatus(false); qcResult.setGasBgValueAndStatus(false);
} }
// //
String detMeasurementID = detSourceData.measurement_id; String detMeasurementID = detSourceData.measurement_id;
if (detMeasurementID.equals(sampleSourceData.detector_bk_measurement_id)){ if (detMeasurementID.equals(sampleSourceData.detector_bk_measurement_id)){
qcResult.setDetBgValue("Match");
qcResult.setDetBgEvaluationMetrics("Match");
qcResult.setDetBgValueAndStatus(true); qcResult.setDetBgValueAndStatus(true);
}else { }else {
qcResult.setDetBgValue("");
qcResult.setDetBgEvaluationMetrics("");
qcResult.setDetBgValueAndStatus(false); qcResult.setDetBgValueAndStatus(false);
} }
} }
@ -2840,6 +2854,23 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
newLineSeries.add(seriseData); newLineSeries.add(seriseData);
} }
map.put("newLineSeries", newLineSeries); map.put("newLineSeries", newLineSeries);
List<SeriseData> seriseDataList = new LinkedList<>();
List<TableWidget> tableWidgets = new LinkedList<>();
for (int i=0; i<tempPoints.size(); i++) {
//表单数据信息
TableWidget tableWidget = new TableWidget();
tableWidget.setRowCount(i+1);
tableWidget.setChannel(tempPoints.get(i).getX());
tableWidget.setEnergy(tempPoints.get(i).getY());
tableWidgets.add(tableWidget);
//折线图位置信息
SeriseData seriseData = new SeriseData();
seriseData.setX(tempPoints.get(i).getX());
seriseData.setY(tempPoints.get(i).getY());
seriseDataList.add(seriseData);
}
map.put("tableWidgets", tableWidgets);
map.put("newScatterSeriesData", seriseDataList);
//E to C //E to C
List<Double> fittingParaToUi = EnergySpectrumHandler.GetFileFittingPara(ys, xs); List<Double> fittingParaToUi = EnergySpectrumHandler.GetFileFittingPara(ys, xs);
List<String> fittingParaToUiStr = new LinkedList<>(); List<String> fittingParaToUiStr = new LinkedList<>();
@ -2862,6 +2893,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
fittingParaStr.add(String.valueOf(paramA)); fittingParaStr.add(String.valueOf(paramA));
fittingParaStr.add(String.valueOf(paramB)); fittingParaStr.add(String.valueOf(paramB));
fittingParaStr.add(String.valueOf(paramC)); fittingParaStr.add(String.valueOf(paramC));
map.put("CToE", fittingParaStr);
List<Double> xs = new LinkedList<>(); List<Double> xs = new LinkedList<>();
for (int i=0; i<tempPoints.size(); i++){ for (int i=0; i<tempPoints.size(); i++){
xs.add(tempPoints.get(i).getX()); xs.add(tempPoints.get(i).getX());
@ -3036,6 +3068,25 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
qcFilePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + dbQcFilePath.substring(0, dbQcFilePath.lastIndexOf(StringPool.SLASH)); qcFilePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + dbQcFilePath.substring(0, dbQcFilePath.lastIndexOf(StringPool.SLASH));
} }
List<GardsXeResultsSpectrum> analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, sampleFilePath, gasFilePath, detFilePath, qcFilePath, userName); List<GardsXeResultsSpectrum> analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, sampleFilePath, gasFilePath, detFilePath, qcFilePath, userName);
if (CollectionUtils.isNotEmpty(analyseResult)){
for (GardsXeResultsSpectrum xeData:analyseResult) {
Double conc = xeData.getConc();
Double mdc = xeData.getMdc();
if (conc < 0){
xeData.setColor("red");
xeData.setNidFlag(0);
} else if (0<conc && conc < mdc) {
xeData.setColor("#ffcc30");
xeData.setNidFlag(0);
} else if (conc > mdc) {
xeData.setColor("green");
xeData.setNidFlag(1);
}
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
}
}
map.put("xeData", analyseResult); map.put("xeData", analyseResult);
map.put("bProcessed", true); map.put("bProcessed", true);
map.put("savedAnalysisResult", true); map.put("savedAnalysisResult", true);
@ -3045,6 +3096,25 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
} else { } else {
String path = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; String path = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
List<GardsXeResultsSpectrum> analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, path, path, path, path, userName); List<GardsXeResultsSpectrum> analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, path, path, path, path, userName);
if (CollectionUtils.isNotEmpty(analyseResult)){
for (GardsXeResultsSpectrum xeData:analyseResult) {
Double conc = xeData.getConc();
Double mdc = xeData.getMdc();
if (conc < 0){
xeData.setColor("red");
xeData.setNidFlag(0);
} else if (0<conc && conc < mdc) {
xeData.setColor("#ffcc30");
xeData.setNidFlag(0);
} else if (conc > mdc) {
xeData.setColor("green");
xeData.setNidFlag(1);
}
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
}
}
map.put("XeData", analyseResult); map.put("XeData", analyseResult);
map.put("bProcessed", true); map.put("bProcessed", true);
map.put("savedAnalysisResult", true); map.put("savedAnalysisResult", true);
@ -3107,6 +3177,25 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
loadDataList.add(m_loadData); loadDataList.add(m_loadData);
} }
List<GardsXeResultsSpectrum> analyseResultList = BetaGammaAnalyzeAllProcess(loadDataList, analyseData, userName, currentFileName, currentQCFileName); List<GardsXeResultsSpectrum> analyseResultList = BetaGammaAnalyzeAllProcess(loadDataList, analyseData, userName, currentFileName, currentQCFileName);
if (CollectionUtils.isNotEmpty(analyseResultList)){
for (GardsXeResultsSpectrum xeData:analyseResultList) {
Double conc = xeData.getConc();
Double mdc = xeData.getMdc();
if (conc < 0){
xeData.setColor("red");
xeData.setNidFlag(0);
} else if (0<conc && conc < mdc) {
xeData.setColor("#ffcc30");
xeData.setNidFlag(0);
} else if (conc > mdc) {
xeData.setColor("green");
xeData.setNidFlag(1);
}
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
}
}
map.put("XeData", analyseResultList); map.put("XeData", analyseResultList);
map.put("bProcessed", true); map.put("bProcessed", true);
map.put("savedAnalysisResult", true); map.put("savedAnalysisResult", true);
@ -3667,6 +3756,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
xeData.setColor("green"); xeData.setColor("green");
xeData.setNidFlag(1); xeData.setNidFlag(1);
} }
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
} }
} }
//更新分析后的缓存信息 //更新分析后的缓存信息
@ -3808,6 +3900,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
xeData.setColor("green"); xeData.setColor("green");
xeData.setNidFlag(1); xeData.setNidFlag(1);
} }
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
} }
} }
//更新分析后的缓存信息 //更新分析后的缓存信息