fix:null bug
This commit is contained in:
parent
cf855d9f28
commit
6e54bce336
|
@ -94,9 +94,9 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
|||
String station = entry.getKey();
|
||||
Set<String> nuclides = entry.getValue();
|
||||
// 查询指定台站的所有的核素浓度 并计算核素浓度均值
|
||||
params.put("nuclideName", nuclides);
|
||||
params.put("stationId", station);
|
||||
List<ConcDtoXe> xeConcAuto = xeResultsAutoService.getConc(params, nuclides); // beta-gamma
|
||||
params.put("nuclideName", nuclides);
|
||||
List<ConcDto> nuclConcAuto = nuclIdedAutoService.getConc(params); // gamma
|
||||
Map<String, String> autoResult = new HashMap<>();
|
||||
autoResult.putAll(calculate(concDto(xeConcAuto), index));
|
||||
|
@ -115,9 +115,9 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
|||
String station = entry.getKey();
|
||||
Set<String> nuclides = entry.getValue();
|
||||
// 查询指定台站的所有的核素浓度 并计算核素浓度均值
|
||||
params.put("nuclideName", nuclides);
|
||||
params.put("stationId", station);
|
||||
List<ConcDtoXe> xeConcMan = xeResultsManService.getConc(params, nuclides); // beta-gamma
|
||||
params.put("nuclideName", nuclides);
|
||||
List<ConcDto> nuclConcMan = nuclIdedManService.getConc(params); // gamma
|
||||
Map<String,String> manResult = new HashMap<>();
|
||||
manResult.putAll(calculate(concDto(xeConcMan), index));
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
|
@ -15,6 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -25,22 +27,26 @@ import java.util.stream.Collectors;
|
|||
public class GardsXeResultsAutoServiceImpl extends ServiceImpl<GardsXeResultsAutoMapper, GardsXeResults> implements IGardsXeResultsAutoService {
|
||||
|
||||
@Override
|
||||
public List<ConcDtoXe> getConc(Map<String, Object> params, Set<String> nuclides) {
|
||||
public List<ConcDtoXe> getConc(Map<String, Object> params, Set<String> nuclideList) {
|
||||
Set<String> nuclides = new HashSet<>();
|
||||
List<String> M = ListUtil.toList("Xe131M", "Xe133M");
|
||||
// XeResults表: 查询条件使用m
|
||||
nuclides = nuclides.stream()
|
||||
.filter(M::contains)
|
||||
.map(item -> StrUtil.replace(item, "M","m")).collect(Collectors.toSet());
|
||||
for (String nuclide : nuclideList) {
|
||||
if (CollUtil.contains(M, nuclide)){
|
||||
nuclides.add(StrUtil.replace(nuclide, "M","m"));
|
||||
continue;
|
||||
}
|
||||
nuclides.add(nuclide);
|
||||
}
|
||||
params.put("nuclideName", nuclides);
|
||||
// 将返回结果的m转换为M
|
||||
List<String> m = ListUtil.toList("Xe131m", "Xe133m");
|
||||
List<ConcDtoXe> result = baseMapper.getConc(params);
|
||||
result = result.stream()
|
||||
.filter(item -> m.contains(item.getNuclideName()))
|
||||
.peek(item -> {
|
||||
String nuclideName = StrUtil.replace(item.getNuclideName(), "m","M");
|
||||
item.setNuclideName(nuclideName);
|
||||
}).collect(Collectors.toList());
|
||||
// 将查询结果的m转换为M
|
||||
List<String> m = ListUtil.toList("Xe131m", "Xe133m");
|
||||
for (ConcDtoXe concDtoXe : result) {
|
||||
String nuclideName = concDtoXe.getNuclideName();
|
||||
if (CollUtil.contains(m, nuclideName))
|
||||
concDtoXe.setNuclideName(StrUtil.replace(nuclideName, "m","M"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
|
@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -24,24 +26,27 @@ import java.util.stream.Collectors;
|
|||
@DS("ora")
|
||||
public class GardsXeResultsManServiceImpl extends ServiceImpl<GardsXeResultsManMapper, GardsXeResults> implements IGardsXeResultsManService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<ConcDtoXe> getConc(Map<String, Object> params ,Set<String> nuclides) {
|
||||
public List<ConcDtoXe> getConc(Map<String, Object> params ,Set<String> nuclideList) {
|
||||
Set<String> nuclides = new HashSet<>();
|
||||
List<String> M = ListUtil.toList("Xe131M", "Xe133M");
|
||||
// XeResults表: 查询条件使用m
|
||||
nuclides = nuclides.stream()
|
||||
.filter(M::contains)
|
||||
.map(item -> StrUtil.replace(item, "M","m")).collect(Collectors.toSet());
|
||||
for (String nuclide : nuclideList) {
|
||||
if (CollUtil.contains(M, nuclide)){
|
||||
nuclides.add(StrUtil.replace(nuclide, "M","m"));
|
||||
continue;
|
||||
}
|
||||
nuclides.add(nuclide);
|
||||
}
|
||||
params.put("nuclideName", nuclides);
|
||||
// 将返回结果的m转换为M
|
||||
List<String> m = ListUtil.toList("Xe131m", "Xe133m");
|
||||
List<ConcDtoXe> result = baseMapper.getConc(params);
|
||||
result = result.stream()
|
||||
.filter(item -> m.contains(item.getNuclideName()))
|
||||
.peek(item -> {
|
||||
String nuclideName = StrUtil.replace(item.getNuclideName(), "m","M");
|
||||
item.setNuclideName(nuclideName);
|
||||
}).collect(Collectors.toList());
|
||||
// 将查询结果的m转换为M
|
||||
List<String> m = ListUtil.toList("Xe131m", "Xe133m");
|
||||
for (ConcDtoXe concDtoXe : result) {
|
||||
String nuclideName = concDtoXe.getNuclideName();
|
||||
if (CollUtil.contains(m, nuclideName))
|
||||
concDtoXe.setNuclideName(StrUtil.replace(nuclideName, "m","M"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user