样品统计分析接口添加核素数据校验
This commit is contained in:
parent
1f22a04d5c
commit
3b797f58c4
|
|
@ -4,6 +4,7 @@ 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.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
import org.jeecg.common.util.DateUtils;
|
import org.jeecg.common.util.DateUtils;
|
||||||
|
|
@ -30,6 +31,7 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
|
|
||||||
public Result getSampleMonitorResult(String sampleType, Integer dataSource, Date startDate, Date endDate) {
|
public Result getSampleMonitorResult(String sampleType, Integer dataSource, Date startDate, Date endDate) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
try {
|
||||||
result.setCode(CommonConstant.SC_OK_200);
|
result.setCode(CommonConstant.SC_OK_200);
|
||||||
//声明返回用的结果map
|
//声明返回用的结果map
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
|
@ -63,20 +65,20 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//时间段内有多少和台站
|
//时间段内有多少和台站
|
||||||
|
|
||||||
Map<String, List<StationInfoData>> groupedByMonth = StationInfoDataList.stream()
|
Map<String, List<StationInfoData>> groupedByMonth = StationInfoDataList.stream()
|
||||||
.collect(Collectors.groupingBy(station ->
|
.collect(Collectors.groupingBy(station ->
|
||||||
station.getCollectStop().toInstant()
|
station.getCollectStop().toInstant()
|
||||||
.atZone(ZoneId.of("UTC"))
|
.atZone(ZoneId.of("UTC"))
|
||||||
.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
|
.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
resultMap.put("SampleMonitorResultList", groupedByMonth);
|
resultMap.put("SampleMonitorResultList", groupedByMonth);
|
||||||
|
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(resultMap);
|
result.setResult(resultMap);
|
||||||
return result;
|
return result;
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.error500("样品监测回放错误:" + e.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -98,6 +100,7 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
String schemaName = dataSource == 1 ? "RNAUTO" : "RNMAN";
|
String schemaName = dataSource == 1 ? "RNAUTO" : "RNMAN";
|
||||||
//region 局部变量
|
//region 局部变量
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
try {
|
||||||
result.setCode(CommonConstant.SC_OK_200);
|
result.setCode(CommonConstant.SC_OK_200);
|
||||||
if (StringUtils.isBlank(stationCode)) {
|
if (StringUtils.isBlank(stationCode)) {
|
||||||
result.error500("Station Code cannot be null");
|
result.error500("Station Code cannot be null");
|
||||||
|
|
@ -138,16 +141,21 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
.collect(Collectors.groupingBy(NuclideActConcIntvl::getNuclideName));
|
.collect(Collectors.groupingBy(NuclideActConcIntvl::getNuclideName));
|
||||||
//查询级别 getSample
|
//查询级别 getSample
|
||||||
List<String> nuclideNames = new ArrayList<>(groupedByNuclideName.keySet());
|
List<String> nuclideNames = new ArrayList<>(groupedByNuclideName.keySet());
|
||||||
|
if (CollectionUtils.isNotEmpty(nuclideNames)) {
|
||||||
//通过台站ID、核素名称查找阈值
|
//通过台站ID、核素名称查找阈值
|
||||||
thresholdResultHisDataList = this.baseMapper.selectByStationAndNuclides(schemaName, Integer.valueOf(stationCode), nuclideNames, startTime, endTime);
|
thresholdResultHisDataList = this.baseMapper.selectByStationAndNuclides(schemaName, Integer.valueOf(stationCode), nuclideNames, startTime, endTime);
|
||||||
|
}
|
||||||
resultMap.put("nuclideActConcIntvlList", groupedByNuclideName);
|
resultMap.put("nuclideActConcIntvlList", groupedByNuclideName);
|
||||||
resultMap.put("sampleLevelDataList", sampleLevelDataList);
|
resultMap.put("sampleLevelDataList", sampleLevelDataList);
|
||||||
resultMap.put("thresholdResultHisDataList", thresholdResultHisDataList);
|
resultMap.put("thresholdResultHisDataList", thresholdResultHisDataList);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(resultMap);
|
result.setResult(resultMap);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.error500("样品统计分析错误:" + e.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -163,6 +171,7 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
List<SampleLevelData> sampleDataList = new ArrayList<>();
|
List<SampleLevelData> sampleDataList = new ArrayList<>();
|
||||||
//region 局部变量
|
//region 局部变量
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
try {
|
||||||
result.setCode(CommonConstant.SC_OK_200);
|
result.setCode(CommonConstant.SC_OK_200);
|
||||||
if (StringUtils.isBlank(sampleType)) {
|
if (StringUtils.isBlank(sampleType)) {
|
||||||
result.error500("SampleType Code cannot be null");
|
result.error500("SampleType Code cannot be null");
|
||||||
|
|
@ -197,9 +206,11 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
resultMap.put("sampleDataList", sampleDataList);
|
resultMap.put("sampleDataList", sampleDataList);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(resultMap);
|
result.setResult(resultMap);
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.error500("样品统计分析错误:" + e.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** 样品活度浓度区间频率分析
|
/*** 样品活度浓度区间频率分析
|
||||||
|
|
@ -219,6 +230,7 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
List<NuclideActConcIntvl> nuclideActConcIntvls = new ArrayList<>();
|
List<NuclideActConcIntvl> nuclideActConcIntvls = new ArrayList<>();
|
||||||
//region 局部变量
|
//region 局部变量
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
try {
|
||||||
result.setCode(CommonConstant.SC_OK_200);
|
result.setCode(CommonConstant.SC_OK_200);
|
||||||
if (StringUtils.isBlank(sampleType)) {
|
if (StringUtils.isBlank(sampleType)) {
|
||||||
result.error500("SampleType Code cannot be null");
|
result.error500("SampleType Code cannot be null");
|
||||||
|
|
@ -299,6 +311,11 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(resultMap);
|
result.setResult(resultMap);
|
||||||
return result;
|
return result;
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.error500("样品活度浓度区间频率分析错误:" + e.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** 核素活度浓度时序分析
|
/*** 核素活度浓度时序分析
|
||||||
|
|
@ -314,9 +331,11 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
@Override
|
@Override
|
||||||
public Result getSampleActConcTimeSeqAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate) {
|
public Result getSampleActConcTimeSeqAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
result.setCode(CommonConstant.SC_OK_200);
|
|
||||||
//声明返回用的结果map
|
//声明返回用的结果map
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
try {
|
||||||
|
result.setCode(CommonConstant.SC_OK_200);
|
||||||
|
|
||||||
//region 局部变量
|
//region 局部变量
|
||||||
|
|
||||||
if (StringUtils.isBlank(sampleType)) {
|
if (StringUtils.isBlank(sampleType)) {
|
||||||
|
|
@ -383,6 +402,11 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(resultMap);
|
result.setResult(resultMap);
|
||||||
return result;
|
return result;
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.error500("核素活度浓度时序分析错误:" + e.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** 核素活度浓度对比分析
|
/*** 核素活度浓度对比分析
|
||||||
|
|
@ -396,11 +420,13 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Result getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds, String nuclideName, Integer dataSource, Date startDate, Date endDate) {
|
public Result getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds, String nuclideName, Integer dataSource, Date startDate, Date endDate) {
|
||||||
|
|
||||||
Result result = new Result();
|
|
||||||
result.setCode(CommonConstant.SC_OK_200);
|
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
List<NuclideActConcIntvl> nuclideActConcIntvls = new ArrayList<>();
|
List<NuclideActConcIntvl> nuclideActConcIntvls = new ArrayList<>();
|
||||||
|
|
||||||
|
Result result = new Result();
|
||||||
|
try {
|
||||||
|
result.setCode(CommonConstant.SC_OK_200);
|
||||||
|
|
||||||
//region 局部变量
|
//region 局部变量
|
||||||
if (Objects.isNull(startDate)) {
|
if (Objects.isNull(startDate)) {
|
||||||
result.error500("The start time cannot be empty");
|
result.error500("The start time cannot be empty");
|
||||||
|
|
@ -431,8 +457,11 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
resultMap.put("nuclideInfoList", nuclideActConcIntvls);
|
resultMap.put("nuclideInfoList", nuclideActConcIntvls);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(resultMap);
|
result.setResult(resultMap);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.error500("核素活度浓度对比分析错误:" + e.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user