From ed00d25f4dacf2e883d21957083b0e0b75358715 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Fri, 29 Dec 2023 09:16:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86?= =?UTF-8?q?=E6=9E=90=E9=A1=B5=E9=9D=A2=E5=9B=9E=E6=98=BE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=B2=BE=E5=BA=A6=E4=BB=A5=E5=8F=8A=E6=A0=BC=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/common/util/NumberFormatUtil.java | 16 +- .../mapper/xml/SpectrumAnalysisMapper.xml | 348 +++++++++--------- .../service/impl/GammaServiceImpl.java | 14 +- 3 files changed, 203 insertions(+), 175 deletions(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/NumberFormatUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/NumberFormatUtil.java index 6202b7ad..36e1043e 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/NumberFormatUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/NumberFormatUtil.java @@ -36,8 +36,12 @@ public class NumberFormatUtil { } else { eValue = "e+0"+ number.substring(number.indexOf("e")+1); } - } else { - eValue = number.substring(number.indexOf("e")); + } else if (Double.valueOf(eValue) < 0){ + if (Double.valueOf(eValue) > -10) { + eValue = "e-0"+number.substring(number.indexOf("e")+2); + } else { + eValue = "e"+number.substring(number.indexOf("e")+1); + } } value = numberCal + eValue.replace("E", "e"); } else if (number.indexOf("E")>0) { @@ -50,8 +54,12 @@ public class NumberFormatUtil { } else { eValue = "e+0"+ number.substring(number.indexOf("E")+1); } - } else { - eValue = number.substring(number.indexOf("E")); + } else if (Double.valueOf(eValue) < 0){ + if (Double.valueOf(eValue) > -10) { + eValue = "e-0"+number.substring(number.indexOf("E")+2); + } else { + eValue = "e"+number.substring(number.indexOf("E")+1); + } } value = numberCal + eValue.replace("E", "e"); } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml index e9f9129f..56357066 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml @@ -236,25 +236,25 @@ SELECT - SITE_DET_CODE, - SAMPLE_ID, - STATION_ID, - DETECTOR_ID, - INPUT_FILE_NAME, - SAMPLE_TYPE, - DATA_TYPE, - GEOMETRY, - SPECTRAL_QUALIFIE, - TRANSMIT_DTG, - COLLECT_START, - COLLECT_STOP, - ACQUISITION_START, - ACQUISITION_STOP, - ACQUISITION_REAL_SEC, - ACQUISITION_LIVE_SEC, - QUANTITY, - STATUS, - MODDATE + SITE_DET_CODE siteDetCode, + SAMPLE_ID sampleId, + STATION_ID stationId, + DETECTOR_ID detectorId, + INPUT_FILE_NAME inputFileName, + SAMPLE_TYPE sampleType, + DATA_TYPE dataType, + GEOMETRY geometry, + SPECTRAL_QUALIFIE spectralQualifie, + TRANSMIT_DTG transmitDtg, + COLLECT_START collectStart, + COLLECT_STOP collectStop, + ACQUISITION_START acquisitionStart, + ACQUISITION_STOP acquisitionStop, + ACQUISITION_REAL_SEC acquisitionRealSec, + ACQUISITION_LIVE_SEC acquisitionLiveSec, + QUANTITY quantity, + STATUS status, + MODDATE moddate FROM ORIGINAL.GARDS_SAMPLE_DATA @@ -442,15 +442,15 @@ SELECT - IDPEAK, - CENTROIDCHANNEL, - ENERGY, - AREA, - UNCAREA, - EFFICIENCY, - FWHM, - FWTM, - SIGNIFICANCE, - LC, - ROISTART, - ROIEND, - MULTIINDEX, - TAIL, - TAILALPHA, - UPPERTAIL, - UPPERTAILALPHA, - BWWIDTHCHAN, - RECOILDELTACHAN, - STEPRAIO, - LD, - SENSITIVITY, - BACKGROUNDAREA, - MEANBACKCOUNT, - PEAKCOMMENTS + IDPEAK idPeak, + CENTROIDCHANNEL centroidChannel, + ENERGY energy, + AREA area, + UNCAREA uncArea, + EFFICIENCY efficiency, + FWHM fwhm, + FWTM fwtm, + SIGNIFICANCE significance, + LC lc, + ROISTART roiStart, + ROIEND roiEnd, + MULTIINDEX mulitiIndex, + TAIL tail, + TAILALPHA tailAlpha, + UPPERTAIL upperTail, + UPPERTAILALPHA upperTailAlpha, + BWWIDTHCHAN bwwidthchan, + RECOILDELTACHAN recoildeltachan, + STEPRAIO stepraio, + LD ld, + SENSITIVITY sensitivity, + BACKGROUNDAREA backgroundarea, + MEANBACKCOUNT meanbackcount, + PEAKCOMMENTS peakcomments FROM ${dbName} WHERE IDANALYSIS = #{idAnalysis} ORDER BY IDPEAK @@ -499,35 +499,51 @@ SELECT DISTINCT - SMAPLE_DATA.DATA_TYPE, - CALIBRATION_PAIRS.IDCALPOINT, - CALIBRATION_PAIRS.XVALUE, - CALIBRATION_PAIRS.YVALUE + SMAPLE_DATA.DATA_TYPE dataType, + CALIBRATION_PAIRS.IDCALPOINT idCalPoint, + CALIBRATION_PAIRS.XVALUE xValue, + CALIBRATION_PAIRS.YVALUE yValue FROM RNMAN.GARDS_CALIBRATION_PAIRS CALIBRATION_PAIRS, ORIGINAL.GARDS_SAMPLE_DATA SMAPLE_DATA @@ -600,10 +616,10 @@ SELECT DISTINCT - SMAPLE_DATA.DATA_TYPE, - CALIBRATION_PAIRS.IDCALPOINT, - CALIBRATION_PAIRS.XVALUE, - CALIBRATION_PAIRS.YVALUE + SMAPLE_DATA.DATA_TYPE dataType, + CALIBRATION_PAIRS.IDCALPOINT idCalPoint, + CALIBRATION_PAIRS.XVALUE xValue, + CALIBRATION_PAIRS.YVALUE yValue FROM RNMAN.GARDS_CALIBRATION_PAIRS CALIBRATION_PAIRS, ORIGINAL.GARDS_SAMPLE_DATA SMAPLE_DATA @@ -632,10 +648,10 @@ SELECT DISTINCT - SAMPLE_DATA.DATA_TYPE, - ROI_CHANNELS.ROI, - ROI_CHANNELS.B_CHAN_START, - ROI_CHANNELS.B_CHAN_STOP, - ROI_CHANNELS.G_CHAN_START, - ROI_CHANNELS.G_CHAN_STOP + SAMPLE_DATA.DATA_TYPE dataType, + ROI_CHANNELS.ROI roi, + ROI_CHANNELS.B_CHAN_START bChanStart, + ROI_CHANNELS.B_CHAN_STOP bChanStop, + ROI_CHANNELS.G_CHAN_START gChanStart, + ROI_CHANNELS.G_CHAN_STOP gChanStop FROM ${dbName}.GARDS_ROI_CHANNELS ROI_CHANNELS, ORIGINAL.GARDS_SAMPLE_DATA SAMPLE_DATA @@ -666,19 +682,19 @@ SELECT - XE_RESULTS.NUCLIDE_NAME, - XE_RESULTS.CONC, - XE_RESULTS.CONC_ERR, - XE_RESULTS.MDC, - XE_RESULTS.NID_FLAG, - XE_RESULTS.LC + XE_RESULTS.NUCLIDE_NAME nuclideName, + XE_RESULTS.CONC conc, + XE_RESULTS.CONC_ERR concErr, + XE_RESULTS.MDC mdc, + XE_RESULTS.NID_FLAG nidFlag, + XE_RESULTS.LC lc FROM ${dbName}.GARDS_XE_RESULTS XE_RESULTS WHERE @@ -741,12 +757,12 @@ select - a.fullname, - a.energy, - a.energy_uncert, - a.yield, - a.yield_uncert + a.fullname fullName, + a.energy energy, + a.energy_uncert energyUncert, + a.yield yield, + a.yield_uncert yieldUncert from CONFIGURATION.GARDS_NUCL_LINES_LIB a where a.name = #{name} and a.energy >= 30 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 78c1d69f..d0270efb 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 @@ -4697,15 +4697,15 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi TableResult tableResult = new TableResult(); NuclideActMda nuc = it.getValue(); tableResult.setNuclide(it.getKey()); - tableResult.setActivity(NumUtil.keep4ScienceStr(nuc.getActivity())); - String act_err = nuc.getActivity() > 0 ? NumUtil.keepStr(nuc.getAct_err() / nuc.getActivity() * 100, 2) : "0"; + tableResult.setActivity(NumberFormatUtil.numberFormat(String.valueOf(nuc.getActivity()))); + String act_err = nuc.getActivity() > 0 ? NumberFormatUtil.numberFormat(String.valueOf(nuc.getAct_err() / nuc.getActivity() * 100)) : "0"; tableResult.setActErr(act_err); - tableResult.setFactor1(coverage_factor); - tableResult.setConfidence1(level_confidence); - tableResult.setConc(Objects.isNull(nuc.getConcentration())?null:NumUtil.keep4ScienceStr(nuc.getConcentration() / 1000)); + tableResult.setFactor1(NumberFormatUtil.numberFormat(coverage_factor)); + tableResult.setConfidence1(NumberFormatUtil.numberFormat(level_confidence)); + tableResult.setConc(Objects.isNull(nuc.getConcentration())?null:NumberFormatUtil.numberFormat(String.valueOf(nuc.getConcentration() / 1000))); tableResult.setConcErr(act_err); - tableResult.setFactor2(coverage_factor); - tableResult.setConfidence2(level_confidence); + tableResult.setFactor2(NumberFormatUtil.numberFormat(coverage_factor)); + tableResult.setConfidence2(NumberFormatUtil.numberFormat(level_confidence)); tableResultList.add(tableResult); } }