From 90fc91fcffed3da551b044571a31ecef8bcabec1 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Tue, 19 Sep 2023 12:49:54 +0800 Subject: [PATCH] =?UTF-8?q?GammaFileUtil=E6=96=B0=E5=A2=9E=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E6=95=B0=E7=BB=84=E5=86=85=E5=AE=B9=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20GammaServiceImpl=E4=BF=AE=E6=94=B9RRR=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E8=BF=94=E5=9B=9E=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/util/GammaFileUtil.java | 25 +++++++++++++------ .../service/impl/GammaServiceImpl.java | 1 - 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/GammaFileUtil.java index e612255a..18febbd2 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -2721,16 +2721,27 @@ public class GammaFileUtil { return data; } + public List DoubleLimit_I(List _data) { + List 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 DoubleLimit_G(List _data) { List rdata = new LinkedList<>(); for(int pos=0;pos<_data.size();pos++) { Double value = _data.get(pos); if(Objects.isNull(value)) { rdata.add("NULL"); - } else if (value > 0){ - rdata.add(String.format("%.10g", value)); } else { - rdata.add(String.valueOf(value)); + rdata.add(String.format("%.10g", value)); } } return rdata; @@ -3167,7 +3178,7 @@ public class GammaFileUtil { dvctComments.add(t_comment); 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_uncpeakCentroid =DoubleLimit_G(dvctUNCCENTROIDCHANNEL); middleData.peaks_Energy =DoubleLimit_G(dvctENERGY); @@ -3240,7 +3251,7 @@ public class GammaFileUtil { dvctUNCACTIVITY.add(itor.getValue().getAct_err()); dvctEFFIC.add(itor.getValue().getEfficiency()); 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)); dvctCSC_RATIO.add(1.0); dvctCSC_RATIO_ERR.add(0.0); @@ -3254,7 +3265,7 @@ public class GammaFileUtil { dvctCONCENTRATION.add(String.format("%e", itor.getValue().getConcentration())); } 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.uncEnergy =DoubleLimit_G(dvctUNCENERGY); nucl_lines_ided_data.Abundance =DoubleLimit_G(dvctABUNDANCE); @@ -3298,7 +3309,7 @@ public class GammaFileUtil { dvctACTIV_KEY.add(itor_v.getValue().getActivity()); dvctACTIV_KEY_ERR.add(itor_v.getValue().getAct_err()); 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())); dvctCSC_RATIO.add(1.0); dvctCSC_RATIO_ERR.add(0.0); 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 c32634f8..06107427 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 @@ -1962,7 +1962,6 @@ public class GammaServiceImpl implements IGammaService { return; } String reportContent = gammaFileUtil.GetReportContent(phd, false); -// String reportContent = gammaFileUtil.GetReportContent(phd, true); OutputStream fos = null; try { //设置响应类型