From 4cbbe9e0f49cd09dd9214512e8c98e00eaf31b2b Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Wed, 21 Jun 2023 13:50:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=A8=A1=E5=9D=97=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2info=E6=8E=A5=E5=8F=A3=E7=BC=BA=E5=B0=91comment?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=9F=A5=E8=AF=A2=E7=BB=93=E6=9E=9C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E6=96=B0=E5=A2=9E=E6=A0=B7=E5=93=81=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E5=AE=9E=E4=BD=93=E7=B1=BB=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2energy=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AEcal?= =?UTF-8?q?type=E7=A9=BA=E6=A0=BC=E5=AF=BC=E8=87=B4=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2resolution=E7=9B=B8=E5=85=B3=E6=95=B0?= =?UTF-8?q?=E6=8D=AEcaltype=E7=A9=BA=E6=A0=BC=E5=AF=BC=E8=87=B4=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98=20=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2efficiency=E4=B8=8Eresolution=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E7=B1=BB=E5=B1=82=E6=96=B9=E6=B3=95=E5=90=8D=E7=A7=B0=E8=B0=83?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/GardsSampleDescription.java | 19 ++++ .../mapper/GardsSampleDescriptionMapper.java | 7 ++ .../impl/GardsSampleDataServiceImpl.java | 93 +++++++++++-------- 3 files changed, 79 insertions(+), 40 deletions(-) create mode 100644 jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/GardsSampleDescription.java create mode 100644 jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDescriptionMapper.java diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/GardsSampleDescription.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/GardsSampleDescription.java new file mode 100644 index 00000000..6bed25ca --- /dev/null +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/GardsSampleDescription.java @@ -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; + +} diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDescriptionMapper.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDescriptionMapper.java new file mode 100644 index 00000000..e08f418a --- /dev/null +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDescriptionMapper.java @@ -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 { +} diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/service/impl/GardsSampleDataServiceImpl.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/service/impl/GardsSampleDataServiceImpl.java index 500e3f80..5f38a899 100644 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/service/impl/GardsSampleDataServiceImpl.java +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/service/impl/GardsSampleDataServiceImpl.java @@ -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 sampleAuxQueryWrapper = new LambdaQueryWrapper<>(); sampleAuxQueryWrapper.eq(GardsSampleAux::getSampleId, sampleId); GardsSampleAux gardsSampleAux = gardsSampleAuxMapper.selectOne(sampleAuxQueryWrapper); - if (Objects.nonNull(gardsSampleData) && Objects.nonNull(gardsSampleAux)){ + //查询comment数据 + LambdaQueryWrapper 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 uncertaintyList = new LinkedList<>(); LambdaQueryWrapper calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>(); calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId); - calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getCaltype, "energy"); List 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> map = new HashMap<>(); - //封装存储 energy - List energyList = new LinkedList<>(); - //封装存储 efficiency - List efficiencyList = new LinkedList<>(); - //封装存储 Uncertainty - List uncertaintyList = new LinkedList<>(); - LambdaQueryWrapper calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>(); - calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId); - calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getCaltype, "efficiency"); - List 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> map = new HashMap<>(); @@ -212,8 +193,8 @@ public class GardsSampleDataServiceImpl extends ServiceImpl uncertaintyList = new LinkedList<>(); LambdaQueryWrapper calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>(); calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId); - calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getCaltype, "Resolution"); List 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> map = new HashMap<>(); + //封装存储 energy + List energyList = new LinkedList<>(); + //封装存储 efficiency + List efficiencyList = new LinkedList<>(); + //封装存储 Uncertainty + List uncertaintyList = new LinkedList<>(); + LambdaQueryWrapper calibrationPairsOrigQueryWrapper = new LambdaQueryWrapper<>(); + calibrationPairsOrigQueryWrapper.eq(GardsCalibrationPairsOrig::getSampleId, sampleId); + List 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 sampleIds){