fix: 核素分析规则 解决识别多个核素报错问题
This commit is contained in:
parent
3761c0deba
commit
14c1ee3468
|
@ -132,14 +132,12 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
Set<String> names = nuclides.keySet();
|
||||
List<String> follow = ListUtil.toList(nuclidesStr.split(COMMA));
|
||||
// 因数据库 Xe核素名称 M大小写不统一,先统一大小写再进行比较
|
||||
Collection<String> followLower = follow.stream().map(String::toLowerCase).collect(Collectors.toList());
|
||||
Collection<String> namesLower = names.stream().map(String::toLowerCase).collect(Collectors.toList());
|
||||
Collection<String> follows = follow.stream().map(f->f.replace("M", "m")).collect(Collectors.toList());
|
||||
// 推送过来的核素集合与所关注核素集合取交集
|
||||
Collection<String> cross = CollectionUtil.intersection(namesLower, followLower);
|
||||
Collection<String> crossNew = cross.stream().map(f->f.replace("x", "X")).collect(Collectors.toList());
|
||||
Collection<String> cross = CollectionUtil.intersection(names, follows);
|
||||
if (CollUtil.isEmpty(cross)) continue;
|
||||
Map<String, String> nuclidesCross = nuclides.entrySet().stream()
|
||||
.filter(entry -> crossNew.contains(entry.getKey()))
|
||||
.filter(entry -> cross.contains(entry.getKey()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
// 开始对交集中的核素进行条件判断
|
||||
info.setRuleId(rule.getId());
|
||||
|
@ -221,6 +219,8 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
if (ObjectUtil.isNotNull(sampleType))
|
||||
logInfo.setSampleType(sampleType.getValue());
|
||||
logInfo.setAlarmInfo(messageDTO.getContent());
|
||||
if (CollUtil.isNotEmpty(moreThanAvg))
|
||||
logInfo.setNuclideInfoList(moreThanAvg);
|
||||
if (CollUtil.isNotEmpty(moreThanAvg))
|
||||
logInfo.setNuclideInfoList(moreThanAvg);
|
||||
logService.saveLog(logInfo);
|
||||
|
@ -239,6 +239,9 @@ public class AnalysisConsumer implements StreamListener<String, ObjectRecord<Str
|
|||
判断核素是否存在的条件: 该核素的Conc值是否大于MDC值
|
||||
*/
|
||||
String detectorId = systemClient.getDetectorId(sampleId);
|
||||
if (StrUtil.isBlank(detectorId)) {
|
||||
throw new RuntimeException("detectorId is null or empty");
|
||||
}
|
||||
return analysisResultService.nuclideFirst(betaOrGamma, dataSourceType, stationId,
|
||||
detectorId, sampleId, nuclideNames);
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ public class AlarmAnalysisRuleServiceImpl extends ServiceImpl<AlarmAnalysisRuleM
|
|||
String original = getById(id).getName();
|
||||
if (null != alarmAnalysisRule.getIdentifyNuclides() && !alarmAnalysisRule.getConditions().contains("4")) {
|
||||
alarmAnalysisRule.setConditions(alarmAnalysisRule.getConditions() + ",4");
|
||||
} else if(null == alarmAnalysisRule.getIdentifyNuclides() && !alarmAnalysisRule.getConditions().contains("4")) {
|
||||
} else if(null == alarmAnalysisRule.getIdentifyNuclides() && alarmAnalysisRule.getConditions().contains("4")) {
|
||||
alarmAnalysisRule.setConditions(alarmAnalysisRule.getConditions().replace("4", ""));
|
||||
}
|
||||
if (!StrUtil.equalsIgnoreCase(name,original)){
|
||||
|
|
Loading…
Reference in New Issue
Block a user