fix:解决能谱文件名称中没有full或者repl的情况下 不能正确识别能谱问题

This commit is contained in:
xiaoguangbin 2023-10-12 14:24:46 +08:00
parent 27c0fdd629
commit a807f410c3

View File

@ -219,7 +219,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
List<Map<String, Object>> resultList = new LinkedList<>(); List<Map<String, Object>> resultList = new LinkedList<>();
String userName = JwtUtil.getUserNameByToken(request); String userName = JwtUtil.getUserNameByToken(request);
String filePath = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH +userName; String filePath = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH +userName;
String sampleRx = "[a-zA-Z]{3}[0-9]{2}_[0-9]{3}-[0-9]{8}_[0-9]{4}_S_(FULL_|PREL_)\\d+\\.PHD"; String sampleRx = "[a-zA-Z]{3}[0-9]{2}_[0-9]{3}-[0-9]{8}_[0-9]{4}_S.*.PHD";
Pattern regexPattern = Pattern.compile(sampleRx); Pattern regexPattern = Pattern.compile(sampleRx);
String sampleRx1 = "[a-zA-Z]{3}[0-9]{2}_[0-9]{3}-[0-9]{8}_[0-9]{4}_S_(FULL_|PREL_)\\d+\\.\\d+\\.PHD"; String sampleRx1 = "[a-zA-Z]{3}[0-9]{2}_[0-9]{3}-[0-9]{8}_[0-9]{4}_S_(FULL_|PREL_)\\d+\\.\\d+\\.PHD";
Pattern regexPattern1 = Pattern.compile(sampleRx1); Pattern regexPattern1 = Pattern.compile(sampleRx1);
@ -234,7 +234,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
for (String matchFileName :matchFileNames) { for (String matchFileName :matchFileNames) {
Map<String, Object> map =new HashMap<>(); Map<String, Object> map =new HashMap<>();
//判断sample文件名称是否匹配正则表达式 如果满足 则查询出对应的文件信息 //判断sample文件名称是否匹配正则表达式 如果满足 则查询出对应的文件信息
if ( regexPattern.matcher(matchFileName).find() || regexPattern1.matcher(matchFileName).find() ){ if ( regexPattern.matcher(matchFileName).find()){
//查询sampleFile文件内容信息 获取文件内容 获取大致的gas det文件名称 //查询sampleFile文件内容信息 获取文件内容 获取大致的gas det文件名称
Map<String, String> fileData = phdFileUtil.getFileData(filePath, matchFileName); Map<String, String> fileData = phdFileUtil.getFileData(filePath, matchFileName);
if (CollectionUtils.isEmpty(fileData)) { if (CollectionUtils.isEmpty(fileData)) {