gamma读取baseline,lc,scac数据nan赋值null

beta提示语句中文切换为英文
This commit is contained in:
qiaoqinzheng 2023-11-08 08:48:04 +08:00
parent e087e80196
commit f865b1045e
3 changed files with 26 additions and 29 deletions

View File

@ -345,7 +345,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
} else if (StringUtils.isNotBlank(strList.get(k)) && strList.get(k).equalsIgnoreCase("nan")) { } else if (StringUtils.isNotBlank(strList.get(k)) && strList.get(k).equalsIgnoreCase("nan")) {
//如果数据不为空 数据匹配任意大小写的nan //如果数据不为空 数据匹配任意大小写的nan
//结果数组中补充0.0 //结果数组中补充0.0
vData.add(0.0); vData.add(null);
} }
} }
} }
@ -386,8 +386,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
data.add(d); data.add(d);
} else if (StringUtils.isNotBlank(str) && str.equalsIgnoreCase("nan")) { } else if (StringUtils.isNotBlank(str) && str.equalsIgnoreCase("nan")) {
//如果当前数据不为空 数据匹配任意大小写的nan //如果当前数据不为空 数据匹配任意大小写的nan
//将0.0填充到 double中 data.add(null);
data.add(0.0);
} }
} }
} }

View File

@ -138,8 +138,6 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
private IGardsQcCheckSpectrumService qcCheckSpectrumService; private IGardsQcCheckSpectrumService qcCheckSpectrumService;
@Autowired @Autowired
private IGardsAnalySettingSpectrumService analySettingSpectrumService; private IGardsAnalySettingSpectrumService analySettingSpectrumService;
@Autowired
private FTPClient ftpClient;
@Override @Override
public Result initValue(Integer sampleId, String dbName, String samfileName, HttpServletRequest request) { public Result initValue(Integer sampleId, String dbName, String samfileName, HttpServletRequest request) {
@ -3685,6 +3683,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH)); String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH) + 1) + ".txt"; String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH) + 1) + ".txt";
// 连接ftp // 连接ftp
FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)) { if (Objects.isNull(ftpClient)) {
throw new RuntimeException("ftp connection failed"); throw new RuntimeException("ftp connection failed");
} }
@ -3712,15 +3711,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
throw new RuntimeException(e); throw new RuntimeException(e);
} finally { } finally {
try { try {
// if (Objects.nonNull(ftpClient)) { if (Objects.nonNull(ftpClient)) {
// ftpClient.disconnect(); ftpClient.disconnect();
// } }
if (ObjectUtil.isNotNull(inputStream)) { if (ObjectUtil.isNotNull(inputStream)) {
inputStream.close(); inputStream.close();
} }
if (ObjectUtil.isNotNull(outputStream)) { if (ObjectUtil.isNotNull(outputStream)) {
outputStream.close(); outputStream.close();
ftpClient.completePendingCommand();
} }
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -3735,7 +3733,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH)); String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH) + 1) + ".txt"; String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH) + 1) + ".txt";
// 连接ftp // 连接ftp
FTPClient ftpClient = null; FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)) { if (Objects.isNull(ftpClient)) {
throw new RuntimeException("ftp connection failed"); throw new RuntimeException("ftp connection failed");
} }
@ -3767,15 +3765,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
throw new RuntimeException(e); throw new RuntimeException(e);
} finally { } finally {
try { try {
// if (Objects.nonNull(ftpClient)) { if (Objects.nonNull(ftpClient)) {
// ftpClient.disconnect(); ftpClient.disconnect();
// } }
if (ObjectUtil.isNotNull(inputStream)) { if (ObjectUtil.isNotNull(inputStream)) {
inputStream.close(); inputStream.close();
} }
if (ObjectUtil.isNotNull(outputStream)) { if (ObjectUtil.isNotNull(outputStream)) {
outputStream.close(); outputStream.close();
ftpClient.completePendingCommand();
} }
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -4274,6 +4271,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath.substring(0, logPath.lastIndexOf(StringPool.SLASH)); String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath.substring(0, logPath.lastIndexOf(StringPool.SLASH));
String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1); String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1);
// 连接ftp // 连接ftp
FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)) { if (Objects.isNull(ftpClient)) {
throw new RuntimeException("ftp connection failed"); throw new RuntimeException("ftp connection failed");
} }

View File

@ -688,7 +688,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
EnergySpectrumStruct struct = betaDataFile.getSampleStruct(); EnergySpectrumStruct struct = betaDataFile.getSampleStruct();
@ -759,7 +759,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(rrrLogInfo.getSampleFileName() + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(rrrLogInfo.getSampleFileName() + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
GardsCalibrationSpectrum gammaCalibrationParamS = new GardsCalibrationSpectrum(); GardsCalibrationSpectrum gammaCalibrationParamS = new GardsCalibrationSpectrum();
@ -1224,7 +1224,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
Map<String, List<String>> map = new HashMap<>(); Map<String, List<String>> map = new HashMap<>();
@ -1258,7 +1258,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
if (StringUtils.isNotBlank(betaDataFile.getSampleFilePathName())){ if (StringUtils.isNotBlank(betaDataFile.getSampleFilePathName())){
@ -1348,7 +1348,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
QCResult qcResult = new QCResult(); QCResult qcResult = new QCResult();
@ -1481,7 +1481,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
List<GardsXeResultsSpectrum> xeDataList = betaDataFile.getXeResultsSpectrumList(); List<GardsXeResultsSpectrum> xeDataList = betaDataFile.getXeResultsSpectrumList();
@ -1549,7 +1549,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
//获取qc的分析结果数据 //获取qc的分析结果数据
@ -1654,7 +1654,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
//判断qc的分析结果是否为空 //判断qc的分析结果是否为空
@ -1762,7 +1762,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
//读取文件信息 //读取文件信息
@ -1849,7 +1849,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(extInfo.getSampleFileName() + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(extInfo.getSampleFileName() + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
//获取sample文件的文件读取信息 //获取sample文件的文件读取信息
@ -2117,7 +2117,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
//读取文件信息 //读取文件信息
@ -2470,7 +2470,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
@ -2618,7 +2618,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
//选择矩形框高度 //选择矩形框高度
@ -2668,7 +2668,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
String sampleFileName = analyseData.getSampleFileNames().get(0); String sampleFileName = analyseData.getSampleFileNames().get(0);
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
map = BetaGammaAnalyzeCurrentProcess(analyseData, betaDataFile); map = BetaGammaAnalyzeCurrentProcess(analyseData, betaDataFile);
@ -3231,7 +3231,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
Cache<String, BetaDataFile> cache = betaCache.getBetaCache(); Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.isNull(betaDataFile)) { if (Objects.isNull(betaDataFile)) {
result.error500("请先加载文件基础信息!"); result.error500("Load basic file information first!");
return result; return result;
} }
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();