|
|
|
@ -14,8 +14,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.google.common.cache.Cache;
|
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
|
import org.apache.commons.net.ftp.FTP;
|
|
|
|
|
import org.apache.commons.net.ftp.FTPClient;
|
|
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
|
|
import org.jeecg.common.api.QueryRequest;
|
|
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
|
@ -29,10 +27,7 @@ import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
|
import org.jeecg.common.util.*;
|
|
|
|
|
import org.jeecg.modules.base.abstracts.AbstractLogOrReport;
|
|
|
|
|
import org.jeecg.modules.base.bizVo.BetaRLR;
|
|
|
|
|
import org.jeecg.modules.base.dto.ESStructDto;
|
|
|
|
|
import org.jeecg.modules.base.dto.ROIChannelsDto;
|
|
|
|
|
import org.jeecg.modules.base.dto.ROIResultsDto;
|
|
|
|
|
import org.jeecg.modules.base.dto.XeResultsDto;
|
|
|
|
|
import org.jeecg.modules.base.dto.*;
|
|
|
|
|
import org.jeecg.modules.base.entity.configuration.GardsDetectors;
|
|
|
|
|
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
|
|
|
|
import org.jeecg.modules.base.entity.rnman.*;
|
|
|
|
@ -64,7 +59,6 @@ import java.util.*;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static org.aspectj.weaver.tools.cache.SimpleCacheFactory.path;
|
|
|
|
|
import static org.jeecg.modules.base.enums.ExportTemplate.*;
|
|
|
|
|
|
|
|
|
|
@Service("spectrumAnalysisService")
|
|
|
|
@ -3792,17 +3786,434 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|
|
|
|
return analyze;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<String, Object> exportDataNew(RRRLogInfo rrrLogInfo){
|
|
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
|
String username = sysUser.getUsername();
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
//获取本地缓存
|
|
|
|
|
Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
|
|
|
|
|
BetaDataFile betaDataFile = cache.getIfPresent(rrrLogInfo.getSampleFileName() + "-" + username);
|
|
|
|
|
if (Objects.isNull(betaDataFile)) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
GardsCalibrationSpectrum gammaCalibrationParamS = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum gammaCalibrationParamG = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum gammaCalibrationParamD = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum gammaCalibrationParamES = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum gammaCalibrationParamEG = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum gammaCalibrationParamED = new GardsCalibrationSpectrum();
|
|
|
|
|
|
|
|
|
|
GardsCalibrationSpectrum betaCalibrationParamS = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum betaCalibrationParamG = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum betaCalibrationParamD = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum betaCalibrationParamES = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum betaCalibrationParamEG = new GardsCalibrationSpectrum();
|
|
|
|
|
GardsCalibrationSpectrum betaCalibrationParamED = new GardsCalibrationSpectrum();
|
|
|
|
|
|
|
|
|
|
StringBuffer strBuffer = new StringBuffer();
|
|
|
|
|
//判断
|
|
|
|
|
if (betaDataFile.isSaveAnalysisResult()) {
|
|
|
|
|
//对分析后的内容进行数据获取
|
|
|
|
|
List<GardsROIChannelsSpectrum> channelsSpectrums = betaDataFile.getRoiChannelsSpectrumList();
|
|
|
|
|
List<GardsROIChannelsSpectrum> roiChannelsSpectrumsSample = channelsSpectrums.stream().filter(item -> item.getDataType().equalsIgnoreCase("S")).collect(Collectors.toList());
|
|
|
|
|
List<GardsROIChannelsSpectrum> roiChannelsSpectrumsGas = channelsSpectrums.stream().filter(item -> item.getDataType().equalsIgnoreCase("G")).collect(Collectors.toList());
|
|
|
|
|
List<GardsROIChannelsSpectrum> roiChannelsSpectrumsDet = channelsSpectrums.stream().filter(item -> item.getDataType().equalsIgnoreCase("D")).collect(Collectors.toList());
|
|
|
|
|
List<GardsROIResultsSpectrum> resultsSpectrums = betaDataFile.getRoiResultsSpectrumList();
|
|
|
|
|
List<GardsXeResultsSpectrum> xeResultsSpectrums = betaDataFile.getXeResultsSpectrumList();
|
|
|
|
|
for (int i=0; i<xeResultsSpectrums.size(); i++) {
|
|
|
|
|
for (int j=0; j<rrrLogInfo.getXeResultsSpectrumList().size(); j++) {
|
|
|
|
|
if (xeResultsSpectrums.get(i).getNuclideName().equalsIgnoreCase(rrrLogInfo.getXeResultsSpectrumList().get(j).getNuclideName())) {
|
|
|
|
|
xeResultsSpectrums.get(i).setNidFlag(rrrLogInfo.getXeResultsSpectrumList().get(j).getNidFlag());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//#SAMPLE: LIMITS PER ROI GAMMA
|
|
|
|
|
List<GardsCalibrationSpectrum> gammaCalibrationParamList = betaDataFile.getGammaCalibrationSpectrumList();
|
|
|
|
|
List<GardsCalibrationSpectrum> gammaCalibrationSpectrumEList = betaDataFile.getGammaCalibrationSpectrumEList();
|
|
|
|
|
for (int i=0; i<gammaCalibrationParamList.size(); i++) {
|
|
|
|
|
if (gammaCalibrationParamList.get(i).getDataType().equals("S")) {
|
|
|
|
|
gammaCalibrationParamS = gammaCalibrationParamList.get(i);
|
|
|
|
|
} else if (gammaCalibrationParamList.get(i).getDataType().equals("G")) {
|
|
|
|
|
gammaCalibrationParamG = gammaCalibrationParamList.get(i);
|
|
|
|
|
} else if (gammaCalibrationParamList.get(i).getDataType().equals("D")) {
|
|
|
|
|
gammaCalibrationParamD = gammaCalibrationParamList.get(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (int i=0; i<gammaCalibrationSpectrumEList.size(); i++) {
|
|
|
|
|
if (gammaCalibrationSpectrumEList.get(i).getDataType().equals("S")) {
|
|
|
|
|
gammaCalibrationParamES = gammaCalibrationSpectrumEList.get(i);
|
|
|
|
|
} else if (gammaCalibrationSpectrumEList.get(i).getDataType().equals("G")) {
|
|
|
|
|
gammaCalibrationParamEG = gammaCalibrationSpectrumEList.get(i);
|
|
|
|
|
} else if (gammaCalibrationSpectrumEList.get(i).getDataType().equals("D")) {
|
|
|
|
|
gammaCalibrationParamED = gammaCalibrationSpectrumEList.get(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//#SAMPLE: LIMITS PER ROI BETA
|
|
|
|
|
List<GardsCalibrationSpectrum> betaCalibrationParamList = betaDataFile.getBetaCalibrationSpectrumList();
|
|
|
|
|
List<GardsCalibrationSpectrum> betaCalibrationSpectrumEList = betaDataFile.getBetaCalibrationSpectrumEList();
|
|
|
|
|
for (int i=0; i<betaCalibrationParamList.size(); i++) {
|
|
|
|
|
if (betaCalibrationParamList.get(i).getDataType().equals("S")) {
|
|
|
|
|
betaCalibrationParamS = betaCalibrationParamList.get(i);
|
|
|
|
|
} else if (betaCalibrationParamList.get(i).getDataType().equals("G")) {
|
|
|
|
|
betaCalibrationParamG = betaCalibrationParamList.get(i);
|
|
|
|
|
} else if (betaCalibrationParamList.get(i).getDataType().equals("D")) {
|
|
|
|
|
betaCalibrationParamD = betaCalibrationParamList.get(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (int i=0; i<betaCalibrationSpectrumEList.size(); i++) {
|
|
|
|
|
if (betaCalibrationSpectrumEList.get(i).getDataType().equals("S")) {
|
|
|
|
|
betaCalibrationParamES = betaCalibrationSpectrumEList.get(i);
|
|
|
|
|
} else if (betaCalibrationSpectrumEList.get(i).getDataType().equals("G")) {
|
|
|
|
|
betaCalibrationParamEG = betaCalibrationSpectrumEList.get(i);
|
|
|
|
|
} else if (betaCalibrationSpectrumEList.get(i).getDataType().equals("D")) {
|
|
|
|
|
betaCalibrationParamED = betaCalibrationSpectrumEList.get(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Information information = new Information();
|
|
|
|
|
//sampleFile 相关数据
|
|
|
|
|
try {
|
|
|
|
|
EnergySpectrumStruct sampleSourceData = betaDataFile.getSampleStruct();
|
|
|
|
|
if (Objects.nonNull(sampleSourceData)) {
|
|
|
|
|
information.setSample_measid_name(sampleSourceData.measurement_id);
|
|
|
|
|
information.setSample_det_measid_name(sampleSourceData.detector_bk_measurement_id);
|
|
|
|
|
information.setSample_gas_measid_name(sampleSourceData.gas_bk_measurement_id);
|
|
|
|
|
information.setSit_det_code(sampleSourceData.site_code);
|
|
|
|
|
information.setSample_type(sampleSourceData.system_type);
|
|
|
|
|
information.setGeometry(sampleSourceData.sample_geometry);
|
|
|
|
|
information.setSpectral_qualifie(sampleSourceData.spectrum_quantity);
|
|
|
|
|
String transmit_dtg_str=sampleSourceData.transmit_date+StringPool.SPACE+sampleSourceData.transmit_time;
|
|
|
|
|
Date transmit_dtg = DateUtils.parseDate(transmit_dtg_str);
|
|
|
|
|
information.setTransmit_dtg(transmit_dtg);
|
|
|
|
|
information.setDetect_code(sampleSourceData.detector_code);
|
|
|
|
|
information.setMeasurementID(sampleSourceData.measurement_id.replace("\\","/"));
|
|
|
|
|
information.setBkgdMeasurementID(sampleSourceData.detector_bk_measurement_id.replace("\\","/"));
|
|
|
|
|
information.setGasBkgdMeasurementID(sampleSourceData.gas_bk_measurement_id.replace("\\","/"));
|
|
|
|
|
information.setSampleRefId(sampleSourceData.sample_ref_id);
|
|
|
|
|
String collect_start_str = sampleSourceData.collection_start_date+StringPool.SPACE+sampleSourceData.collection_start_time;
|
|
|
|
|
Date collect_start = DateUtils.parseDate(collect_start_str);
|
|
|
|
|
information.setCollect_start(collect_start);
|
|
|
|
|
String collect_stop_str = sampleSourceData.collection_stop_date+StringPool.SPACE+sampleSourceData.collection_stop_time;
|
|
|
|
|
Date collect_stop = DateUtils.parseDate(collect_stop_str);
|
|
|
|
|
information.setCollect_stop(collect_stop);
|
|
|
|
|
information.setS_xe_stable_volume(sampleSourceData.air_volume);
|
|
|
|
|
String acquisition_start_str = sampleSourceData.acquisition_start_date+StringPool.SPACE+sampleSourceData.acquisition_start_time;
|
|
|
|
|
Date acquisition_start = DateUtils.parseDate(acquisition_start_str);
|
|
|
|
|
information.setAcquisition_start(acquisition_start);
|
|
|
|
|
long dataTime = (long) (acquisition_start.getTime() + sampleSourceData.acquisition_live_time * 1000);
|
|
|
|
|
String acquisition_stop_str = DateUtils.formatDate(new Date(dataTime), "yyyy/MM/dd HH:mm:ss");
|
|
|
|
|
Date acquisition_stop = DateUtils.parseDate(acquisition_stop_str);
|
|
|
|
|
information.setAcquisition_stop(acquisition_stop);
|
|
|
|
|
information.setAcquisition_real_sec(sampleSourceData.acquisition_real_time);
|
|
|
|
|
information.setAcquisition_live_sec(sampleSourceData.acquisition_live_time);
|
|
|
|
|
information.setS_volume_of_Xe(sampleSourceData.sample_volume_of_Xe);
|
|
|
|
|
}
|
|
|
|
|
EnergySpectrumStruct gasSourceData = betaDataFile.getGasStruct();
|
|
|
|
|
if (Objects.nonNull(gasSourceData)) {
|
|
|
|
|
information.setGas_measid_name(gasSourceData.measurement_id);
|
|
|
|
|
}
|
|
|
|
|
EnergySpectrumStruct detSourceData = betaDataFile.getDetStruct();
|
|
|
|
|
if (Objects.nonNull(detSourceData)) {
|
|
|
|
|
information.setDet_measid_name(detSourceData.measurement_id);
|
|
|
|
|
}
|
|
|
|
|
/* 开始装配数据 */
|
|
|
|
|
// 设置标题中的时间
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DateConstant.DATE_TIME_S);
|
|
|
|
|
result.put("now", LocalDateTime.now().format(formatter));
|
|
|
|
|
result.put("measurement_id", information.getMeasurementID());
|
|
|
|
|
result.put("gas_bk_measurement_id", information.getGasBkgdMeasurementID());
|
|
|
|
|
result.put("sample_ref_id", information.getSampleRefId());
|
|
|
|
|
result.put("site_code", information.getSit_det_code());
|
|
|
|
|
result.put("detector_code", information.getDetect_code());
|
|
|
|
|
result.put("collection_start", DateUtils.formatDate(information.getCollect_start(), "yyyy/MM/dd HH:mm:ss"));
|
|
|
|
|
result.put("collection_stop", DateUtils.formatDate(information.getCollect_stop(), "yyyy/MM/dd HH:mm:ss"));
|
|
|
|
|
result.put("collection_time", (information.getCollect_stop().getTime()/1000-information.getCollect_start().getTime()/1000)/3600);
|
|
|
|
|
result.put("air_volume", information.getS_xe_stable_volume());
|
|
|
|
|
result.put("sample_volume_of_Xe", information.getS_volume_of_Xe());
|
|
|
|
|
result.put("acquisition_start", DateUtils.formatDate(information.getAcquisition_start(), "yyyy/MM/dd HH:mm:ss"));
|
|
|
|
|
result.put("acquisition_real_time", information.getAcquisition_real_sec());
|
|
|
|
|
result.put("acquisition_live_time", information.getAcquisition_live_sec());
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* SAMPLE
|
|
|
|
|
* */
|
|
|
|
|
// #SAMPLE Old CALIBRATION
|
|
|
|
|
List<Calibration> samplOldCalibrations = new ArrayList<>();
|
|
|
|
|
Calibration samplOldCalibrationCH = new Calibration();
|
|
|
|
|
Calibration samplOldCalibrationE = new Calibration();
|
|
|
|
|
if (betaDataFile.isBBetaEnergyValidSample() || betaDataFile.isBGammaEnergyValidSample()){
|
|
|
|
|
if (betaDataFile.isBBetaEnergyValidSample()) {
|
|
|
|
|
samplOldCalibrationCH.setBeta(rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
samplOldCalibrationCH.setBeta("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
if (betaDataFile.isBGammaEnergyValidSample()) {
|
|
|
|
|
samplOldCalibrationCH.setGamma(rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
samplOldCalibrationCH.setGamma("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
if (betaDataFile.isBBetaEnergyValidSample()) {
|
|
|
|
|
samplOldCalibrationE.setBeta(rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
samplOldCalibrationE.setBeta("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
if (betaDataFile.isBGammaEnergyValidSample()) {
|
|
|
|
|
samplOldCalibrationE.setGamma(rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x ", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
samplOldCalibrationE.setGamma("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
samplOldCalibrationCH.setBeta("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
samplOldCalibrationCH.setGamma("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
samplOldCalibrationE.setBeta("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
samplOldCalibrationE.setGamma("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
samplOldCalibrations.add(samplOldCalibrationCH);
|
|
|
|
|
samplOldCalibrations.add(samplOldCalibrationE);
|
|
|
|
|
result.put("samplOldCalibrations",samplOldCalibrations);
|
|
|
|
|
|
|
|
|
|
// #SAMPLE New CALIBRATION
|
|
|
|
|
List<Calibration> samplNewCalibrations = new ArrayList<>();
|
|
|
|
|
Calibration samplNewCalibrationCH = new Calibration();
|
|
|
|
|
Calibration samplNewCalibrationE = new Calibration();
|
|
|
|
|
samplNewCalibrationCH.setBeta("CH(x) = ("+ (Objects.isNull(betaCalibrationParamES.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamES.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(betaCalibrationParamES.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamES.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(betaCalibrationParamES.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamES.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
samplNewCalibrationCH.setGamma("CH(x) = ("+ (Objects.isNull(gammaCalibrationParamES.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamES.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(gammaCalibrationParamES.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamES.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(gammaCalibrationParamES.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamES.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
samplNewCalibrationE.setBeta("E(x) = ("+ (Objects.isNull(betaCalibrationParamS.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamS.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(betaCalibrationParamS.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamS.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(betaCalibrationParamS.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamS.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
samplNewCalibrationE.setGamma("E(x) = ("+ (Objects.isNull(gammaCalibrationParamS.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamS.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(gammaCalibrationParamS.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamS.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(gammaCalibrationParamS.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamS.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
samplNewCalibrations.add(samplNewCalibrationCH);
|
|
|
|
|
samplNewCalibrations.add(samplNewCalibrationE);
|
|
|
|
|
result.put("samplNewCalibrations",samplNewCalibrations);
|
|
|
|
|
|
|
|
|
|
// #SAMPLE: LIMITS PER ROI
|
|
|
|
|
List<ROIChannelsDto> roiChannelsDtosS = new LinkedList<>();
|
|
|
|
|
for (GardsROIChannelsSpectrum roiChannels : roiChannelsSpectrumsSample) {
|
|
|
|
|
ROIChannelsDto roiChannelsDto = new ROIChannelsDto();
|
|
|
|
|
BeanUtil.copyProperties(roiChannels, roiChannelsDto);
|
|
|
|
|
roiChannelsDto.shift();
|
|
|
|
|
roiChannelsDtosS.add(roiChannelsDto);
|
|
|
|
|
}
|
|
|
|
|
result.put("roiChannelsS",roiChannelsDtosS);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* DET
|
|
|
|
|
* */
|
|
|
|
|
// #DET Old CALIBRATION
|
|
|
|
|
List<Calibration> detOldCalibrations = new ArrayList<>();
|
|
|
|
|
Calibration detOldCalibrationCH = new Calibration();
|
|
|
|
|
Calibration detOldCalibrationE = new Calibration();
|
|
|
|
|
if (betaDataFile.isBBetaEnergyValidDet() || betaDataFile.isBGammaEnergyValidDet()){
|
|
|
|
|
if (betaDataFile.isBBetaEnergyValidDet()) {
|
|
|
|
|
detOldCalibrationCH.setBeta(rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
detOldCalibrationCH.setBeta("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
if (betaDataFile.isBGammaEnergyValidDet()) {
|
|
|
|
|
detOldCalibrationCH.setGamma(rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
detOldCalibrationCH.setGamma("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
if (betaDataFile.isBBetaEnergyValidDet()) {
|
|
|
|
|
detOldCalibrationE.setBeta(rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
detOldCalibrationE.setBeta("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
if (betaDataFile.isBGammaEnergyValidDet()) {
|
|
|
|
|
detOldCalibrationE.setGamma(rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x ", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
detOldCalibrationE.setGamma("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
detOldCalibrationCH.setBeta("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
detOldCalibrationCH.setGamma("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
detOldCalibrationE.setBeta("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
detOldCalibrationE.setGamma("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
detOldCalibrations.add(detOldCalibrationCH);
|
|
|
|
|
detOldCalibrations.add(detOldCalibrationE);
|
|
|
|
|
result.put("detOldCalibrations", detOldCalibrations);
|
|
|
|
|
|
|
|
|
|
// DET New CALIBRATION
|
|
|
|
|
List<Calibration> detNewCalibrations = new ArrayList<>();
|
|
|
|
|
Calibration detNewCalibrationCH = new Calibration();
|
|
|
|
|
Calibration detNewCalibrationE = new Calibration();
|
|
|
|
|
detNewCalibrationCH.setBeta("CH(x) = ("+ (Objects.isNull(betaCalibrationParamED.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamED.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(betaCalibrationParamED.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamED.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(betaCalibrationParamED.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamED.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
detNewCalibrationCH.setGamma("CH(x) = ("+ (Objects.isNull(gammaCalibrationParamED.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamED.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(gammaCalibrationParamED.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamED.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(gammaCalibrationParamED.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamED.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
detNewCalibrationE.setBeta("E(x) = ("+ (Objects.isNull(betaCalibrationParamD.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamD.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(betaCalibrationParamD.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamD.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(betaCalibrationParamD.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamD.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
detNewCalibrationE.setGamma("E(x) = ("+ (Objects.isNull(gammaCalibrationParamD.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamD.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(gammaCalibrationParamD.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamD.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(gammaCalibrationParamD.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamD.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
detNewCalibrations.add(detNewCalibrationCH);
|
|
|
|
|
detNewCalibrations.add(detNewCalibrationE);
|
|
|
|
|
result.put("detNewCalibrations", detNewCalibrations);
|
|
|
|
|
|
|
|
|
|
// DET: LIMITS PER ROI
|
|
|
|
|
List<ROIChannelsDto> roiChannelsDtosD = new LinkedList<>();
|
|
|
|
|
for (GardsROIChannelsSpectrum roiChannels : roiChannelsSpectrumsDet) {
|
|
|
|
|
ROIChannelsDto roiChannelsDto = new ROIChannelsDto();
|
|
|
|
|
BeanUtil.copyProperties(roiChannels, roiChannelsDto);
|
|
|
|
|
roiChannelsDto.shift();
|
|
|
|
|
roiChannelsDtosD.add(roiChannelsDto);
|
|
|
|
|
}
|
|
|
|
|
result.put("roiChannelsD",roiChannelsDtosD);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* GAS
|
|
|
|
|
* */
|
|
|
|
|
// #GAS Old CALIBRATION
|
|
|
|
|
List<Calibration> gasOldCalibrations = new ArrayList<>();
|
|
|
|
|
Calibration gasOldCalibrationCH = new Calibration();
|
|
|
|
|
Calibration gasOldCalibrationE = new Calibration();
|
|
|
|
|
if (betaDataFile.isBBetaEnergyValidGas() || betaDataFile.isBGammaEnergyValidGas()){
|
|
|
|
|
if (betaDataFile.isBBetaEnergyValidGas()) {
|
|
|
|
|
gasOldCalibrationCH.setBeta(rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
gasOldCalibrationCH.setBeta("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
if (betaDataFile.isBGammaEnergyValidGas()) {
|
|
|
|
|
gasOldCalibrationCH.setGamma(rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
gasOldCalibrationCH.setGamma("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
if (betaDataFile.isBBetaEnergyValidGas()) {
|
|
|
|
|
gasOldCalibrationE.setBeta(rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
gasOldCalibrationE.setBeta("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
if (betaDataFile.isBGammaEnergyValidGas()) {
|
|
|
|
|
gasOldCalibrationE.setGamma(rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x ", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2))));
|
|
|
|
|
} else {
|
|
|
|
|
gasOldCalibrationE.setGamma("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
gasOldCalibrationCH.setBeta("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
gasOldCalibrationCH.setGamma("CH(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
gasOldCalibrationE.setBeta("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
gasOldCalibrationE.setGamma("E(x) = (?1)+(?2)*x+(?3)x*x");
|
|
|
|
|
}
|
|
|
|
|
gasOldCalibrations.add(gasOldCalibrationCH);
|
|
|
|
|
gasOldCalibrations.add(gasOldCalibrationE);
|
|
|
|
|
result.put("gasOldCalibrations",gasOldCalibrations);
|
|
|
|
|
|
|
|
|
|
// #GAS New CALIBRATION
|
|
|
|
|
List<Calibration> gasNewCalibrations = new ArrayList<>();
|
|
|
|
|
Calibration gasNewCalibrationCH = new Calibration();
|
|
|
|
|
Calibration gasNewCalibrationE = new Calibration();
|
|
|
|
|
gasNewCalibrationCH.setBeta("CH(x) = ("+ (Objects.isNull(betaCalibrationParamEG.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamEG.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(betaCalibrationParamEG.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamEG.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(betaCalibrationParamEG.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamEG.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
gasNewCalibrationCH.setGamma("CH(x) = ("+ (Objects.isNull(gammaCalibrationParamEG.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamEG.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(gammaCalibrationParamEG.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamEG.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(gammaCalibrationParamEG.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamEG.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
gasNewCalibrationE.setBeta("E(x) = ("+ (Objects.isNull(betaCalibrationParamG.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamG.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(betaCalibrationParamG.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamG.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(betaCalibrationParamG.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamG.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
gasNewCalibrationE.setGamma("E(x) = ("+ (Objects.isNull(gammaCalibrationParamG.getCoeff1())?"?1":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamG.getCoeff1())))
|
|
|
|
|
+")+("+ (Objects.isNull(gammaCalibrationParamG.getCoeff2())?"?2":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamG.getCoeff2())))
|
|
|
|
|
+")*x+("+ (Objects.isNull(gammaCalibrationParamG.getCoeff3())?"?3":NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamG.getCoeff3())))
|
|
|
|
|
+")x*x");
|
|
|
|
|
gasNewCalibrations.add(gasNewCalibrationCH);
|
|
|
|
|
gasNewCalibrations.add(gasNewCalibrationE);
|
|
|
|
|
result.put("gasNewCalibrations",gasNewCalibrations);
|
|
|
|
|
|
|
|
|
|
// #GAS: LIMITS PER ROI
|
|
|
|
|
List<ROIChannelsDto> roiChannelsDtosG = new LinkedList<>();
|
|
|
|
|
for (GardsROIChannelsSpectrum roiChannels : roiChannelsSpectrumsGas) {
|
|
|
|
|
ROIChannelsDto roiChannelsDto = new ROIChannelsDto();
|
|
|
|
|
BeanUtil.copyProperties(roiChannels, roiChannelsDto);
|
|
|
|
|
roiChannelsDto.shift();
|
|
|
|
|
roiChannelsDtosG.add(roiChannelsDto);
|
|
|
|
|
}
|
|
|
|
|
result.put("roiChannelsG",roiChannelsDtosG);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* GardsROIResultsSpectrum
|
|
|
|
|
* */
|
|
|
|
|
// #GROSS COUNTS PER ROI
|
|
|
|
|
// #NET COUNTS AND LC PER ROI
|
|
|
|
|
// #CONCENTRATION AND LC PER ROI
|
|
|
|
|
List<ROIResultsStrDto> roiResults = new ArrayList<>();
|
|
|
|
|
for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums) {
|
|
|
|
|
ROIResultsStrDto roiResultsStrDto = new ROIResultsStrDto();
|
|
|
|
|
roiResultsStrDto.setRoi(resultsSpectrum.getRoi());
|
|
|
|
|
roiResultsStrDto.setSGross(resultsSpectrum.getSGross());
|
|
|
|
|
roiResultsStrDto.setGGross(resultsSpectrum.getGGross());
|
|
|
|
|
roiResultsStrDto.setBGross(resultsSpectrum.getBGross());
|
|
|
|
|
roiResultsStrDto.setLc(NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getLc())));
|
|
|
|
|
roiResultsStrDto.setMdc(NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getMdc())));
|
|
|
|
|
if (betaDataFile.isBProcessed()) {
|
|
|
|
|
roiResultsStrDto.setConcStr(NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getConc()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getConcErr())));
|
|
|
|
|
roiResultsStrDto.setNetCount(NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNetErr())));
|
|
|
|
|
if (ObjectUtil.isNotNull(resultsSpectrums.get(0).getLcCts())) {
|
|
|
|
|
roiResultsStrDto.setLcCts(NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getLcCts())));
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
roiResultsStrDto.setConcStr(NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getConcErr()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getConcErr())));
|
|
|
|
|
roiResultsStrDto.setNetCount(NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(Math.sqrt(resultsSpectrum.getNetErr()))));
|
|
|
|
|
if (ObjectUtil.isNotNull(resultsSpectrums.get(0).getLcCts())) {
|
|
|
|
|
roiResultsStrDto.setLcCts(NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getLcCts())));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
roiResults.add(roiResultsStrDto);
|
|
|
|
|
}
|
|
|
|
|
result.put("roiResults", roiResults);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* GardsXeResultsSpectrum
|
|
|
|
|
* */
|
|
|
|
|
// #RESULT SUMMARY
|
|
|
|
|
List<XeResultsStrDto> xeResults = new ArrayList<>();
|
|
|
|
|
for (GardsXeResultsSpectrum xeResultsSpectrum : xeResultsSpectrums) {
|
|
|
|
|
XeResultsStrDto xeResultsStrDto = new XeResultsStrDto();
|
|
|
|
|
xeResultsStrDto.setNuclideName(xeResultsSpectrum.getNuclideName());
|
|
|
|
|
xeResultsStrDto.setConcStr(NumberFormatUtil.numberSixLen(String.valueOf(xeResultsSpectrum.getConc()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(xeResultsSpectrum.getConcErr())));
|
|
|
|
|
xeResultsStrDto.setLc(NumberFormatUtil.numberSixLen(String.valueOf(xeResultsSpectrum.getLc())));
|
|
|
|
|
xeResultsStrDto.setMdc(NumberFormatUtil.numberSixLen(String.valueOf(xeResultsSpectrum.getMdc())));
|
|
|
|
|
xeResultsStrDto.setNidFlag(xeResultsSpectrum.getNidFlag());
|
|
|
|
|
xeResults.add(xeResultsStrDto);
|
|
|
|
|
}
|
|
|
|
|
result.put("xeResults", xeResults);
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void saveToHTML(BgDataAnlyseResultIn anlyseResultIn, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
public void saveToHTML(RRRLogInfo rrrLogInfo, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
String userName = JwtUtil.getUserNameByToken(request);
|
|
|
|
|
// 解析文件,生成导出数据
|
|
|
|
|
Map<String, Object> analyze = exportData(anlyseResultIn, userName);
|
|
|
|
|
Map<String, Object> analyze = exportDataNew(rrrLogInfo);
|
|
|
|
|
// 解析生成Html字符串并导出为Html文件
|
|
|
|
|
String result = parseHtml(analyze);
|
|
|
|
|
PrintWriter writer = null;
|
|
|
|
|
try {
|
|
|
|
|
String export = "saveToHtml.html";
|
|
|
|
|
String sampleFileName = anlyseResultIn.getSampleFileName();
|
|
|
|
|
String sampleFileName = rrrLogInfo.getSampleFileName();
|
|
|
|
|
if (StrUtil.isNotBlank(sampleFileName)){
|
|
|
|
|
if (StrUtil.contains(sampleFileName, ".PHD"))
|
|
|
|
|
export = StrUtil.replace(sampleFileName, ".PHD", ".html");
|
|
|
|
@ -3818,14 +4229,14 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void saveToExcel(BgDataAnlyseResultIn anlyseResultIn, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
public void saveToExcel(RRRLogInfo rrrLogInfo, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
String userName = JwtUtil.getUserNameByToken(request);
|
|
|
|
|
// 解析文件,生成导出数据
|
|
|
|
|
Map<String, Object> analyze = exportData(anlyseResultIn, userName);
|
|
|
|
|
Map<String, Object> analyze = exportDataNew(rrrLogInfo);
|
|
|
|
|
// 将Null值替换为"",避免空指针异常(集合为空集合,不能为null)
|
|
|
|
|
analyze.replaceAll((key, value) -> ObjectUtil.isNull(value) ? "" : value);
|
|
|
|
|
String export = "SaveToExcel.xls";
|
|
|
|
|
String sampleFileName = anlyseResultIn.getSampleFileName();
|
|
|
|
|
String sampleFileName = rrrLogInfo.getSampleFileName();
|
|
|
|
|
if (StrUtil.isNotBlank(sampleFileName)){
|
|
|
|
|
if (StrUtil.contains(sampleFileName, ".PHD"))
|
|
|
|
|
export = StrUtil.replace(sampleFileName, ".PHD", ".xls");
|
|
|
|
@ -3834,8 +4245,8 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|
|
|
|
ExportUtil.exportXls(response, template, analyze, export);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void saveToTxt(BgDataAnlyseResultIn anlyseResultIn, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
|
|
|
|
|
public void saveToTxtOld(BgDataAnlyseResultIn anlyseResultIn, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
String userName = JwtUtil.getUserNameByToken(request);
|
|
|
|
|
// 解析文件,生成导出数据
|
|
|
|
|
Map<String, Object> analyze = exportData(anlyseResultIn, userName);
|
|
|
|
@ -3923,6 +4334,30 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void saveToTxt(RRRLogInfo rrrLogInfo, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
String result = (String)viewRRR(rrrLogInfo, request).getResult();
|
|
|
|
|
if (StrUtil.isBlank(result)) return;
|
|
|
|
|
List<String> lines = ListUtil.toList(StrUtil.split(result, "\n"));
|
|
|
|
|
PrintWriter writer = null;
|
|
|
|
|
try{
|
|
|
|
|
String export = "SaveToTxt.txt";
|
|
|
|
|
String sampleFileName = rrrLogInfo.getSampleFileName();
|
|
|
|
|
if (StrUtil.isNotBlank(sampleFileName)){
|
|
|
|
|
if (StrUtil.contains(sampleFileName, ".PHD"))
|
|
|
|
|
export = StrUtil.replace(sampleFileName, ".PHD", ".txt");
|
|
|
|
|
}
|
|
|
|
|
writer = ExportUtil.streamWriter(response, export);
|
|
|
|
|
for (String newLine : lines) {
|
|
|
|
|
writer.println(newLine);
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}finally {
|
|
|
|
|
if (ObjectUtil.isNotNull(writer)) writer.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<String> calibrations(GardsCalibrationSpectrum gammaCalibrationCE,GardsCalibrationSpectrum gammaCalibrationEC, GardsCalibrationSpectrum betaCalibrationCE, GardsCalibrationSpectrum betaCalibrationEC) {
|
|
|
|
|
int min = 79;
|
|
|
|
|
String space = StrUtil.SPACE;
|
|
|
|
|