From f06261a8dc20f50e0d7ffd216a6ebd1db6eaa0b4 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Fri, 29 Dec 2023 15:33:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E6=A8=A1?= =?UTF-8?q?=E5=9D=97Beta=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2=E5=9B=9E?= =?UTF-8?q?=E6=98=BEXeData=E6=95=B0=E6=8D=AE=E6=9C=AB=E5=B0=BE0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E5=AE=9E=E4=BD=93=E7=B1=BBGardsXeResultsV?= =?UTF-8?q?iew=E7=94=A8=E4=BA=8E=E5=B0=81=E8=A3=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=95=B0=E6=8D=AE=20PHDFileUtil=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0viewXeData=E5=A4=84=E7=90=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/modules/entity/vo/SpectrumData.java | 8 ++-- .../org/jeecg/common/util/PHDFileUtil.java | 34 ++++++++++----- .../modules/entity/GardsXeResultsView.java | 38 ++++++++++++++++ .../service/impl/GammaServiceImpl.java | 43 +++++++++++++------ .../impl/SpectrumAnalysisServiceImpl.java | 16 +++---- 5 files changed, 105 insertions(+), 34 deletions(-) create mode 100644 jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/GardsXeResultsView.java diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/SpectrumData.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/SpectrumData.java index 8e416380..2ffc374a 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/SpectrumData.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/SpectrumData.java @@ -30,13 +30,13 @@ public class SpectrumData implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date acquisitionStart; - private double acquisitionRealTime; + private String acquisitionRealTime; - private double acquisitionLiveTime; + private String acquisitionLiveTime; - private double airVolume; + private String airVolume; - private double xeVolume; + private String xeVolume; private double yield; diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java index 09bc898b..e7fe99af 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java @@ -16,10 +16,7 @@ import org.jeecg.modules.base.entity.rnman.GardsXeResults; import org.jeecg.modules.base.enums.DataType; import org.jeecg.modules.base.enums.DataTypeAbbr; import org.jeecg.modules.base.enums.XeNuclideName; -import org.jeecg.modules.entity.GardsCalibrationSpectrum; -import org.jeecg.modules.entity.GardsROIChannelsSpectrum; -import org.jeecg.modules.entity.GardsROIResultsSpectrum; -import org.jeecg.modules.entity.GardsXeResultsSpectrum; +import org.jeecg.modules.entity.*; import org.jeecg.modules.entity.vo.*; import org.jeecg.modules.native_jni.EnergySpectrumHandler; import org.jeecg.modules.native_jni.struct.BgAnalyseResult; @@ -100,10 +97,10 @@ public class PHDFileUtil extends AbstractLogOrReport { spectrumData.setCollectionStop(CollectionStop); spectrumData.setCollectionTime(CollectionTime); spectrumData.setAcquisitionStart(AcquisitionStart); - spectrumData.setAcquisitionRealTime(AcquisitionRealTime); - spectrumData.setAcquisitionLiveTime(AcquisitionLiveTime); - spectrumData.setAirVolume(airVolume); - spectrumData.setXeVolume(xeVolume); + spectrumData.setAcquisitionRealTime(String.format("%.2f", AcquisitionRealTime)); + spectrumData.setAcquisitionLiveTime(String.format("%.2f", AcquisitionLiveTime)); + spectrumData.setAirVolume(String.format("%.5f", airVolume)); + spectrumData.setXeVolume(String.format("%.5f", xeVolume)); spectrumData.setYield(xeCollectionYield); spectrumData.setGasBkMeasurementId(gasBkMeasurementId); spectrumData.setDetectorBkMeasurementId(detectorBkMeasurementId); @@ -354,7 +351,7 @@ public class PHDFileUtil extends AbstractLogOrReport { List collectionTimeSections = sections.getCollectionTimeSections(); List acquisitionTimeSections = sections.getAcquisitionTimeSections(); List xeVolumeSections = sections.getXeVolumeSections(); - double airVolume = sampleSpectrumData.getAirVolume(); + double airVolume = Double.parseDouble(sampleSpectrumData.getAirVolume()); if (Objects.nonNull(airVolume)){ // air volume check if (airVolumeSections.get(0) < airVolume && airVolume <= airVolumeSections.get(1)) { // red @@ -406,7 +403,7 @@ public class PHDFileUtil extends AbstractLogOrReport { qcMap.put("CollectTimeBtn", "RedLight"); } } - double acquisitionLiveTime = sampleSpectrumData.getAcquisitionLiveTime(); + double acquisitionLiveTime = Double.parseDouble(sampleSpectrumData.getAcquisitionLiveTime()); if (Objects.nonNull(acquisitionLiveTime)){ acquisitionLiveTime = acquisitionLiveTime/3600; // acquisition time check @@ -1990,4 +1987,21 @@ public class PHDFileUtil extends AbstractLogOrReport { } } + public List viewXeData(List xeResultsSpectrumList) { + List xeResultsViewList = new LinkedList<>(); + if (CollectionUtils.isNotEmpty(xeResultsSpectrumList)) { + for (GardsXeResultsSpectrum xeResultsSpectrum:xeResultsSpectrumList) { + GardsXeResultsView xeResultsView = new GardsXeResultsView(); + xeResultsView.setNuclideName(xeResultsSpectrum.getNuclideName()); + xeResultsView.setConc(NumberFormatUtil.numberSixLen(String.valueOf(xeResultsSpectrum.getConc()))); + xeResultsView.setMdc(NumberFormatUtil.numberSixLen(String.valueOf(xeResultsSpectrum.getMdc()))); + xeResultsView.setConcErr(NumberFormatUtil.numberSixLen(String.valueOf(xeResultsSpectrum.getConcErr()))); + xeResultsView.setNidFlag(xeResultsSpectrum.getNidFlag()); + xeResultsView.setColor(xeResultsSpectrum.getColor()); + xeResultsViewList.add(xeResultsView); + } + } + return xeResultsViewList; + } + } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/GardsXeResultsView.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/GardsXeResultsView.java new file mode 100644 index 00000000..cad705ac --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/GardsXeResultsView.java @@ -0,0 +1,38 @@ +package org.jeecg.modules.entity; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GardsXeResultsView implements Serializable { + + /** + * 核素名称 + */ + private String nuclideName; + /** + * 感兴趣区活度浓度 + */ + private String conc; + + /** + * 感兴趣区活度浓度不确定度 + */ + private String concErr; + /** + * 感兴趣区MDC + */ + private String mdc; + /** + * 感兴趣区LC + */ + private String lc; + /** + * 感兴趣区识别标示;1:识别到,0,未识别到 + */ + private Integer nidFlag; + + private String color; + +} 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 b476d1f0..a107b35d 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 @@ -4439,18 +4439,37 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi } Map map = new HashMap<>(); try { - String collect_start = phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time(); - String collect_stop = phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time(); - String acq_start = phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time(); - Date collect_stop_dt = DateUtils.parseDate(collect_stop); - Date collect_start_dt = DateUtils.parseDate(collect_start); - double Sampling_Time = ((collect_stop_dt.getTime() - collect_start_dt.getTime()) / 1000) / 3600.0; - - Date acq_start_dt = DateUtils.parseDate(acq_start); - double Decay_Time = ((acq_start_dt.getTime() - collect_stop_dt.getTime()) / 1000) / 3600.0; - long secs = (long) (acq_start_dt.getTime() + (phd.getAcq().getAcquisition_real_time() * 1000)); - String acq_stop = DateUtils.formatDate(new Date(secs), "yyyy/MM/dd HH:mm:ss.S"); - + String collect_start = ""; + Date collect_start_dt = null; + if (StringUtils.isNotBlank(phd.getCollect().getCollection_start_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_start_time())) { + collect_start = phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time(); + collect_start_dt = DateUtils.parseDate(collect_start); + } + String collect_stop = ""; + Date collect_stop_dt = null; + if (StringUtils.isNotBlank(phd.getCollect().getCollection_stop_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_stop_time())) { + collect_stop = phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time(); + collect_stop_dt = DateUtils.parseDate(collect_stop); + } + String acq_start = ""; + Date acq_start_dt = null; + if (StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_date()) && StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_time())) { + acq_start = phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time(); + acq_start_dt = DateUtils.parseDate(acq_start); + } + double Sampling_Time = 0.0; + if (Objects.nonNull(collect_stop_dt) && Objects.nonNull(collect_start_dt)) { + Sampling_Time = ((collect_stop_dt.getTime() - collect_start_dt.getTime()) / 1000) / 3600.0; + } + double Decay_Time = 0.0; + if (Objects.nonNull(acq_start_dt) && Objects.nonNull(collect_stop_dt)) { + Decay_Time = ((acq_start_dt.getTime() - collect_stop_dt.getTime()) / 1000) / 3600.0; + } + String acq_stop = ""; + if (Objects.nonNull(acq_start_dt)) { + long secs = (long) (acq_start_dt.getTime() + (phd.getAcq().getAcquisition_real_time() * 1000)); + acq_stop = DateUtils.formatDate(new Date(secs), "yyyy/MM/dd HH:mm:ss.S"); + } map.put("stationId", phd.getHeader().getSite_code()); map.put("sampleId", phd.getId_sample()); map.put("sampleQuantity", String.format("%.2f", phd.getCollect().getAir_volume()) + " m3"); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java index a652db96..dced9e2f 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java @@ -530,7 +530,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements betaDataFile.setBetaCalibrationPairsList(betaCalibrationPairsList); betaDataFile.setXeResultsSpectrumList(xeResultsSpectrumList); betaDataFile.setSaveAnalysisResult(true); - resultMap.put("XeData", xeResultsSpectrumList); + resultMap.put("XeData", phdFileUtil.viewXeData(xeResultsSpectrumList)); resultMap.put("bProcessed", betaDataFile.isBProcessed()); resultMap.put("savedAnalysisResult", betaDataFile.isSaveAnalysisResult()); cache.put(betaDataFile.getSampleFileName()+"-"+userName, betaDataFile); @@ -651,7 +651,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements xeData.setConcErr(Double.valueOf(NumberFormatUtil.numberSixLen(String.valueOf(xeData.getConcErr())))); } } - resultMap.put("XeData", xeResultsSpectrumList); + resultMap.put("XeData", phdFileUtil.viewXeData(xeResultsSpectrumList)); resultMap.put("bProcessed", betaDataFile.isBProcessed()); resultMap.put("savedAnalysisResult", betaDataFile.isSaveAnalysisResult()); cache.put(betaDataFile.getSampleFileName()+"-"+userName, betaDataFile); @@ -1973,8 +1973,8 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements if (Objects.nonNull(struct)) { //Acquisition String acquisitionStart = struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time; - String acquisitionRealTime = String.valueOf(struct.acquisition_real_time); - String acquisitionLiveTime = String.valueOf(struct.acquisition_live_time); + double acquisitionRealTime = Double.parseDouble(String.format("%.1f", struct.acquisition_real_time)); + double acquisitionLiveTime = Double.parseDouble(String.format("%.1f", struct.acquisition_live_time)); map.put("acquisitionStart", acquisitionStart); map.put("acquisitionRealTime", acquisitionRealTime); map.put("acquisitionLiveTime", acquisitionLiveTime); @@ -5968,10 +5968,10 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements spectrumData.setCollectionStop(CollectionStop); spectrumData.setCollectionTime(CollectionTime); spectrumData.setAcquisitionStart(AcquisitionStart); - spectrumData.setAcquisitionRealTime(AcquisitionRealTime); - spectrumData.setAcquisitionLiveTime(AcquisitionLiveTime); - spectrumData.setAirVolume(airVolume); - spectrumData.setXeVolume(xeVolume); + spectrumData.setAcquisitionRealTime(String.format("%.2f", AcquisitionRealTime)); + spectrumData.setAcquisitionLiveTime(String.format("%.2f", AcquisitionLiveTime)); + spectrumData.setAirVolume(String.format("%.5f", airVolume)); + spectrumData.setXeVolume(String.format("%.5f", xeVolume)); spectrumData.setYield(xeCollectionYield); spectrumData.setGasBkMeasurementId(gasBkMeasurementId); spectrumData.setDetectorBkMeasurementId(detectorBkMeasurementId);