Merge remote-tracking branch 'origin/station' into station
This commit is contained in:
commit
45811d00e0
|
@ -62,7 +62,7 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public GardsSampleData getSampleIdAndInputFileName(String measurementId, String dataType, String systemType) {
|
public GardsSampleData getSampleIdAndInputFileName(String measurementId, String dataType, String systemType) {
|
||||||
String detectorId = measurementId.substring(0, 8);
|
String detectorId = measurementId.substring(0, 9);
|
||||||
final List<GardsSampleData> sampleDatas = this.baseMapper.getSampleIdAndInputFileName(measurementId, dataType, systemType, detectorId);
|
final List<GardsSampleData> sampleDatas = this.baseMapper.getSampleIdAndInputFileName(measurementId, dataType, systemType, detectorId);
|
||||||
if(!CollectionUtils.isEmpty(sampleDatas)){
|
if(!CollectionUtils.isEmpty(sampleDatas)){
|
||||||
//如果查询出多条则需要根据inputFileName字段降序排序后返回第一个
|
//如果查询出多条则需要根据inputFileName字段降序排序后返回第一个
|
||||||
|
|
|
@ -65,6 +65,10 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
phd.setFilename(fileName);
|
phd.setFilename(fileName);
|
||||||
String fromPath = pathName + StringPool.SLASH + fileName;
|
String fromPath = pathName + StringPool.SLASH + fileName;
|
||||||
File file = ftpUtil.downloadFile(fromPath, "betaGamma");
|
File file = ftpUtil.downloadFile(fromPath, "betaGamma");
|
||||||
|
if (Objects.isNull(file)) {
|
||||||
|
result.error500("ftp file can't find");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
//读取文件信息
|
//读取文件信息
|
||||||
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||||
|
@ -238,7 +242,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetBaseInfo(PHDFile phd) {
|
public void SetBaseInfo(PHDFile phd, String prefixName) {
|
||||||
String pathName = phd.getFilepath();
|
String pathName = phd.getFilepath();
|
||||||
String fileName = phd.getFilename();
|
String fileName = phd.getFilename();
|
||||||
//文件名称需要加上自动处理的前缀以及修改不同的文件后缀名
|
//文件名称需要加上自动处理的前缀以及修改不同的文件后缀名
|
||||||
|
@ -248,7 +252,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
File scacFile = null;
|
File scacFile = null;
|
||||||
InputStream inputStreamBase = null;
|
InputStream inputStreamBase = null;
|
||||||
try {
|
try {
|
||||||
String lcFileName = "RNAUTO_"+subFileName + ".lc";
|
String lcFileName = prefixName+"_"+subFileName + ".lc";
|
||||||
String fromPathLc = pathName + StringPool.SLASH + lcFileName;
|
String fromPathLc = pathName + StringPool.SLASH + lcFileName;
|
||||||
lcFile = ftpUtil.downloadFile(fromPathLc, "betaGamma");
|
lcFile = ftpUtil.downloadFile(fromPathLc, "betaGamma");
|
||||||
|
|
||||||
|
@ -258,7 +262,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
//将数据结果赋值给 phdFile的vLc
|
//将数据结果赋值给 phdFile的vLc
|
||||||
phd.setVLc(vDataLc);
|
phd.setVLc(vDataLc);
|
||||||
|
|
||||||
String scacFileName = "RNAUTO_"+subFileName + ".scac";
|
String scacFileName = prefixName+"_"+subFileName + ".scac";
|
||||||
String fromPathScac = pathName + StringPool.SLASH + scacFileName;
|
String fromPathScac = pathName + StringPool.SLASH + scacFileName;
|
||||||
scacFile = ftpUtil.downloadFile(fromPathScac, "betaGamma");
|
scacFile = ftpUtil.downloadFile(fromPathScac, "betaGamma");
|
||||||
|
|
||||||
|
@ -268,7 +272,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
//将数据结果赋值给 phdFile的vLc
|
//将数据结果赋值给 phdFile的vLc
|
||||||
phd.setVScac(vDataScac);
|
phd.setVScac(vDataScac);
|
||||||
|
|
||||||
String baselineFileName = "RNAUTO_"+subFileName + ".baseline";
|
String baselineFileName = prefixName+"_"+subFileName + ".baseline";
|
||||||
String fromPathBase = pathName + StringPool.SLASH + baselineFileName;
|
String fromPathBase = pathName + StringPool.SLASH + baselineFileName;
|
||||||
inputStreamBase = ftpUtil.downloadFileStream(fromPathBase);
|
inputStreamBase = ftpUtil.downloadFileStream(fromPathBase);
|
||||||
// 调用处理BaseCtrl的方法
|
// 调用处理BaseCtrl的方法
|
||||||
|
@ -861,7 +865,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> DetailedInfo(Integer sampleId, PHDFile phd) {
|
public List<String> DetailedInfo(String sampleId, PHDFile phd) {
|
||||||
try {
|
try {
|
||||||
// Sample_Id, Station_Code, Detector_Code, System_Type, Data_Type, Spectral_Qualifier,
|
// Sample_Id, Station_Code, Detector_Code, System_Type, Data_Type, Spectral_Qualifier,
|
||||||
// SRID, Sample_Status, Collect_Start, Sampling_Time, Quantity, Flow_Rate,
|
// SRID, Sample_Status, Collect_Start, Sampling_Time, Quantity, Flow_Rate,
|
||||||
|
@ -872,7 +876,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
detailInfo.add("");
|
detailInfo.add("");
|
||||||
}
|
}
|
||||||
//读取phdFile的数据 修改detailInfo的数据
|
//读取phdFile的数据 修改detailInfo的数据
|
||||||
detailInfo.set(0, Objects.nonNull(sampleId)?sampleId.toString():""); // Sample_Id
|
detailInfo.set(0, StringUtils.isNotBlank(sampleId)?sampleId:""); // Sample_Id
|
||||||
detailInfo.set(1, phd.getHeader().getSite_code()); // Station_Code
|
detailInfo.set(1, phd.getHeader().getSite_code()); // Station_Code
|
||||||
detailInfo.set(2, phd.getHeader().getDetector_code()); // Detector_Code
|
detailInfo.set(2, phd.getHeader().getDetector_code()); // Detector_Code
|
||||||
detailInfo.set(3, phd.getHeader().getSystem_type().toUpperCase()); // System_Type
|
detailInfo.set(3, phd.getHeader().getSystem_type().toUpperCase()); // System_Type
|
||||||
|
@ -3020,8 +3024,20 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
anylseEnd = DateUtils.formatDate(new Date(), "yyyy/MM/dd HH:mm:ss");
|
anylseEnd = DateUtils.formatDate(new Date(), "yyyy/MM/dd HH:mm:ss");
|
||||||
middleData.analyses_analysisBegin = anylseBegin;
|
middleData.analyses_analysisBegin = anylseBegin;
|
||||||
middleData.analyses_analysisEnd = anylseEnd;
|
middleData.analyses_analysisEnd = anylseEnd;
|
||||||
|
} else if (type.equals(MiddleDataType.InterAction.getType())){ //如果是人工交互分析 则先上传phd对应文件信息
|
||||||
|
//上传本次文件到ftp人工交互存储路径下
|
||||||
|
File sampleTmp = null;
|
||||||
|
try {
|
||||||
|
sampleTmp = analyzeFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + fileAnlyse.getFilepath(), fileAnlyse.getFilename());
|
||||||
|
if (Objects.nonNull(sampleTmp)) {
|
||||||
|
bRet = ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + middleData.analyses_save_filePath.substring(0, middleData.analyses_save_filePath.lastIndexOf(StringPool.SLASH)), middleData.analyses_save_filePath.substring(middleData.analyses_save_filePath.lastIndexOf(StringPool.SLASH)+1), new FileInputStream(sampleTmp));
|
||||||
|
}
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} finally {
|
||||||
|
sampleTmp.delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//gards_analyses
|
//gards_analyses
|
||||||
String qsBaseLinePath = path+StringPool.SLASH+middleData.analyses_analyst+"_"+baselineName;
|
String qsBaseLinePath = path+StringPool.SLASH+middleData.analyses_analyst+"_"+baselineName;
|
||||||
|
|
|
@ -605,7 +605,8 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void analyzeSpectrum(File sampleTmp, File gasTmp, File detTmp, BgCalibratePara BgCalPara, Map<String, Object> map) {
|
public boolean analyzeSpectrum(File sampleTmp, File gasTmp, File detTmp, BgCalibratePara BgCalPara, Map<String, Object> map) {
|
||||||
|
boolean bRet = true;
|
||||||
//调用动态库解析文件
|
//调用动态库解析文件
|
||||||
BgAnalyseResult analyseResult = null;
|
BgAnalyseResult analyseResult = null;
|
||||||
if (Objects.isNull(BgCalPara)) {
|
if (Objects.isNull(BgCalPara)) {
|
||||||
|
@ -613,6 +614,10 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
} else {
|
} else {
|
||||||
analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara);
|
analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara);
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(analyseResult.error_log) && !analyseResult.error_log.equalsIgnoreCase("no error.")) {
|
||||||
|
bRet = false;
|
||||||
|
return bRet;
|
||||||
|
} else {
|
||||||
EnergySpectrumStruct sample = analyzeFileSourceData(sampleTmp);
|
EnergySpectrumStruct sample = analyzeFileSourceData(sampleTmp);
|
||||||
EnergySpectrumStruct gas = analyzeFileSourceData(gasTmp);
|
EnergySpectrumStruct gas = analyzeFileSourceData(gasTmp);
|
||||||
EnergySpectrumStruct det = analyzeFileSourceData(detTmp);
|
EnergySpectrumStruct det = analyzeFileSourceData(detTmp);
|
||||||
|
@ -692,6 +697,8 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
}
|
}
|
||||||
map.put("DetBoundary", boundaryList);
|
map.put("DetBoundary", boundaryList);
|
||||||
}
|
}
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnergySpectrumStruct analyzeFileSourceData(String filePath, String fileName) {
|
public EnergySpectrumStruct analyzeFileSourceData(String filePath, String fileName) {
|
||||||
|
@ -1239,19 +1246,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第三十六行数据
|
//第三十六行数据
|
||||||
|
if (bgAnalyseResult.s_b_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.s_b_fitting_c_e)) {
|
||||||
if (bgAnalyseResult.s_b_fitting_c_e.size() > 0) {
|
if (bgAnalyseResult.s_b_fitting_c_e.size() > 0) {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_c_e.get(2)))));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_c_e.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第三十七行数据
|
//第三十七行数据
|
||||||
|
if (bgAnalyseResult.s_b_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.s_b_fitting_e_c)) {
|
||||||
if (bgAnalyseResult.s_b_fitting_e_c.size() > 0) {
|
if (bgAnalyseResult.s_b_fitting_e_c.size() > 0) {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_e_c.get(2)))));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_e_c.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//换行
|
//换行
|
||||||
|
@ -1261,19 +1276,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第三十六行数据
|
//第三十六行数据
|
||||||
|
if (bgAnalyseResult.s_g_fitting_c_e !=null && CollectionUtils.isNotEmpty(bgAnalyseResult.s_g_fitting_c_e)) {
|
||||||
if (bgAnalyseResult.s_g_fitting_c_e.size() > 0) {
|
if (bgAnalyseResult.s_g_fitting_c_e.size() > 0) {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_c_e.get(2)))));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_c_e.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第三十七行数据
|
//第三十七行数据
|
||||||
|
if (bgAnalyseResult.s_g_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.s_g_fitting_e_c)) {
|
||||||
if (bgAnalyseResult.s_g_fitting_e_c.size() > 0) {
|
if (bgAnalyseResult.s_g_fitting_e_c.size() > 0) {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_e_c.get(2)))));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_e_c.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//换行
|
//换行
|
||||||
|
@ -1323,20 +1346,28 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第四十四行数据
|
//第四十四行数据
|
||||||
|
if (bgAnalyseResult.d_b_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.d_b_fitting_c_e)) {
|
||||||
if (bgAnalyseResult.d_b_fitting_c_e.size() > 0) {
|
if (bgAnalyseResult.d_b_fitting_c_e.size() > 0) {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_c_e.get(2)))));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_c_e.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
|
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第四十五行数据
|
//第四十五行数据
|
||||||
|
if (bgAnalyseResult.d_b_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.d_b_fitting_e_c)) {
|
||||||
if (bgAnalyseResult.d_b_fitting_e_c.size() > 0) {
|
if (bgAnalyseResult.d_b_fitting_e_c.size() > 0) {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_e_c.get(2)))));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_e_c.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//换行
|
//换行
|
||||||
|
@ -1346,19 +1377,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第四十四行数据
|
//第四十四行数据
|
||||||
|
if (bgAnalyseResult.d_g_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.d_g_fitting_c_e)) {
|
||||||
if (bgAnalyseResult.d_g_fitting_c_e.size() > 0) {
|
if (bgAnalyseResult.d_g_fitting_c_e.size() > 0) {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_c_e.get(2)))));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_c_e.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第四十五行数据
|
//第四十五行数据
|
||||||
|
if (bgAnalyseResult.d_g_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.d_g_fitting_e_c)) {
|
||||||
if (bgAnalyseResult.d_g_fitting_e_c.size() > 0) {
|
if (bgAnalyseResult.d_g_fitting_e_c.size() > 0) {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_e_c.get(2)))));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_e_c.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//换行
|
//换行
|
||||||
|
@ -1403,19 +1442,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第五十一行数据
|
//第五十一行数据
|
||||||
|
if (bgAnalyseResult.g_b_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.g_b_fitting_c_e)) {
|
||||||
if (bgAnalyseResult.g_b_fitting_c_e.size() > 0) {
|
if (bgAnalyseResult.g_b_fitting_c_e.size() > 0) {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_c_e.get(2)))));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_c_e.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第五十二行数据
|
//第五十二行数据
|
||||||
|
if (bgAnalyseResult.g_b_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.g_b_fitting_e_c)) {
|
||||||
if (bgAnalyseResult.g_b_fitting_e_c.size() > 0) {
|
if (bgAnalyseResult.g_b_fitting_e_c.size() > 0) {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_e_c.get(2)))));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_e_c.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//换行
|
//换行
|
||||||
|
@ -1425,19 +1472,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第五十四行数据
|
//第五十四行数据
|
||||||
|
if (bgAnalyseResult.g_g_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.g_g_fitting_c_e)) {
|
||||||
if (bgAnalyseResult.g_g_fitting_c_e.size() > 0) {
|
if (bgAnalyseResult.g_g_fitting_c_e.size() > 0) {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_c_e.get(2)))));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_c_e.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//第五十五行数据
|
//第五十五行数据
|
||||||
|
if (bgAnalyseResult.g_g_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.g_g_fitting_e_c)) {
|
||||||
if (bgAnalyseResult.g_g_fitting_e_c.size() > 0) {
|
if (bgAnalyseResult.g_g_fitting_e_c.size() > 0) {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_e_c.get(2)))));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_e_c.get(2)))));
|
||||||
} else {
|
} else {
|
||||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||||
|
}
|
||||||
//换行
|
//换行
|
||||||
out.append(System.lineSeparator());
|
out.append(System.lineSeparator());
|
||||||
//换行
|
//换行
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class BgDataAnlyseResultIn implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 标识本次操作是否进行过解析
|
* 标识本次操作是否进行过解析
|
||||||
*/
|
*/
|
||||||
private boolean bProcessed;
|
private boolean savedAnalysisResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分析员名称
|
* 分析员名称
|
||||||
|
@ -266,7 +266,7 @@ public class BgDataAnlyseResultIn implements Serializable {
|
||||||
|
|
||||||
public BgDataAnlyseResultIn() {
|
public BgDataAnlyseResultIn() {
|
||||||
comment = "";
|
comment = "";
|
||||||
bProcessed = false;
|
savedAnalysisResult = false;
|
||||||
userName = "";
|
userName = "";
|
||||||
stationName = "";
|
stationName = "";
|
||||||
dbName = "";
|
dbName = "";
|
||||||
|
|
|
@ -85,6 +85,8 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileFtransitUtil fileFtransitUtil;
|
private FileFtransitUtil fileFtransitUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private NameStandUtil nameStandUtil;
|
||||||
|
@Autowired
|
||||||
private DBUtil dbUtil;
|
private DBUtil dbUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserTaskUtil userTaskUtil;
|
private UserTaskUtil userTaskUtil;
|
||||||
|
@ -160,9 +162,24 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// 声明基础数组信息
|
// 声明基础数组信息
|
||||||
gammaFileUtil.SetBaseInfo(phd);
|
if (dbName.equals("auto")) {
|
||||||
|
gammaFileUtil.SetBaseInfo(phd, "RNAUTO");
|
||||||
|
} else if (dbName.equals("man")) {
|
||||||
|
gammaFileUtil.SetBaseInfo(phd, userName);
|
||||||
|
}
|
||||||
// 从数据库中读取相关信息
|
// 从数据库中读取相关信息
|
||||||
boolean bRet = getResultFromDB(dbName, userName, sampleId, phd, result);
|
boolean bRet = getResultFromDB(dbName, userName, sampleId, phd, result);
|
||||||
|
if (!redisUtil.hasKey(fileName+"-"+userName)) {
|
||||||
|
// 查询当前用户关联的核素信息
|
||||||
|
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);
|
||||||
|
}
|
||||||
if (!bRet) {
|
if (!bRet) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -171,6 +188,17 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
||||||
String fileName = samfileName;
|
String fileName = samfileName;
|
||||||
boolean flag = gammaFileUtil.loadFile(pathName, fileName, phd, result);
|
boolean flag = gammaFileUtil.loadFile(pathName, fileName, phd, result);
|
||||||
|
if (!redisUtil.hasKey(fileName+"-"+userName)) {
|
||||||
|
// 查询当前用户关联的核素信息
|
||||||
|
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);
|
||||||
|
}
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -437,9 +465,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// 加载phd数据所需的lc,scac,baseline数据
|
// 加载phd数据所需的lc,scac,baseline数据
|
||||||
gammaFileUtil.SetBaseInfo(phd);
|
if (dbName.equals("auto")) {
|
||||||
|
gammaFileUtil.SetBaseInfo(phd, "RNAUTO");
|
||||||
|
} else if (dbName.equals("man")) {
|
||||||
|
gammaFileUtil.SetBaseInfo(phd, userName);
|
||||||
|
}
|
||||||
// 从数据库中读取phd其他相关信息
|
// 从数据库中读取phd其他相关信息
|
||||||
boolean bRet = getResultFromDB(dbName, userName, sampleId, phd, result);
|
boolean bRet = getResultFromDB(dbName, userName, sampleId, phd, result);
|
||||||
|
if (!redisUtil.hasKey(fileName+"-"+userName)) {
|
||||||
// 查询当前用户关联的核素信息
|
// 查询当前用户关联的核素信息
|
||||||
List<String> userLib = new LinkedList<>();
|
List<String> userLib = new LinkedList<>();
|
||||||
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||||
|
@ -449,6 +482,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
}
|
}
|
||||||
Map<String, NuclideLines> nuclideMap = GetNuclideLines(userLib);
|
Map<String, NuclideLines> nuclideMap = GetNuclideLines(userLib);
|
||||||
redisUtil.set(fileName+"-"+userName, nuclideMap);
|
redisUtil.set(fileName+"-"+userName, nuclideMap);
|
||||||
|
}
|
||||||
// 判断数据库信息是否读取正常
|
// 判断数据库信息是否读取正常
|
||||||
if (!bRet) {
|
if (!bRet) {
|
||||||
return result;
|
return result;
|
||||||
|
@ -460,7 +494,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
List<String> qcstate = gammaFileUtil.Qcstate(phd);
|
List<String> qcstate = gammaFileUtil.Qcstate(phd);
|
||||||
map.put("QCFlag", qcstate);
|
map.put("QCFlag", qcstate);
|
||||||
// 更新 ‘Detailed Information’ 信息
|
// 更新 ‘Detailed Information’ 信息
|
||||||
List<String> detailedInfo = gammaFileUtil.DetailedInfo(sampleId, phd);
|
List<String> detailedInfo = gammaFileUtil.DetailedInfo(String.valueOf(sampleId), phd);
|
||||||
map.put("DetailedInformation", detailedInfo);
|
map.put("DetailedInformation", detailedInfo);
|
||||||
// 更新 ACQ 模块中各时间信息
|
// 更新 ACQ 模块中各时间信息
|
||||||
map.put("start_time", phd.getAcq().getAcquisition_start_date() + "\n" + phd.getAcq().getAcquisition_start_time());
|
map.put("start_time", phd.getAcq().getAcquisition_start_date() + "\n" + phd.getAcq().getAcquisition_start_time());
|
||||||
|
@ -486,7 +520,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
|
|
||||||
public boolean getResultFromDB(String dbName, String userName, Integer sampleId, PHDFile phd, Result result) {
|
public boolean getResultFromDB(String dbName, String userName, Integer sampleId, PHDFile phd, Result result) {
|
||||||
// 判断连接的数据库
|
// 判断连接的数据库
|
||||||
String T_analy, T_calib, T_peaks, T_param, T_nuc_line, T_nuc_act, T_qc, T_setting;
|
String T_analy = "";
|
||||||
|
String T_calib = "";
|
||||||
|
String T_peaks = "";
|
||||||
|
String T_param = "";
|
||||||
|
String T_nuc_line = "";
|
||||||
|
String T_nuc_act = "";
|
||||||
|
String T_qc = "";
|
||||||
|
String T_setting = "";
|
||||||
if (dbName.equals("auto")) {
|
if (dbName.equals("auto")) {
|
||||||
T_analy = "RNAUTO.GARDS_ANALYSES";
|
T_analy = "RNAUTO.GARDS_ANALYSES";
|
||||||
T_calib = "RNAUTO.GARDS_CALIBRATION_PAIRS";
|
T_calib = "RNAUTO.GARDS_CALIBRATION_PAIRS";
|
||||||
|
@ -496,7 +537,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
T_nuc_act = "RNAUTO.GARDS_NUCL_IDED";
|
T_nuc_act = "RNAUTO.GARDS_NUCL_IDED";
|
||||||
T_qc = "RNAUTO.GARDS_QC_CHECK";
|
T_qc = "RNAUTO.GARDS_QC_CHECK";
|
||||||
userName = "RNAUTO";
|
userName = "RNAUTO";
|
||||||
} else {
|
} else if (dbName.equals("man")) {
|
||||||
T_analy = "RNMAN.GARDS_ANALYSES";
|
T_analy = "RNMAN.GARDS_ANALYSES";
|
||||||
T_calib = "RNMAN.GARDS_CALIBRATION_PAIRS";
|
T_calib = "RNMAN.GARDS_CALIBRATION_PAIRS";
|
||||||
T_peaks = "RNMAN.GARDS_PEAKS";
|
T_peaks = "RNMAN.GARDS_PEAKS";
|
||||||
|
@ -793,6 +834,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
phd = new PHDFile();
|
phd = new PHDFile();
|
||||||
// 加载文件内容
|
// 加载文件内容
|
||||||
boolean bRet = gammaFileUtil.loadFile(path, fileName, phd, result);
|
boolean bRet = gammaFileUtil.loadFile(path, fileName, phd, result);
|
||||||
|
if (!bRet) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (!redisUtil.hasKey(fileName+"-"+userName)) {
|
||||||
// 查询当前用户关联的核素信息
|
// 查询当前用户关联的核素信息
|
||||||
List<String> userLib = new LinkedList<>();
|
List<String> userLib = new LinkedList<>();
|
||||||
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||||
|
@ -802,15 +847,13 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
}
|
}
|
||||||
Map<String, NuclideLines> nuclideMap = GetNuclideLines(userLib);
|
Map<String, NuclideLines> nuclideMap = GetNuclideLines(userLib);
|
||||||
redisUtil.set(fileName+"-"+userName, nuclideMap);
|
redisUtil.set(fileName+"-"+userName, nuclideMap);
|
||||||
if (!bRet) {
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 更新 ‘QC Flags’ 状态
|
// 更新 ‘QC Flags’ 状态
|
||||||
List<String> qcstate = gammaFileUtil.Qcstate(phd);
|
List<String> qcstate = gammaFileUtil.Qcstate(phd);
|
||||||
map.put("QCFlag", qcstate);
|
map.put("QCFlag", qcstate);
|
||||||
// 更新 ‘Detailed Information’ 信息
|
// 更新 ‘Detailed Information’ 信息
|
||||||
List<String> detailedInfo = gammaFileUtil.DetailedInfo(null, phd);
|
List<String> detailedInfo = gammaFileUtil.DetailedInfo(phd.getId_sample(), phd);
|
||||||
map.put("DetailedInformation", detailedInfo);
|
map.put("DetailedInformation", detailedInfo);
|
||||||
// 更新 ACQ 模块中各时间信息
|
// 更新 ACQ 模块中各时间信息
|
||||||
map.put("start_time", phd.getAcq().getAcquisition_start_date() + "\n" + phd.getAcq().getAcquisition_start_time());
|
map.put("start_time", phd.getAcq().getAcquisition_start_date() + "\n" + phd.getAcq().getAcquisition_start_time());
|
||||||
|
@ -839,6 +882,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
String key = fileName + StrUtil.DASHED + username;
|
String key = fileName + StrUtil.DASHED + username;
|
||||||
// 删除指定key的Cache
|
// 删除指定key的Cache
|
||||||
localCache.deletePHDCache(key);
|
localCache.deletePHDCache(key);
|
||||||
|
redisUtil.del(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4328,26 +4372,36 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
public Result saveToDB(String fileName, HttpServletRequest request) {
|
public Result saveToDB(String fileName, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
String userName = JwtUtil.getUserNameByToken(request);
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
boolean bRet = true;
|
boolean bRet = false;
|
||||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
PHDFile phd = phdCache.getIfPresent(fileName + "-" + userName);
|
PHDFile phd = phdCache.getIfPresent(fileName + "-" + userName);
|
||||||
if (Objects.isNull(phd)) {
|
if (Objects.isNull(phd)) {
|
||||||
result.error500("Please select the parse file first!");
|
result.error500("Please select the parse file first!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// 查看分析员是否有权限操作当前台站信息
|
if (!phd.isBAnalyed()) {
|
||||||
// 判断当前分析员是否有过排班任务
|
result.error500("Please first Reprocessing!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//获取当前操作的台站的id
|
||||||
Integer stationId = spectrumAnalysisMapper.getStationId(phd.getHeader().getSite_code());
|
Integer stationId = spectrumAnalysisMapper.getStationId(phd.getHeader().getSite_code());
|
||||||
boolean bAnalysisResultWriteAuthority = userTaskUtil.CheckUserWriteAuthorityForStation(userName, stationId);
|
//判断当前分析员当天是否有对应台站的排班任务
|
||||||
|
List<String> userStation = userTaskUtil.findUserStation(userName);
|
||||||
|
boolean bAnalysisResultWriteAuthority = false;
|
||||||
|
if (userStation.contains(String.valueOf(stationId))) {
|
||||||
|
bAnalysisResultWriteAuthority = true;
|
||||||
|
}
|
||||||
|
//根据系统类型获取系统存储前缀
|
||||||
|
String sysTemSubdir = nameStandUtil.GetSysTemSubdir(phd.getHeader().getSystem_type());
|
||||||
|
//根据数据类型获取数据存储前缀
|
||||||
|
String dateTypeSubdir = nameStandUtil.GetDateTypeSubdir(phd.getMsgInfo().getData_type());
|
||||||
|
//格式化名称
|
||||||
|
Map<String, String> nameMap = nameStandUtil.NameStandard(phd);
|
||||||
|
String mSaveFileName = nameMap.get("saveFile");
|
||||||
|
//判断当前分析员是否有过历史分析当前文件
|
||||||
|
Integer isExist = spectrumAnalysisMapper.SampleIsExist(sysTemSubdir+ dateTypeSubdir + StringPool.SLASH + mSaveFileName, userName);
|
||||||
// 如果用户没有权限操作 则查看当前用户是否是高级分析员/管理员
|
// 如果用户没有权限操作 则查看当前用户是否是高级分析员/管理员
|
||||||
if (!bAnalysisResultWriteAuthority) {
|
if (!bAnalysisResultWriteAuthority && Objects.isNull(isExist)) {
|
||||||
List<String> roleCodes = userTaskUtil.findRoleCodeByUserName(userName);
|
|
||||||
// 如果只是分析员 则无法保存数据库 返回信息
|
|
||||||
if (roleCodes.contains(RoleType.Role_Analyst) && !roleCodes.contains(RoleType.Role_SuperAnalyst) && !roleCodes.contains(RoleType.Role_Manager)) {
|
|
||||||
bRet = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!bRet) {
|
|
||||||
result.error500("You have no permission to save results to DB!");
|
result.error500("You have no permission to save results to DB!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -4366,7 +4420,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
phd.setStatus(sampleData.getStatus());
|
phd.setStatus(sampleData.getStatus());
|
||||||
} else {
|
} else {
|
||||||
// 如果sampleData为空 存储数据
|
// 如果sampleData为空 存储数据
|
||||||
SaveSampleToDB(phd, middleData.analyses_save_filePath);
|
bRet = SaveSampleToDB(phd, middleData.analyses_save_filePath);
|
||||||
}
|
}
|
||||||
if (!bRet) {
|
if (!bRet) {
|
||||||
result.error500("The Database hasn't this Spectrum(" + phd.getFilename() + ") and Insert it to Database failed.");
|
result.error500("The Database hasn't this Spectrum(" + phd.getFilename() + ") and Insert it to Database failed.");
|
||||||
|
@ -4386,8 +4440,6 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
if (StringUtils.isBlank(idAnalysis)) {
|
if (StringUtils.isBlank(idAnalysis)) {
|
||||||
// 向 RNMAN.GARDS_ANALYSES 表插入数据
|
// 向 RNMAN.GARDS_ANALYSES 表插入数据
|
||||||
analysesSpectrumService.insertEntity(middleData, phd, userName, comments);
|
analysesSpectrumService.insertEntity(middleData, phd, userName, comments);
|
||||||
// 查询idAnalysis
|
|
||||||
idAnalysis = spectrumAnalysisMapper.getIdAnalysisByIdAnalyst(phd.getId_sample(), userName);
|
|
||||||
// 修改sample_data状态
|
// 修改sample_data状态
|
||||||
spectrumAnalysisMapper.updateAnalysesStatus(middleData.analyses_save_filePath);
|
spectrumAnalysisMapper.updateAnalysesStatus(middleData.analyses_save_filePath);
|
||||||
} else {
|
} else {
|
||||||
|
@ -4427,27 +4479,48 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
paths.add(middleData.analyses_lc_filePath);
|
paths.add(middleData.analyses_lc_filePath);
|
||||||
paths.add(middleData.analyses_scac_filePath);
|
paths.add(middleData.analyses_scac_filePath);
|
||||||
paths.add(middleData.analyses_baseline_filePath);
|
paths.add(middleData.analyses_baseline_filePath);
|
||||||
if (false) paths.add(middleData.analyses_save_filePath);
|
if (bRet) {
|
||||||
|
paths.add(middleData.analyses_save_filePath);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
result.error500("Save analysis results to DB failed.");
|
result.error500("Save analysis results to DB failed.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
//更新detial Information
|
||||||
|
List<String> detailedInfo = gammaFileUtil.DetailedInfo(phd.getId_sample(), phd);
|
||||||
|
map.put("DetailedInformation", detailedInfo);
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(map);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void SaveSampleToDB(PHDFile phd, String input_file_name) {
|
public boolean SaveSampleToDB(PHDFile phd, String input_file_name) {
|
||||||
|
boolean bRet = false;
|
||||||
String sit_det_code = phd.getHeader().getSite_code();
|
String sit_det_code = phd.getHeader().getSite_code();
|
||||||
String detect_code = phd.getHeader().getDetector_code();
|
String detect_code = phd.getHeader().getDetector_code();
|
||||||
// 查询 station_id 和 detect_id
|
// 查询 station_id 和 detect_id
|
||||||
Integer station_id = spectrumAnalysisMapper.getStationId(sit_det_code);
|
Integer station_id = spectrumAnalysisMapper.getStationId(sit_det_code);
|
||||||
Integer detect_id = spectrumAnalysisMapper.getDetectorId(detect_code);
|
Integer detect_id = spectrumAnalysisMapper.getDetectorId(detect_code);
|
||||||
// ORIGINAL.GARDS_SAMPLE_DATA 表数据
|
// ORIGINAL.GARDS_SAMPLE_DATA 表数据
|
||||||
sampleDataSpectrumService.saveSampleDataGamma(phd, input_file_name, station_id, detect_id);
|
Integer saveSampleDataGamma = sampleDataSpectrumService.saveSampleDataGamma(phd, input_file_name, station_id, detect_id);
|
||||||
|
if (saveSampleDataGamma > 0) {
|
||||||
|
bRet = true;
|
||||||
|
} else {
|
||||||
|
bRet = false;
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
// 查询新增后的 sample_id 的值赋给变量 DECLARESAMPLEID
|
// 查询新增后的 sample_id 的值赋给变量 DECLARESAMPLEID
|
||||||
Integer sampleId = spectrumAnalysisMapper.getSampleId(input_file_name);
|
Integer sampleId = spectrumAnalysisMapper.getSampleId(input_file_name);
|
||||||
// ORIGINAL.GARDS_SAMPLE_AUX 表数据
|
// ORIGINAL.GARDS_SAMPLE_AUX 表数据
|
||||||
sampleAuxSpectrumService.saveSampleAuxGamma(phd, sampleId);
|
Integer saveSampleAuxGamma = sampleAuxSpectrumService.saveSampleAuxGamma(phd, sampleId);
|
||||||
|
if (saveSampleAuxGamma > 0) {
|
||||||
|
bRet = true;
|
||||||
|
} else {
|
||||||
|
bRet = false;
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
// ORIGINAL.gards_sample_description 数据表
|
// ORIGINAL.gards_sample_description 数据表
|
||||||
sampleDescriptionSpectrumService.saveSampleDescriptionGamma(phd, sampleId);
|
sampleDescriptionSpectrumService.saveSampleDescriptionGamma(phd, sampleId);
|
||||||
// ORIGINAL.GARDS_SAMPLE_CERT 和 ORIGINAL.GARDS_SAMPLE_CERT_LINE 数据表
|
// ORIGINAL.GARDS_SAMPLE_CERT 和 ORIGINAL.GARDS_SAMPLE_CERT_LINE 数据表
|
||||||
|
@ -4456,17 +4529,18 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
sampleCertLineSpectrumService.saveSampleCertLineGamma(phd, sampleId);
|
sampleCertLineSpectrumService.saveSampleCertLineGamma(phd, sampleId);
|
||||||
}
|
}
|
||||||
// gards_ calibration_pairs_orig数据表
|
// gards_ calibration_pairs_orig数据表
|
||||||
calibrationPairsOrigSpectrumService.saveCalibrationPairsOrigGamma(phd, sampleId);
|
Integer saveCalibrationPairsOrigGamma = calibrationPairsOrigSpectrumService.saveCalibrationPairsOrigGamma(phd, sampleId);
|
||||||
// gards_total_efficiency _pairs数据表(IDC没有)
|
// gards_total_efficiency _pairs数据表(IDC没有)
|
||||||
totalEfficiencyPairsSpectrumService.saveTotalEfficiencyPairsGamma(phd, sampleId);
|
Integer saveTotalEfficiencyPairsGamma = totalEfficiencyPairsSpectrumService.saveTotalEfficiencyPairsGamma(phd, sampleId);
|
||||||
// gards_spectrum数据表
|
// gards_spectrum数据表
|
||||||
spectrumService.saveSpectrumGamma(phd, sampleId, input_file_name);
|
Integer saveSpectrumGamma = spectrumService.saveSpectrumGamma(phd, sampleId, input_file_name);
|
||||||
// 根据文件名称获取sample基础数据信息
|
// 根据文件名称获取sample基础数据信息
|
||||||
GardsSampleDataSpectrum samplData = spectrumAnalysisMapper.findSampleByFilePath(input_file_name);
|
GardsSampleDataSpectrum samplData = spectrumAnalysisMapper.findSampleByFilePath(input_file_name);
|
||||||
if (Objects.nonNull(samplData)) {
|
if (Objects.nonNull(samplData)) {
|
||||||
phd.setId_sample(samplData.getSampleId().toString());
|
phd.setId_sample(samplData.getSampleId().toString());
|
||||||
phd.setStatus(samplData.getStatus());
|
phd.setStatus(samplData.getStatus());
|
||||||
}
|
}
|
||||||
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4523,6 +4597,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
// 换行
|
// 换行
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
// 文本内容第三块数据
|
// 文本内容第三块数据
|
||||||
|
if (CollectionUtils.isNotEmpty(phd.getVPeak())) {
|
||||||
List<List<String>> peakNuclides = phd.getVPeak().stream().map(item -> item.nuclides).collect(Collectors.toList());
|
List<List<String>> peakNuclides = phd.getVPeak().stream().map(item -> item.nuclides).collect(Collectors.toList());
|
||||||
List<String> nuclides = new LinkedList<>();
|
List<String> nuclides = new LinkedList<>();
|
||||||
for (int i = 0; i < peakNuclides.size(); i++) {
|
for (int i = 0; i < peakNuclides.size(); i++) {
|
||||||
|
@ -4537,6 +4612,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
strBuild.append(nuclideStr);
|
strBuild.append(nuclideStr);
|
||||||
// 换行
|
// 换行
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
|
}
|
||||||
// 换行
|
// 换行
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
// 文本内容第四块
|
// 文本内容第四块
|
||||||
|
@ -4569,6 +4645,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
// 文本内容第五块数据
|
// 文本内容第五块数据
|
||||||
Map<String, NuclideActMda> mapNucActMda = phd.getMapNucActMda();
|
Map<String, NuclideActMda> mapNucActMda = phd.getMapNucActMda();
|
||||||
|
if (CollectionUtils.isNotEmpty(mapNucActMda)) {
|
||||||
for (Map.Entry<String, NuclideActMda> entry : mapNucActMda.entrySet()) {
|
for (Map.Entry<String, NuclideActMda> entry : mapNucActMda.entrySet()) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
NuclideActMda nuc = entry.getValue();
|
NuclideActMda nuc = entry.getValue();
|
||||||
|
@ -4607,6 +4684,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
String detectorCode = phd.getHeader().getDetector_code();
|
String detectorCode = phd.getHeader().getDetector_code();
|
||||||
String date = phd.getAcq().getAcquisition_start_date().replace("/", "");
|
String date = phd.getAcq().getAcquisition_start_date().replace("/", "");
|
||||||
|
|
|
@ -3,7 +3,6 @@ package org.jeecg.modules.service.impl;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.ReUtil;
|
import cn.hutool.core.util.ReUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
@ -13,7 +12,6 @@ import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.net.ftp.FTP;
|
import org.apache.commons.net.ftp.FTP;
|
||||||
|
@ -35,7 +33,7 @@ import org.jeecg.modules.base.dto.ROIChannelsDto;
|
||||||
import org.jeecg.modules.base.dto.ROIResultsDto;
|
import org.jeecg.modules.base.dto.ROIResultsDto;
|
||||||
import org.jeecg.modules.base.dto.XeResultsDto;
|
import org.jeecg.modules.base.dto.XeResultsDto;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsDetectors;
|
import org.jeecg.modules.base.entity.configuration.GardsDetectors;
|
||||||
import org.jeecg.modules.base.entity.original.*;
|
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||||
import org.jeecg.modules.base.entity.rnman.*;
|
import org.jeecg.modules.base.entity.rnman.*;
|
||||||
import org.jeecg.modules.base.enums.*;
|
import org.jeecg.modules.base.enums.*;
|
||||||
import org.jeecg.modules.entity.*;
|
import org.jeecg.modules.entity.*;
|
||||||
|
@ -58,13 +56,10 @@ import javax.servlet.ServletOutputStream;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.sql.*;
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -393,6 +388,26 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
phdFileUtil.getLightColor(sampleMap,gasBgMap,detBgMap,qcMap);
|
phdFileUtil.getLightColor(sampleMap,gasBgMap,detBgMap,qcMap);
|
||||||
String sampleFileName = String.valueOf(sampleMap.get("fileName"));
|
String sampleFileName = String.valueOf(sampleMap.get("fileName"));
|
||||||
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
||||||
|
Map<String, Object> dataCache = cache.getIfPresent(sampleFileName + "-" + userName + "-data");
|
||||||
|
if (CollectionUtils.isNotEmpty(dataCache)) {
|
||||||
|
SpectrumData sample = (SpectrumData) dataCache.get("sample");
|
||||||
|
if (Objects.nonNull(sample)) {
|
||||||
|
sampleMap.put("spectrumData", sample);
|
||||||
|
}
|
||||||
|
SpectrumData gas = (SpectrumData) dataCache.get("gas");
|
||||||
|
if (Objects.nonNull(gas)) {
|
||||||
|
gasBgMap.put("spectrumData", gas);
|
||||||
|
}
|
||||||
|
SpectrumData det = (SpectrumData) dataCache.get("det");
|
||||||
|
if (Objects.nonNull(det)) {
|
||||||
|
detBgMap.put("spectrumData", det);
|
||||||
|
}
|
||||||
|
SpectrumData qc = (SpectrumData) dataCache.get("qc");
|
||||||
|
if (Objects.nonNull(qc)) {
|
||||||
|
qcMap.put("spectrumData", qc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Object> xeDataMap = cache.getIfPresent(sampleFileName + "-" + userName + "-xeData");
|
Map<String, Object> xeDataMap = cache.getIfPresent(sampleFileName + "-" + userName + "-xeData");
|
||||||
if (CollectionUtils.isNotEmpty(xeDataMap)) {
|
if (CollectionUtils.isNotEmpty(xeDataMap)) {
|
||||||
xeResultsSpectrumList = (List<GardsXeResultsSpectrum>) xeDataMap.get("XeData");
|
xeResultsSpectrumList = (List<GardsXeResultsSpectrum>) xeDataMap.get("XeData");
|
||||||
|
@ -429,9 +444,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
xeData.setColor("green");
|
xeData.setColor("green");
|
||||||
xeData.setNidFlag(1);
|
xeData.setNidFlag(1);
|
||||||
}
|
}
|
||||||
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
||||||
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
||||||
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resultMap.put("XeData", xeResultsSpectrumList);
|
resultMap.put("XeData", xeResultsSpectrumList);
|
||||||
|
@ -490,6 +505,25 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
phdFileUtil.getLightColor(sampleMap,gasBgMap,detBgMap,qcMap);
|
phdFileUtil.getLightColor(sampleMap,gasBgMap,detBgMap,qcMap);
|
||||||
//获取本地缓存信息
|
//获取本地缓存信息
|
||||||
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
||||||
|
Map<String, Object> dataCache = cache.getIfPresent(sampleFileName + "-" + userName + "-data");
|
||||||
|
if (CollectionUtils.isNotEmpty(dataCache)) {
|
||||||
|
SpectrumData sample = (SpectrumData) dataCache.get("sample");
|
||||||
|
if (Objects.nonNull(sample)) {
|
||||||
|
sampleMap.put("spectrumData", sample);
|
||||||
|
}
|
||||||
|
SpectrumData gas = (SpectrumData) dataCache.get("gas");
|
||||||
|
if (Objects.nonNull(gas)) {
|
||||||
|
gasBgMap.put("spectrumData", gas);
|
||||||
|
}
|
||||||
|
SpectrumData det = (SpectrumData) dataCache.get("det");
|
||||||
|
if (Objects.nonNull(det)) {
|
||||||
|
detBgMap.put("spectrumData", det);
|
||||||
|
}
|
||||||
|
SpectrumData qc = (SpectrumData) dataCache.get("qc");
|
||||||
|
if (Objects.nonNull(qc)) {
|
||||||
|
qcMap.put("spectrumData", qc);
|
||||||
|
}
|
||||||
|
}
|
||||||
//根据key获取缓存数据
|
//根据key获取缓存数据
|
||||||
Map<String, Object> xeDataMap = cache.getIfPresent(sampleFileName + "-" + userName + "-xeData");
|
Map<String, Object> xeDataMap = cache.getIfPresent(sampleFileName + "-" + userName + "-xeData");
|
||||||
//如果缓存数据存在 则将缓存数据取出使用
|
//如果缓存数据存在 则将缓存数据取出使用
|
||||||
|
@ -516,9 +550,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
xeData.setColor("green");
|
xeData.setColor("green");
|
||||||
xeData.setNidFlag(1);
|
xeData.setNidFlag(1);
|
||||||
}
|
}
|
||||||
xeData.setMdc(Double.valueOf(String.format("%.6f", xeData.getMdc())));
|
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
||||||
xeData.setConc(Double.valueOf(String.format("%.6f", xeData.getConc())));
|
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
||||||
xeData.setConcErr(Double.valueOf(String.format("%.6f", xeData.getConcErr())));
|
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(sampleBoundary)) {
|
if (CollectionUtils.isNotEmpty(sampleBoundary)) {
|
||||||
|
@ -562,6 +596,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
if (Objects.nonNull(inputStream)){
|
if (Objects.nonNull(inputStream)){
|
||||||
//声明一个临时文件
|
//声明一个临时文件
|
||||||
file = File.createTempFile("betaGamma", null);
|
file = File.createTempFile("betaGamma", null);
|
||||||
|
if (Objects.isNull(file)) {
|
||||||
|
throw new RuntimeException("ftp file can't find!");
|
||||||
|
}
|
||||||
//将ftp文件的输入流复制给临时文件
|
//将ftp文件的输入流复制给临时文件
|
||||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||||
map = phdFileUtil.getSourceData(file.getAbsolutePath(), sampleId, status);
|
map = phdFileUtil.getSourceData(file.getAbsolutePath(), sampleId, status);
|
||||||
|
@ -599,6 +636,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
betaCache.deleteBetaCache(analyseKey);
|
betaCache.deleteBetaCache(analyseKey);
|
||||||
String xeKey = sampleFileName + "-" + userName + "-xeData";
|
String xeKey = sampleFileName + "-" + userName + "-xeData";
|
||||||
betaCache.deleteBetaCache(xeKey);
|
betaCache.deleteBetaCache(xeKey);
|
||||||
|
String dataKey = sampleFileName + "-" + userName + "-data";
|
||||||
|
betaCache.deleteBetaCache(dataKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3082,9 +3121,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
xeData.setColor("green");
|
xeData.setColor("green");
|
||||||
xeData.setNidFlag(1);
|
xeData.setNidFlag(1);
|
||||||
}
|
}
|
||||||
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
||||||
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
||||||
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
map.put("xeData", analyseResult);
|
map.put("xeData", analyseResult);
|
||||||
|
@ -3110,14 +3149,14 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
xeData.setColor("green");
|
xeData.setColor("green");
|
||||||
xeData.setNidFlag(1);
|
xeData.setNidFlag(1);
|
||||||
}
|
}
|
||||||
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
||||||
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
||||||
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
map.put("XeData", analyseResult);
|
|
||||||
map.put("bProcessed", true);
|
map.put("bProcessed", true);
|
||||||
map.put("savedAnalysisResult", true);
|
map.put("savedAnalysisResult", true);
|
||||||
|
}
|
||||||
|
map.put("XeData", analyseResult);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(map);
|
result.setResult(map);
|
||||||
}
|
}
|
||||||
|
@ -3191,14 +3230,14 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
xeData.setColor("green");
|
xeData.setColor("green");
|
||||||
xeData.setNidFlag(1);
|
xeData.setNidFlag(1);
|
||||||
}
|
}
|
||||||
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
||||||
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
||||||
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
map.put("XeData", analyseResultList);
|
|
||||||
map.put("bProcessed", true);
|
map.put("bProcessed", true);
|
||||||
map.put("savedAnalysisResult", true);
|
map.put("savedAnalysisResult", true);
|
||||||
|
}
|
||||||
|
map.put("XeData", analyseResultList);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(map);
|
result.setResult(map);
|
||||||
}
|
}
|
||||||
|
@ -3323,8 +3362,12 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
gasTmp = phdFileUtil.analyzeFile(gasFilePath, gasFileName);
|
gasTmp = phdFileUtil.analyzeFile(gasFilePath, gasFileName);
|
||||||
//获取det文件
|
//获取det文件
|
||||||
detTmp = phdFileUtil.analyzeFile(detFilePath, detFileName);
|
detTmp = phdFileUtil.analyzeFile(detFilePath, detFileName);
|
||||||
|
if (Objects.nonNull(sampleTmp) && Objects.nonNull(gasTmp) && Objects.nonNull(detTmp)) {
|
||||||
//调用重新分析算法 获取算法结果
|
//调用重新分析算法 获取算法结果
|
||||||
BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara);
|
BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara);
|
||||||
|
if (StringUtils.isNotBlank(analyseResult.error_log) && !analyseResult.error_log.equalsIgnoreCase("no error.")) {
|
||||||
|
return Collections.EMPTY_LIST;
|
||||||
|
} else {
|
||||||
//生成分析操作日志
|
//生成分析操作日志
|
||||||
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
||||||
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
||||||
|
@ -3416,6 +3459,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
cache.put(sampleFileName + "-" + userName + "-reAnalyseParam", map);
|
cache.put(sampleFileName + "-" + userName + "-reAnalyseParam", map);
|
||||||
cache.put(sampleFileName + "-" + userName + "-xeData", xeMap);
|
cache.put(sampleFileName + "-" + userName + "-xeData", xeMap);
|
||||||
betaCache.setBetaCache(cache);
|
betaCache.setBetaCache(cache);
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -3539,7 +3584,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
sampleTmp = phdFileUtil.analyzeFile(sampleFilePath, sampleFileName);
|
sampleTmp = phdFileUtil.analyzeFile(sampleFilePath, sampleFileName);
|
||||||
gasTmp = phdFileUtil.analyzeFile(gasFilePath, gasFileName);
|
gasTmp = phdFileUtil.analyzeFile(gasFilePath, gasFileName);
|
||||||
detTmp = phdFileUtil.analyzeFile(detFilePath, detFileName);
|
detTmp = phdFileUtil.analyzeFile(detFilePath, detFileName);
|
||||||
|
if (Objects.nonNull(sampleTmp) && Objects.nonNull(gasTmp) && Objects.nonNull(detTmp)) {
|
||||||
BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara);
|
BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara);
|
||||||
|
if (StringUtils.isNotBlank(analyseResult.error_log) && !analyseResult.error_log.equalsIgnoreCase("no error.")) {
|
||||||
|
analyseResultMap.put(sampleFileName, Collections.EMPTY_LIST);
|
||||||
|
} else {
|
||||||
//生成分析操作日志
|
//生成分析操作日志
|
||||||
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
||||||
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
||||||
|
@ -3634,6 +3683,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
betaCache.setBetaCache(cache);
|
betaCache.setBetaCache(cache);
|
||||||
analyseResultMap.put(sampleFileName, xeResultsSpectrumList);
|
analyseResultMap.put(sampleFileName, xeResultsSpectrumList);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -3732,7 +3783,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
BgCalPara = (BgCalibratePara) reAnalyseParam.get("reAnalyseParam");
|
BgCalPara = (BgCalibratePara) reAnalyseParam.get("reAnalyseParam");
|
||||||
}
|
}
|
||||||
//调用分析方法
|
//调用分析方法
|
||||||
phdFileUtil.analyzeSpectrum(sampleTmp, gasTmp, detTmp, BgCalPara, map);
|
boolean bRet = phdFileUtil.analyzeSpectrum(sampleTmp, gasTmp, detTmp, BgCalPara, map);
|
||||||
|
if (bRet) {
|
||||||
//分析qc文件信息并重新计算qc边界值
|
//分析qc文件信息并重新计算qc边界值
|
||||||
if (StringUtils.isNotBlank(qcPath)) {
|
if (StringUtils.isNotBlank(qcPath)) {
|
||||||
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(qcPath, qcFileName);
|
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(qcPath, qcFileName);
|
||||||
|
@ -3756,9 +3808,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
xeData.setColor("green");
|
xeData.setColor("green");
|
||||||
xeData.setNidFlag(1);
|
xeData.setNidFlag(1);
|
||||||
}
|
}
|
||||||
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
||||||
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
||||||
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//更新分析后的缓存信息
|
//更新分析后的缓存信息
|
||||||
|
@ -3767,6 +3819,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
map.put("bProcessed", true);
|
map.put("bProcessed", true);
|
||||||
map.put("savedAnalysisResult", true);
|
map.put("savedAnalysisResult", true);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
map.clear();
|
||||||
|
map.put("XeData", Collections.EMPTY_LIST);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -3876,8 +3932,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
if (CollectionUtils.isNotEmpty(reAnalyseParam)) {
|
if (CollectionUtils.isNotEmpty(reAnalyseParam)) {
|
||||||
BgCalPara = (BgCalibratePara) reAnalyseParam.get("reAnalyseParam");
|
BgCalPara = (BgCalibratePara) reAnalyseParam.get("reAnalyseParam");
|
||||||
}
|
}
|
||||||
|
if(Objects.nonNull(sampleTmp) && Objects.nonNull(gasTmp) && Objects.nonNull(detTmp)) {
|
||||||
//调用分析方法
|
//调用分析方法
|
||||||
phdFileUtil.analyzeSpectrum(sampleTmp, gasTmp, detTmp, BgCalPara, map);
|
boolean bRet = phdFileUtil.analyzeSpectrum(sampleTmp, gasTmp, detTmp, BgCalPara, map);
|
||||||
|
if (bRet) {
|
||||||
//分析qc文件信息并重新计算qc边界值
|
//分析qc文件信息并重新计算qc边界值
|
||||||
if (StringUtils.isNotBlank(qcPath)) {
|
if (StringUtils.isNotBlank(qcPath)) {
|
||||||
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(qcPath, qcFileName);
|
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(qcPath, qcFileName);
|
||||||
|
@ -3900,9 +3958,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
xeData.setColor("green");
|
xeData.setColor("green");
|
||||||
xeData.setNidFlag(1);
|
xeData.setNidFlag(1);
|
||||||
}
|
}
|
||||||
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getMdc()).substring(0, String.valueOf(xeData.getMdc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc())));
|
||||||
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(xeData.getConc()).substring(0, String.valueOf(xeData.getConc()).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc())));
|
||||||
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(xeData.getConcErr()).substring(0, String.valueOf(xeData.getConcErr()).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//更新分析后的缓存信息
|
//更新分析后的缓存信息
|
||||||
|
@ -3911,6 +3969,12 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
map.put("bProcessed", true);
|
map.put("bProcessed", true);
|
||||||
map.put("savedAnalysisResult", true);
|
map.put("savedAnalysisResult", true);
|
||||||
mapList.put(sampleFileName, map);
|
mapList.put(sampleFileName, map);
|
||||||
|
} else {
|
||||||
|
map.clear();
|
||||||
|
map.put("XeData", Collections.EMPTY_LIST);
|
||||||
|
mapList.put(sampleFileName, map);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -4018,8 +4082,18 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
@Transactional
|
@Transactional
|
||||||
public Result saveToDB(BgDataAnlyseResultIn anlyseResultIn, HttpServletRequest request) {
|
public Result saveToDB(BgDataAnlyseResultIn anlyseResultIn, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
//根据请求体获取用户名
|
//根据请求体获取用户名
|
||||||
String userName = JwtUtil.getUserNameByToken(request);
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
|
Integer sampleId = null;
|
||||||
|
Integer gasId = null;
|
||||||
|
Integer detId = null;
|
||||||
|
Integer qcId = null;
|
||||||
|
//判断保存分析结果标识
|
||||||
|
if (!anlyseResultIn.isSavedAnalysisResult()) {
|
||||||
|
result.error500("Please first Analyse File!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
//用户名赋值到 分析员
|
//用户名赋值到 分析员
|
||||||
anlyseResultIn.setUserName(userName);
|
anlyseResultIn.setUserName(userName);
|
||||||
//从本地缓存获取beta gamma的数组
|
//从本地缓存获取beta gamma的数组
|
||||||
|
@ -4074,19 +4148,19 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
String beginDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
|
String beginDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||||
//获取当前时间作为人工分析结束时间
|
//获取当前时间作为人工分析结束时间
|
||||||
String endDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
|
String endDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||||
//判断当前分析员是否有过排班任务
|
//根据台站名称获取台站id
|
||||||
Integer stationId = spectrumAnalysisMapper.getStationId(anlyseResultIn.getStationName());
|
Integer stationId = spectrumAnalysisMapper.getStationId(anlyseResultIn.getStationName());
|
||||||
//判断当前分析员是否有过当前台站的排班任务
|
//判断当前分析员当天是否有对应台站的排班任务
|
||||||
boolean bAnalysisResultWriteAuthority = userTaskUtil.CheckUserWriteAuthorityForStation(anlyseResultIn.getUserName(), stationId);
|
List<String> userStation = userTaskUtil.findUserStation(userName);
|
||||||
if ( !bAnalysisResultWriteAuthority ){
|
boolean bAnalysisResultWriteAuthority = false;
|
||||||
result.error500("This user has no right to store the results of the analysis to the database.");
|
if (userStation.contains(String.valueOf(stationId))) {
|
||||||
return result;
|
bAnalysisResultWriteAuthority = true;
|
||||||
}
|
}
|
||||||
//获取ROI Limit数据
|
//获取ROI Limit数据
|
||||||
// getROILimit(anlyseResultIn);
|
// getROILimit(anlyseResultIn);
|
||||||
//根据sample文件名称模糊查询sampleId
|
//根据sample文件名称模糊查询sampleId
|
||||||
if (StringUtils.isNotBlank(anlyseResultIn.getDbName())) {
|
if (StringUtils.isNotBlank(anlyseResultIn.getDbName())) {
|
||||||
Integer sampleId = spectrumAnalysisMapper.getSampleIdLikeFileName(anlyseResultIn.getSampleFileName());
|
sampleId = spectrumAnalysisMapper.getSampleIdLikeFileName(anlyseResultIn.getSampleFileName());
|
||||||
Integer analysisID = null;
|
Integer analysisID = null;
|
||||||
if (anlyseResultIn.getDbName().equals("auto")) {
|
if (anlyseResultIn.getDbName().equals("auto")) {
|
||||||
anlyseResultIn.setDbName("RNAUTO");
|
anlyseResultIn.setDbName("RNAUTO");
|
||||||
|
@ -4120,16 +4194,22 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
anlyseResultIn.setDetFilePath(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName);
|
anlyseResultIn.setDetFilePath(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName);
|
||||||
anlyseResultIn.setQcFilePath(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName);
|
anlyseResultIn.setQcFilePath(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//处理数据 获取对应的channel/energy值
|
|
||||||
getChannelAndEnergy(anlyseResultIn, betaList, gammaList);
|
|
||||||
//分析文件内容
|
|
||||||
analyzePHDFile(anlyseResultIn, BgCalPara, betaFittingPara, gammaFittingPara);
|
|
||||||
//处理文件名称
|
//处理文件名称
|
||||||
String sampleFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
String sampleFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||||
String gasFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
String gasFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
||||||
String detFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName());
|
String detFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName());
|
||||||
String qcFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getQcFilePath(), anlyseResultIn.getQcFileName());
|
String qcFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getQcFilePath(), anlyseResultIn.getQcFileName());
|
||||||
|
//判断当前分析员是否有过历史分析当前文件
|
||||||
|
Integer isExist = spectrumAnalysisMapper.SampleIsExist(sampleFilePathName, anlyseResultIn.getUserName());
|
||||||
|
//如果当前分析员在当天没有排班任务 并且 没有历史分析过当前文件 则不允许进行保存操作
|
||||||
|
if ( !bAnalysisResultWriteAuthority && Objects.isNull(isExist) ){
|
||||||
|
result.error500("You have no permission to save results to DB!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//处理数据 获取对应的channel/energy值
|
||||||
|
getChannelAndEnergy(anlyseResultIn, betaList, gammaList);
|
||||||
|
//分析文件内容
|
||||||
|
analyzePHDFile(anlyseResultIn, BgCalPara, betaFittingPara, gammaFittingPara);
|
||||||
//判断文件是否存储过 如果没有则解析文件并进行存储
|
//判断文件是否存储过 如果没有则解析文件并进行存储
|
||||||
if ( !OriginalDataStore(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName(), gasFilePathName, anlyseResultIn.getUserName()) ){
|
if ( !OriginalDataStore(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName(), gasFilePathName, anlyseResultIn.getUserName()) ){
|
||||||
result.error500("gasFile save failed");
|
result.error500("gasFile save failed");
|
||||||
|
@ -4144,17 +4224,16 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
result.error500("qcFile save failed");
|
result.error500("qcFile save failed");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
qcId = spectrumAnalysisMapper.getSampleId(qcFilePathName);
|
||||||
}
|
}
|
||||||
if ( !OriginalDataStore(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName(), sampleFilePathName, anlyseResultIn.getUserName()) ){
|
if ( !OriginalDataStore(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName(), sampleFilePathName, anlyseResultIn.getUserName()) ){
|
||||||
result.error500("sampleFile save failed");
|
result.error500("sampleFile save failed");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//判断当前分析员是否有过历史分析当前文件
|
|
||||||
Integer isExist = spectrumAnalysisMapper.SampleIsExist(sampleFilePathName, anlyseResultIn.getUserName());
|
|
||||||
//根据文件名称查询对应的sampleId--- sampleFile gasFile detFile
|
//根据文件名称查询对应的sampleId--- sampleFile gasFile detFile
|
||||||
Integer sampleId = spectrumAnalysisMapper.getSampleId(sampleFilePathName);
|
sampleId = spectrumAnalysisMapper.getSampleId(sampleFilePathName);
|
||||||
Integer gasId = spectrumAnalysisMapper.getSampleId(gasFilePathName);
|
gasId = spectrumAnalysisMapper.getSampleId(gasFilePathName);
|
||||||
Integer detId = spectrumAnalysisMapper.getSampleId(detFilePathName);
|
detId = spectrumAnalysisMapper.getSampleId(detFilePathName);
|
||||||
//如果分析过就修改原记录--GARDS_ANALYSES
|
//如果分析过就修改原记录--GARDS_ANALYSES
|
||||||
GardsAnalysesSpectrum gardsAnalyses = new GardsAnalysesSpectrum();
|
GardsAnalysesSpectrum gardsAnalyses = new GardsAnalysesSpectrum();
|
||||||
gardsAnalyses.setSampleId(sampleId);
|
gardsAnalyses.setSampleId(sampleId);
|
||||||
|
@ -4263,13 +4342,16 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
File sampleTmp = null;
|
File sampleTmp = null;
|
||||||
File gasTmp = null;
|
File gasTmp = null;
|
||||||
File detTmp = null;
|
File detTmp = null;
|
||||||
|
File qcTmp = null;
|
||||||
try {
|
try {
|
||||||
sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||||
gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
||||||
detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName());
|
detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName());
|
||||||
ftpUtil.saveFile(StringPool.SLASH + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + sampleFilePathName.substring(0, sampleFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getSampleFileName(), new FileInputStream(sampleTmp));
|
qcTmp = phdFileUtil.analyzeFile(anlyseResultIn.getQcFilePath(), anlyseResultIn.getQcFileName());
|
||||||
ftpUtil.saveFile(StringPool.SLASH + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + gasFilePathName.substring(0, gasFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getGasFileName(), new FileInputStream(gasTmp));
|
ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + sampleFilePathName.substring(0, sampleFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getSampleFileName(), new FileInputStream(sampleTmp));
|
||||||
ftpUtil.saveFile(StringPool.SLASH + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + detFilePathName.substring(0, detFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getDetFileName(), new FileInputStream(detTmp));
|
ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + gasFilePathName.substring(0, gasFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getGasFileName(), new FileInputStream(gasTmp));
|
||||||
|
ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + detFilePathName.substring(0, detFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getDetFileName(), new FileInputStream(detTmp));
|
||||||
|
ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + qcFilePathName.substring(0, qcFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getQcFileName(), new FileInputStream(qcTmp));
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -4277,7 +4359,26 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
gasTmp.delete();
|
gasTmp.delete();
|
||||||
detTmp.delete();
|
detTmp.delete();
|
||||||
}
|
}
|
||||||
|
if (Objects.nonNull(sampleId)) {
|
||||||
|
SpectrumData sampleData = getSpectrumData(sampleId);
|
||||||
|
map.put("sample", sampleData);
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(gasId)) {
|
||||||
|
SpectrumData gasData = getSpectrumData(gasId);
|
||||||
|
map.put("gas", gasData);
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(detId)) {
|
||||||
|
SpectrumData detData = getSpectrumData(detId);
|
||||||
|
map.put("det", detData);
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(qcId)) {
|
||||||
|
SpectrumData qcData = getSpectrumData(qcId);
|
||||||
|
map.put("qc", qcData);
|
||||||
|
}
|
||||||
|
cache.put(anlyseResultIn.getSampleFileName()+"-"+userName+"-data", map);
|
||||||
|
betaCache.setBetaCache(cache);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
|
result.setResult(map);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5782,4 +5883,81 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
return roiResultsList;
|
return roiResultsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SpectrumData getSpectrumData(Integer sampleId) {
|
||||||
|
//根据 sampleId获取sampleData的数据内容
|
||||||
|
GardsSampleDataSpectrum sampleData = spectrumAnalysisMapper.getSampleData(sampleId);
|
||||||
|
//获取文件存储路径
|
||||||
|
String inputFileName = sampleData.getInputFileName();
|
||||||
|
//拼接完整的ftp路径
|
||||||
|
String filePath = StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + inputFileName;
|
||||||
|
File file = ftpUtil.downloadFile(filePath, "betaGamma");
|
||||||
|
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||||
|
SpectrumData spectrumData = new SpectrumData();
|
||||||
|
try {
|
||||||
|
//封装散点图下的基础数据信息
|
||||||
|
//Station Code
|
||||||
|
String stationCode = struct.site_code;
|
||||||
|
//Detector Code
|
||||||
|
String detectorCode = struct.detector_code;
|
||||||
|
//Data Type
|
||||||
|
String dataType = struct.data_type;
|
||||||
|
//Collection Start
|
||||||
|
Date CollectionStart = null;
|
||||||
|
if ( StringUtils.isNotBlank(struct.collection_start_date) && StringUtils.isNotBlank(struct.collection_start_time) ){
|
||||||
|
CollectionStart = DateUtils.parseDate(struct.collection_start_date + StringPool.SPACE + struct.collection_start_time);
|
||||||
|
}
|
||||||
|
//Collection Stop
|
||||||
|
Date CollectionStop = null;
|
||||||
|
if ( StringUtils.isNotBlank(struct.collection_stop_date) && StringUtils.isNotBlank(struct.collection_stop_time) ){
|
||||||
|
CollectionStop = DateUtils.parseDate(struct.collection_stop_date + StringPool.SPACE + struct.collection_stop_time);
|
||||||
|
}
|
||||||
|
//Collection Time
|
||||||
|
String CollectionTime = "";
|
||||||
|
if ( Objects.nonNull(CollectionStart) && Objects.nonNull(CollectionStop) ){
|
||||||
|
CollectionTime = String.format ("%.2f",Double.valueOf(CollectionStop.getTime()/1000 - CollectionStart.getTime()/ 1000));
|
||||||
|
}
|
||||||
|
//Acquisition Start
|
||||||
|
Date AcquisitionStart = null;
|
||||||
|
if ( StringUtils.isNotBlank(struct.collection_start_date) && StringUtils.isNotBlank(struct.collection_start_time) ){
|
||||||
|
AcquisitionStart = DateUtils.parseDate(struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time);
|
||||||
|
}
|
||||||
|
//Acq Real Time
|
||||||
|
double AcquisitionRealTime = struct.acquisition_real_time;
|
||||||
|
//Acq live Time
|
||||||
|
double AcquisitionLiveTime = struct.acquisition_live_time;
|
||||||
|
//Air Volume[m3]
|
||||||
|
double airVolume = struct.air_volume;
|
||||||
|
//Xe Volume[m3]
|
||||||
|
double xeVolume = struct.sample_volume_of_Xe;
|
||||||
|
//xeCollectionYield
|
||||||
|
double xeCollectionYield = struct.Xe_collection_yield;
|
||||||
|
//gasBkMeasurementId
|
||||||
|
String gasBkMeasurementId = struct.gas_bk_measurement_id;
|
||||||
|
//detectorBkMeasurementId
|
||||||
|
String detectorBkMeasurementId = struct.detector_bk_measurement_id;
|
||||||
|
//measurementId
|
||||||
|
String measurementId = struct.measurement_id;
|
||||||
|
spectrumData.setSampleId(sampleId);
|
||||||
|
spectrumData.setStatus(sampleData.getStatus());
|
||||||
|
spectrumData.setStationCode(stationCode);
|
||||||
|
spectrumData.setDetectorCode(detectorCode);
|
||||||
|
spectrumData.setDataType(dataType);
|
||||||
|
spectrumData.setCollectionStart(CollectionStart);
|
||||||
|
spectrumData.setCollectionStop(CollectionStop);
|
||||||
|
spectrumData.setCollectionTime(CollectionTime);
|
||||||
|
spectrumData.setAcquisitionStart(AcquisitionStart);
|
||||||
|
spectrumData.setAcquisitionRealTime(AcquisitionRealTime);
|
||||||
|
spectrumData.setAcquisitionLiveTime(AcquisitionLiveTime);
|
||||||
|
spectrumData.setAirVolume(airVolume);
|
||||||
|
spectrumData.setXeVolume(xeVolume);
|
||||||
|
spectrumData.setYield(xeCollectionYield);
|
||||||
|
spectrumData.setGasBkMeasurementId(gasBkMeasurementId);
|
||||||
|
spectrumData.setDetectorBkMeasurementId(detectorBkMeasurementId);
|
||||||
|
spectrumData.setMeasurementId(measurementId);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return spectrumData;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user