统计模块查询info接口缺少comment相关查询结果修改
新增样品说明实体类 修改查询energy相关数据caltype空格导致查询失败问题 修改查询resolution相关数据caltype空格导致查询失败问题 查询efficiency与resolution实现类层方法名称调换
This commit is contained in:
parent
28d79939cf
commit
4cbbe9e0f4
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@TableName(value = "gards_sample_description")
|
||||
public class GardsSampleDescription implements Serializable {
|
||||
|
||||
@TableId(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
@TableId(value = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.entity.GardsSampleDescription;
|
||||
|
||||
public interface GardsSampleDescriptionMapper extends BaseMapper<GardsSampleDescription> {
|
||||
}
|
|
@ -13,9 +13,11 @@ import org.jeecg.common.util.RedisUtil;
|
|||
import org.jeecg.modules.entity.GardsCalibrationPairsOrig;
|
||||
import org.jeecg.modules.entity.GardsSampleAux;
|
||||
import org.jeecg.modules.base.entity.GardsSampleData;
|
||||
import org.jeecg.modules.entity.GardsSampleDescription;
|
||||
import org.jeecg.modules.mapper.GardsCalibrationPairsOrigMapper;
|
||||
import org.jeecg.modules.mapper.GardsSampleAuxMapper;
|
||||
import org.jeecg.modules.mapper.GardsSampleDataMapper;
|
||||
import org.jeecg.modules.mapper.GardsSampleDescriptionMapper;
|
||||
import org.jeecg.modules.service.IGardsSampleDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -24,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service("gardsSampleDataService")
|
||||
@DS("ori")
|
||||
|
@ -35,6 +38,8 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
private GardsSampleAuxMapper gardsSampleAuxMapper;
|
||||
@Autowired
|
||||
private GardsCalibrationPairsOrigMapper gardsCalibrationPairsOrigMapper;
|
||||
@Autowired
|
||||
private GardsSampleDescriptionMapper gardsSampleDescriptionMapper;
|
||||
|
||||
@Override
|
||||
public Result findParticulatePage(QueryRequest queryRequest, Integer[] stationIds, String dataType, String spectralQualifie, Date startTime,Date endTime) {
|
||||
|
@ -111,23 +116,32 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
LambdaQueryWrapper<GardsSampleAux> sampleAuxQueryWrapper = new LambdaQueryWrapper<>();
|
||||
sampleAuxQueryWrapper.eq(GardsSampleAux::getSampleId, sampleId);
|
||||
GardsSampleAux gardsSampleAux = gardsSampleAuxMapper.selectOne(sampleAuxQueryWrapper);
|
||||
if (Objects.nonNull(gardsSampleData) && Objects.nonNull(gardsSampleAux)){
|
||||
//查询comment数据
|
||||
LambdaQueryWrapper<GardsSampleDescription> descriptionQueryWrapper = new LambdaQueryWrapper<>();
|
||||
descriptionQueryWrapper.eq(GardsSampleDescription::getSampleId, sampleId);
|
||||
GardsSampleDescription gardsSampleDescription = gardsSampleDescriptionMapper.selectOne(descriptionQueryWrapper);
|
||||
if (Objects.nonNull(gardsSampleData)){
|
||||
//封装数据内容
|
||||
map.put("Site Code", gardsSampleData.getStationName());
|
||||
map.put("Detector Code",gardsSampleData.getSiteDetCode());
|
||||
map.put("System Type",gardsSampleData.getSampleType());
|
||||
map.put("Sample Geometry",gardsSampleData.getGeometry());
|
||||
map.put("Spectrum Qualifier",gardsSampleData.getSpectralQualifie());
|
||||
map.put("Sample Reference Identification", gardsSampleAux.getSampleRefId());
|
||||
map.put("Measurement Identification", gardsSampleAux.getMeasurementId());
|
||||
map.put("Detector Background Measurement Identification", gardsSampleAux.getBkgdMeasurementId());
|
||||
map.put("Gas Background Measurement Identification", gardsSampleAux.getGasBkgdMeasurementId());
|
||||
map.put("Transmit Time", gardsSampleData.getTransmitDtg());
|
||||
map.put("Acquisition Time", gardsSampleData.getAcquisitionStart());
|
||||
map.put("Acquisition Real Time", gardsSampleData.getAcquisitionRealSec());
|
||||
map.put("Acquisition Live Time", gardsSampleData.getAcquisitionLiveSec());
|
||||
}
|
||||
if (Objects.nonNull(gardsSampleAux)){
|
||||
map.put("Sample Reference Identification", gardsSampleAux.getSampleRefId());
|
||||
map.put("Measurement Identification", gardsSampleAux.getMeasurementId());
|
||||
map.put("Detector Background Measurement Identification", gardsSampleAux.getBkgdMeasurementId());
|
||||
map.put("Gas Background Measurement Identification", gardsSampleAux.getGasBkgdMeasurementId());
|
||||
map.put("Date of Last Calibration", gardsSampleAux.getCalibrationDtg());
|
||||
}
|
||||
if (Objects.nonNull(gardsSampleDescription)){
|
||||
map.put("COMMENT", gardsSampleDescription.getDescription());
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
return result;
|
||||
|
@ -146,8 +160,8 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
List<Double> uncertaintyList = new LinkedList<>();
|
||||
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getCaltype, "energy");
|
||||
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
||||
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item-> item.getCaltype().trim().equals("energy")).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
||||
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
||||
// Xvalue 对应 centroid channel
|
||||
|
@ -168,39 +182,6 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
|
||||
@Override
|
||||
public Result findParticulateResolution(Integer sampleId) {
|
||||
Result result = new Result();
|
||||
//map 封装三个数组
|
||||
Map<String, List<Double>> map = new HashMap<>();
|
||||
//封装存储 energy
|
||||
List<Double> energyList = new LinkedList<>();
|
||||
//封装存储 efficiency
|
||||
List<Double> efficiencyList = new LinkedList<>();
|
||||
//封装存储 Uncertainty
|
||||
List<Double> uncertaintyList = new LinkedList<>();
|
||||
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getCaltype, "efficiency");
|
||||
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
||||
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
||||
// Xvalue 对应 energy
|
||||
energyList.add(orig.getXvalue());
|
||||
// YValue 对应 efficiency
|
||||
efficiencyList.add(orig.getYvalue());
|
||||
// UncyValue 对应 Uncertainty
|
||||
uncertaintyList.add(orig.getUncyvalue());
|
||||
}
|
||||
}
|
||||
map.put("energy", energyList);
|
||||
map.put("efficiency", efficiencyList);
|
||||
map.put("Uncertainty", uncertaintyList);
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result findParticulateEfficiency(Integer sampleId) {
|
||||
Result result = new Result();
|
||||
//map 封装三个数组
|
||||
Map<String, List<Double>> map = new HashMap<>();
|
||||
|
@ -212,8 +193,8 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
List<Double> uncertaintyList = new LinkedList<>();
|
||||
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getCaltype, "Resolution");
|
||||
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
||||
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item-> item.getCaltype().trim().equals("Resolution")).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
||||
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
||||
// Xvalue 对应 energy
|
||||
|
@ -232,6 +213,38 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result findParticulateEfficiency(Integer sampleId) {
|
||||
Result result = new Result();
|
||||
//map 封装三个数组
|
||||
Map<String, List<Double>> map = new HashMap<>();
|
||||
//封装存储 energy
|
||||
List<Double> energyList = new LinkedList<>();
|
||||
//封装存储 efficiency
|
||||
List<Double> efficiencyList = new LinkedList<>();
|
||||
//封装存储 Uncertainty
|
||||
List<Double> uncertaintyList = new LinkedList<>();
|
||||
LambdaQueryWrapper<GardsCalibrationPairsOrig> calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>();
|
||||
calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId);
|
||||
List<GardsCalibrationPairsOrig> gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigMapper.selectList(calibrationPairsOrigQueryWrapper);
|
||||
gardsCalibrationPairsOrigs = gardsCalibrationPairsOrigs.stream().filter(item->item.getCaltype().trim().equals("efficiency")).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(gardsCalibrationPairsOrigs)){
|
||||
for (GardsCalibrationPairsOrig orig:gardsCalibrationPairsOrigs) {
|
||||
// Xvalue 对应 energy
|
||||
energyList.add(orig.getXvalue());
|
||||
// YValue 对应 efficiency
|
||||
efficiencyList.add(orig.getYvalue());
|
||||
// UncyValue 对应 Uncertainty
|
||||
uncertaintyList.add(orig.getUncyvalue());
|
||||
}
|
||||
}
|
||||
map.put("energy", energyList);
|
||||
map.put("efficiency", efficiencyList);
|
||||
map.put("Uncertainty", uncertaintyList);
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class)
|
||||
public Result findPageBySampleIds(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime, List<Integer> sampleIds){
|
||||
|
|
Loading…
Reference in New Issue
Block a user