添加返回结果Code代码
This commit is contained in:
parent
a1eeaa234e
commit
b46a773d53
|
|
@ -4,6 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
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.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
import org.jeecg.common.util.DateUtils;
|
import org.jeecg.common.util.DateUtils;
|
||||||
import org.jeecg.entity.GardsThresholdResultHis;
|
import org.jeecg.entity.GardsThresholdResultHis;
|
||||||
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||||
|
|
@ -28,6 +29,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();
|
||||||
|
result.setCode(CommonConstant.SC_OK_200);
|
||||||
//声明返回用的结果map
|
//声明返回用的结果map
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
List<StationInfoData> StationInfoDataList = new ArrayList<>();
|
List<StationInfoData> StationInfoDataList = new ArrayList<>();
|
||||||
|
|
@ -73,7 +75,6 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
|
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(resultMap);
|
result.setResult(resultMap);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,6 +97,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();
|
||||||
|
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");
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -160,6 +162,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();
|
||||||
|
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");
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -215,6 +218,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();
|
||||||
|
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");
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -276,7 +280,7 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
|
|
||||||
|
|
||||||
// 1. 区间统计
|
// 1. 区间统计
|
||||||
List<DistributionAnalysisToolkit.IntervalStat> stats = DistributionAnalysisToolkit.calculateIntervalStats(data, start, step);
|
List<DistributionAnalysisToolkit.IntervalStat> stats = DistributionAnalysisToolkit.calculateIntervalStats(nuclideActConcIntvls, start, step);
|
||||||
// 3. 累积分布函数
|
// 3. 累积分布函数
|
||||||
List<DistributionAnalysisToolkit.CDFPoint> cdfPoints = DistributionAnalysisToolkit.calculateCDF(data);
|
List<DistributionAnalysisToolkit.CDFPoint> cdfPoints = DistributionAnalysisToolkit.calculateCDF(data);
|
||||||
// 4. 核密度估计
|
// 4. 核密度估计
|
||||||
|
|
@ -309,6 +313,7 @@ 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<>();
|
||||||
//region 局部变量
|
//region 局部变量
|
||||||
|
|
@ -392,6 +397,7 @@ public class SampleStatAnalysisService extends ServiceImpl<GardsSampleStatAnalys
|
||||||
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 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<>();
|
||||||
//region 局部变量
|
//region 局部变量
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user