From 98a5d1d78d2fc0838f55a976140ef8e54320c0c1 Mon Sep 17 00:00:00 2001 From: duwenyuan <1351851645@qq.com> Date: Fri, 17 Oct 2025 18:55:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=8F=B0?= =?UTF-8?q?=E7=AB=99=E4=BF=A1=E6=81=AF=E5=92=8C=E6=A0=B8=E7=B4=A0=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DataAnalysisController.java | 33 ++ .../org/jeecg/entity/SysDefaultNuclide.java | 61 +++ .../jeecg/mapper/SysDefaultNuclideMapper.java | 9 + .../xml/GardsSampleStatAnalysisMapper.xml | 484 ++++++++---------- .../service/ISampleStatAnalysisService.java | 6 + .../impl/SampleStatAnalysisService.java | 29 +- 6 files changed, 355 insertions(+), 267 deletions(-) create mode 100644 jeecg-module-data-analyze/src/main/java/org/jeecg/entity/SysDefaultNuclide.java create mode 100644 jeecg-module-data-analyze/src/main/java/org/jeecg/mapper/SysDefaultNuclideMapper.java diff --git a/jeecg-module-data-analyze/src/main/java/org/jeecg/controller/DataAnalysisController.java b/jeecg-module-data-analyze/src/main/java/org/jeecg/controller/DataAnalysisController.java index cb8e3d2..02c10ee 100644 --- a/jeecg-module-data-analyze/src/main/java/org/jeecg/controller/DataAnalysisController.java +++ b/jeecg-module-data-analyze/src/main/java/org/jeecg/controller/DataAnalysisController.java @@ -5,6 +5,8 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.api.vo.Result; import org.jeecg.common.util.DateUtils; +import org.jeecg.entity.GardsStations; +import org.jeecg.entity.SysDefaultNuclide; import org.jeecg.service.ISampleStatAnalysisService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; @@ -14,7 +16,9 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.time.LocalDate; +import java.util.ArrayList; import java.util.Date; +import java.util.List; import java.util.Objects; @RestController @@ -127,4 +131,33 @@ public class DataAnalysisController { } + @GetMapping("/findStationList") + public Result findStationList(String systemType) { + Result result = new Result(); + try { + List gardsStations = sampleStatAnalysisService.findStationListByMenuName(); + result.setCode(200); + result.setSuccess(true); + result.setResult(gardsStations); + } catch (Exception e) { + result.setCode(500); + result.setSuccess(false); + } + return result; + } + @GetMapping("/findNuclideList") + public Result findNuclideList(String systemType) { + Result result = new Result(); + try { + List defaultNuclides = sampleStatAnalysisService.findNuclideList(); + result.setCode(200); + result.setSuccess(true); + result.setResult(defaultNuclides); + } catch (Exception e) { + result.setCode(500); + result.setSuccess(false); + } + return result; + } + } diff --git a/jeecg-module-data-analyze/src/main/java/org/jeecg/entity/SysDefaultNuclide.java b/jeecg-module-data-analyze/src/main/java/org/jeecg/entity/SysDefaultNuclide.java new file mode 100644 index 0000000..e8b7df2 --- /dev/null +++ b/jeecg-module-data-analyze/src/main/java/org/jeecg/entity/SysDefaultNuclide.java @@ -0,0 +1,61 @@ +package org.jeecg.entity; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class SysDefaultNuclide implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_ID) + private String id; + + /** + * 核素名称 + */ + @Excel(name = "核素名称", width = 15) + private String nuclideName; + + /** + * 核素用途 + */ + @Excel(name = "核素用途", width = 15) + private Integer useType; + + /** + * 核素类型 + */ + @Excel(name = "核素类型", width = 8) + private String nuclideType; + + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** + * 更新人 + */ + private String createBy; +} + + diff --git a/jeecg-module-data-analyze/src/main/java/org/jeecg/mapper/SysDefaultNuclideMapper.java b/jeecg-module-data-analyze/src/main/java/org/jeecg/mapper/SysDefaultNuclideMapper.java new file mode 100644 index 0000000..7227698 --- /dev/null +++ b/jeecg-module-data-analyze/src/main/java/org/jeecg/mapper/SysDefaultNuclideMapper.java @@ -0,0 +1,9 @@ +package org.jeecg.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.jeecg.entity.SysDefaultNuclide; +@Mapper +public interface SysDefaultNuclideMapper extends BaseMapper +{ +} diff --git a/jeecg-module-data-analyze/src/main/java/org/jeecg/mapper/xml/GardsSampleStatAnalysisMapper.xml b/jeecg-module-data-analyze/src/main/java/org/jeecg/mapper/xml/GardsSampleStatAnalysisMapper.xml index 490d44c..cd2c6f8 100644 --- a/jeecg-module-data-analyze/src/main/java/org/jeecg/mapper/xml/GardsSampleStatAnalysisMapper.xml +++ b/jeecg-module-data-analyze/src/main/java/org/jeecg/mapper/xml/GardsSampleStatAnalysisMapper.xml @@ -2,19 +2,15 @@ @@ -77,135 +67,121 @@ @@ -245,77 +221,72 @@ AND t1.SAMPLE_ID = t3.SAMPLE_ID WHERE t1.STATION_ID = #{station} AND t1.STATUS != 'F' - AND t1.COLLECT_STOP BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD hh24:mi:ss') - AND TO_DATE(#{endTime}, 'YYYY-MM-DD hh24:mi:ss') + AND t1.COLLECT_STOP BETWEEN TO_DATE(#{startTime} + , 'YYYY-MM-DD hh24:mi:ss') + AND TO_DATE(#{endTime} + , 'YYYY-MM-DD hh24:mi:ss') @@ -370,7 +342,7 @@ SELECT * FROM ${schemaName}.GARDS_THRESHOLD_RESULT_HIS - AND STATION_ID IN + AND STATION_ID IN #{stationId} @@ -392,9 +364,6 @@ - - - @@ -510,63 +478,57 @@ - - + + - + \ No newline at end of file diff --git a/jeecg-module-data-analyze/src/main/java/org/jeecg/service/ISampleStatAnalysisService.java b/jeecg-module-data-analyze/src/main/java/org/jeecg/service/ISampleStatAnalysisService.java index 8f49104..2920039 100644 --- a/jeecg-module-data-analyze/src/main/java/org/jeecg/service/ISampleStatAnalysisService.java +++ b/jeecg-module-data-analyze/src/main/java/org/jeecg/service/ISampleStatAnalysisService.java @@ -2,6 +2,8 @@ package org.jeecg.service; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.common.api.vo.Result; +import org.jeecg.entity.GardsStations; +import org.jeecg.entity.SysDefaultNuclide; import org.jeecg.modules.base.entity.original.GardsSampleData; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.RequestParam; @@ -24,4 +26,8 @@ public interface ISampleStatAnalysisService extends IService { Result getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds, String nuclideName, Integer dataSource, Date startDate, Date endDate); + + List findStationListByMenuName(); + List findNuclideList(); + } diff --git a/jeecg-module-data-analyze/src/main/java/org/jeecg/service/impl/SampleStatAnalysisService.java b/jeecg-module-data-analyze/src/main/java/org/jeecg/service/impl/SampleStatAnalysisService.java index c7355d9..a7d3257 100644 --- a/jeecg-module-data-analyze/src/main/java/org/jeecg/service/impl/SampleStatAnalysisService.java +++ b/jeecg-module-data-analyze/src/main/java/org/jeecg/service/impl/SampleStatAnalysisService.java @@ -1,19 +1,19 @@ package org.jeecg.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.util.DateUtils; -import org.jeecg.entity.GardsThresholdResultHis; +import org.jeecg.entity.*; +import org.jeecg.mapper.SysDefaultNuclideMapper; import org.jeecg.modules.base.entity.original.GardsSampleData; -import org.jeecg.entity.NuclideActConcIntvl; -import org.jeecg.entity.SampleLevelData; -import org.jeecg.entity.StationInfoData; import org.jeecg.mapper.GardsSampleStatAnalysisMapper; import org.jeecg.service.ISampleStatAnalysisService; import org.jeecg.util.DistributionAnalysisToolkit; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.time.ZoneId; @@ -25,7 +25,8 @@ import java.util.stream.Collectors; @Service @DS("ora") public class SampleStatAnalysisService extends ServiceImpl implements ISampleStatAnalysisService { - + @Autowired + private SysDefaultNuclideMapper defaultNuclideMapper; public Result getSampleMonitorResult(String sampleType, Integer dataSource, Date startDate, Date endDate) { Result result = new Result(); @@ -133,7 +134,7 @@ public class SampleStatAnalysisService extends ServiceImpl> groupedByNuclideName = nuclideActConcIntvlList.stream() - .filter(p->p.getNuclideName()!=null) + .filter(p -> p.getNuclideName() != null) .collect(Collectors.groupingBy(NuclideActConcIntvl::getNuclideName)); //查询级别 getSample List nuclideNames = new ArrayList<>(groupedByNuclideName.keySet()); @@ -434,5 +435,21 @@ public class SampleStatAnalysisService extends ServiceImpl findStationListByMenuName() { + List gardsStations = new LinkedList<>(); + //获取台站信息 + gardsStations = this.baseMapper.findStationListByMenuName(); + return gardsStations; + } + @Override + @DS("master") + public List findNuclideList() { + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SysDefaultNuclide::getUseType, 4); + List defaultNuclides = defaultNuclideMapper.selectList(queryWrapper); + return defaultNuclides; + } }