修改数据分析接口

This commit is contained in:
duwenyuan 2025-12-26 11:49:28 +08:00
parent 290493fa34
commit 4f29457b49
7 changed files with 3167 additions and 24 deletions

View File

@ -1,6 +1,7 @@
package org.jeecg.controller; package org.jeecg.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
@ -60,6 +61,16 @@ public class DataAnalysisController {
} }
@GetMapping("/getNuclideActConcChartData")
@ApiOperation(value = "样品统计分析-核素等级时序分析", notes = "样品统计分析-核素等级时序分析")
public Result getNuclideActConcChartData(String sampleType,String station, String nuclideName, Integer dataSource, @RequestParam("startDate")
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
@RequestParam("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) throws JsonProcessingException {
return sampleStatAnalysisService.getNuclideActConcChartData(sampleType,station, nuclideName, dataSource, startDate, endDate);
}
/*** 样品等级时序分析 /*** 样品等级时序分析
* 样品等级时序分析 * 样品等级时序分析
* @param sampleType 样品类型 * @param sampleType 样品类型
@ -109,8 +120,9 @@ public class DataAnalysisController {
@GetMapping("/getActConcTimeSeqAnalysis") @GetMapping("/getActConcTimeSeqAnalysis")
@ApiOperation(value = "样品活度浓度时序分析", notes = "样品活度浓度时序分析") @ApiOperation(value = "样品活度浓度时序分析", notes = "样品活度浓度时序分析")
public Result getSampleActConcTimeSeqAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, @RequestParam("startDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, public Result getSampleActConcTimeSeqAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, @RequestParam("startDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
@RequestParam("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) { @RequestParam("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) throws JsonProcessingException {
return sampleStatAnalysisService.getSampleActConcTimeSeqAnalysis(sampleType, station, nuclideName, dataSource, startDate, endDate); //return sampleStatAnalysisService.getSampleActConcTimeSeqAnalysis(sampleType, station, nuclideName, dataSource, startDate, endDate);
return sampleStatAnalysisService.getNuclideActConcChartData(sampleType, station, nuclideName, dataSource, startDate, endDate);
} }
/*** 核素活度浓度对比分析 /*** 核素活度浓度对比分析
@ -145,6 +157,7 @@ public class DataAnalysisController {
} }
return result; return result;
} }
@GetMapping("/findNuclideList") @GetMapping("/findNuclideList")
public Result findNuclideList(String systemType) { public Result findNuclideList(String systemType) {
Result result = new Result(); Result result = new Result();

View File

@ -13,78 +13,78 @@ public class NuclideActConcIntvl {
/** 样品ID /** 样品ID
* *
*/ */
@JsonProperty("SAMPLEID") //@JsonProperty("SAMPLEID")
private Integer sampleId; private Integer sampleId;
/** /**
* 级别 * 级别
*/ */
@JsonProperty("CATEGORY") //@JsonProperty("CATEGORY")
private Integer category; private Integer category;
/** /**
* 阈值 * 阈值
*/ */
@JsonProperty("THRESHOLDVALUE") //@JsonProperty("THRESHOLDVALUE")
private double thresholdValue; private double thresholdValue;
/**样品类型 /**样品类型
* 系统类型P : particulate; B :gas with 3-D β-γ coincidence detection; G :all other gas systems (high-resolution * 系统类型P : particulate; B :gas with 3-D β-γ coincidence detection; G :all other gas systems (high-resolution
* γ-spectrometry or 2-D β-γ coincidence * γ-spectrometry or 2-D β-γ coincidence
* detection) * detection)
*/ */
@JsonProperty("SAMPLE_TYPE") //@JsonProperty("SAMPLE_TYPE")
private String sampleType; private String sampleType;
/** 台站ID /** 台站ID
* *
*/ */
@JsonProperty("STATIONID") //@JsonProperty("STATIONID")
private Integer stationId; private Integer stationId;
/** 台站编码 /** 台站编码
* *
*/ */
@JsonProperty("STATIONCODE") //@JsonProperty("STATIONCODE")
private String stationCode; private String stationCode;
/**数据源 /**数据源
* *
*/ */
@JsonProperty("DATASOURCE") //@JsonProperty("DATASOURCE")
private Integer dataSource; private Integer dataSource;
/** MDC /** MDC
* *
*/ */
@JsonProperty("MDC") //@JsonProperty("MDC")
private Double mdc; private Double mdc;
/** 活度浓度 /** 活度浓度
* *
*/ */
@JsonProperty("CONC") //@JsonProperty("CONC")
private Double conc; private Double conc;
/** 收集停止时间 /** 收集停止时间
* *
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonProperty("COLLECTSTOP") //@JsonProperty("COLLECTSTOP")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date collectStop; private Date collectStop;
/** /**
* 活度值不确定度 * 活度值不确定度
*/ */
@JsonProperty("CONCERR") //@JsonProperty("CONCERR")
private Double concErr; private Double concErr;
/** /**
* 样品处理状态 * 样品处理状态
*/ */
@JsonProperty("STATUS") //@JsonProperty("STATUS")
private String status; private String status;
/** /**
* 核素名称 * 核素名称
*/ */
@JsonProperty("NUCLIDE_NAME") //@JsonProperty("NUCLIDE_NAME")
private String nuclideName; private String nuclideName;
} }

