Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
79fd294f78
|
|
@ -0,0 +1,40 @@
|
||||||
|
package org.jeecg.config;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class SchemaMappingConfig {
|
||||||
|
|
||||||
|
private static final Map<Integer, String> SOURCE_SCHEMA_MAP = new HashMap<Integer, String>() {
|
||||||
|
{
|
||||||
|
put(1, "RNAUTO");
|
||||||
|
put(2, "RNMAN");
|
||||||
|
put(3, "RMSAUTO");
|
||||||
|
put(4, "RMSMAN");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据库
|
||||||
|
*
|
||||||
|
* @param source 标识
|
||||||
|
* @return 数据库名
|
||||||
|
*/
|
||||||
|
public String getSourceSchema(Integer source) {
|
||||||
|
return SOURCE_SCHEMA_MAP.get(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValid(Integer source) {
|
||||||
|
return SOURCE_SCHEMA_MAP.containsKey(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Integer> getAllSources() {
|
||||||
|
return SOURCE_SCHEMA_MAP.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,187 +1,148 @@
|
||||||
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 jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||||
import org.jeecg.entity.GardsStations;
|
import org.jeecg.entity.GardsStations;
|
||||||
import org.jeecg.entity.SysDefaultNuclide;
|
import org.jeecg.entity.SysDefaultNuclide;
|
||||||
import org.jeecg.service.ISampleStatAnalysisService;
|
import org.jeecg.service.ISampleStatAnalysisService;
|
||||||
|
import org.jeecg.service.impl.ExcelExportService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("dataAnalysis")
|
@RequestMapping("dataAnalysis")
|
||||||
@Api(value = "数据分析", tags = "数据分析")
|
@Api(value = "数据分析", tags = "数据分析")
|
||||||
public class DataAnalysisController {
|
public class DataAnalysisController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISampleStatAnalysisService sampleStatAnalysisService;
|
private ISampleStatAnalysisService sampleStatAnalysisService;
|
||||||
|
@Autowired
|
||||||
|
private ExcelExportService excelExportService;
|
||||||
|
|
||||||
/*** 样品监测结果回放
|
/*** 样品监测结果回放
|
||||||
*
|
*
|
||||||
* @param sampleType
|
|
||||||
* @param dataSource
|
|
||||||
* @param startDate
|
|
||||||
* @param endDate
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "样品监测结果回放")
|
||||||
@GetMapping("/getSampleMonitorResult")
|
@GetMapping("/getSampleMonitorResult")
|
||||||
@ApiOperation(value = "样品监测结果回放", notes = "样品监测结果回放")
|
@ApiOperation(value = "样品监测结果回放", notes = "样品监测结果回放")
|
||||||
public Result<?> getSampleMonitorResult(String sampleType, Integer dataSource,
|
public Result<?> getSampleMonitorResult(@Valid SampleQueryRequestDTO reqDTO) {
|
||||||
@RequestParam("startDate")
|
return Result.OK(
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
|
sampleStatAnalysisService.getSampleMonitorResult(reqDTO));
|
||||||
@RequestParam("endDate")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
|
|
||||||
return sampleStatAnalysisService.getSampleMonitorResult(sampleType, dataSource, startDate,
|
|
||||||
endDate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** 样品统计分析
|
/*** 样品统计分析
|
||||||
*
|
*
|
||||||
* @param station
|
|
||||||
* @param dataSource
|
|
||||||
* @param startDate
|
|
||||||
* @param endDate
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "样品统计分析")
|
||||||
@GetMapping("/getSampleStatAnalysis")
|
@GetMapping("/getSampleStatAnalysis")
|
||||||
@ApiOperation(value = "样品统计分析", notes = "样品统计分析")
|
@ApiOperation(value = "样品统计分析", notes = "样品统计分析")
|
||||||
public Result<?> getSampleStatAnalysis(String station, Integer dataSource,
|
public Result<?> getSampleStatAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
|
||||||
@RequestParam("startDate")
|
return Result.OK(
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
|
sampleStatAnalysisService.getSampleStatAnalysis(reqDTO));
|
||||||
@RequestParam("endDate")
|
//return sampleStatAnalysisService.getSampleStatAnalysis(station, dataSource, startDate,
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
|
// endDate);
|
||||||
return sampleStatAnalysisService.getSampleStatAnalysis(station, dataSource, startDate,
|
|
||||||
endDate);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "样品统计分析-核素等级时序分析")
|
||||||
@GetMapping("/getNuclideActConcChartData")
|
@GetMapping("/getNuclideActConcChartData")
|
||||||
@ApiOperation(value = "样品统计分析-核素等级时序分析", notes = "样品统计分析-核素等级时序分析")
|
@ApiOperation(value = "样品统计分析-核素等级时序分析", notes = "样品统计分析-核素等级时序分析")
|
||||||
public Result<?> getNuclideActConcChartData(
|
public Result<?> getNuclideActConcChartData(@Valid SampleQueryRequestDTO reqDTO) {
|
||||||
@RequestParam(value = "sampleType") String sampleType,
|
|
||||||
@RequestParam("station") String station,
|
|
||||||
@RequestParam("nuclideName") String nuclideName,
|
return Result.OK(sampleStatAnalysisService.getNuclideActConcChartData(reqDTO));
|
||||||
@RequestParam("dataSource") 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 station 台站编码
|
|
||||||
* @param dataSource 数据源
|
|
||||||
* @param startDate 开始时间
|
|
||||||
* @param endDate 结束时间
|
|
||||||
* @return 返回样品等级信息
|
* @return 返回样品等级信息
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "样品等级时序分析")
|
||||||
@GetMapping("/getSampleGradeAnalysis")
|
@GetMapping("/getSampleGradeAnalysis")
|
||||||
@ApiOperation(value = "样品等级时序分析", notes = "样品等级时序分析")
|
@ApiOperation(value = "样品等级时序分析", notes = "样品等级时序分析")
|
||||||
public Result<?> getSampleGradeAnalysis(String sampleType, String station, Integer dataSource,
|
public Result<?> getSampleGradeAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
|
||||||
@RequestParam("startDate")
|
return Result.OK(
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
|
sampleStatAnalysisService.getSampleGradeAnalysis(reqDTO));
|
||||||
@RequestParam("endDate")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
|
|
||||||
return sampleStatAnalysisService.getSampleGradeAnalysis(sampleType, station, startDate,
|
|
||||||
endDate, dataSource);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*** 样品活度浓度区间频率分析
|
/*** 样品活度浓度区间频率分析
|
||||||
*
|
*
|
||||||
* @param sampleType 样品类型-颗粒物、气体
|
|
||||||
* @param station 台站编码
|
|
||||||
* @param nuclideName 核素名称
|
|
||||||
* @param dataSource 数据源
|
|
||||||
* @param startDate 开始时间
|
|
||||||
* @param endDate 结束时间
|
|
||||||
* @return 返回样品获取浓度区间信息
|
* @return 返回样品获取浓度区间信息
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "样品活度浓度区间频率分析")
|
||||||
@GetMapping("/getActConcIntvlAnalysis")
|
@GetMapping("/getActConcIntvlAnalysis")
|
||||||
@ApiOperation(value = "样品活度浓度区间频率分析", notes = "样品活度浓度区间频率分析")
|
@ApiOperation(value = "样品活度浓度区间频率分析", notes = "样品活度浓度区间频率分析")
|
||||||
public Result<?> getSampleActConcIntvlAnalysis(String sampleType, String station,
|
public Result<?> getSampleActConcIntvlAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
|
||||||
String nuclideName, Integer dataSource,
|
return Result.OK(
|
||||||
@RequestParam("startDate")
|
sampleStatAnalysisService.getSampleActConcIntvlAnalysis(reqDTO));
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
||||||
Date startDate,
|
|
||||||
@RequestParam("endDate")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
||||||
Date endDate) {
|
|
||||||
return sampleStatAnalysisService.getSampleActConcIntvlAnalysis(sampleType, station,
|
|
||||||
nuclideName, dataSource, startDate, endDate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** 样品活度浓度时序分析
|
/*** 样品活度浓度时序分析
|
||||||
*
|
*
|
||||||
* @param sampleType 样品类型-颗粒物、气体
|
|
||||||
* @param station 台站编码
|
|
||||||
* @param nuclideName 核素名称
|
|
||||||
* @param dataSource 数据源
|
|
||||||
* @param startDate 开始时间
|
|
||||||
* @param endDate 结束时间
|
|
||||||
* @return 返回样品获取浓度时序信息
|
* @return 返回样品获取浓度时序信息
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "样品活度浓度时序分析")
|
||||||
@GetMapping("/getActConcTimeSeqAnalysis")
|
@GetMapping("/getActConcTimeSeqAnalysis")
|
||||||
@ApiOperation(value = "样品活度浓度时序分析", notes = "样品活度浓度时序分析")
|
@ApiOperation(value = "样品活度浓度时序分析", notes = "样品活度浓度时序分析")
|
||||||
public Result<?> getSampleActConcTimeSeqAnalysis(String sampleType, String station,
|
public Result<?> getSampleActConcTimeSeqAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
|
||||||
String nuclideName, Integer dataSource,
|
return Result.OK(sampleStatAnalysisService.getNuclideActConcChartData(reqDTO));
|
||||||
@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 stationIds
|
|
||||||
* @param nuclideName
|
|
||||||
* @param dataSource
|
|
||||||
* @param startDate
|
|
||||||
* @param endDate
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "样品活度浓度时序分析")
|
||||||
@GetMapping("/getNuclideActivityConcAnalyze")
|
@GetMapping("/getNuclideActivityConcAnalyze")
|
||||||
@ApiOperation(value = "核素活度浓度对比分析", notes = "核素活度浓度对比分析")
|
@ApiOperation(value = "核素活度浓度对比分析", notes = "核素活度浓度对比分析")
|
||||||
public Result<?> getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds,
|
public Result<?> getNuclideActivityConcAnalyze(@Valid SampleQueryRequestDTO reqDTO) {
|
||||||
String nuclideName, Integer dataSource,
|
return Result.OK(
|
||||||
@RequestParam("startDate")
|
sampleStatAnalysisService.getNuclideActivityConcAnalyze(reqDTO));
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
||||||
Date startDate,
|
|
||||||
@RequestParam("endDate")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
||||||
Date endDate) {
|
|
||||||
return sampleStatAnalysisService.getNuclideActivityConcAnalyze(sampleType, stationIds,
|
|
||||||
nuclideName, dataSource, startDate, endDate);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "导出数据")
|
||||||
|
@GetMapping("/exportData")
|
||||||
|
public void exportData(@RequestParam("type") String type, @Valid SampleQueryRequestDTO reqDTO,HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
excelExportService.exportSingle(type, reqDTO, response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("导出失败, type={}", type, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "获取台站信息")
|
||||||
@GetMapping("/findStationList")
|
@GetMapping("/findStationList")
|
||||||
public Result<?> findStationList(String systemType) {
|
public Result<?> findStationList(@RequestParam("systemType") String systemType, @RequestParam("dataSource") Integer dataSource) {
|
||||||
List<GardsStations> gardsStations =
|
List<GardsStations> gardsStations =
|
||||||
sampleStatAnalysisService.findStationListByMenuName(systemType);
|
sampleStatAnalysisService.findStationListByMenuName(systemType, dataSource);
|
||||||
return Result.OK(gardsStations);
|
return Result.OK(gardsStations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "获取核素信息")
|
||||||
@GetMapping("/findNuclideList")
|
@GetMapping("/findNuclideList")
|
||||||
public Result<?> findNuclideList(String systemType) {
|
public Result<?> findNuclideList(@RequestParam("systemType") String systemType) {
|
||||||
List<SysDefaultNuclide> defaultNuclides =
|
List<SysDefaultNuclide> defaultNuclides =
|
||||||
sampleStatAnalysisService.findNuclideList(systemType);
|
sampleStatAnalysisService.findNuclideList(systemType);
|
||||||
return Result.OK(defaultNuclides);
|
return Result.OK(defaultNuclides);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package org.jeecg.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SampleQueryRequestDTO {
|
||||||
|
private String sampleType;
|
||||||
|
private List<Integer> stationIds;
|
||||||
|
private String nuclideName;
|
||||||
|
private Integer dataSource;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date startDate;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date endDate;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package org.jeecg.entity;
|
||||||
|
|
||||||
|
public final class ExportType {
|
||||||
|
|
||||||
|
private ExportType() {}
|
||||||
|
|
||||||
|
/** 样品等级时序分析 */
|
||||||
|
public static final String SAMPLE_LEVEL_TIME = "sampleLevelTime";
|
||||||
|
|
||||||
|
/** 样品统计分析 */
|
||||||
|
public static final String SAMPLE_STAT = "sampleStat";
|
||||||
|
|
||||||
|
/** 样品活度浓度区间频率分析 */
|
||||||
|
public static final String SAMPLE_RANGE_FREQ = "sampleRangeFreq";
|
||||||
|
|
||||||
|
/** 核素活度浓度时序分析 */
|
||||||
|
public static final String NUCLIDE_TIME = "nuclideTime";
|
||||||
|
|
||||||
|
/** 核素活度浓度对比分析 */
|
||||||
|
public static final String NUCLIDE_COMPARE = "nuclideCompare";
|
||||||
|
|
||||||
|
/** 全部类型 */
|
||||||
|
public static final String ALL = "all";
|
||||||
|
}
|
||||||
|
|
@ -13,6 +13,9 @@ public class SampleLevelData {
|
||||||
* 样品ID
|
* 样品ID
|
||||||
*/
|
*/
|
||||||
private Integer sampleId;
|
private Integer sampleId;
|
||||||
|
|
||||||
|
|
||||||
|
private String stationId;
|
||||||
/** 收集停止时间
|
/** 收集停止时间
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -5,281 +5,150 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.jeecg.entity.*;
|
import org.jeecg.entity.*;
|
||||||
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||||
|
import org.jeecg.vo.NuclideActConcRawVO;
|
||||||
|
import org.jeecg.vo.SampleStatExcelVO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleData> {
|
public interface GardsSampleStatAnalysisMapper extends BaseMapper<GardsSampleData> {
|
||||||
|
|
||||||
List<GardsSampleData> getSampleStatAnalysis(String station, String startDate, String endDate);
|
|
||||||
|
|
||||||
List<ThresholdMetric> selectByStationIds(@Param("stationIds") List<String> stationIds,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
//region 样品等级时序分析
|
//region 样品等级时序分析
|
||||||
|
List<SampleLevelData> getSampleGradeAnalysis(
|
||||||
|
@Param("sampleType") String sampleType,
|
||||||
List<GardsSampleData> getSampleGradeAnalysis(String sampleType, String station,
|
@Param("stations") List<Integer> stations,
|
||||||
@Param("startTime") String startTime,
|
@Param("startTime") Date startTime,
|
||||||
@Param("endTime") String endTime,
|
@Param("endTime") Date endTime,
|
||||||
Integer dataSource);
|
@Param("dsType") String dsType);
|
||||||
|
|
||||||
List<SampleLevelData> getRnAutoSampleGradeAnalysis(String sampleType, String station,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
List<SampleLevelData> getRnManSampleGradeAnalysis(String sampleType, String station,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
|
|
||||||
List<NuclideActConcIntvl> getIdentifiedNuclides(@Param("schemaName") String schemaName,
|
List<NuclideActConcIntvl> getIdentifiedNuclides(@Param("schemaName") String schemaName,
|
||||||
@Param("nuclideName") String nuclideName,
|
@Param("nuclideName") String nuclideName,
|
||||||
String station,
|
@Param("stations") List<Integer> stations,
|
||||||
@Param("startTime") String startTime,
|
@Param("startTime") Date startTime,
|
||||||
@Param("endTime") String endTime);
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
|
List<NuclideActConcIntvl> getRMSIdentifiedNuclides(@Param("schemaName") String schemaName,
|
||||||
//endregion
|
|
||||||
|
|
||||||
/*** 获取样品类型P中元素的浓度活度、MDC信息
|
|
||||||
* 获取样品中元素的浓度活度、MDC信息
|
|
||||||
* @param station 台站编码
|
|
||||||
* @param startTime 开始时间
|
|
||||||
* @param endTime 结束时间
|
|
||||||
* @return 返回List<NuclideActConcIntvl>
|
|
||||||
*/
|
|
||||||
List<NuclideActConcIntvl> getSamplePNuclideActConcIntvl(String station,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
//region 获取样品的级别和阈值
|
|
||||||
|
|
||||||
List<SampleLevelData> getRnAutoSampleLevel(String station, @Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
List<SampleLevelData> getRnManSampleLevel(String station, @Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
|
|
||||||
List<SampleLevelData> getNuclideTimeSeriesAnalysis(@Param("schemaName") String schemaName,
|
|
||||||
@Param("station") String station,
|
|
||||||
@Param("nuclideName") String nuclideName,
|
@Param("nuclideName") String nuclideName,
|
||||||
@Param("startTime") String startTime,
|
@Param("stations") List<Integer> stations,
|
||||||
@Param("endTime") String endTime);
|
@Param("startTime") Date startTime,
|
||||||
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
List<SampleLevelData> getNuclideTimeSeriesAnalysis(@Param("schemaName") String schemaName,
|
||||||
|
@Param("stations") List<Integer> stations,
|
||||||
|
@Param("nuclideName") String nuclideName,
|
||||||
|
@Param("startTime") Date startTime,
|
||||||
|
@Param("endTime") Date endTime);
|
||||||
|
//endregion
|
||||||
//region RNAUTO 获取样品中元素的浓度活度、MDC信息
|
//region RNAUTO 获取样品中元素的浓度活度、MDC信息
|
||||||
|
|
||||||
/*** 获取样品中元素的浓度活度、MDC信息
|
|
||||||
* 查询RNAUTO.GARDS_NUCL_IDED中的活度浓度、MDC信息
|
|
||||||
* @param station 台站编码
|
|
||||||
* @param startTime 开始时间
|
|
||||||
* @param endTime 结束时间
|
|
||||||
* @return 返回List<NuclideActConcIntvl>
|
|
||||||
*/
|
|
||||||
List<NuclideActConcIntvl> getRnautoPNuclideActConcIntvl(String sampleType, String station,
|
|
||||||
String nuclideName,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
/*** 获取样品中元素的浓度活度、MDC信息
|
|
||||||
* 查询RNAUTO.GARDS_XE_RESULTS中的活度浓度、MDC信息
|
|
||||||
* @param station
|
|
||||||
* @param startTime
|
|
||||||
* @param endTime
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<NuclideActConcIntvl> getRnautoNuclideActConcIntvl(String sampleType, String station,
|
|
||||||
String nuclideName,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 样品活度浓度区间频率分析
|
||||||
|
* 获取样品中元素的浓度活度、MDC信息
|
||||||
*
|
*
|
||||||
* @param schemaName
|
* @param schemaName 模式名”
|
||||||
* @return
|
* @param sampleType 样品类型
|
||||||
|
* @param stations 台站
|
||||||
|
* @param nuclideName 核素名称
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
|
* @return List<NuclideActConcIntvl>
|
||||||
*/
|
*/
|
||||||
List<NuclideActConcIntvl>getNuclideActConcIntvl(@Param("schemaName") String schemaName);
|
List<NuclideActConcIntvl> getNuclideActConcIntvl(@Param("schemaName") String schemaName,
|
||||||
|
@Param("sampleType") String sampleType,
|
||||||
|
@Param("stations") List<Integer> stations,
|
||||||
|
@Param("nuclideName") String nuclideName,
|
||||||
|
@Param("startTime") Date startTime,
|
||||||
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
|
List<NuclideActConcIntvl> getRMSNuclideActConcIntvl(@Param("schemaName") String schemaName,
|
||||||
|
@Param("sampleType") String sampleType,
|
||||||
|
@Param("stations") List<Integer> stations,
|
||||||
|
@Param("nuclideName") String nuclideName,
|
||||||
|
@Param("startTime") Date startTime,
|
||||||
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
//region RNMAN 获取样品中元素的浓度活度、MDC信息
|
|
||||||
|
|
||||||
/*** 获取样品中元素的浓度活度、MDC信息
|
|
||||||
* 查询RNAUTO.GARDS_NUCL_IDED中的活度浓度、MDC信息
|
|
||||||
* @param station 台站编码
|
|
||||||
* @param startTime 开始时间
|
|
||||||
* @param endTime 结束时间
|
|
||||||
* @return 返回List<NuclideActConcIntvl>
|
|
||||||
*/
|
|
||||||
List<NuclideActConcIntvl> getRnmanPNuclideActConcIntvl(String sampleType, String station,
|
|
||||||
String nuclideName,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
/*** 获取样品中元素的浓度活度、MDC信息
|
|
||||||
* 查询RNAUTO.GARDS_XE_RESULTS中的活度浓度、MDC信息
|
|
||||||
* @param station
|
|
||||||
* @param startTime
|
|
||||||
* @param endTime
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<NuclideActConcIntvl> getRnmanNuclideActConcIntvl(String sampleType, String station,
|
|
||||||
String nuclideName,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
//endregion
|
|
||||||
|
|
||||||
//region 样品统计分析
|
//region 样品统计分析
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RnAuto--获取样品中识别到的核素集合
|
* RnAuto--获取样品中识别到的核素集合
|
||||||
*/
|
*/
|
||||||
|
List<NuclideActConcIntvl> getSampleNuclides(
|
||||||
List<NuclideActConcIntvl> getRnAutoIdentifiedNuclides(String station,
|
@Param("dbType") String dbType,
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* RnAuto-- 核素等级时序分析
|
|
||||||
*/
|
|
||||||
|
|
||||||
List<SampleLevelData> getRnAutoNuclideTimeSeriesAnalysis(String station,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* RnMan--获取样品中识别到的核素集合
|
|
||||||
*/
|
|
||||||
List<NuclideActConcIntvl> getRnManIdentifiedNuclides(String station,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* RnMan--核素等级时序分析
|
|
||||||
*
|
|
||||||
* @return List<SampleLevelData>
|
|
||||||
*/
|
|
||||||
List<SampleLevelData> getRnManNuclideTimeSeriesAnalysis(String station,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 精确查询(单个站点 + 单个核素)
|
|
||||||
*
|
|
||||||
* @param stationId 站点ID (必填)
|
|
||||||
* @param nuclideName 核素名称 (必填)
|
|
||||||
* @return 匹配的记录列表
|
|
||||||
*/
|
|
||||||
List<GardsThresholdResultHis> selectByStationAndNuclide(
|
|
||||||
@Param("schemaName") String schemaName,
|
@Param("schemaName") String schemaName,
|
||||||
@Param("stationId") Integer stationId,
|
@Param("stations") List<Integer> stations,
|
||||||
|
@Param("startTime") Date startTime,
|
||||||
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
|
List<SampleStatExcelVO> getSampleStatPData(@Param("schemaName") String schemaName,
|
||||||
|
@Param("stations") List<Integer> stations,
|
||||||
|
@Param("startTime") Date startTime,
|
||||||
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
|
List<SampleStatExcelVO> getSampleStatBData(@Param("schemaName") String schemaName,
|
||||||
|
@Param("stations") List<Integer> stations,
|
||||||
|
@Param("startTime") Date startTime,
|
||||||
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
|
|
||||||
|
List<NuclideActConcIntvl> getIdentifiedNuclidesBatch(
|
||||||
|
@Param("schema") String schema,
|
||||||
@Param("nuclideName") String nuclideName,
|
@Param("nuclideName") String nuclideName,
|
||||||
@Param("startTime") String startTime,
|
@Param("stations") List<Integer> stations,
|
||||||
@Param("endTime") String endTime
|
@Param("startTime") Date startTime,
|
||||||
);
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
/**
|
|
||||||
* 多站点 + 多核素查询
|
|
||||||
*
|
|
||||||
* @param stationIds 站点ID集合 (非空)
|
|
||||||
* @param nuclideNames 核素名称集合 (非空)
|
|
||||||
* @return 匹配的记录列表
|
|
||||||
*/
|
|
||||||
List<GardsThresholdResultHis> selectByStationsAndNuclides(
|
|
||||||
@Param("schemaName") String schemaName,
|
|
||||||
@Param("stationIds") List<Integer> stationIds,
|
|
||||||
@Param("nuclideNames") List<String> nuclideNames,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 多站点 + 单核素查询
|
|
||||||
*
|
|
||||||
* @param stationIds 站点ID集合 (非空)
|
|
||||||
* @param nuclideName 单个核素名称 (必填)
|
|
||||||
* @return 匹配的记录列表
|
|
||||||
*/
|
|
||||||
List<GardsThresholdResultHis> selectByStationsAndNuclide(
|
|
||||||
@Param("schemaName") String schemaName,
|
|
||||||
@Param("stationIds") List<Integer> stationIds,
|
|
||||||
@Param("nuclideName") String nuclideName,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单站点 + 多核素查询
|
|
||||||
*
|
|
||||||
* @param stationId 单个站点ID (必填)
|
|
||||||
* @param nuclideNames 核素名称集合 (非空)
|
|
||||||
* @return 匹配的记录列表
|
|
||||||
*/
|
|
||||||
List<GardsThresholdResultHis> selectByStationAndNuclides(
|
|
||||||
@Param("schemaName") String schemaName,
|
|
||||||
@Param("stationId") Integer stationId,
|
|
||||||
@Param("nuclideNames") List<String> nuclideNames,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动态条件查询(所有参数均可为空)
|
|
||||||
*
|
|
||||||
* @param stationIds 站点ID集合 (可选)
|
|
||||||
* @param nuclideNames 核素名称集合 (可选)
|
|
||||||
* @param startTime 开始时间 (可选)
|
|
||||||
* @param endTime 结束时间 (可选)
|
|
||||||
* @return 匹配的记录列表
|
|
||||||
*/
|
|
||||||
List<GardsThresholdResultHis> selectByCondition(
|
|
||||||
@Param("schemaName") String schemaName,
|
|
||||||
@Param("stationIds") List<Integer> stationIds,
|
|
||||||
@Param("nuclideNames") List<String> nuclideNames,
|
|
||||||
@Param("startTime") String startTime,
|
|
||||||
@Param("endTime") String endTime
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
//region 核素活度浓度对比分析
|
//region 核素活度浓度对比分析
|
||||||
List<NuclideActConcIntvl> getRnAutoAnalyzeNuclideActivityConc(
|
List<NuclideActConcIntvl> getRnAutoAnalyzeNuclideActivityConc(
|
||||||
@Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName,
|
@Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName,
|
||||||
@Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime,
|
@Param("stations") List<Integer> stations, @Param("startTime") Date startTime,
|
||||||
@Param("endTime") String endTime);
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
List<NuclideActConcIntvl> getRnManAnalyzeNuclideActivityConc(
|
List<NuclideActConcIntvl> getRnManAnalyzeNuclideActivityConc(
|
||||||
@Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName,
|
@Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName,
|
||||||
@Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime,
|
@Param("stations") List<Integer> stations, @Param("startTime") Date startTime,
|
||||||
@Param("endTime") String endTime);
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
|
List<NuclideActConcIntvl> getRnAnalyzeNuclideActivityConc(
|
||||||
|
@Param("schemaName") String schemaName, @Param("sampleType") String sampleType,
|
||||||
|
@Param("nuclideName") String nuclideName, @Param("stations") List<Integer> stations,
|
||||||
|
@Param("startTime") Date startTime,@Param("endTime") Date endTime);
|
||||||
|
|
||||||
|
List<NuclideActConcIntvl> getRMSAnalyzeNuclideActivityConc(
|
||||||
|
@Param("schemaName") String schemaName, @Param("sampleType") String sampleType,
|
||||||
|
@Param("nuclideName") String nuclideName,@Param("stations") List<Integer> stations,
|
||||||
|
@Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
//region 样品监测结果
|
//region 样品监测结果
|
||||||
List<StationInfoData> getRnAutoSampleResult(String sampleType,
|
List<StationInfoData> getRnAutoSampleResult(String sampleType,
|
||||||
@Param("startTime") String startTime,
|
@Param("startTime") Date startTime,
|
||||||
@Param("endTime") String endTime);
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
List<StationInfoData> getRnManSampleResult(String sampleType,
|
List<StationInfoData> getRnManSampleResult(String sampleType,
|
||||||
@Param("startTime") String startTime,
|
@Param("startTime") Date startTime,
|
||||||
@Param("endTime") String endTime);
|
@Param("endTime") Date endTime);
|
||||||
|
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
//region 查询台站信息
|
//region 查询台站信息
|
||||||
List<GardsStations> findStationListByMenuName(@Param("systemType") String systemType);
|
List<GardsStations> findStationListByMenuName(@Param("systemType") String systemType);
|
||||||
|
List<GardsStations> findRMSStationListByMenuName(@Param("systemType") String systemType);
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询各站点核素的活度浓度(用于区间频率分析)
|
||||||
|
*/
|
||||||
|
List<NuclideActConcRawVO> getNuclideActConcList(
|
||||||
|
@Param("schema") String schema,
|
||||||
|
@Param("stations") List<Integer> stations,
|
||||||
|
@Param("sampleType") String sampleType,
|
||||||
|
@Param("startTime") Date startTime,
|
||||||
|
@Param("endTime") Date endTime);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,23 @@
|
||||||
|
package org.jeecg.service;
|
||||||
|
|
||||||
|
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出处理器接口 —— 每种数据类型实现一个
|
||||||
|
*/
|
||||||
|
public interface ExportHandler {
|
||||||
|
|
||||||
|
/** 数据类型标识 */
|
||||||
|
String getType();
|
||||||
|
|
||||||
|
/** Sheet 名称 */
|
||||||
|
String getSheetName();
|
||||||
|
|
||||||
|
/** 查询数据 */
|
||||||
|
List<?> queryData(SampleQueryRequestDTO reqDTO);
|
||||||
|
|
||||||
|
/** 返回 VO 的 Class */
|
||||||
|
Class<?> getExcelClass();
|
||||||
|
}
|
||||||
|
|
@ -3,40 +3,35 @@ 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 com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||||
import org.jeecg.entity.GardsStations;
|
import org.jeecg.entity.GardsStations;
|
||||||
|
import org.jeecg.entity.SampleLevelData;
|
||||||
import org.jeecg.entity.SysDefaultNuclide;
|
import org.jeecg.entity.SysDefaultNuclide;
|
||||||
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||||
|
import org.jeecg.vo.SampleStatExcelVO;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface ISampleStatAnalysisService extends IService<GardsSampleData> {
|
public interface ISampleStatAnalysisService extends IService<GardsSampleData> {
|
||||||
|
|
||||||
Result getSampleMonitorResult(String sampleType, Integer dataSource, Date startDate, Date endDate);
|
Map<String, Object> getSampleMonitorResult(SampleQueryRequestDTO reqDTO);
|
||||||
|
|
||||||
/*** 样品统计分析
|
/*** 样品统计分析
|
||||||
* 样品统计分析
|
* 样品统计分析
|
||||||
* @param station
|
|
||||||
* @param startDate
|
|
||||||
* @param endDate
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result getSampleStatAnalysis(String station, Integer dataSource, Date startDate, Date endDate);
|
Map<String, Object> getSampleStatAnalysis(SampleQueryRequestDTO reqDTO);
|
||||||
|
List<SampleStatExcelVO> getSampleStatData(SampleQueryRequestDTO reqDTO);
|
||||||
/**
|
/**
|
||||||
* 样品统计分析--核素浓度时序分析
|
* 样品统计分析--核素浓度时序分析
|
||||||
* @param sampleType
|
*
|
||||||
* @param stationCode
|
|
||||||
* @param nuclideName
|
|
||||||
* @param dataSource
|
|
||||||
* @param startDate
|
|
||||||
* @param endDate
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result getNuclideActConcChartData (String sampleType,String stationCode, String nuclideName,Integer dataSource, Date startDate, Date endDate) throws JsonProcessingException;
|
Map<String, Object> getNuclideActConcChartData(SampleQueryRequestDTO reqDTO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,54 +39,40 @@ public interface ISampleStatAnalysisService extends IService<GardsSampleData> {
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Result getSampleGradeAnalysis(String sampleType, String station, Date startDate, Date endDate, Integer dataSource);
|
Map<String, Object> getSampleGradeAnalysis(SampleQueryRequestDTO reqDTO);
|
||||||
|
|
||||||
|
List<SampleLevelData> getSampleGradeAnalysisData(SampleQueryRequestDTO reqDTO);
|
||||||
|
|
||||||
/*** 样品活度浓度区间频率分析
|
/*** 样品活度浓度区间频率分析
|
||||||
* 样品活度浓度区间频率分析
|
* 样品活度浓度区间频率分析
|
||||||
* @param sampleType 样品类型
|
|
||||||
* @param station 台站编码
|
|
||||||
* @param nuclideName 核素名称
|
|
||||||
* @param dataSource 数据源
|
|
||||||
* @param startDate 开始时间
|
|
||||||
* @param endDate 结束时间
|
|
||||||
* @return 返回样品活度浓度区间信息
|
* @return 返回样品活度浓度区间信息
|
||||||
*/
|
*/
|
||||||
Result getSampleActConcIntvlAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate);
|
Map<String, Object> getSampleActConcIntvlAnalysis(SampleQueryRequestDTO reqDTO);
|
||||||
|
|
||||||
/*** 核素活度浓度时序分析
|
/*** 核素活度浓度时序分析
|
||||||
* 核素活度浓度时序分析
|
* 核素活度浓度时序分析
|
||||||
* @param sampleType 样品类型
|
|
||||||
* @param station 台站编码
|
|
||||||
* @param nuclideName 核素名
|
|
||||||
* @param dataSource 数据源
|
|
||||||
* @param startDate 开始时间
|
|
||||||
* @param endDate 结束时间
|
|
||||||
* @return 返回核素活度浓度信息
|
* @return 返回核素活度浓度信息
|
||||||
*/
|
*/
|
||||||
Result getSampleActConcTimeSeqAnalysis(String sampleType, String station, String nuclideName, Integer dataSource, Date startDate, Date endDate);
|
Result getSampleActConcTimeSeqAnalysis(SampleQueryRequestDTO reqDTO);
|
||||||
|
|
||||||
/*** 核素活度浓度对比分析
|
/*** 核素活度浓度对比分析
|
||||||
* 核素活度浓度对比分析
|
* 核素活度浓度对比分析
|
||||||
* @param sampleType 样品类型
|
|
||||||
* @param stationIds 台站ID集合
|
|
||||||
* @param nuclideName 核素名
|
|
||||||
* @param dataSource 数据源
|
|
||||||
* @param startDate 开始时间
|
|
||||||
* @param endDate 结束时间
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds, String nuclideName, Integer dataSource, Date startDate, Date endDate);
|
Map<String, Object> getNuclideActivityConcAnalyze(SampleQueryRequestDTO reqDTO);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询台站信息
|
* 查询台站信息
|
||||||
|
*
|
||||||
* @param systemType
|
* @param systemType
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<GardsStations> findStationListByMenuName(String systemType);
|
List<GardsStations> findStationListByMenuName(String systemType,Integer dataSource);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询核素信息
|
* 查询核素信息
|
||||||
|
*
|
||||||
* @param systemType
|
* @param systemType
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
package org.jeecg.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||||
|
import org.jeecg.service.ExportHandler;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ExcelExportService {
|
||||||
|
private final ExportHandlerRegistry registry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单类型导出
|
||||||
|
*
|
||||||
|
* @param type 导出类型
|
||||||
|
* @param reqDTO 请求实体
|
||||||
|
* @param response 响应
|
||||||
|
*/
|
||||||
|
public void exportSingle(String type, SampleQueryRequestDTO reqDTO, HttpServletResponse response) throws
|
||||||
|
IOException {
|
||||||
|
ExportHandler handler = registry.getHandler(type);
|
||||||
|
|
||||||
|
List<?> data = handler.queryData(reqDTO);
|
||||||
|
if (CollectionUtils.isEmpty(data)) {
|
||||||
|
throw new IOException("暂无导出数据");
|
||||||
|
}
|
||||||
|
if (data == null) {
|
||||||
|
data = new ArrayList<>();
|
||||||
|
} else {
|
||||||
|
data = new ArrayList<>(data); // ← 转为可变 List
|
||||||
|
}
|
||||||
|
ExportParams params = new ExportParams(handler.getSheetName(), handler.getSheetName(), ExcelType.XSSF);
|
||||||
|
|
||||||
|
try (Workbook workbook = ExcelExportUtil.exportExcel(params, handler.getExcelClass(), data)) {
|
||||||
|
download(workbook, handler.getSheetName(), response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void download(Workbook workbook,
|
||||||
|
String fileName,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
response.setContentType(
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setCharacterEncoding("UTF-8");
|
||||||
|
response.setHeader("Content-Disposition",
|
||||||
|
"attachment;filename*=utf-8''" +
|
||||||
|
URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20") + ".xlsx");
|
||||||
|
workbook.write(response.getOutputStream());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package org.jeecg.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.service.ExportHandler;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class ExportHandlerRegistry {
|
||||||
|
private final Map<String, ExportHandler> handlerMap = new HashMap<String, ExportHandler>();
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ExportHandlerRegistry(List<ExportHandler> handlers) {
|
||||||
|
handlers.forEach(handler -> {
|
||||||
|
handlerMap.put(handler.getType(), handler);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定类型的处理类
|
||||||
|
*/
|
||||||
|
public ExportHandler getHandler(String type) {
|
||||||
|
ExportHandler exportHandler = handlerMap.get(type);
|
||||||
|
if (exportHandler == null) {
|
||||||
|
throw new IllegalArgumentException("不支持的导出类型: " + type);
|
||||||
|
}
|
||||||
|
return exportHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取全部处理类
|
||||||
|
* @return ExportHandler集合
|
||||||
|
*/
|
||||||
|
public Collection<ExportHandler> getHandlers() {
|
||||||
|
return handlerMap.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package org.jeecg.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||||
|
import org.jeecg.entity.ExportType;
|
||||||
|
import org.jeecg.service.ExportHandler;
|
||||||
|
import org.jeecg.vo.NuclideCompareExcelVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class NuclideCompareExportHandler implements ExportHandler {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SampleStatAnalysisService sampleStatAnalysisService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return ExportType.NUCLIDE_COMPARE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSheetName() {
|
||||||
|
return "核素对比分析";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<?> getExcelClass() {
|
||||||
|
return NuclideCompareExcelVO.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
|
||||||
|
return sampleStatAnalysisService.getNuclideCompareExportData(reqDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package org.jeecg.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||||
|
import org.jeecg.entity.ExportType;
|
||||||
|
import org.jeecg.service.ExportHandler;
|
||||||
|
import org.jeecg.vo.NuclideTimeExcelVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class NuclideTimeExportHandler implements ExportHandler {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SampleStatAnalysisService sampleStatAnalysisService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return ExportType.NUCLIDE_TIME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSheetName() {
|
||||||
|
return "核素时序分析";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<?> getExcelClass() {
|
||||||
|
return NuclideTimeExcelVO.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
|
||||||
|
return sampleStatAnalysisService.getNuclideActConcExportData(reqDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package org.jeecg.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||||
|
import org.jeecg.entity.ExportType;
|
||||||
|
import org.jeecg.entity.SampleLevelData;
|
||||||
|
import org.jeecg.service.ExportHandler;
|
||||||
|
import org.jeecg.service.ISampleStatAnalysisService;
|
||||||
|
import org.jeecg.vo.SampleAnalysisExcelVO;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class SampleAnalysisExportHandler implements ExportHandler {
|
||||||
|
@Autowired
|
||||||
|
private ISampleStatAnalysisService sampleStatAnalysisService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return ExportType.SAMPLE_LEVEL_TIME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSheetName() {
|
||||||
|
return "样品等级时序分析";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
|
||||||
|
List<SampleLevelData> dataList =
|
||||||
|
sampleStatAnalysisService.getSampleGradeAnalysisData(reqDTO);
|
||||||
|
if (CollectionUtils.isEmpty(dataList)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return dataList.stream().map(data -> {
|
||||||
|
SampleAnalysisExcelVO vo = new SampleAnalysisExcelVO();
|
||||||
|
BeanUtils.copyProperties(data, vo);
|
||||||
|
return vo;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<?> getExcelClass() {
|
||||||
|
return SampleAnalysisExcelVO.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package org.jeecg.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||||
|
import org.jeecg.entity.ExportType;
|
||||||
|
import org.jeecg.service.ExportHandler;
|
||||||
|
import org.jeecg.vo.SampleRangeFreqExcelVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class SampleRangeFreqExportHandler implements ExportHandler {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SampleStatAnalysisService sampleStatAnalysisService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return ExportType.SAMPLE_RANGE_FREQ;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSheetName() {
|
||||||
|
return "浓度区间频率";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<?> getExcelClass() {
|
||||||
|
return SampleRangeFreqExcelVO.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
|
||||||
|
return sampleStatAnalysisService.getSampleRangeFreqExportData(reqDTO,
|
||||||
|
null // 区间宽度,默认 10
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,45 @@
|
||||||
|
package org.jeecg.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||||
|
import org.jeecg.entity.ExportType;
|
||||||
|
import org.jeecg.service.ExportHandler;
|
||||||
|
import org.jeecg.service.ISampleStatAnalysisService;
|
||||||
|
import org.jeecg.vo.SampleStatExcelVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class SampleStatExportHandler implements ExportHandler {
|
||||||
|
@Autowired
|
||||||
|
private ISampleStatAnalysisService sampleStatAnalysisService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return ExportType.SAMPLE_STAT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSheetName() {
|
||||||
|
return "样品统计分析";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<?> queryData(SampleQueryRequestDTO reqDTO) {
|
||||||
|
List<SampleStatExcelVO> dataList =
|
||||||
|
sampleStatAnalysisService.getSampleStatData(reqDTO);
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(dataList)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return dataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<?> getExcelClass() {
|
||||||
|
return SampleStatExcelVO.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
package org.jeecg.util;
|
package org.jeecg.util;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.entity.NuclideActConcIntvl;
|
import org.jeecg.entity.NuclideActConcIntvl;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@Slf4j
|
||||||
public class DistributionAnalysisToolkit {
|
public class DistributionAnalysisToolkit {
|
||||||
/**
|
/**
|
||||||
* 区间统计结果
|
* 区间统计结果
|
||||||
|
|
@ -16,25 +17,26 @@ public class DistributionAnalysisToolkit {
|
||||||
private final int count;
|
private final int count;
|
||||||
private final List<Double> values;
|
private final List<Double> values;
|
||||||
private final Map<Integer, Integer> levelDistribution;
|
private final Map<Integer, Integer> levelDistribution;
|
||||||
public IntervalStat(String interval, List<NuclideActConcIntvl> nuclideData) {
|
|
||||||
values=new ArrayList<>();
|
public IntervalStat(String interval, List<NuclideActConcIntvl> nuclideData) {
|
||||||
levelDistribution=new TreeMap<>();
|
values = new ArrayList<>();
|
||||||
|
levelDistribution = new TreeMap<>();
|
||||||
this.interval = interval;
|
this.interval = interval;
|
||||||
this.count = nuclideData.size();
|
this.count = nuclideData.size();
|
||||||
for (NuclideActConcIntvl nuclide : nuclideData) {
|
for (NuclideActConcIntvl nuclide : nuclideData) {
|
||||||
//获取浓度值
|
//获取浓度值
|
||||||
Double conc = nuclide.getConc();
|
Double conc = nuclide.getConc();
|
||||||
if (conc != null) { // 过滤 conc null
|
if (conc != null) { // 过滤 conc null
|
||||||
values.add(conc);
|
values.add(conc);
|
||||||
}
|
}
|
||||||
Integer category = nuclide.getCategory();
|
Integer category = nuclide.getCategory();
|
||||||
if (category != null) { // 跳过 null
|
if (category != null) { // 跳过 null
|
||||||
levelDistribution.merge(category, 1, Integer::sum);
|
levelDistribution.merge(category, 1, Integer::sum);
|
||||||
} else {
|
} else {
|
||||||
// 数据库中存在记录 null 级别,用特殊 key 如 -1
|
// 数据库中存在记录 null 级别,用特殊 key 如 -1
|
||||||
// levelDistribution.merge(-1, 1, Integer::sum);
|
// levelDistribution.merge(-1, 1, Integer::sum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,8 +52,13 @@ public class DistributionAnalysisToolkit {
|
||||||
this.density = density;
|
this.density = density;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getX() { return x; }
|
public double getX() {
|
||||||
public double getDensity() { return density; }
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getDensity() {
|
||||||
|
return density;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -66,15 +73,19 @@ public class DistributionAnalysisToolkit {
|
||||||
this.cumulativeProb = cumulativeProb;
|
this.cumulativeProb = cumulativeProb;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getValue() { return value; }
|
public double getValue() {
|
||||||
public double getCumulativeProb() { return cumulativeProb; }
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getCumulativeProb() {
|
||||||
|
return cumulativeProb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据区间统计
|
* 数据区间统计
|
||||||
*
|
*
|
||||||
* @param nuclideData 原始数据
|
* @param nuclideData 原始数据
|
||||||
* @param start 起始值
|
|
||||||
* @param step 区间宽度
|
|
||||||
* @return 区间统计结果列表
|
* @return 区间统计结果列表
|
||||||
*/
|
*/
|
||||||
//region
|
//region
|
||||||
|
|
@ -111,50 +122,80 @@ public class DistributionAnalysisToolkit {
|
||||||
// return stats;
|
// return stats;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
//endregion
|
//endregion
|
||||||
|
public static List<IntervalStat> calculateIntervalStats(List<NuclideActConcIntvl> nuclideData) {
|
||||||
public static List<IntervalStat> calculateIntervalStats(List<NuclideActConcIntvl> nuclideData, double start, double step) {
|
|
||||||
if (nuclideData == null || nuclideData.isEmpty()) {
|
if (nuclideData == null || nuclideData.isEmpty()) {
|
||||||
throw new IllegalArgumentException("数据不能为空");
|
throw new IllegalArgumentException("数据不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算结束边界
|
int numBins = calculateOptimalBins(nuclideData);
|
||||||
double maxConc = nuclideData.stream()
|
//int numBins = 50;
|
||||||
.mapToDouble(NuclideActConcIntvl::getConc)
|
log.info("分箱个数",numBins);
|
||||||
.max()
|
//统计 min/max/count
|
||||||
.orElse(0.0);
|
DoubleSummaryStatistics statsData = nuclideData.stream()
|
||||||
double end = Math.ceil(maxConc / step) * step + step;
|
.map(nuclideActConcIntvl -> nuclideActConcIntvl.getConc())
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.filter(d -> !d.isNaN() && !d.isInfinite())
|
||||||
|
.mapToDouble(Double::doubleValue)
|
||||||
|
.summaryStatistics();
|
||||||
|
if (statsData.getCount() == 0) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
double min = statsData.getMin();
|
||||||
|
double max = statsData.getMax();
|
||||||
|
log.info("数据min:",min);
|
||||||
|
log.info("数据max:",max);
|
||||||
|
|
||||||
|
//2. 处理所有值相同或极小范围(关键!避免 binWidth = 0)
|
||||||
|
if (max - min < 1e-8) {
|
||||||
|
// 取值向下取整为起点,向上扩展一个单位
|
||||||
|
min = Math.floor(min);
|
||||||
|
max = min + Math.max(1.0, Math.abs(min) * 0.1); // 避免 min=-1000 时扩展太小
|
||||||
|
}
|
||||||
|
|
||||||
|
double binWidth = (max - min) / numBins;
|
||||||
|
if (binWidth <= 0) {
|
||||||
|
binWidth = 1.0; // 极端防御
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> bins = new ArrayList<>();
|
||||||
// 初始化区间映射
|
// 初始化区间映射
|
||||||
Map<String, List<NuclideActConcIntvl>> intervalMap = new TreeMap<>();
|
Map<String, List<NuclideActConcIntvl>> intervalMap = new TreeMap<>();
|
||||||
for (double lower = start; lower < end; lower += step) {
|
for (int i = 0; i < numBins; i++) {
|
||||||
double upper = lower + step;
|
double start1 = min + i * binWidth;
|
||||||
String key = String.format("[%.1f, %.1f)", lower, upper);
|
double end1 = min + (i + 1) * binWidth;
|
||||||
|
|
||||||
|
// 最后一个区间使用闭区间,语义更清晰
|
||||||
|
String key = i == numBins - 1
|
||||||
|
? String.format("[%.4f ~ %.4f]", start1, max)
|
||||||
|
: String.format("[%.4f ~ %.4f)", start1, end1);
|
||||||
|
bins.add(key);
|
||||||
intervalMap.put(key, new ArrayList<>());
|
intervalMap.put(key, new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分配数据到区间
|
// 分配数据到区间
|
||||||
for (NuclideActConcIntvl nuclide : nuclideData) {
|
for (NuclideActConcIntvl nuclide : nuclideData) {
|
||||||
double value=nuclide.getConc();
|
double value = nuclide.getConc();
|
||||||
double lower = Math.floor(value / step) * step;
|
// 计算当前对象属于哪个区间索引
|
||||||
String key = String.format("[%.1f, %.1f)", lower, lower + step);
|
int index = (int) ((value - min) / binWidth);
|
||||||
|
if (index < 0) {
|
||||||
intervalMap.get(key).add(nuclide);
|
index = 0;
|
||||||
|
}
|
||||||
|
if (index >= numBins) {
|
||||||
|
index = numBins - 1;
|
||||||
|
}
|
||||||
|
intervalMap.get(bins.get(index)).add(nuclide);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转换为统计结果对象
|
// 转换为统计结果对象
|
||||||
List<IntervalStat> stats = new ArrayList<>();
|
List<IntervalStat> stats = new ArrayList<>();
|
||||||
for (Map.Entry<String,List<NuclideActConcIntvl>> entry : intervalMap.entrySet()) {
|
for (Map.Entry<String, List<NuclideActConcIntvl>> entry : intervalMap.entrySet()) {
|
||||||
stats.add(new IntervalStat(entry.getKey(), entry.getValue()));
|
stats.add(new IntervalStat(entry.getKey(), entry.getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return stats;
|
return stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算95%累积线
|
* 计算95%累积线
|
||||||
*
|
*
|
||||||
|
|
@ -218,7 +259,6 @@ public class DistributionAnalysisToolkit {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 核函数接口
|
* 核函数接口
|
||||||
*/
|
*/
|
||||||
|
|
@ -228,10 +268,12 @@ public class DistributionAnalysisToolkit {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 常用核函数实现
|
// 常用核函数实现
|
||||||
public static final KernelFunction GAUSSIAN_KERNEL = u -> Math.exp(-0.5 * u * u) / Math.sqrt(2 * Math.PI);
|
public static final KernelFunction GAUSSIAN_KERNEL =
|
||||||
public static final KernelFunction EPANECHNIKOV_KERNEL = u -> (Math.abs(u) <= 1) ? 0.75 * (1 - u * u) : 0;
|
u -> Math.exp(-0.5 * u * u) / Math.sqrt(2 * Math.PI);
|
||||||
public static final KernelFunction TRIANGULAR_KERNEL = u -> (Math.abs(u) <= 1) ? 1 - Math.abs(u) : 0;
|
public static final KernelFunction EPANECHNIKOV_KERNEL =
|
||||||
|
u -> (Math.abs(u) <= 1) ? 0.75 * (1 - u * u) : 0;
|
||||||
|
public static final KernelFunction TRIANGULAR_KERNEL =
|
||||||
|
u -> (Math.abs(u) <= 1) ? 1 - Math.abs(u) : 0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -239,7 +281,9 @@ public class DistributionAnalysisToolkit {
|
||||||
*/
|
*/
|
||||||
public static double calculateBandwidthSilverman(List<Double> data) {
|
public static double calculateBandwidthSilverman(List<Double> data) {
|
||||||
int n = data.size();
|
int n = data.size();
|
||||||
if (n <= 1) return 1.0;
|
if (n <= 1) {
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
// 计算标准差
|
// 计算标准差
|
||||||
double mean = data.stream().mapToDouble(Double::doubleValue).average().orElse(0.0);
|
double mean = data.stream().mapToDouble(Double::doubleValue).average().orElse(0.0);
|
||||||
|
|
@ -310,15 +354,15 @@ public class DistributionAnalysisToolkit {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//获取浓度值集合
|
//获取浓度值集合
|
||||||
public static List<Double> convertConcToDoubleList(List<NuclideActConcIntvl> nuclideList) {
|
public static List<Double> convertConcToDoubleList(List<NuclideActConcIntvl> nuclideList) {
|
||||||
return nuclideList.stream() // 创建流
|
return nuclideList.stream() // 创建流
|
||||||
.map(NuclideActConcIntvl::getConc) // 提取conc值
|
.map(NuclideActConcIntvl::getConc) // 提取conc值
|
||||||
.collect(Collectors.toList()); // 收集为List<Double>
|
.collect(Collectors.toList()); // 收集为List<Double>
|
||||||
}
|
}
|
||||||
|
|
||||||
//累积和
|
//累积和
|
||||||
public static List<Double> cumulativeSum(List<Double> data) {
|
public static List<Double> cumulativeSum(List<Double> data) {
|
||||||
List<Double> result = new ArrayList<>();
|
List<Double> result = new ArrayList<>();
|
||||||
double sum = 0.0;
|
double sum = 0.0;
|
||||||
|
|
||||||
|
|
@ -331,15 +375,32 @@ public class DistributionAnalysisToolkit {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static int calculateOptimalBins(List<NuclideActConcIntvl> data) {
|
||||||
|
if (Objects.isNull(data)) {
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
List<Double> values = data.stream()
|
||||||
|
.map(NuclideActConcIntvl::getConc)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.filter(d -> !d.isNaN() && !d.isInfinite())
|
||||||
|
.sorted()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
int n = values.size();
|
||||||
|
if (n < 2) {
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
double q1 = values.get(n / 4);
|
||||||
|
double q3 = values.get((3 * n) / 4);
|
||||||
|
double iqr = q3 - q1;
|
||||||
|
if (iqr <= 0) {
|
||||||
|
return (int) Math.max(3, Math.ceil(Math.sqrt(n)));
|
||||||
|
}
|
||||||
|
double binWidth = 2 * iqr * Math.pow(n, -1.0 / 3.0);
|
||||||
|
double dataRange = values.get(n - 1) - values.get(0);
|
||||||
|
int bins = (int) Math.ceil(dataRange / binWidth);
|
||||||
|
bins = Math.max(3, Math.min(40, bins));
|
||||||
|
return bins;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package org.jeecg.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class NuclideActConcRawVO {
|
||||||
|
/** 站点 */
|
||||||
|
private String stationId;
|
||||||
|
/** 核素名称 */
|
||||||
|
private String nuclideName;
|
||||||
|
/** 活度浓度 */
|
||||||
|
private BigDecimal conc;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package org.jeecg.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.ExcelTarget;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ExcelTarget("nuclideCompareExcel")
|
||||||
|
public class NuclideCompareExcelVO {
|
||||||
|
|
||||||
|
@Excel(name = "核素名称", width = 15, orderNum = "1")
|
||||||
|
private String nuclideName;
|
||||||
|
|
||||||
|
@Excel(name = "单位", width = 15, orderNum = "2")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Excel(name = "台站A ID", width = 15, orderNum = "3")
|
||||||
|
private Integer stationAId;
|
||||||
|
|
||||||
|
@Excel(name = "台站A 活度浓度", width = 20, orderNum = "4")
|
||||||
|
private Double valueA;
|
||||||
|
|
||||||
|
@Excel(name = "台站A 收集时间", width = 20, format = "yyyy-MM-dd HH:mm:ss", orderNum = "5")
|
||||||
|
private Date collectStopA;
|
||||||
|
|
||||||
|
@Excel(name = "台站B ID", width = 15, orderNum = "6")
|
||||||
|
private Integer stationBId;
|
||||||
|
|
||||||
|
@Excel(name = "台站B 活度浓度", width = 20, orderNum = "7")
|
||||||
|
private Double valueB;
|
||||||
|
|
||||||
|
@Excel(name = "台站B 收集时间", width = 20, format = "yyyy-MM-dd HH:mm:ss", orderNum = "8")
|
||||||
|
private Date collectStopB;
|
||||||
|
|
||||||
|
@Excel(name = "浓度差值(A-B)", width = 20, orderNum = "9")
|
||||||
|
private Double diffValue;
|
||||||
|
|
||||||
|
@Excel(name = "变化率(%)", width = 15, orderNum = "10")
|
||||||
|
private Double changeRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package org.jeecg.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.ExcelTarget;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ExcelTarget("nuclideTimeExcel")
|
||||||
|
public class NuclideTimeExcelVO {
|
||||||
|
|
||||||
|
@Excel(name = "站点", orderNum = "0", width = 15)
|
||||||
|
private Integer stationId;
|
||||||
|
|
||||||
|
@Excel(name = "核素名称", orderNum = "1", width = 12)
|
||||||
|
private String nuclideName;
|
||||||
|
|
||||||
|
@Excel(name = "采样时间", orderNum = "2", width = 20,
|
||||||
|
format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date collectStop;
|
||||||
|
|
||||||
|
@Excel(name = "活度浓度", orderNum = "3", width = 16, numFormat = "#,##0.000E00")
|
||||||
|
private Double conc;
|
||||||
|
|
||||||
|
@Excel(name = "不确定度", orderNum = "4", width = 16, numFormat = "#,##0.000E00")
|
||||||
|
private Double concErr;
|
||||||
|
|
||||||
|
@Excel(name = "MDC", orderNum = "5", width = 16, numFormat = "#,##0.000E00")
|
||||||
|
private Double mdc;
|
||||||
|
|
||||||
|
@Excel(name = "阈值", orderNum = "6", width = 16, numFormat = "#,##0.000E00")
|
||||||
|
private Double thresholdValue;
|
||||||
|
|
||||||
|
@Excel(name = "等级", orderNum = "7", width = 10)
|
||||||
|
private Integer category;
|
||||||
|
|
||||||
|
@Excel(name = "浓度单位", orderNum = "8", width = 12)
|
||||||
|
private String unit;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package org.jeecg.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SampleAnalysisExcelVO {
|
||||||
|
/**
|
||||||
|
* 样品ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "样品ID",orderNum = "0", width = 15)
|
||||||
|
private Integer sampleId;
|
||||||
|
@Excel(name = "台站",orderNum = "1", width = 15)
|
||||||
|
private String stationId;
|
||||||
|
/**
|
||||||
|
* 收集停止时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@Excel(name = "采集停止时间",orderNum = "2", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date collectStop;
|
||||||
|
/**
|
||||||
|
* 级别
|
||||||
|
*/
|
||||||
|
@Excel(name = "级别",orderNum = "3", width = 10)
|
||||||
|
private Integer category;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package org.jeecg.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.ExcelTarget;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ExcelTarget("sampleRangeFreqExcel")
|
||||||
|
public class SampleRangeFreqExcelVO {
|
||||||
|
|
||||||
|
@Excel(name = "站点", orderNum = "0", width = 15)
|
||||||
|
private String stationId;
|
||||||
|
|
||||||
|
@Excel(name = "核素名称", orderNum = "1", width = 12)
|
||||||
|
private String nuclideName;
|
||||||
|
|
||||||
|
@Excel(name = "浓度区间", orderNum = "2", width = 22)
|
||||||
|
private String rangeLabel;
|
||||||
|
|
||||||
|
@Excel(name = "频数", orderNum = "3", width = 10)
|
||||||
|
private Integer frequency;
|
||||||
|
|
||||||
|
@Excel(name = "频率(%)", orderNum = "4", width = 12, numFormat = "#,##0.00")
|
||||||
|
private BigDecimal frequencyRate;
|
||||||
|
|
||||||
|
@Excel(name = "累计频率(%)", orderNum = "5", width = 14, numFormat = "#,##0.00")
|
||||||
|
private BigDecimal cumulativeRate;
|
||||||
|
|
||||||
|
@Excel(name = "样本总数", orderNum = "6", width = 10)
|
||||||
|
private Integer totalCount;
|
||||||
|
|
||||||
|
@Excel(name = "浓度单位", orderNum = "7", width = 12)
|
||||||
|
private String unit;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.jeecg.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.ExcelTarget;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ExcelTarget("sampleStatExcel")
|
||||||
|
public class SampleStatExcelVO {
|
||||||
|
|
||||||
|
@Excel(name = "核素名称", orderNum = "0", width = 15)
|
||||||
|
private String nuclideName;
|
||||||
|
|
||||||
|
@Excel(name = "样品数量", orderNum = "1", width = 12)
|
||||||
|
private Integer count;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user