diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/QcCheckItem.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/QcCheckItem.java index dd6a2693..da53b809 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/QcCheckItem.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/QcCheckItem.java @@ -9,7 +9,7 @@ public class QcCheckItem implements Serializable { private String standard; - private double value; + private Double value; private boolean bPass; 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-auto-process/src/main/java/org/jeecg/modules/spectrum/ParsingProcessLog.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/ParsingProcessLog.java index c487ffbc..8f419cf0 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/ParsingProcessLog.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/ParsingProcessLog.java @@ -789,7 +789,7 @@ public class ParsingProcessLog extends AbstractAutoLogOrReport{ this.handleStorageProcessLog(); if(DataType.SAMPLEPHD.getType().equals(this.spectrumHandler.currDataType.getType()) && this.spectrumHandler.sourceData.system_type.equals(SystemType.BETA.getType()) && - this.fileRepeat == false){ + this.fileRepeat == false && this.fileNotExist == false){ this.handleAnalysisProcessLog(); } diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java index 4ad7b331..80cbe987 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -225,8 +225,12 @@ public class GammaFileUtil extends AbstractLogOrReport { phd.getSetting().setECutAnalysis_Low(35.0); phd.getSetting().setBUpdateCal(true); } - phd.getSetting().setRefTime_conc(DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time().substring(0, phd.getCollect().getCollection_start_time().indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss")); - phd.getSetting().setRefTime_act(DateUtils.parseDate(phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time().substring(0, phd.getAcq().getAcquisition_start_time().indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss")); + if (StringUtils.isNotBlank(phd.getCollect().getCollection_start_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_start_time())) { + phd.getSetting().setRefTime_conc(DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time())); + } + if (StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_date()) && StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_time())) { + phd.getSetting().setRefTime_act(DateUtils.parseDate(phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time())); + } SpecSetup usedSetting = new SpecSetup(); BeanUtils.copyProperties(phd.getSetting(), usedSetting); phd.setUsedSetting(usedSetting); @@ -490,17 +494,32 @@ public class GammaFileUtil extends AbstractLogOrReport { public void RunQC(PHDFile phd) { try { //获取phdFile的 采集开始时间 - Date start = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time()); + Date start = null; + if (StringUtils.isNotBlank(phd.getCollect().getCollection_start_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_start_time())) { + start = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time()); + } //获取phdFile的 采集结束时间 - Date end = DateUtils.parseDate(phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time()); + Date end = null; + if (StringUtils.isNotBlank(phd.getCollect().getCollection_stop_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_stop_time())) { + end = DateUtils.parseDate(phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time()); + } //获取phdFile的 分析开始时间 - Date acq = DateUtils.parseDate(phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time()); + Date acq = null; + if (StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_date()) && StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_time())) { + acq = DateUtils.parseDate(phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time()); + } //计算得到采集耗时 - double collect_hour = ((end.getTime() - start.getTime())/1000) / 3600.0; + double collect_hour = 0.0; + if (Objects.nonNull(end) && Objects.nonNull(start)) { + collect_hour = ((end.getTime() - start.getTime())/1000) / 3600.0; + } //获取 实际分析时长 double acq_hour = phd.getAcq().getAcquisition_real_time() / 3600.0; //计算得到衰减耗时 - double Decay_hour = ((acq.getTime() - end.getTime())/1000) / 3600.0; + double Decay_hour = 0.0; + if (Objects.nonNull(acq) && Objects.nonNull(end)) { + Decay_hour = ((acq.getTime() - end.getTime())/1000) / 3600.0; + } //声明一个double数据 List Be7Value = new LinkedList<>(); //声明一个map用于存储计算数据 @@ -633,16 +652,32 @@ public class GammaFileUtil extends AbstractLogOrReport { if(vMdcInfo.size() < 3 || vMdcInfo.get(2) == 0) { return 0.0; } + //获取采集开始时间 - Date collectStart = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time()); + Date collectStart = null; + if (StringUtils.isNotBlank(phd.getCollect().getCollection_start_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_start_time())) { + collectStart = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time()); + } //获取采样结束时间 - Date collectStop = DateUtils.parseDate(phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time()); + Date collectStop = null; + if (StringUtils.isNotBlank(phd.getCollect().getCollection_stop_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_stop_time())) { + collectStop = DateUtils.parseDate(phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time()); + } //获取能谱获取时间 - Date acqStart = DateUtils.parseDate(phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time()); + Date acqStart = null; + if (StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_date()) && StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_time())) { + acqStart = DateUtils.parseDate(phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time()); + } //计算采样时间 - double Ts = ((collectStop.getTime() - collectStart.getTime())/1000); + double Ts = 0.0; + if (Objects.nonNull(collectStop) && Objects.nonNull(collectStart)) { + Ts = ((collectStop.getTime() - collectStart.getTime())/1000); + } //计算衰变时间 - double Td = ((acqStart.getTime() - collectStop.getTime())/1000); + double Td = 0.0; + if (Objects.nonNull(acqStart) && Objects.nonNull(collectStop)) { + Td = ((acqStart.getTime() - collectStop.getTime())/1000); + } //获取能谱获取实时间 double Ta = phd.getAcq().getAcquisition_real_time(); //获取能谱获取活时间 @@ -670,7 +705,10 @@ public class GammaFileUtil extends AbstractLogOrReport { DCF3 = lambda * Ta / (1-Math.exp(-lambda*Ta)); } //计算得到DCF_conc - double DCF_conc = Math.exp(lambda * ((collectStart.getTime() - phd.getUsedSetting().getRefTime_conc().getTime())/1000)); + double DCF_conc = Double.POSITIVE_INFINITY; + if (Objects.nonNull(collectStart) && Objects.nonNull(phd.getUsedSetting().getRefTime_conc())) { + DCF_conc = Math.exp(lambda * ((collectStart.getTime() - phd.getUsedSetting().getRefTime_conc().getTime())/1000)); + } //声明一个集合 List energy = new LinkedList<>(); energy.add(vMdcInfo.get(0)); @@ -881,22 +919,41 @@ public class GammaFileUtil extends AbstractLogOrReport { detailInfo.set(5, phd.getHeader().getSpectrum_quantity()); // Spectral_Qualifier detailInfo.set(6, phd.getHeader().getSample_ref_id()); // SRID detailInfo.set(7, phd.getStatus()); // Sample_Status - String collect_stop = phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time().substring(0,phd.getCollect().getCollection_stop_time().indexOf(StringPool.DOT)); - Date collect_stop_dt = DateUtils.parseDate(collect_stop,"yyyy/MM/dd HH:mm:ss"); - detailInfo.set(8, phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time()); - Date date = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time().substring(0,phd.getCollect().getCollection_start_time().indexOf(StringPool.DOT)),"yyyy/MM/dd HH:mm:ss"); - double timeSpan = (collect_stop_dt.getTime()/1000 - date.getTime()/1000) / 3600.0; + 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,"yyyy/MM/dd HH:mm:ss"); + } + 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(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time()); + } + detailInfo.set(8, collect_start); + double timeSpan = 0.0; + if (Objects.nonNull(collect_start_dt) && Objects.nonNull(collect_stop_dt)) { + timeSpan = (collect_stop_dt.getTime()/1000 - collect_start_dt.getTime()/1000) / 3600.0; + } detailInfo.set(9, String.format("%.2f", timeSpan));// Sampling_Time detailInfo.set(10, String.format("%.2f", phd.getCollect().getAir_volume())); if(timeSpan != 0){ detailInfo.set(11, String.format("%.2f", phd.getCollect().getAir_volume()/timeSpan)); } - detailInfo.set(12, phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time()); - String start_time = phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time().substring(0, phd.getAcq().getAcquisition_start_time().indexOf(StringPool.DOT)); - Date start_date = DateUtils.parseDate(start_time, "yyyy/MM/dd HH:mm:ss"); + String acq_start = ""; + Date start_date = 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(); + start_date = DateUtils.parseDate(acq_start); + } + detailInfo.set(12, acq_start); detailInfo.set(13, String.format("%.2f", phd.getAcq().getAcquisition_real_time())); detailInfo.set(14, String.format("%.2f", phd.getAcq().getAcquisition_live_time())); - double timespan = (start_date.getTime()/1000 - collect_stop_dt.getTime()/1000); + double timespan = 0.0; + if (Objects.nonNull(start_date) && Objects.nonNull(collect_start_dt)) { + timespan = (start_date.getTime()/1000 - collect_stop_dt.getTime()/1000); + } detailInfo.set(15, String.format("%.2f", timespan / 3600.0)); detailInfo.set(17, phd.getCategory()); return detailInfo; @@ -1728,11 +1785,26 @@ public class GammaFileUtil extends AbstractLogOrReport { private boolean CalculateMDCs(PHDFile phd, NuclideActMda nucActMda, int mainPeakIdx, double lambda, double keyLineYield, double CCF) { // 计算衰变校正因子——DCF try { - Date collectStart = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time().substring(0, phd.getCollect().getCollection_start_time().indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss"); - Date collectStop = DateUtils.parseDate(phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time().substring(0, phd.getCollect().getCollection_stop_time().indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss"); - Date acqStart = DateUtils.parseDate(phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time().substring(0, phd.getAcq().getAcquisition_start_time().indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss"); - double Ts = collectStop.getTime()/1000 - collectStart.getTime()/1000; // 采样时间 - double Td = acqStart.getTime()/1000 - collectStop.getTime()/1000; // 衰变时间 + Date collectStart = null; + if (StringUtils.isNotBlank(phd.getCollect().getCollection_start_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_start_time())) { + collectStart = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time()); + } + Date collectStop = null; + if (StringUtils.isNotBlank(phd.getCollect().getCollection_stop_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_stop_time())) { + collectStop = DateUtils.parseDate(phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time()); + } + Date acqStart = null; + if (StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_date()) && StringUtils.isNotBlank(phd.getAcq().getAcquisition_start_time())) { + acqStart = DateUtils.parseDate(phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time()); + } + double Ts = 0.0; + if (Objects.nonNull(collectStop) && Objects.nonNull(collectStart)) { + Ts = collectStop.getTime()/1000 - collectStart.getTime()/1000; // 采样时间 + } + double Td = 0.0; + if (Objects.nonNull(acqStart) && Objects.nonNull(collectStop)) { + Td = acqStart.getTime()/1000 - collectStop.getTime()/1000; // 衰变时间 + } double Ta = phd.getAcq().getAcquisition_real_time(); // 能谱获取实时间 double Tl = phd.getAcq().getAcquisition_live_time(); // 能谱获取活时间 double Svol = phd.getCollect().getAir_volume(); // 样品采样体积 @@ -3653,7 +3725,7 @@ public class GammaFileUtil extends AbstractLogOrReport { for(Map.Entry itor_q:fileAnlyse.getQcItems().entrySet()) { String nuclideName = itor_q.getKey(); qvctQC_NAME.add(nuclideName); - dvctQC_VALUE.add(itor_q.getValue().getValue()); + dvctQC_VALUE.add(Double.isFinite(itor_q.getValue().getValue())?itor_q.getValue().getValue():null); qvctQC_STANDARD.add(itor_q.getValue().getStandard()); dvctQC_RESULT.add(itor_q.getValue().isBPass()?1.0:0.0); } @@ -3663,8 +3735,14 @@ public class GammaFileUtil extends AbstractLogOrReport { middleData.QC_CHECK_QC_VALUE=DoubleLimit_G(dvctQC_VALUE); } //sample info - middleData.sample_collection_start = fileAnlyse.getCollect().getCollection_start_date()+StringPool.SPACE+fileAnlyse.getCollect().getCollection_start_time(); - middleData.sample_collection_stop = fileAnlyse.getCollect().getCollection_stop_date()+StringPool.SPACE+fileAnlyse.getCollect().getCollection_stop_time(); + middleData.sample_collection_start = ""; + if (StringUtils.isNotBlank(fileAnlyse.getCollect().getCollection_start_date()) && StringUtils.isNotBlank(fileAnlyse.getCollect().getCollection_start_time())) { + middleData.sample_collection_start = fileAnlyse.getCollect().getCollection_start_date()+StringPool.SPACE+fileAnlyse.getCollect().getCollection_start_time(); + } + middleData.sample_collection_stop = ""; + if (StringUtils.isNotBlank(fileAnlyse.getCollect().getCollection_stop_date()) && StringUtils.isNotBlank(fileAnlyse.getCollect().getCollection_stop_time())) { + middleData.sample_collection_stop = fileAnlyse.getCollect().getCollection_stop_date()+StringPool.SPACE+fileAnlyse.getCollect().getCollection_stop_time(); + } if(Objects.nonNull(fileAnlyse.getQcItems().get("col_time"))) { middleData.sample_time = String.format("%.4f", fileAnlyse.getQcItems().get("col_time").getValue()); if(fileAnlyse.getQcItems().get("col_time").getValue()!=0) { @@ -3678,10 +3756,14 @@ public class GammaFileUtil extends AbstractLogOrReport { middleData.sample_acquistion_time = String.format("%.5f", fileAnlyse.getQcItems().get("acq_time").getValue()); } middleData.sample_quantity = String.format("%.4f", fileAnlyse.getCollect().getAir_volume()); - middleData.sample_acquisiton_start = fileAnlyse.getAcq().getAcquisition_start_date()+StringPool.SPACE+fileAnlyse.getAcq().getAcquisition_start_time(); - String acquisition_start = middleData.sample_acquisiton_start; - Date dataTime = DateUtils.parseDate(acquisition_start); - middleData.sample_acquistion_stop = DateUtils.formatDate(new Date((long) (dataTime.getTime() + fileAnlyse.getAcq().getAcquisition_real_time()*1000)), "yyyy/MM/dd HH:mm:ss"); + middleData.sample_acquisiton_start = ""; + Date dataTime = null; + middleData.sample_acquistion_stop = ""; + if (StringUtils.isNotBlank(fileAnlyse.getAcq().getAcquisition_start_date()) && StringUtils.isNotBlank(fileAnlyse.getAcq().getAcquisition_start_time())) { + middleData.sample_acquisiton_start = fileAnlyse.getAcq().getAcquisition_start_date()+StringPool.SPACE+fileAnlyse.getAcq().getAcquisition_start_time(); + dataTime = DateUtils.parseDate(middleData.sample_acquisiton_start); + middleData.sample_acquistion_stop = DateUtils.formatDate(new Date((long) (dataTime.getTime() + fileAnlyse.getAcq().getAcquisition_real_time()*1000)), "yyyy/MM/dd HH:mm:ss"); + } middleData.sample_acquistion_time = String.format("%.2f", fileAnlyse.getAcq().getAcquisition_real_time()) ; middleData.sample_stationID = fileAnlyse.getHeader().getSite_code(); middleData.sample_detectID = fileAnlyse.getHeader().getDetector_code(); 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 4e9b3589..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; @@ -72,7 +69,7 @@ public class PHDFileUtil extends AbstractLogOrReport { } //Acquisition Start Date AcquisitionStart = null; - if ( StringUtils.isNotBlank(struct.collection_start_date) && StringUtils.isNotBlank(struct.collection_start_time) ){ + if ( StringUtils.isNotBlank(struct.acquisition_start_date) && StringUtils.isNotBlank(struct.acquisition_start_time) ){ AcquisitionStart = DateUtils.parseDate(struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time); } //Acq Real Time @@ -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 d0270efb..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 @@ -805,7 +805,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi for (GardsQcCheckSpectrum qcCheckSpectrum : qcChecks) { String str_key = qcCheckSpectrum.getQcName(); QcCheckItem qcCheckItem = new QcCheckItem(); - qcCheckItem.setValue(qcCheckSpectrum.getQcValue()); + qcCheckItem.setValue(qcCheckSpectrum.getQcValue() == null?0.0:qcCheckSpectrum.getQcValue()); qcCheckItem.setBPass(qcCheckSpectrum.getQcResult() == 1); qcCheckItem.setStandard(qcCheckSpectrum.getQcStandard()); phd.getQcItems().put(str_key, qcCheckItem); @@ -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"); @@ -4523,7 +4542,13 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi } item.setName(name); item.setFlag(iter.getValue().isBPass() ? "PASS" : "FAIL"); - item.setValue(Double.parseDouble(NumberFormatUtil.numberFormat(String.valueOf(iter.getValue().getValue())))); + if (Double.isFinite(iter.getValue().getValue())) { + item.setValue(Double.parseDouble(NumberFormatUtil.numberFormat(String.valueOf(iter.getValue().getValue())))); + } else if (Double.isInfinite(iter.getValue().getValue())) { + item.setValue(iter.getValue().getValue()); + } else if (Double.isNaN(iter.getValue().getValue())) { + item.setValue(iter.getValue().getValue()); + } String standard = ""; List strList = Arrays.asList(iter.getValue().getStandard().split(StringPool.COMMA)); for (String str : strList) { 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 01906c39..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); @@ -1381,14 +1381,14 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements String sit_det_code = struct.site_code; String detect_code = struct.detector_code; String sample_id = Objects.nonNull(sampleId)?sampleId.toString():""; - Date collectStartDate = DateUtils.parseDate(struct.collection_start_date + StringPool.SPACE + struct.collection_start_time.substring(0, struct.collection_start_time.indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss"); - Date collectStopDate = DateUtils.parseDate(struct.collection_stop_date + StringPool.SPACE + struct.collection_stop_time.substring(0, struct.collection_stop_time.indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss"); + Date collectStartDate = DateUtils.parseDate(struct.collection_start_date + StringPool.SPACE + struct.collection_start_time); + Date collectStopDate = DateUtils.parseDate(struct.collection_stop_date + StringPool.SPACE + struct.collection_stop_time); String collect_start = DateUtils.formatDate(collectStartDate, "yyyy/MM/dd HH:mm:ss"); String collect_stop = DateUtils.formatDate(collectStopDate, "yyyy/MM/dd HH:mm:ss"); String collection_time_value = String.format ("%.2f",Double.valueOf((collectStopDate.getTime() - collectStartDate.getTime())/ 1000)); String s_volume_of_Xe = String.valueOf(struct.air_volume); String s_xe_stable_volume = String.valueOf(struct.sample_volume_of_Xe); - Date acquisitionStartDate = DateUtils.parseDate(struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time.substring(0, struct.acquisition_start_time.indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss"); + Date acquisitionStartDate = DateUtils.parseDate(struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time); String acquisition_start = DateUtils.formatDate(acquisitionStartDate, "yyyy/MM/dd HH:mm:ss"); String acquisition_real_sec = String.valueOf(struct.acquisition_real_time); String acquisition_live_sec = String.valueOf(struct.acquisition_live_time); @@ -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);