beta功能查询排序

beta功能分析结果数据未赋值问题修改
gamma功能保存用户核素信息后重新缓存核素信息
This commit is contained in:
qiaoqinzheng 2023-11-06 10:57:02 +08:00
parent f3406eaae0
commit f923485118
4 changed files with 839 additions and 812 deletions

View File

@ -20,7 +20,7 @@ public interface SpectrumAnalysisMapper {
List<GardsSampleDataSpectrum> getDBSearchList(String dbName, List<String> stationTypes, List<String> userStations, boolean AllUsers); List<GardsSampleDataSpectrum> getDBSearchList(String dbName, List<String> stationTypes, List<String> userStations, boolean AllUsers);
Page<GardsSampleDataSpectrum> getDBSpectrumList(IPage<GardsSampleDataSpectrum> page, GardsSampleDataSpectrum gardsSampleData, String dbName, List<String> stationTypes, boolean CollectStopB, boolean AcqStartB, String startTime, String endTime, List<String> userStations, boolean AllUsers); Page<GardsSampleDataSpectrum> getDBSpectrumList(IPage<GardsSampleDataSpectrum> page, GardsSampleDataSpectrum gardsSampleData, String dbName, List<String> stationTypes, boolean CollectStopB, boolean AcqStartB, String startTime, String endTime, List<String> userStations, boolean AllUsers, String orderField, String orderType);
SpectrumFileRecord getDBSpectrumFilePath(String dbName, Integer sampleId, Integer analysisID); SpectrumFileRecord getDBSpectrumFilePath(String dbName, Integer sampleId, Integer analysisID);

View File

@ -32,19 +32,19 @@
</select> </select>
<select id="getDBSpectrumList" resultType="org.jeecg.modules.entity.GardsSampleDataSpectrum"> <select id="getDBSpectrumList" resultType="org.jeecg.modules.entity.GardsSampleDataSpectrum">
select c.sample_id, select c.sample_id sampleId,
b.station_code stationName, b.station_code stationName,
a.detector_code detectorsName, a.detector_code detectorsName,
c.sample_type, c.sample_type sampleType,
c.data_type, c.data_type dataType,
c.spectral_qualifie, c.spectral_qualifie spectralQualifie,
c.collect_stop, c.collect_stop collectStop,
c.acquisition_start, c.acquisition_start acquisitionStart,
c.acquisition_real_sec, c.acquisition_real_sec acquisitionRealSec,
c.acquisition_live_sec, c.acquisition_live_sec acquisitionLiveSec,
d.analyst, d.analyst analyst,
c.status, c.status status,
c.input_file_name c.input_file_name inputFileName
from from
CONFIGURATION.GARDS_DETECTORS a, CONFIGURATION.GARDS_DETECTORS a,
CONFIGURATION.GARDS_STATIONS b, CONFIGURATION.GARDS_STATIONS b,
@ -97,7 +97,12 @@
</if> </if>
</if> </if>
</where> </where>
ORDER BY c.collect_stop DESC <if test=" orderField != 'createTime' and orderField != '' and orderField != null and orderType != '' and orderType != null ">
ORDER BY ${orderField} ${orderType}
</if>
<if test=" orderField == 'createTime' or orderField == '' or orderField == null or orderType == '' or orderType == null ">
ORDER BY collectStop DESC
</if>
</select> </select>
<select id="getXeDataList" resultType="org.jeecg.modules.entity.GardsXeResultsSpectrum"> <select id="getXeDataList" resultType="org.jeecg.modules.entity.GardsXeResultsSpectrum">
@ -182,7 +187,6 @@
<where> <where>
SAMPLE_ID = #{sampleId} SAMPLE_ID = #{sampleId}
</where> </where>
</select> </select>
<select id="findSampleByFilePath" resultType="org.jeecg.modules.entity.GardsSampleDataSpectrum"> <select id="findSampleByFilePath" resultType="org.jeecg.modules.entity.GardsSampleDataSpectrum">
@ -211,7 +215,6 @@
<where> <where>
INPUT_FILE_NAME = #{filePath} INPUT_FILE_NAME = #{filePath}
</where> </where>
</select> </select>
<select id="getDetectorList" resultType="org.jeecg.modules.base.entity.configuration.GardsDetectors"> <select id="getDetectorList" resultType="org.jeecg.modules.base.entity.configuration.GardsDetectors">

View File

@ -3568,6 +3568,15 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
boolean save = defaultNuclideSpectrumService.saveNuclidesByUserName(userLibraryName, userName, phd.getHeader().getSystem_type().toUpperCase()); boolean save = defaultNuclideSpectrumService.saveNuclidesByUserName(userLibraryName, userName, phd.getHeader().getSystem_type().toUpperCase());
if (save) { if (save) {
result.success("Modified successfully"); result.success("Modified successfully");
// 查询当前用户关联的核素信息
List<String> userLib = new LinkedList<>();
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
userLib = defaultNuclideSpectrumService.findNuclidesByUserName(userName, phd.getHeader().getSystem_type().toUpperCase());
if (CollectionUtils.isEmpty(userLib)) {
userLib = defaultNuclideSpectrumService.findNuclidesByUserName("admin", phd.getHeader().getSystem_type().toUpperCase());
}
Map<String, NuclideLines> nuclideMap = GetNuclideLines(userLib);
redisUtil.set(fileName+"-"+userName, nuclideMap);
} else { } else {
result.success("Modification failure"); result.success("Modification failure");
} }

View File

@ -213,7 +213,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
} }
//声明分页page //声明分页page
Page<GardsSampleDataSpectrum> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize()); Page<GardsSampleDataSpectrum> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
Page<GardsSampleDataSpectrum> sampleDataPage = spectrumAnalysisMapper.getDBSpectrumList(page, gardsSampleData, dbName, stationTypes, CollectStopB, AcqStartB, startTime, endTime, userStations, AllUsers); Page<GardsSampleDataSpectrum> sampleDataPage = spectrumAnalysisMapper.getDBSpectrumList(page, gardsSampleData, dbName, stationTypes, CollectStopB, AcqStartB, startTime, endTime, userStations, AllUsers, queryRequest.getField(), queryRequest.getOrder());
sampleDataPage.getRecords().stream().forEach(item->{item.setDbName(tempDBName);}); sampleDataPage.getRecords().stream().forEach(item->{item.setDbName(tempDBName);});
result.setSuccess(true); result.setSuccess(true);
result.setResult(sampleDataPage); result.setResult(sampleDataPage);
@ -387,42 +387,46 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
betaDataFile = new BetaDataFile(); betaDataFile = new BetaDataFile();
//给公用变量赋值sampleId //给公用变量赋值sampleId
betaDataFile.setSampleId(String.valueOf(sampleId)); betaDataFile.setSampleId(String.valueOf(sampleId));
betaDataFile.setSampleFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getSampleFilePath());
betaDataFile.setSampleFileName(sampleFileName);
if (Objects.nonNull(sample)) { if (Objects.nonNull(sample)) {
sampleTmp = ftpUtil.downloadFile(betaDataFile.getSampleFilePathName(), "betaGamma"); sampleTmp = ftpUtil.downloadFile(betaDataFile.getSampleFilePathName(), "betaGamma");
if (Objects.nonNull(sampleTmp)) { if (Objects.nonNull(sampleTmp)) {
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(sampleTmp.getAbsolutePath()); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(sampleTmp.getAbsolutePath());
betaDataFile.setSampleStruct(struct);
betaDataFile.setSampleFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getSampleFilePath());
betaDataFile.setSampleFileName(sampleFileName);
sampleMap = phdFileUtil.getSourceData(struct, sample.getSampleId(), sample.getStatus(), "sample", betaDataFile); sampleMap = phdFileUtil.getSourceData(struct, sample.getSampleId(), sample.getStatus(), "sample", betaDataFile);
resultMap.put("sample",sampleMap); resultMap.put("sample",sampleMap);
} }
} }
betaDataFile.setGasFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getGasBgFilePath());
betaDataFile.setGasFileName(gasFileName);
if (Objects.nonNull(gasBg)) { if (Objects.nonNull(gasBg)) {
gasTmp = ftpUtil.downloadFile(betaDataFile.getGasFilePathName(), "betaGamma"); gasTmp = ftpUtil.downloadFile(betaDataFile.getGasFilePathName(), "betaGamma");
if (Objects.nonNull(gasTmp)) { if (Objects.nonNull(gasTmp)) {
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(gasTmp.getAbsolutePath()); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(gasTmp.getAbsolutePath());
betaDataFile.setGasStruct(struct);
betaDataFile.setGasFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getGasBgFilePath());
betaDataFile.setGasFileName(gasFileName);
gasBgMap = phdFileUtil.getSourceData(struct, gasBg.getSampleId(), gasBg.getStatus(), "gas", betaDataFile); gasBgMap = phdFileUtil.getSourceData(struct, gasBg.getSampleId(), gasBg.getStatus(), "gas", betaDataFile);
resultMap.put("gasBg",gasBgMap); resultMap.put("gasBg",gasBgMap);
} }
} }
betaDataFile.setDetFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getDetBgFilePath());
betaDataFile.setDetFileName(detFileName);
if (Objects.nonNull(detBg)) { if (Objects.nonNull(detBg)) {
detTmp = ftpUtil.downloadFile(betaDataFile.getDetFilePathName(), "betaGamma"); detTmp = ftpUtil.downloadFile(betaDataFile.getDetFilePathName(), "betaGamma");
if (Objects.nonNull(detTmp)) { if (Objects.nonNull(detTmp)) {
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(detTmp.getAbsolutePath()); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(detTmp.getAbsolutePath());
betaDataFile.setDetStruct(struct);
betaDataFile.setDetFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getDetBgFilePath());
betaDataFile.setDetFileName(detFileName);
detBgMap = phdFileUtil.getSourceData(struct, detBg.getSampleId(), detBg.getStatus(), "det", betaDataFile); detBgMap = phdFileUtil.getSourceData(struct, detBg.getSampleId(), detBg.getStatus(), "det", betaDataFile);
resultMap.put("detBg",detBgMap); resultMap.put("detBg",detBgMap);
} }
} }
betaDataFile.setQcFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbQcFilePath);
betaDataFile.setQcFileName(qcFileName);
if (Objects.nonNull(qc)) { if (Objects.nonNull(qc)) {
qcTmp = ftpUtil.downloadFile(betaDataFile.getQcFilePathName(), "betaGamma"); qcTmp = ftpUtil.downloadFile(betaDataFile.getQcFilePathName(), "betaGamma");
if (Objects.nonNull(qcTmp)) { if (Objects.nonNull(qcTmp)) {
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(qcTmp.getAbsolutePath()); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(qcTmp.getAbsolutePath());
betaDataFile.setQcStruct(struct);
betaDataFile.setQcFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbQcFilePath);
betaDataFile.setQcFileName(qcFileName);
qcMap = phdFileUtil.getSourceData(struct, qc.getSampleId(), qc.getStatus(), "qc", betaDataFile); qcMap = phdFileUtil.getSourceData(struct, qc.getSampleId(), qc.getStatus(), "qc", betaDataFile);
resultMap.put("qc",qcMap); resultMap.put("qc",qcMap);
} }
@ -758,7 +762,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
rrrLogInfo.setBBetaEnergyValidDet(betaDataFile.isBBetaEnergyValidDet()); rrrLogInfo.setBBetaEnergyValidDet(betaDataFile.isBBetaEnergyValidDet());
} }
//对当前文件内容进行分析 //对当前文件内容进行分析
analyzeRRR(rrrLogInfo, BgCalPara, betaFittingPara, gammaFittingPara); boolean bRet = analyzeRRR(rrrLogInfo, BgCalPara, betaFittingPara, gammaFittingPara);
StringBuffer strBuffer = new StringBuffer();
if (bRet) {
//对分析后的内容进行数据获取 //对分析后的内容进行数据获取
List<GardsROIChannelsSpectrum> channelsSpectrums = rrrLogInfo.getRoiChannelsSpectrumList(); List<GardsROIChannelsSpectrum> channelsSpectrums = rrrLogInfo.getRoiChannelsSpectrumList();
List<GardsROIResultsSpectrum> resultsSpectrums = rrrLogInfo.getRoiResultsSpectrumList(); List<GardsROIResultsSpectrum> resultsSpectrums = rrrLogInfo.getRoiResultsSpectrumList();
@ -834,7 +840,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
} catch (ParseException e) { } catch (ParseException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
StringBuffer strBuffer = new StringBuffer();
strBuffer.append("CNL06 GENERATED REPORT").append("\n"); strBuffer.append("CNL06 GENERATED REPORT").append("\n");
strBuffer.append("REVIEWED RADIONUCLIDE REPORT").append("\n"); strBuffer.append("REVIEWED RADIONUCLIDE REPORT").append("\n");
strBuffer.append("(Noble Gas Version)").append("\n"); strBuffer.append("(Noble Gas Version)").append("\n");
@ -950,13 +955,14 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
strBuffer.append(StringPool.SPACE+xeResultsSpectrum.getNuclideName()+" "+xeResultsSpectrum.getConc()+" +/- "+xeResultsSpectrum.getConcErr()+" "+xeResultsSpectrum.getLc()+" "+xeResultsSpectrum.getMdc()+" "+xeResultsSpectrum.getNidFlag()).append("\n"); strBuffer.append(StringPool.SPACE+xeResultsSpectrum.getNuclideName()+" "+xeResultsSpectrum.getConc()+" +/- "+xeResultsSpectrum.getConcErr()+" "+xeResultsSpectrum.getLc()+" "+xeResultsSpectrum.getMdc()+" "+xeResultsSpectrum.getNidFlag()).append("\n");
} }
strBuffer.append("\n"); strBuffer.append("\n");
}
result.setSuccess(true); result.setSuccess(true);
result.setResult(strBuffer.toString()); result.setResult(strBuffer.toString());
return result; return result;
} }
public void analyzeRRR(RRRLogInfo rrrLogInfo, BgCalibratePara BgCalPara, List<String> betaFittingPara, List<String> gammaFittingPara) { public boolean analyzeRRR(RRRLogInfo rrrLogInfo, BgCalibratePara BgCalPara, List<String> betaFittingPara, List<String> gammaFittingPara) {
boolean bRet = true;
File sampleTmp = null; File sampleTmp = null;
File gasTmp = null; File gasTmp = null;
File detTmp = null; File detTmp = null;
@ -974,6 +980,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
} else { } else {
bgAnalyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara); bgAnalyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara);
} }
if (StringUtils.isNotBlank(bgAnalyseResult.error_log) && !bgAnalyseResult.error_log.equalsIgnoreCase("no error.")) {
bRet = false;
} else {
//处理XeData的数据 //处理XeData的数据
List<GardsXeResultsSpectrum> xeResultsSpectrumList = new LinkedList<>(); List<GardsXeResultsSpectrum> xeResultsSpectrumList = new LinkedList<>();
GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum(); GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum();
@ -1164,6 +1173,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
roiResultsSpectrumList.add(roiResults); roiResultsSpectrumList.add(roiResults);
} }
rrrLogInfo.setRoiResultsSpectrumList(roiResultsSpectrumList); rrrLogInfo.setRoiResultsSpectrumList(roiResultsSpectrumList);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
@ -1177,6 +1187,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
detTmp.delete(); detTmp.delete();
} }
} }
return bRet;
} }
@Override @Override
@ -4129,6 +4140,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
} else { } else {
bgAnalyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara); bgAnalyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara);
} }
if (StringUtils.isBlank(bgAnalyseResult.error_log) || bgAnalyseResult.error_log.equalsIgnoreCase("no error.")) {
List<GardsXeResults> xeResultsSpectrumList = new LinkedList<>(); List<GardsXeResults> xeResultsSpectrumList = new LinkedList<>();
GardsXeResults xe131m = new GardsXeResults(); GardsXeResults xe131m = new GardsXeResults();
xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); xe131m.setNuclideName(XeNuclideName.XE_131m.getType());
@ -4358,6 +4370,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
roiResultsSpectrumList.add(roiResults); roiResultsSpectrumList.add(roiResults);
} }
anlyseResultIn.setRoiResultsSpectrumList(roiResultsSpectrumList); anlyseResultIn.setRoiResultsSpectrumList(roiResultsSpectrumList);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
@ -4391,6 +4404,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
} else { } else {
bgAnalyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara); bgAnalyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara);
} }
if (StringUtils.isBlank(bgAnalyseResult.error_log) || bgAnalyseResult.error_log.equalsIgnoreCase("no error.")) {
//处理XeData的数据 //处理XeData的数据
List<GardsXeResults> xeResultsSpectrumList = new LinkedList<>(); List<GardsXeResults> xeResultsSpectrumList = new LinkedList<>();
GardsXeResults xe131m = new GardsXeResults(); GardsXeResults xe131m = new GardsXeResults();
@ -4581,6 +4595,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
roiResultsSpectrumList.add(roiResults); roiResultsSpectrumList.add(roiResults);
} }
anlyseResultIn.setRoiResultsSpectrumList(roiResultsSpectrumList); anlyseResultIn.setRoiResultsSpectrumList(roiResultsSpectrumList);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {