添加导出数据工具类
This commit is contained in:
parent
a7710c1bcb
commit
ce2817d168
|
|
@ -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;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import io.swagger.annotations.Api;
|
||||
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.aspect.annotation.AutoLog;
|
||||
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||
import org.jeecg.entity.GardsStations;
|
||||
import org.jeecg.entity.SysDefaultNuclide;
|
||||
import org.jeecg.service.ISampleStatAnalysisService;
|
||||
import org.jeecg.service.impl.ExcelExportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("dataAnalysis")
|
||||
@Api(value = "数据分析", tags = "数据分析")
|
||||
public class DataAnalysisController {
|
||||
@Autowired
|
||||
private ISampleStatAnalysisService sampleStatAnalysisService;
|
||||
@Autowired
|
||||
private ExcelExportService excelExportService;
|
||||
|
||||
/*** 样品监测结果回放
|
||||
*
|
||||
* @param sampleType
|
||||
* @param dataSource
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "样品监测结果回放")
|
||||
@GetMapping("/getSampleMonitorResult")
|
||||
@ApiOperation(value = "样品监测结果回放", notes = "样品监测结果回放")
|
||||
public Result<?> getSampleMonitorResult(String sampleType, Integer dataSource,
|
||||
@RequestParam("startDate")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
|
||||
@RequestParam("endDate")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
|
||||
return sampleStatAnalysisService.getSampleMonitorResult(sampleType, dataSource, startDate,
|
||||
endDate);
|
||||
public Result<?> getSampleMonitorResult(@Valid SampleQueryRequestDTO reqDTO) {
|
||||
return Result.OK(
|
||||
sampleStatAnalysisService.getSampleMonitorResult(reqDTO));
|
||||
}
|
||||
|
||||
/*** 样品统计分析
|
||||
*
|
||||
* @param station
|
||||
* @param dataSource
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "样品统计分析")
|
||||
@GetMapping("/getSampleStatAnalysis")
|
||||
@ApiOperation(value = "样品统计分析", notes = "样品统计分析")
|
||||
public Result<?> getSampleStatAnalysis(String station, Integer dataSource,
|
||||
@RequestParam("startDate")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
|
||||
@RequestParam("endDate")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
|
||||
return sampleStatAnalysisService.getSampleStatAnalysis(station, dataSource, startDate,
|
||||
endDate);
|
||||
public Result<?> getSampleStatAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
|
||||
return Result.OK(
|
||||
sampleStatAnalysisService.getSampleStatAnalysis(reqDTO));
|
||||
//return sampleStatAnalysisService.getSampleStatAnalysis(station, dataSource, startDate,
|
||||
// endDate);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "样品统计分析-核素等级时序分析")
|
||||
@GetMapping("/getNuclideActConcChartData")
|
||||
@ApiOperation(value = "样品统计分析-核素等级时序分析", notes = "样品统计分析-核素等级时序分析")
|
||||
public Result<?> getNuclideActConcChartData(
|
||||
@RequestParam(value = "sampleType") String sampleType,
|
||||
@RequestParam("station") String station,
|
||||
@RequestParam("nuclideName") String nuclideName,
|
||||
@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);
|
||||
public Result<?> getNuclideActConcChartData(@Valid SampleQueryRequestDTO reqDTO) {
|
||||
|
||||
|
||||
return Result.OK(sampleStatAnalysisService.getNuclideActConcChartData(reqDTO));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*** 样品等级时序分析
|
||||
* 样品等级时序分析
|
||||
* @param sampleType 样品类型
|
||||
* @param station 台站编码
|
||||
* @param dataSource 数据源
|
||||
* @param startDate 开始时间
|
||||
* @param endDate 结束时间
|
||||
* @return 返回样品等级信息
|
||||
*/
|
||||
@AutoLog(value = "样品等级时序分析")
|
||||
@GetMapping("/getSampleGradeAnalysis")
|
||||
@ApiOperation(value = "样品等级时序分析", notes = "样品等级时序分析")
|
||||
public Result<?> getSampleGradeAnalysis(String sampleType, String station, Integer dataSource,
|
||||
@RequestParam("startDate")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
|
||||
@RequestParam("endDate")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
|
||||
return sampleStatAnalysisService.getSampleGradeAnalysis(sampleType, station, startDate,
|
||||
endDate, dataSource);
|
||||
public Result<?> getSampleGradeAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
|
||||
return Result.OK(
|
||||
sampleStatAnalysisService.getSampleGradeAnalysis(reqDTO));
|
||||
}
|
||||
|
||||
|
||||
/*** 样品活度浓度区间频率分析
|
||||
*
|
||||
* @param sampleType 样品类型-颗粒物、气体
|
||||
* @param station 台站编码
|
||||
* @param nuclideName 核素名称
|
||||
* @param dataSource 数据源
|
||||
* @param startDate 开始时间
|
||||
* @param endDate 结束时间
|
||||
* @return 返回样品获取浓度区间信息
|
||||
*/
|
||||
@AutoLog(value = "样品活度浓度区间频率分析")
|
||||
@GetMapping("/getActConcIntvlAnalysis")
|
||||
@ApiOperation(value = "样品活度浓度区间频率分析", notes = "样品活度浓度区间频率分析")
|
||||
public Result<?> getSampleActConcIntvlAnalysis(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) {
|
||||
return sampleStatAnalysisService.getSampleActConcIntvlAnalysis(sampleType, station,
|
||||
nuclideName, dataSource, startDate, endDate);
|
||||
public Result<?> getSampleActConcIntvlAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
|
||||
return Result.OK(
|
||||
sampleStatAnalysisService.getSampleActConcIntvlAnalysis(reqDTO));
|
||||
|
||||
}
|
||||
|
||||
/*** 样品活度浓度时序分析
|
||||
*
|
||||
* @param sampleType 样品类型-颗粒物、气体
|
||||
* @param station 台站编码
|
||||
* @param nuclideName 核素名称
|
||||
* @param dataSource 数据源
|
||||
* @param startDate 开始时间
|
||||
* @param endDate 结束时间
|
||||
* @return 返回样品获取浓度时序信息
|
||||
*/
|
||||
@AutoLog(value = "样品活度浓度时序分析")
|
||||
@GetMapping("/getActConcTimeSeqAnalysis")
|
||||
@ApiOperation(value = "样品活度浓度时序分析", notes = "样品活度浓度时序分析")
|
||||
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) throws JsonProcessingException {
|
||||
return sampleStatAnalysisService.getNuclideActConcChartData(sampleType, station,
|
||||
nuclideName, dataSource, startDate, endDate);
|
||||
public Result<?> getSampleActConcTimeSeqAnalysis(@Valid SampleQueryRequestDTO reqDTO) {
|
||||
return Result.OK(sampleStatAnalysisService.getNuclideActConcChartData(reqDTO));
|
||||
}
|
||||
|
||||
|
||||
/*** 核素活度浓度对比分析
|
||||
*
|
||||
* @param sampleType
|
||||
* @param stationIds
|
||||
* @param nuclideName
|
||||
* @param dataSource
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "样品活度浓度时序分析")
|
||||
@GetMapping("/getNuclideActivityConcAnalyze")
|
||||
@ApiOperation(value = "核素活度浓度对比分析", notes = "核素活度浓度对比分析")
|
||||
public Result<?> getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds,
|
||||
String nuclideName, Integer dataSource,
|
||||
@RequestParam("startDate")
|
||||
@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);
|
||||
public Result<?> getNuclideActivityConcAnalyze(@Valid SampleQueryRequestDTO reqDTO) {
|
||||
return Result.OK(
|
||||
sampleStatAnalysisService.getNuclideActivityConcAnalyze(reqDTO));
|
||||
|
||||
}
|
||||
|
||||
@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")
|
||||
public Result<?> findStationList(String systemType) {
|
||||
public Result<?> findStationList(@RequestParam("systemType") String systemType, @RequestParam("dataSource") Integer dataSource) {
|
||||
List<GardsStations> gardsStations =
|
||||
sampleStatAnalysisService.findStationListByMenuName(systemType);
|
||||
sampleStatAnalysisService.findStationListByMenuName(systemType, dataSource);
|
||||
return Result.OK(gardsStations);
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取核素信息")
|
||||
@GetMapping("/findNuclideList")
|
||||
public Result<?> findNuclideList(String systemType) {
|
||||
public Result<?> findNuclideList(@RequestParam("systemType") String systemType) {
|
||||
List<SysDefaultNuclide> defaultNuclides =
|
||||
sampleStatAnalysisService.findNuclideList(systemType);
|
||||
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
|
||||
*/
|
||||
private Integer sampleId;
|
||||
|
||||
|
||||
private String stationId;
|
||||
/** 收集停止时间
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,281 +5,150 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.entity.*;
|
||||
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;
|
||||
|
||||
@Mapper
|
||||
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 样品等级时序分析
|
||||
|
||||
|
||||
List<GardsSampleData> getSampleGradeAnalysis(String sampleType, String station,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime,
|
||||
Integer dataSource);
|
||||
|
||||
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<SampleLevelData> getSampleGradeAnalysis(
|
||||
@Param("sampleType") String sampleType,
|
||||
@Param("stations") List<Integer> stations,
|
||||
@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime,
|
||||
@Param("dsType") String dsType);
|
||||
|
||||
List<NuclideActConcIntvl> getIdentifiedNuclides(@Param("schemaName") String schemaName,
|
||||
@Param("nuclideName") String nuclideName,
|
||||
String station,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
@Param("stations") List<Integer> stations,
|
||||
@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime);
|
||||
|
||||
|
||||
//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,
|
||||
List<NuclideActConcIntvl> getRMSIdentifiedNuclides(@Param("schemaName") String schemaName,
|
||||
@Param("nuclideName") String nuclideName,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
@Param("stations") List<Integer> stations,
|
||||
@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime);
|
||||
|
||||
//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信息
|
||||
|
||||
/*** 获取样品中元素的浓度活度、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
|
||||
* @return
|
||||
* @param schemaName 模式名”
|
||||
* @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
|
||||
|
||||
//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 样品统计分析
|
||||
|
||||
/**
|
||||
* RnAuto--获取样品中识别到的核素集合
|
||||
*/
|
||||
|
||||
List<NuclideActConcIntvl> getRnAutoIdentifiedNuclides(String station,
|
||||
@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(
|
||||
List<NuclideActConcIntvl> getSampleNuclides(
|
||||
@Param("dbType") String dbType,
|
||||
@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("startTime") String startTime,
|
||||
@Param("endTime") String 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
|
||||
);
|
||||
@Param("stations") List<Integer> stations,
|
||||
@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime);
|
||||
|
||||
|
||||
//endregion
|
||||
|
||||
//region 核素活度浓度对比分析
|
||||
List<NuclideActConcIntvl> getRnAutoAnalyzeNuclideActivityConc(
|
||||
@Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName,
|
||||
@Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
@Param("stations") List<Integer> stations, @Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime);
|
||||
|
||||
List<NuclideActConcIntvl> getRnManAnalyzeNuclideActivityConc(
|
||||
@Param("sampleType") String sampleType, @Param("nuclideName") String nuclideName,
|
||||
@Param("stationIds") Integer[] stationIds, @Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
@Param("stations") List<Integer> stations, @Param("startTime") Date startTime,
|
||||
@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
|
||||
|
||||
//region 样品监测结果
|
||||
List<StationInfoData> getRnAutoSampleResult(String sampleType,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime);
|
||||
|
||||
List<StationInfoData> getRnManSampleResult(String sampleType,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
|
||||
@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime);
|
||||
//endregion
|
||||
|
||||
//region 查询台站信息
|
||||
List<GardsStations> findStationListByMenuName(@Param("systemType") String systemType);
|
||||
List<GardsStations> findRMSStationListByMenuName(@Param("systemType") String systemType);
|
||||
//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.fasterxml.jackson.core.JsonProcessingException;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.dto.SampleQueryRequestDTO;
|
||||
import org.jeecg.entity.GardsStations;
|
||||
import org.jeecg.entity.SampleLevelData;
|
||||
import org.jeecg.entity.SysDefaultNuclide;
|
||||
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||
import org.jeecg.vo.SampleStatExcelVO;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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 返回样品活度浓度区间信息
|
||||
*/
|
||||
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 返回核素活度浓度信息
|
||||
*/
|
||||
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
|
||||
*/
|
||||
Result getNuclideActivityConcAnalyze(String sampleType, Integer[] stationIds, String nuclideName, Integer dataSource, Date startDate, Date endDate);
|
||||
Map<String, Object> getNuclideActivityConcAnalyze(SampleQueryRequestDTO reqDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 查询台站信息
|
||||
*
|
||||
* @param systemType
|
||||
* @return
|
||||
*/
|
||||
List<GardsStations> findStationListByMenuName(String systemType);
|
||||
List<GardsStations> findStationListByMenuName(String systemType,Integer dataSource);
|
||||
|
||||
/**
|
||||
* 查询核素信息
|
||||
*
|
||||
* @param systemType
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
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.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("暂无导出数据");
|
||||
}
|
||||
ExportParams params = new ExportParams(handler.getSheetName(), handler.getSheetName(), ExcelType.XSSF);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user