Merge remote-tracking branch 'origin/mdc' into mdc

This commit is contained in:
nieziyan 2023-12-29 19:33:59 +08:00
commit bc79da2cd0
8 changed files with 235 additions and 76 deletions

View File

@ -9,7 +9,7 @@ public class QcCheckItem implements Serializable {
private String standard; private String standard;
private double value; private Double value;
private boolean bPass; private boolean bPass;

View File

@ -30,13 +30,13 @@ public class SpectrumData implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date acquisitionStart; 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; private double yield;

View File

@ -789,7 +789,7 @@ public class ParsingProcessLog extends AbstractAutoLogOrReport{
this.handleStorageProcessLog(); this.handleStorageProcessLog();
if(DataType.SAMPLEPHD.getType().equals(this.spectrumHandler.currDataType.getType()) && if(DataType.SAMPLEPHD.getType().equals(this.spectrumHandler.currDataType.getType()) &&
this.spectrumHandler.sourceData.system_type.equals(SystemType.BETA.getType()) && this.spectrumHandler.sourceData.system_type.equals(SystemType.BETA.getType()) &&
this.fileRepeat == false){ this.fileRepeat == false && this.fileNotExist == false){
this.handleAnalysisProcessLog(); this.handleAnalysisProcessLog();
} }

View File

@ -225,8 +225,12 @@ public class GammaFileUtil extends AbstractLogOrReport {
phd.getSetting().setECutAnalysis_Low(35.0); phd.getSetting().setECutAnalysis_Low(35.0);
phd.getSetting().setBUpdateCal(true); 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")); if (StringUtils.isNotBlank(phd.getCollect().getCollection_start_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_start_time())) {
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")); 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(); SpecSetup usedSetting = new SpecSetup();
BeanUtils.copyProperties(phd.getSetting(), usedSetting); BeanUtils.copyProperties(phd.getSetting(), usedSetting);
phd.setUsedSetting(usedSetting); phd.setUsedSetting(usedSetting);
@ -490,17 +494,32 @@ public class GammaFileUtil extends AbstractLogOrReport {
public void RunQC(PHDFile phd) { public void RunQC(PHDFile phd) {
try { try {
//获取phdFile的 采集开始时间 //获取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的 采集结束时间 //获取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的 分析开始时间 //获取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 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数据 //声明一个double数据
List<Double> Be7Value = new LinkedList<>(); List<Double> Be7Value = new LinkedList<>();
//声明一个map用于存储计算数据 //声明一个map用于存储计算数据
@ -633,16 +652,32 @@ public class GammaFileUtil extends AbstractLogOrReport {
if(vMdcInfo.size() < 3 || vMdcInfo.get(2) == 0) { if(vMdcInfo.size() < 3 || vMdcInfo.get(2) == 0) {
return 0.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(); double Ta = phd.getAcq().getAcquisition_real_time();
//获取能谱获取活时间 //获取能谱获取活时间
@ -670,7 +705,10 @@ public class GammaFileUtil extends AbstractLogOrReport {
DCF3 = lambda * Ta / (1-Math.exp(-lambda*Ta)); DCF3 = lambda * Ta / (1-Math.exp(-lambda*Ta));
} }
//计算得到DCF_conc //计算得到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<Double> energy = new LinkedList<>(); List<Double> energy = new LinkedList<>();
energy.add(vMdcInfo.get(0)); 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(5, phd.getHeader().getSpectrum_quantity()); // Spectral_Qualifier
detailInfo.set(6, phd.getHeader().getSample_ref_id()); // SRID detailInfo.set(6, phd.getHeader().getSample_ref_id()); // SRID
detailInfo.set(7, phd.getStatus()); // Sample_Status 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)); String collect_stop = "";
Date collect_stop_dt = DateUtils.parseDate(collect_stop,"yyyy/MM/dd HH:mm:ss"); Date collect_stop_dt = null;
detailInfo.set(8, phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time()); if (StringUtils.isNotBlank(phd.getCollect().getCollection_stop_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_stop_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"); collect_stop = phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time();
double timeSpan = (collect_stop_dt.getTime()/1000 - date.getTime()/1000) / 3600.0; 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(9, String.format("%.2f", timeSpan));// Sampling_Time
detailInfo.set(10, String.format("%.2f", phd.getCollect().getAir_volume())); detailInfo.set(10, String.format("%.2f", phd.getCollect().getAir_volume()));
if(timeSpan != 0){ if(timeSpan != 0){
detailInfo.set(11, String.format("%.2f", phd.getCollect().getAir_volume()/timeSpan)); 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 acq_start = "";
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 = null;
Date start_date = DateUtils.parseDate(start_time, "yyyy/MM/dd HH:mm:ss"); 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(13, String.format("%.2f", phd.getAcq().getAcquisition_real_time()));
detailInfo.set(14, String.format("%.2f", phd.getAcq().getAcquisition_live_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(15, String.format("%.2f", timespan / 3600.0));
detailInfo.set(17, phd.getCategory()); detailInfo.set(17, phd.getCategory());
return detailInfo; 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) { private boolean CalculateMDCs(PHDFile phd, NuclideActMda nucActMda, int mainPeakIdx, double lambda, double keyLineYield, double CCF) {
// 计算衰变校正因子DCF // 计算衰变校正因子DCF
try { 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 collectStart = null;
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"); if (StringUtils.isNotBlank(phd.getCollect().getCollection_start_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_start_time())) {
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"); collectStart = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time());
double Ts = collectStop.getTime()/1000 - collectStart.getTime()/1000; // 采样时间 }
double Td = acqStart.getTime()/1000 - collectStop.getTime()/1000; // 衰变时间 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 Ta = phd.getAcq().getAcquisition_real_time(); // 能谱获取实时间
double Tl = phd.getAcq().getAcquisition_live_time(); // 能谱获取活时间 double Tl = phd.getAcq().getAcquisition_live_time(); // 能谱获取活时间
double Svol = phd.getCollect().getAir_volume(); // 样品采样体积 double Svol = phd.getCollect().getAir_volume(); // 样品采样体积
@ -3653,7 +3725,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
for(Map.Entry<String, QcCheckItem> itor_q:fileAnlyse.getQcItems().entrySet()) { for(Map.Entry<String, QcCheckItem> itor_q:fileAnlyse.getQcItems().entrySet()) {
String nuclideName = itor_q.getKey(); String nuclideName = itor_q.getKey();
qvctQC_NAME.add(nuclideName); 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()); qvctQC_STANDARD.add(itor_q.getValue().getStandard());
dvctQC_RESULT.add(itor_q.getValue().isBPass()?1.0:0.0); 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); middleData.QC_CHECK_QC_VALUE=DoubleLimit_G(dvctQC_VALUE);
} }
//sample info //sample info
middleData.sample_collection_start = fileAnlyse.getCollect().getCollection_start_date()+StringPool.SPACE+fileAnlyse.getCollect().getCollection_start_time(); middleData.sample_collection_start = "";
middleData.sample_collection_stop = fileAnlyse.getCollect().getCollection_stop_date()+StringPool.SPACE+fileAnlyse.getCollect().getCollection_stop_time(); 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"))) { if(Objects.nonNull(fileAnlyse.getQcItems().get("col_time"))) {
middleData.sample_time = String.format("%.4f", fileAnlyse.getQcItems().get("col_time").getValue()); middleData.sample_time = String.format("%.4f", fileAnlyse.getQcItems().get("col_time").getValue());
if(fileAnlyse.getQcItems().get("col_time").getValue()!=0) { 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_acquistion_time = String.format("%.5f", fileAnlyse.getQcItems().get("acq_time").getValue());
} }
middleData.sample_quantity = String.format("%.4f", fileAnlyse.getCollect().getAir_volume()); 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(); middleData.sample_acquisiton_start = "";
String acquisition_start = middleData.sample_acquisiton_start; Date dataTime = null;
Date dataTime = DateUtils.parseDate(acquisition_start); middleData.sample_acquistion_stop = "";
middleData.sample_acquistion_stop = DateUtils.formatDate(new Date((long) (dataTime.getTime() + fileAnlyse.getAcq().getAcquisition_real_time()*1000)), "yyyy/MM/dd HH:mm:ss"); 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_acquistion_time = String.format("%.2f", fileAnlyse.getAcq().getAcquisition_real_time()) ;
middleData.sample_stationID = fileAnlyse.getHeader().getSite_code(); middleData.sample_stationID = fileAnlyse.getHeader().getSite_code();
middleData.sample_detectID = fileAnlyse.getHeader().getDetector_code(); middleData.sample_detectID = fileAnlyse.getHeader().getDetector_code();

View File

@ -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.DataType;
import org.jeecg.modules.base.enums.DataTypeAbbr; import org.jeecg.modules.base.enums.DataTypeAbbr;
import org.jeecg.modules.base.enums.XeNuclideName; import org.jeecg.modules.base.enums.XeNuclideName;
import org.jeecg.modules.entity.GardsCalibrationSpectrum; import org.jeecg.modules.entity.*;
import org.jeecg.modules.entity.GardsROIChannelsSpectrum;
import org.jeecg.modules.entity.GardsROIResultsSpectrum;
import org.jeecg.modules.entity.GardsXeResultsSpectrum;
import org.jeecg.modules.entity.vo.*; import org.jeecg.modules.entity.vo.*;
import org.jeecg.modules.native_jni.EnergySpectrumHandler; import org.jeecg.modules.native_jni.EnergySpectrumHandler;
import org.jeecg.modules.native_jni.struct.BgAnalyseResult; import org.jeecg.modules.native_jni.struct.BgAnalyseResult;
@ -72,7 +69,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
} }
//Acquisition Start //Acquisition Start
Date AcquisitionStart = null; 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); AcquisitionStart = DateUtils.parseDate(struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time);
} }
//Acq Real Time //Acq Real Time
@ -100,10 +97,10 @@ public class PHDFileUtil extends AbstractLogOrReport {
spectrumData.setCollectionStop(CollectionStop); spectrumData.setCollectionStop(CollectionStop);
spectrumData.setCollectionTime(CollectionTime); spectrumData.setCollectionTime(CollectionTime);
spectrumData.setAcquisitionStart(AcquisitionStart); spectrumData.setAcquisitionStart(AcquisitionStart);
spectrumData.setAcquisitionRealTime(AcquisitionRealTime); spectrumData.setAcquisitionRealTime(String.format("%.2f", AcquisitionRealTime));
spectrumData.setAcquisitionLiveTime(AcquisitionLiveTime); spectrumData.setAcquisitionLiveTime(String.format("%.2f", AcquisitionLiveTime));
spectrumData.setAirVolume(airVolume); spectrumData.setAirVolume(String.format("%.5f", airVolume));
spectrumData.setXeVolume(xeVolume); spectrumData.setXeVolume(String.format("%.5f", xeVolume));
spectrumData.setYield(xeCollectionYield); spectrumData.setYield(xeCollectionYield);
spectrumData.setGasBkMeasurementId(gasBkMeasurementId); spectrumData.setGasBkMeasurementId(gasBkMeasurementId);
spectrumData.setDetectorBkMeasurementId(detectorBkMeasurementId); spectrumData.setDetectorBkMeasurementId(detectorBkMeasurementId);
@ -354,7 +351,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
List<Double> collectionTimeSections = sections.getCollectionTimeSections(); List<Double> collectionTimeSections = sections.getCollectionTimeSections();
List<Double> acquisitionTimeSections = sections.getAcquisitionTimeSections(); List<Double> acquisitionTimeSections = sections.getAcquisitionTimeSections();
List<Double> xeVolumeSections = sections.getXeVolumeSections(); List<Double> xeVolumeSections = sections.getXeVolumeSections();
double airVolume = sampleSpectrumData.getAirVolume(); double airVolume = Double.parseDouble(sampleSpectrumData.getAirVolume());
if (Objects.nonNull(airVolume)){ if (Objects.nonNull(airVolume)){
// air volume check // air volume check
if (airVolumeSections.get(0) < airVolume && airVolume <= airVolumeSections.get(1)) { // red if (airVolumeSections.get(0) < airVolume && airVolume <= airVolumeSections.get(1)) { // red
@ -406,7 +403,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
qcMap.put("CollectTimeBtn", "RedLight"); qcMap.put("CollectTimeBtn", "RedLight");
} }
} }
double acquisitionLiveTime = sampleSpectrumData.getAcquisitionLiveTime(); double acquisitionLiveTime = Double.parseDouble(sampleSpectrumData.getAcquisitionLiveTime());
if (Objects.nonNull(acquisitionLiveTime)){ if (Objects.nonNull(acquisitionLiveTime)){
acquisitionLiveTime = acquisitionLiveTime/3600; acquisitionLiveTime = acquisitionLiveTime/3600;
// acquisition time check // acquisition time check
@ -1990,4 +1987,21 @@ public class PHDFileUtil extends AbstractLogOrReport {
} }
} }
public List<GardsXeResultsView> viewXeData(List<GardsXeResultsSpectrum> xeResultsSpectrumList) {
List<GardsXeResultsView> 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;
}
} }

View File

@ -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;
}

View File

@ -805,7 +805,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
for (GardsQcCheckSpectrum qcCheckSpectrum : qcChecks) { for (GardsQcCheckSpectrum qcCheckSpectrum : qcChecks) {
String str_key = qcCheckSpectrum.getQcName(); String str_key = qcCheckSpectrum.getQcName();
QcCheckItem qcCheckItem = new QcCheckItem(); QcCheckItem qcCheckItem = new QcCheckItem();
qcCheckItem.setValue(qcCheckSpectrum.getQcValue()); qcCheckItem.setValue(qcCheckSpectrum.getQcValue() == null?0.0:qcCheckSpectrum.getQcValue());
qcCheckItem.setBPass(qcCheckSpectrum.getQcResult() == 1); qcCheckItem.setBPass(qcCheckSpectrum.getQcResult() == 1);
qcCheckItem.setStandard(qcCheckSpectrum.getQcStandard()); qcCheckItem.setStandard(qcCheckSpectrum.getQcStandard());
phd.getQcItems().put(str_key, qcCheckItem); phd.getQcItems().put(str_key, qcCheckItem);
@ -4439,18 +4439,37 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
} }
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
try { try {
String collect_start = phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time(); String collect_start = "";
String collect_stop = phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time(); Date collect_start_dt = null;
String acq_start = phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time(); if (StringUtils.isNotBlank(phd.getCollect().getCollection_start_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_start_time())) {
Date collect_stop_dt = DateUtils.parseDate(collect_stop); collect_start = phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time();
Date collect_start_dt = DateUtils.parseDate(collect_start); collect_start_dt = DateUtils.parseDate(collect_start);
double Sampling_Time = ((collect_stop_dt.getTime() - collect_start_dt.getTime()) / 1000) / 3600.0; }
String collect_stop = "";
Date acq_start_dt = DateUtils.parseDate(acq_start); Date collect_stop_dt = null;
double Decay_Time = ((acq_start_dt.getTime() - collect_stop_dt.getTime()) / 1000) / 3600.0; if (StringUtils.isNotBlank(phd.getCollect().getCollection_stop_date()) && StringUtils.isNotBlank(phd.getCollect().getCollection_stop_time())) {
long secs = (long) (acq_start_dt.getTime() + (phd.getAcq().getAcquisition_real_time() * 1000)); collect_stop = phd.getCollect().getCollection_stop_date() + StringPool.SPACE + phd.getCollect().getCollection_stop_time();
String acq_stop = DateUtils.formatDate(new Date(secs), "yyyy/MM/dd HH:mm:ss.S"); 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("stationId", phd.getHeader().getSite_code());
map.put("sampleId", phd.getId_sample()); map.put("sampleId", phd.getId_sample());
map.put("sampleQuantity", String.format("%.2f", phd.getCollect().getAir_volume()) + " m3"); 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.setName(name);
item.setFlag(iter.getValue().isBPass() ? "PASS" : "FAIL"); 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 = ""; String standard = "";
List<String> strList = Arrays.asList(iter.getValue().getStandard().split(StringPool.COMMA)); List<String> strList = Arrays.asList(iter.getValue().getStandard().split(StringPool.COMMA));
for (String str : strList) { for (String str : strList) {

View File

@ -530,7 +530,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
betaDataFile.setBetaCalibrationPairsList(betaCalibrationPairsList); betaDataFile.setBetaCalibrationPairsList(betaCalibrationPairsList);
betaDataFile.setXeResultsSpectrumList(xeResultsSpectrumList); betaDataFile.setXeResultsSpectrumList(xeResultsSpectrumList);
betaDataFile.setSaveAnalysisResult(true); betaDataFile.setSaveAnalysisResult(true);
resultMap.put("XeData", xeResultsSpectrumList); resultMap.put("XeData", phdFileUtil.viewXeData(xeResultsSpectrumList));
resultMap.put("bProcessed", betaDataFile.isBProcessed()); resultMap.put("bProcessed", betaDataFile.isBProcessed());
resultMap.put("savedAnalysisResult", betaDataFile.isSaveAnalysisResult()); resultMap.put("savedAnalysisResult", betaDataFile.isSaveAnalysisResult());
cache.put(betaDataFile.getSampleFileName()+"-"+userName, betaDataFile); 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())))); 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("bProcessed", betaDataFile.isBProcessed());
resultMap.put("savedAnalysisResult", betaDataFile.isSaveAnalysisResult()); resultMap.put("savedAnalysisResult", betaDataFile.isSaveAnalysisResult());
cache.put(betaDataFile.getSampleFileName()+"-"+userName, betaDataFile); cache.put(betaDataFile.getSampleFileName()+"-"+userName, betaDataFile);
@ -1381,14 +1381,14 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
String sit_det_code = struct.site_code; String sit_det_code = struct.site_code;
String detect_code = struct.detector_code; String detect_code = struct.detector_code;
String sample_id = Objects.nonNull(sampleId)?sampleId.toString():""; 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 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.substring(0, struct.collection_stop_time.indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss"); 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_start = DateUtils.formatDate(collectStartDate, "yyyy/MM/dd HH:mm:ss");
String collect_stop = DateUtils.formatDate(collectStopDate, "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 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_volume_of_Xe = String.valueOf(struct.air_volume);
String s_xe_stable_volume = String.valueOf(struct.sample_volume_of_Xe); 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_start = DateUtils.formatDate(acquisitionStartDate, "yyyy/MM/dd HH:mm:ss");
String acquisition_real_sec = String.valueOf(struct.acquisition_real_time); String acquisition_real_sec = String.valueOf(struct.acquisition_real_time);
String acquisition_live_sec = String.valueOf(struct.acquisition_live_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)) { if (Objects.nonNull(struct)) {
//Acquisition //Acquisition
String acquisitionStart = struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time; String acquisitionStart = struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time;
String acquisitionRealTime = String.valueOf(struct.acquisition_real_time); double acquisitionRealTime = Double.parseDouble(String.format("%.1f", struct.acquisition_real_time));
String acquisitionLiveTime = String.valueOf(struct.acquisition_live_time); double acquisitionLiveTime = Double.parseDouble(String.format("%.1f", struct.acquisition_live_time));
map.put("acquisitionStart", acquisitionStart); map.put("acquisitionStart", acquisitionStart);
map.put("acquisitionRealTime", acquisitionRealTime); map.put("acquisitionRealTime", acquisitionRealTime);
map.put("acquisitionLiveTime", acquisitionLiveTime); map.put("acquisitionLiveTime", acquisitionLiveTime);
@ -5968,10 +5968,10 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
spectrumData.setCollectionStop(CollectionStop); spectrumData.setCollectionStop(CollectionStop);
spectrumData.setCollectionTime(CollectionTime); spectrumData.setCollectionTime(CollectionTime);
spectrumData.setAcquisitionStart(AcquisitionStart); spectrumData.setAcquisitionStart(AcquisitionStart);
spectrumData.setAcquisitionRealTime(AcquisitionRealTime); spectrumData.setAcquisitionRealTime(String.format("%.2f", AcquisitionRealTime));
spectrumData.setAcquisitionLiveTime(AcquisitionLiveTime); spectrumData.setAcquisitionLiveTime(String.format("%.2f", AcquisitionLiveTime));
spectrumData.setAirVolume(airVolume); spectrumData.setAirVolume(String.format("%.5f", airVolume));
spectrumData.setXeVolume(xeVolume); spectrumData.setXeVolume(String.format("%.5f", xeVolume));
spectrumData.setYield(xeCollectionYield); spectrumData.setYield(xeCollectionYield);
spectrumData.setGasBkMeasurementId(gasBkMeasurementId); spectrumData.setGasBkMeasurementId(gasBkMeasurementId);
spectrumData.setDetectorBkMeasurementId(detectorBkMeasurementId); spectrumData.setDetectorBkMeasurementId(detectorBkMeasurementId);