View File

@ -27,6 +27,13 @@ public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleDat
List<SampleLevelData> getRnManSampleGradeAnalysis(String sampleType, String station, List<SampleLevelData> getRnManSampleGradeAnalysis(String sampleType, String station,
@Param("startTime") String startTime, @Param("endTime") String endTime); @Param("startTime") String startTime, @Param("endTime") String endTime);
List<NuclideActConcIntvl> getIdentifiedNuclides(@Param("schemaName") String schemaName ,@Param("nuclideName")String nuclideName, String station,
@Param("startTime") String startTime, @Param("endTime") String endTime);
//endregion //endregion
/*** 获取样品类型P中元素的浓度活度MDC信息 /*** 获取样品类型P中元素的浓度活度MDC信息

View File

@ -240,6 +240,65 @@
</select> </select>
<select id="getIdentifiedNuclides" resultType="org.jeecg.entity.NuclideActConcIntvl">
SELECT * FROM (
<!-- P类型数据 -->
SELECT
t1.SAMPLE_ID AS sampleId,
t1.COLLECT_STOP AS collectStop,
t1.SAMPLE_TYPE AS sampleType,
t1.STATION_ID AS stationId,
t1.STATUS AS status,
COALESCE(s1.category, 0) AS category,
t2.NUCLIDENAME AS nuclideName,
CAST(REGEXP_REPLACE(t2.CONCENTRATION, '[^0-9.Ee-]', '') AS BINARY_DOUBLE) AS conc,
0 as concErr,
CAST(REGEXP_REPLACE(t2.MDC, '[^0-9.Ee-]', '') AS BINARY_DOUBLE) AS mdc
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN ${schemaName}.GARDS_ANALYSES s1 ON t1.SAMPLE_ID = s1.SAMPLE_ID
INNER JOIN ${schemaName}.GARDS_NUCL_IDED t2 ON t1.SAMPLE_ID = t2.SAMPLE_ID
WHERE t1.STATION_ID = #{station}
AND t2.NUCLIDENAME=#{nuclideName}
AND s1.category in(3,4)
AND t1.STATUS != 'F'
AND t1.COLLECT_STOP &gt;= TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS')
AND t1.COLLECT_STOP &lt; TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
AND t1.SAMPLE_TYPE = 'P'
UNION ALL
<!-- B类型数据 -->
SELECT
t1.SAMPLE_ID AS sampleId,
t1.COLLECT_STOP AS collectStop,
t1.SAMPLE_TYPE AS sampleType,
t1.STATION_ID AS stationId,
t1.STATUS AS status,
COALESCE(s1.category, 0) AS category,
t3.NUCLIDE_NAME AS nuclideName,
t3.CONC AS conc,
t3.CONC_ERR as concErr,
t3.MDC AS mdc
FROM ORIGINAL.GARDS_SAMPLE_DATA t1
LEFT JOIN ${schemaName}.GARDS_ANALYSES s1 ON t1.SAMPLE_ID = s1.SAMPLE_ID
INNER JOIN ${schemaName}.GARDS_XE_RESULTS t3 ON t1.SAMPLE_ID = t3.SAMPLE_ID
WHERE t1.STATION_ID = #{station}
AND t3.NUCLIDE_NAME=#{nuclideName}
AND s1.category in(1,2,3)
AND t1.STATUS != 'F'
AND t1.COLLECT_STOP &gt;= TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS')
AND t1.COLLECT_STOP &lt; TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
AND t1.SAMPLE_TYPE = 'B'
) t
ORDER BY collectStop DESC
</select>
<!-- RnAuto 核素等级时序分析--> <!-- RnAuto 核素等级时序分析-->
<select id="getRnAutoNuclideTimeSeriesAnalysis" resultType="org.jeecg.entity.SampleLevelData"> <select id="getRnAutoNuclideTimeSeriesAnalysis" resultType="org.jeecg.entity.SampleLevelData">

View File

@ -1,6 +1,7 @@
package org.jeecg.service; package org.jeecg.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.entity.GardsStations; import org.jeecg.entity.GardsStations;
import org.jeecg.entity.SysDefaultNuclide; import org.jeecg.entity.SysDefaultNuclide;
@ -15,19 +16,85 @@ public interface ISampleStatAnalysisService extends IService<GardsSampleData> {
Result getSampleMonitorResult(String sampleType, Integer dataSource, Date startDate, Date endDate); Result getSampleMonitorResult(String sampleType, Integer dataSource, Date startDate, Date endDate);
/*** 样品统计分析
* 样品统计分析
* @param station
* @param startDate
* @param endDate
* @return
*/
Result getSampleStatAnalysis(String station, Integer dataSource, Date startDate, Date endDate); Result getSampleStatAnalysis(String station, Integer dataSource, Date startDate, Date endDate);
/**
* 样品统计分析--核素浓度时序分析
* @param sampleType
* @param stationCode
* @param nuclideName
* @param dataSource
* @param startDate
* @param endDate
* @return
*/
Result getNuclideActConcChartData (String sampleType,String stationCode, String nuclideName,Integer dataSource, Date startDate, Date endDate) throws JsonProcessingException;
/**
* 获取指定时间范围内的样品等级
*
*
*/
Result getSampleGradeAnalysis(String sampleType, String station, Date startDate, Date endDate, Integer dataSource); Result getSampleGradeAnalysis(String sampleType, String station, Date startDate, Date endDate, Integer dataSource);
/*** 样品活度浓度区间频率分析
* 样品活度浓度区间频率分析
* @param sampleType 样品类型
* @param station 台站编码
* @param nuclideName 核素名称
* @param dataSource 数据源
* @param startDate 开始时间
* @param endDate 结束时间
* @return 返回样品活度浓度区间信息
*/
Result getSampleActConcIntvlAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate); Result getSampleActConcIntvlAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate);
/*** 核素活度浓度时序分析
* 核素活度浓度时序分析
* @param sampleType 样品类型
* @param station 台站编码
* @param nuclideName 核素名
* @param dataSource 数据源
* @param startDate 开始时间
* @param endDate 结束时间
* @return 返回核素活度浓度信息
*/
Result getSampleActConcTimeSeqAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate); Result getSampleActConcTimeSeqAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate);
/*** 核素活度浓度对比分析
* 核素活度浓度对比分析
* @param sampleType 样品类型
* @param stationIds 台站ID集合
* @param nuclideName 核素名
* @param dataSource 数据源
* @param startDate 开始时间
* @param endDate 结束时间
* @return
*/
Result getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds, String nuclideName, Integer dataSource, Date startDate, Date endDate); Result getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds, String nuclideName, Integer dataSource, Date startDate, Date endDate);
/**
* 查询台站信息
* @param systemType
* @return
*/
List<GardsStations> findStationListByMenuName(String systemType); List<GardsStations> findStationListByMenuName(String systemType);
/**
* 查询核素信息
* @param systemType
* @return
*/
List<SysDefaultNuclide> findNuclideList(String systemType); List<SysDefaultNuclide> findNuclideList(String systemType);
} }

View File

@ -0,0 +1,42 @@
package org.jeecg.vo;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@Data
public class NuclideDynamicChartDTO {
//图表的X轴是根据collectStop显示的
//核素名称 nuclideName
//MDC集合[时间,数值]
//阈值集合[时间,数值]
//类型是A时级别有
// 级别3[时间,数值]
// 级别4[时间,数值]
//类型是B的时候
// 级别1[时间,数值]
// 级别2[时间,数值]
// 级别3[时间,数值]
private String nuclideName;
/** 单位(固定或动态) */
private String unit = "μBq/m³";
private List<Object[]> mdc; // [[时间, ], ...]
private List<Object[]> threshold; // [[时间, ], ...]
//private List<LevelSeriesDTO> levels; // 动态级别数据
Map<String, List<Object[]>> levels;
@Data
public static class LevelSeriesDTO {
private Integer category;
//private String seriesName;
private List<Object[]> data; // 3级: [时间, 活度, 下限, 上限]其他: [时间, 活度]
}
}