GammaFileUtil新增格式化数组内容方法

GammaServiceImpl修改RRR导出返回内容
This commit is contained in:
qiaoqinzheng 2023-09-19 12:49:54 +08:00
parent 82674b613c
commit 90fc91fcff
2 changed files with 18 additions and 8 deletions

View File

@ -2721,16 +2721,27 @@ public class GammaFileUtil {
return data; return data;
} }
public List<String> DoubleLimit_I(List<Double> _data) {
List<String> rdata = new LinkedList<>();
for(int pos=0;pos<_data.size();pos++) {
Double value = _data.get(pos);
if(Objects.isNull(value)) {
rdata.add("NULL");
} else {
rdata.add(String.valueOf(value));
}
}
return rdata;
}
public List<String> DoubleLimit_G(List<Double> _data) { public List<String> DoubleLimit_G(List<Double> _data) {
List<String> rdata = new LinkedList<>(); List<String> rdata = new LinkedList<>();
for(int pos=0;pos<_data.size();pos++) { for(int pos=0;pos<_data.size();pos++) {
Double value = _data.get(pos); Double value = _data.get(pos);
if(Objects.isNull(value)) { if(Objects.isNull(value)) {
rdata.add("NULL"); rdata.add("NULL");
} else if (value > 0){
rdata.add(String.format("%.10g", value));
} else { } else {
rdata.add(String.valueOf(value)); rdata.add(String.format("%.10g", value));
} }
} }
return rdata; return rdata;
@ -3167,7 +3178,7 @@ public class GammaFileUtil {
dvctComments.add(t_comment); dvctComments.add(t_comment);
dvctNuclide_name.add(StringUtils.join(fileAnlyse.getVPeak().get(m).nuclides, ";")); dvctNuclide_name.add(StringUtils.join(fileAnlyse.getVPeak().get(m).nuclides, ";"));
} }
middleData.peaks_idPeak =DoubleLimit_G(dvctIDPEAK); middleData.peaks_idPeak =DoubleLimit_I(dvctIDPEAK);
middleData.peaks_peakCentroid =DoubleLimit_G(dvctCENTROIDCHANNEL); middleData.peaks_peakCentroid =DoubleLimit_G(dvctCENTROIDCHANNEL);
middleData.peaks_uncpeakCentroid =DoubleLimit_G(dvctUNCCENTROIDCHANNEL); middleData.peaks_uncpeakCentroid =DoubleLimit_G(dvctUNCCENTROIDCHANNEL);
middleData.peaks_Energy =DoubleLimit_G(dvctENERGY); middleData.peaks_Energy =DoubleLimit_G(dvctENERGY);
@ -3240,7 +3251,7 @@ public class GammaFileUtil {
dvctUNCACTIVITY.add(itor.getValue().getAct_err()); dvctUNCACTIVITY.add(itor.getValue().getAct_err());
dvctEFFIC.add(itor.getValue().getEfficiency()); dvctEFFIC.add(itor.getValue().getEfficiency());
dvctUNEFFIC.add(itor.getValue().getEffi_err()); dvctUNEFFIC.add(itor.getValue().getEffi_err());
dvctMDA.add(String.format("%e", itor.getValue().getMda())); dvctMDA.add(itor.getValue().getMda()>0?String.format("%e", itor.getValue().getMda()):"0.0");
// dvctKEY_FLAG.add(itor.value().vYield.get(m)); // dvctKEY_FLAG.add(itor.value().vYield.get(m));
dvctCSC_RATIO.add(1.0); dvctCSC_RATIO.add(1.0);
dvctCSC_RATIO_ERR.add(0.0); dvctCSC_RATIO_ERR.add(0.0);
@ -3254,7 +3265,7 @@ public class GammaFileUtil {
dvctCONCENTRATION.add(String.format("%e", itor.getValue().getConcentration())); dvctCONCENTRATION.add(String.format("%e", itor.getValue().getConcentration()));
} }
nucl_lines_ided_data.nuclideFullname = svctNUCLIDEFULLNAME; nucl_lines_ided_data.nuclideFullname = svctNUCLIDEFULLNAME;
nucl_lines_ided_data.idPeak =DoubleLimit_G(dvctIDPEAK); nucl_lines_ided_data.idPeak =DoubleLimit_I(dvctIDPEAK);
nucl_lines_ided_data.Energy =DoubleLimit_G(dvctENERGY); nucl_lines_ided_data.Energy =DoubleLimit_G(dvctENERGY);
nucl_lines_ided_data.uncEnergy =DoubleLimit_G(dvctUNCENERGY); nucl_lines_ided_data.uncEnergy =DoubleLimit_G(dvctUNCENERGY);
nucl_lines_ided_data.Abundance =DoubleLimit_G(dvctABUNDANCE); nucl_lines_ided_data.Abundance =DoubleLimit_G(dvctABUNDANCE);
@ -3298,7 +3309,7 @@ public class GammaFileUtil {
dvctACTIV_KEY.add(itor_v.getValue().getActivity()); dvctACTIV_KEY.add(itor_v.getValue().getActivity());
dvctACTIV_KEY_ERR.add(itor_v.getValue().getAct_err()); dvctACTIV_KEY_ERR.add(itor_v.getValue().getAct_err());
dvctMDA.add(String.format("%e", itor_v.getValue().getMda())); dvctMDA.add(String.format("%e", itor_v.getValue().getMda()));
dvctMDC.add(String.format("%e", itor_v.getValue().getMdc())); dvctMDC.add(itor_v.getValue().getMdc()>0?String.format("%e", itor_v.getValue().getMdc()):"0.0");
dvctCONCENTRATION.add(String.format("%e", itor_v.getValue().getConcentration())); dvctCONCENTRATION.add(String.format("%e", itor_v.getValue().getConcentration()));
dvctCSC_RATIO.add(1.0); dvctCSC_RATIO.add(1.0);
dvctCSC_RATIO_ERR.add(0.0); dvctCSC_RATIO_ERR.add(0.0);

View File

@ -1962,7 +1962,6 @@ public class GammaServiceImpl implements IGammaService {
return; return;
} }
String reportContent = gammaFileUtil.GetReportContent(phd, false); String reportContent = gammaFileUtil.GetReportContent(phd, false);
// String reportContent = gammaFileUtil.GetReportContent(phd, true);
OutputStream fos = null; OutputStream fos = null;
try { try {
//设置响应类型 //设置响应类型