fix:核素浓度计算为null问题
This commit is contained in:
parent
0b15a28641
commit
16449f5c0e
|
@ -11,7 +11,7 @@ import java.util.Set;
|
||||||
|
|
||||||
public interface IGardsXeResultsAutoService extends IService<GardsXeResults> {
|
public interface IGardsXeResultsAutoService extends IService<GardsXeResults> {
|
||||||
|
|
||||||
List<ConcDtoXe> getConc(Map<String,Object> params);
|
List<ConcDtoXe> getConc(Map<String,Object> params, Set<String> nuclides);
|
||||||
|
|
||||||
List<String> nuclideNames(Set<String> nuclideNames);
|
List<String> nuclideNames(Set<String> nuclideNames);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import java.util.Set;
|
||||||
|
|
||||||
public interface IGardsXeResultsManService extends IService<GardsXeResults> {
|
public interface IGardsXeResultsManService extends IService<GardsXeResults> {
|
||||||
|
|
||||||
List<ConcDtoXe> getConc(Map<String,Object> params);
|
List<ConcDtoXe> getConc(Map<String,Object> params, Set<String> nuclides);
|
||||||
|
|
||||||
List<String> nuclideNames(Set<String> nuclideNames);
|
List<String> nuclideNames(Set<String> nuclideNames);
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
||||||
// 查询指定台站的所有的核素浓度 并计算核素浓度均值
|
// 查询指定台站的所有的核素浓度 并计算核素浓度均值
|
||||||
params.put("nuclideName", nuclides);
|
params.put("nuclideName", nuclides);
|
||||||
params.put("stationId", station);
|
params.put("stationId", station);
|
||||||
List<ConcDtoXe> xeConcAuto = xeResultsAutoService.getConc(params); // beta-gamma
|
List<ConcDtoXe> xeConcAuto = xeResultsAutoService.getConc(params, nuclides); // beta-gamma
|
||||||
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));
|
||||||
|
@ -117,7 +117,7 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
||||||
// 查询指定台站的所有的核素浓度 并计算核素浓度均值
|
// 查询指定台站的所有的核素浓度 并计算核素浓度均值
|
||||||
params.put("nuclideName", nuclides);
|
params.put("nuclideName", nuclides);
|
||||||
params.put("stationId", station);
|
params.put("stationId", station);
|
||||||
List<ConcDtoXe> xeConcMan = xeResultsManService.getConc(params); // beta-gamma
|
List<ConcDtoXe> xeConcMan = xeResultsManService.getConc(params, nuclides); // beta-gamma
|
||||||
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));
|
||||||
|
@ -180,12 +180,10 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String log(List<AlarmAnalysisNuclideAvg> nuclideAvgs){
|
private String log(List<AlarmAnalysisNuclideAvg> nuclideAvgs){
|
||||||
List<String> nuclideNames = nuclideAvgs.stream()
|
Set<String> nuclideNames = nuclideAvgs.stream()
|
||||||
.map(AlarmAnalysisNuclideAvg::getNuclide)
|
.map(AlarmAnalysisNuclideAvg::getNuclide)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toSet());
|
||||||
String nuclide = CollUtil.join(nuclideNames, ",");
|
String nuclide = CollUtil.join(nuclideNames, ",");
|
||||||
String now = LocalDateTime.now()
|
return "核素 [" + nuclide + "] 进行了浓度均值计算";
|
||||||
.format(DateTimeFormatter.ofPattern(DateConstant.DATE_TIME));
|
|
||||||
return "核素 [" + nuclide + "] 进行了浓度均值计算, 计算时间: " + now;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.jeecg.modules.service.impl;
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import org.jeecg.common.constant.DateConstant;
|
import org.jeecg.common.constant.DateConstant;
|
||||||
|
@ -22,10 +24,24 @@ import java.util.stream.Collectors;
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
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) {
|
public List<ConcDtoXe> getConc(Map<String, Object> params, Set<String> nuclides) {
|
||||||
return baseMapper.getConc(params);
|
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());
|
||||||
|
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());
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.jeecg.modules.service.impl;
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
@ -24,8 +26,23 @@ public class GardsXeResultsManServiceImpl extends ServiceImpl<GardsXeResultsManM
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ConcDtoXe> getConc(Map<String, Object> params) {
|
public List<ConcDtoXe> getConc(Map<String, Object> params ,Set<String> nuclides) {
|
||||||
return baseMapper.getConc(params);
|
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());
|
||||||
|
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());
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class TableSpaceJob extends Monitor {
|
||||||
/**
|
/**
|
||||||
* 解析Oracle 表空间预警规则
|
* 解析Oracle 表空间预警规则
|
||||||
**/
|
**/
|
||||||
@Scheduled(cron = "${task.period-space:0 0/1 * * * ?}")
|
@Scheduled(cron = "${task.period-space:0 0 */1 * * ?}")
|
||||||
public void execute(){
|
public void execute(){
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user