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