From d1683ca9742a92f24a2c9ffde0c6880d708562dd Mon Sep 17 00:00:00 2001 From: duwenyuan <15600000461@163.com> Date: Wed, 7 Jan 2026 20:47:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AD=89=E7=BA=A7=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/IThresholdCalculationService.java | 5 +- .../impl/RnAutoThresholdServiceImpl.java | 43 ++++- .../impl/RnManThresholdServiceImpl.java | 12 +- .../impl/ThresholdCalculationBaseService.java | 182 ++++++++++++++---- .../modules/redisStream/GradingConsumer.java | 2 +- .../modules/spectrum/Sample_B_Analysis.java | 15 ++ .../modules/spectrum/Sample_G_Analysis.java | 17 +- .../redisStream/RnManGradingConsumer.java | 2 +- .../modules/service/IGenerateHtmlReport.java | 82 ++++++++ .../impl/RnManGardsThresholdServiceImpl.java | 2 +- .../jeecg/JeecgAutoProcessApplication.java | 26 +-- .../JeecgSpectrumAnalysisApplication.java | 2 +- 12 files changed, 318 insertions(+), 72 deletions(-) create mode 100644 jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGenerateHtmlReport.java diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/IThresholdCalculationService.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/IThresholdCalculationService.java index 66c7388c..c9f2f498 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/IThresholdCalculationService.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/IThresholdCalculationService.java @@ -1,5 +1,6 @@ package org.jeecg.modules.base.service; +import org.jeecg.modules.base.dto.Info; import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -8,13 +9,13 @@ import java.util.Map; public interface IThresholdCalculationService { @Transactional(rollbackFor = Exception.class) - Map calculateSingleStationThreshold(String stationId); + Map calculateSingleStationThreshold(Info info); Map getStationThresholds(String stationId); @Transactional(rollbackFor = Exception.class) - void processBatchCalculation(List stationIds); + void processBatchCalculation(List infos); } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/RnAutoThresholdServiceImpl.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/RnAutoThresholdServiceImpl.java index f00cb89d..b749f012 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/RnAutoThresholdServiceImpl.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/RnAutoThresholdServiceImpl.java @@ -2,7 +2,9 @@ package org.jeecg.modules.base.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.util.NumberFormatUtil; import org.jeecg.common.util.RadionuclideUtil; +import org.jeecg.modules.base.dto.Info; import org.jeecg.modules.base.entity.StatisticsResult; import org.jeecg.modules.base.entity.ThresholdMetric; import org.jeecg.modules.base.entity.rnauto.GardsThresholdResult; @@ -28,6 +30,7 @@ public class RnAutoThresholdServiceImpl extends ThresholdCalculationBaseService< @Autowired private RnAutoThresholdHisServiceImpl thresholdHisService; + /** * 获取当前服务处理的数据类型 * @@ -41,29 +44,31 @@ public class RnAutoThresholdServiceImpl extends ThresholdCalculationBaseService< /** * 保存RNAUTO类型阈值计算结果 * - * @param stationId 台站ID + * @param info 台站ID * @param thresholds 阈值映射 * @param statistics 统计结果映射 */ @Override - protected void saveThresholdResults(String stationId, Map thresholds, + protected void saveThresholdResults(Info info, Map thresholds, Map statistics) { + String stationId = info.getStationId(); validateSaveParams(stationId, thresholds, statistics); log.debug("开始保存RNAUTO阈值结果:台站{},核素{}个", stationId, thresholds.size()); - List results = buildThresholdResultList(stationId, thresholds, statistics); + List results = buildThresholdResultList(info, thresholds, statistics); if (!CollectionUtils.isEmpty(results)) { // 先删除旧数据 this.baseMapper.deleteByStationId(stationId); // 批量保存新数据 - boolean saveSuccess = this.saveBatch(results); - // saveBatch(results, DEFAULT_BATCH_SIZE); + boolean saveSuccess = this.saveBatch(results); + // saveBatch(results, DEFAULT_BATCH_SIZE); if (saveSuccess) { List resultHisList = results.stream() .map(item -> { GardsThresholdResultHistory his = new GardsThresholdResultHistory(); + BeanUtils.copyProperties(item, his); return his; }) @@ -112,8 +117,9 @@ public class RnAutoThresholdServiceImpl extends ThresholdCalculationBaseService< /** * 构建ThresholdResult列表 */ - private List buildThresholdResultList(String stationId, Map thresholds, + private List buildThresholdResultList(Info info, Map thresholds, Map statistics) { + List results = new ArrayList<>(thresholds.size()); thresholds.forEach((nuclideName, thresholdValue) -> { @@ -123,14 +129,30 @@ public class RnAutoThresholdServiceImpl extends ThresholdCalculationBaseService< return; } + Map nulides = info.getNuclides(); + + String category = "A"; // 默认无效 + if (Objects.nonNull(nulides)) { + String concStr = info.getNuclides().get(nuclideName); + if (StringUtils.hasText(concStr)) { + try { + double concValue = Double.parseDouble(NumberFormatUtil.numberFormat(concStr)); + category = concValue < thresholdValue ? "B" : "C"; + } catch (Exception ignored) { + // 解析失败保持 A + } + } + } GardsThresholdResult result = new GardsThresholdResult(); result.setId(UUID.randomUUID().toString()); - result.setStationId(stationId); + result.setStationId(info.getStationId()); result.setNuclideName(nuclideName); + result.setCategory(category); result.setThresholdValue(thresholdValue); result.setMedian(stats.getMedian()); result.setPercentile25(stats.getPercentile25()); result.setPercentile75(stats.getPercentile75()); + result.setCollectStop(info.getCollectStop()); results.add(result); @@ -198,7 +220,8 @@ public class RnAutoThresholdServiceImpl extends ThresholdCalculationBaseService< public List getAllNuclides() { return RadionuclideUtil.getAllNuclides(); } - public Integer getDayValue(){ - return RadionuclideUtil.getDayValue(); - } + + public Integer getDayValue() { + return RadionuclideUtil.getDayValue(); + } } diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/RnManThresholdServiceImpl.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/RnManThresholdServiceImpl.java index ca8b3ade..9b9685ef 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/RnManThresholdServiceImpl.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/RnManThresholdServiceImpl.java @@ -2,6 +2,7 @@ package org.jeecg.modules.base.service.impl; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.util.RadionuclideUtil; +import org.jeecg.modules.base.dto.Info; import org.jeecg.modules.base.entity.StatisticsResult; import org.jeecg.modules.base.entity.ThresholdMetric; import org.jeecg.modules.base.entity.rnman.GardsThresholdResult; @@ -44,12 +45,13 @@ public class RnManThresholdServiceImpl extends ThresholdCalculationBaseService thresholds, + protected void saveThresholdResults(Info info, Map thresholds, Map statistics) { + String stationId=info.getStationId(); validateSaveParams(stationId, thresholds, statistics); log.debug("开始保存RNMAN阈值结果:台站{},核素{}个", stationId, thresholds.size()); - List results = buildThresholdRnManResultList(stationId, thresholds, statistics); + List results = buildThresholdRnManResultList(info, thresholds, statistics); if (!CollectionUtils.isEmpty(results)) { // 先删除旧数据 @@ -109,7 +111,7 @@ public class RnManThresholdServiceImpl extends ThresholdCalculationBaseService buildThresholdRnManResultList(String stationId, Map thresholds, + private List buildThresholdRnManResultList(Info info, Map thresholds, Map statistics) { List results = new ArrayList<>(thresholds.size()); @@ -122,13 +124,13 @@ public class RnManThresholdServiceImpl extends ThresholdCalculationBaseService, T /** * 保存阈值计算结果(子类实现具体保存逻辑) * - * @param stationId 台站ID + * @param info 台站ID * @param thresholds 阈值映射 * @param statistics 统计结果映射 */ - protected abstract void saveThresholdResults(String stationId, Map thresholds, Map statistics); + protected abstract void saveThresholdResults(Info info, Map thresholds, Map statistics); /** * 从数据库查询台站阈值(子类实现具体查询逻辑) @@ -112,12 +114,13 @@ public abstract class ThresholdCalculationBaseService, T /** * 计算单个台站的阈值(公共逻辑) * - * @param stationId 台站ID + * @param info 台站ID * @return 核素-阈值映射 */ @Transactional(rollbackFor = Exception.class) @Override - public Map calculateSingleStationThreshold(String stationId) { + public Map calculateSingleStationThreshold(Info info) { + String stationId = info.getStationId(); // 1. 参数校验 validateCalculateParams(stationId); log.info("开始计算单个台站阈值:stationId={}", stationId); @@ -125,7 +128,8 @@ public abstract class ThresholdCalculationBaseService, T List stationIds = Collections.singletonList(stationId); Map>> metricsMap = getMetricsForStations(stationIds); - // 3. 检查是否有数据 + // List metricsMap = getThresholdMetric(stationIds); + // 3. 检查是否有数据getConcentrationsByStation(metricsMap, stationId);// Map> metrics = metricsMap.get(stationId); if (CollectionUtils.isEmpty(metrics)) { log.warn("台站{}没有找到有效的度量数据", stationId); @@ -138,12 +142,26 @@ public abstract class ThresholdCalculationBaseService, T calculateThresholdAndStats(metrics, thresholds, statistics); // 5. 保存计算结果(子类实现) - saveThresholdResults(stationId, thresholds, statistics); + saveThresholdResults(info, thresholds, statistics); log.info("单个台站阈值计算完成:stationId={}, 核素数量={}", stationId, thresholds.size()); return thresholds; } + //根据台站ID筛选出核素对应的浓度 + public Map> getConcentrationsByStation(List metrics, String stationId) { + return metrics.stream() + .filter(m -> Objects.equals(m.getStationId(), Integer.valueOf(stationId))) + .filter(m -> StringUtils.hasText(m.getNuclideName()) && StringUtils.hasText(m.getConcentration())) + .collect(Collectors.groupingBy( + ThresholdMetric::getNuclideName, // 按核素名称分组 + Collectors.mapping( + m -> m, // 转换浓度为 double + Collectors.toList() + ) + )); + } + /** * 查询单个台站的阈值(优先缓存,缓存未命中查库) * @@ -181,7 +199,9 @@ public abstract class ThresholdCalculationBaseService, T */ @Transactional(rollbackFor = Exception.class) @Override - public void processBatchCalculation(List stationIds) { + public void processBatchCalculation(List infos) { + List stationIds = infos.stream().map(info -> info.getStationId()).collect(Collectors.toList()); + String currentDataType = getCurrentDataType(); log.info("开始批量阈值计算:dataType={}", currentDataType); @@ -198,12 +218,12 @@ public abstract class ThresholdCalculationBaseService, T Map>> metricsMap = getMetricsForStations(stationIds); // 3. 处理每个台站 - stationIds.forEach(stationId -> { - Map> metrics = metricsMap.get(stationId); + infos.forEach(info -> { + Map> metrics = metricsMap.get(info.getStationId()); if (metrics != null && !metrics.isEmpty()) { - processSingleStation(stationId, metrics); + processSingleStation(info, metrics); } else { - log.warn("台站 {} {} 没有度量数据,跳过处理", stationId, currentDataType); + log.warn("台站 {} {} 没有度量数据,跳过处理", info.getStationId(), currentDataType); } }); @@ -269,26 +289,41 @@ public abstract class ThresholdCalculationBaseService, T // 按数据类型查询度量数据 List queryMetrics = queryMetricsByDataType(stationIds, startDate); - List metrics = stationIds.stream() - .flatMap(stationId -> getAllNuclides().stream() - .map(nuclide -> { - // 查找匹配的查询结果 - Optional matched = queryMetrics.stream() - .filter(Objects::nonNull) - .filter(qm -> qm.getStationId() == Integer.parseInt(stationId)) - .filter(qm -> nuclide != null && nuclide.equals(qm.getNuclideName())) - .findFirst(); + List metrics = new ArrayList<>(); - return matched.orElseGet(()->{ - ThresholdMetric tm = new ThresholdMetric(); - tm.setStationId(Integer.valueOf(stationId)); - tm.setNuclideName(nuclide); - tm.setConcentration("0"); - return tm; - }); - })) - .collect(Collectors.toList()); + // 查询结果的快速索引 (StationId -> (NuclideName -> ThresholdMetric)) + Map>> metricIndex = queryMetrics.stream() + .collect(Collectors.groupingBy( + ThresholdMetric::getStationId, + Collectors.groupingBy(ThresholdMetric::getNuclideName) + )); + // 2. 预先处理所有核素名称 + List allNuclides = RadionuclideUtil.getAllNuclides(); + + // 3. 遍历所有组合 + for (String stationId : stationIds) { + Integer station = Integer.parseInt(stationId); + // 获取当前站点对应的核素Map,若不存在则返回空Map + Map> nuclideMap = metricIndex.getOrDefault(station, Collections.emptyMap()); + + for (String nuclideName : allNuclides) { + // 直接从索引中获取该站点的该核素数据列表 + List stationMetrics = nuclideMap.get(nuclideName); + + if (stationMetrics == null || stationMetrics.isEmpty()) { + // 没有找到记录,创建默认对象 + ThresholdMetric tm = new ThresholdMetric(); + tm.setStationId(station); + tm.setNuclideName(nuclideName); + tm.setConcentration("0"); + metrics.add(tm); + } else { + // 找到了对应的记录,直接添加 + metrics.addAll(stationMetrics); + } + } + } if (CollectionUtils.isEmpty(metrics)) { log.debug("未查询到核素度量数据:台站{}", stationIds); @@ -303,6 +338,52 @@ public abstract class ThresholdCalculationBaseService, T return result; } + protected List getThresholdMetric(List stationIds) { + // 参数校验 + if (CollectionUtils.isEmpty(stationIds)) { + log.warn("获取核素度量数据失败:台站ID列表为空"); + throw new IllegalArgumentException("台站ID列表不可为空"); + } + + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_YEAR, -getDayValue()); + String startDate = DateUtils.formatDate(calendar.getTime(), "yyyy-MM-dd HH:mm:ss"); + log.debug("查询核素度量数据:台站{}个,时间范围{}至今", + stationIds.size(), startDate); + + // 按数据类型查询度量数据 + List queryMetrics = queryMetricsByDataType(stationIds, startDate); + + List metrics = stationIds.stream() + .flatMap(stationId -> getAllNuclides().stream() + .map(nuclide -> { + // 查找匹配的查询结果 + Optional matched = queryMetrics.stream() + .filter(Objects::nonNull) + .filter(qm -> qm.getStationId() == Integer.parseInt(stationId)) + .filter(qm -> nuclide != null && nuclide.equals(qm.getNuclideName())) + .findFirst(); + + return matched.orElseGet(() -> { + ThresholdMetric tm = new ThresholdMetric(); + tm.setStationId(Integer.valueOf(stationId)); + tm.setNuclideName(nuclide); + tm.setConcentration("0"); + return tm; + }); + })) + .collect(Collectors.toList()); + + + if (CollectionUtils.isEmpty(metrics)) { + log.debug("未查询到核素度量数据:台站{}", stationIds); + return new ArrayList<>(); + } + + return metrics; + } + + /** * 按数据类型查询度量数据(差异化查询逻辑) * @@ -385,13 +466,45 @@ public abstract class ThresholdCalculationBaseService, T }); } + +// protected void calculateThresholdAndStats(Map> metrics, +// Map thresholds, +// Map statistics) { +// if (metrics == null || metrics.isEmpty()) { +// log.warn("核素度量数据为空,跳过计算"); +// return; +// } +// metrics.forEach((nuclideName, values) -> { +// if (values==null||values.isEmpty()) { +// log.trace("核素{}数据为空,跳过计算", nuclideName); +// return; +// } +// +// // 计算统计值(中位数、四分位数) +// StatisticsResult stats = calculateStatistics( nuclideName); +// statistics.put(nuclideName, stats); +// +// // 计算阈值:中位数 + 3 * IQR(四分位距) +// double median = stats.getMedian(); +// double q1 = stats.getPercentile25(); +// double q3 = stats.getPercentile75(); +// double iqr = q3 - q1; +// double threshold = NumUtil.keep(median + (iqr * 3), 6); +// +// thresholds.put(nuclideName, threshold); +// }); +// +// +// } + + /** * 处理单个台站(批量计算时用) * - * @param stationId 台站ID - * @param metrics 核素-浓度列表映射 + * @param info 台站ID + * @param metrics 核素-浓度列表映射 */ - protected void processSingleStation(String stationId, Map> metrics) { + protected void processSingleStation(Info info, Map> metrics) { Map thresholds = new HashMap<>(); Map statistics = new HashMap<>(); @@ -399,10 +512,10 @@ public abstract class ThresholdCalculationBaseService, T calculateThresholdAndStats(metrics, thresholds, statistics); // 保存结果(子类实现) - saveThresholdResults(stationId, thresholds, statistics); + saveThresholdResults(info, thresholds, statistics); log.info("台站 {} 处理完成:dataType={},生成 {} 个阈值结果", - stationId, getCurrentDataType(), thresholds.size()); + info.getStationId(), getCurrentDataType(), thresholds.size()); } /** @@ -433,6 +546,7 @@ public abstract class ThresholdCalculationBaseService, T return result; } + /** * 计算分位数 */ diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/redisStream/GradingConsumer.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/redisStream/GradingConsumer.java index ffe60ae9..b0458d72 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/redisStream/GradingConsumer.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/redisStream/GradingConsumer.java @@ -100,7 +100,7 @@ public class GradingConsumer implements StreamListener= 3) { + GardsTransportStatus transportStatus = new GardsTransportStatus(); + transportStatus.setSampleId(this.sampleData.getSampleId()); + transportStatus.setDescription(""); + transportStatus.setTransportStatus(0); + transportStatus.setCloseStatus(0); + transportStatus.setModdate(new Date()); + boolean result = spectrumServiceQuotes.getGardsTransportStatusService().save(transportStatus); + } + } catch (Exception e) { + log.error("获取样品分级数据错误"); } @@ -370,6 +384,7 @@ public class Sample_B_Analysis implements BlockConstant { final Instant instant = this.sampleData.getCollectStart().toInstant(); final LocalDateTime collectTime = instant.atZone(ZoneId.systemDefault()).toLocalDateTime(); info.setCollectionDate(collectTime); + info.setCollectStop(this.sampleData.getCollectStop()); info.setDatasource(DSType.ARMDARR.getType()); info.setFullOrPrel(this.sampleData.getSpectralQualifie()); info.setBetaOrGamma(SpectrumType.BETA.getType()); diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java index 185ec361..09367a14 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java @@ -24,9 +24,7 @@ import org.jeecg.modules.base.bizVo.AttributeItemVo; import org.jeecg.modules.base.dto.*; import org.jeecg.modules.base.entity.original.GardsSampleData; import org.jeecg.modules.base.entity.rnauto.*; -import org.jeecg.modules.base.enums.DSType; -import org.jeecg.modules.base.enums.MiddleDataType; -import org.jeecg.modules.base.enums.SpectrumType; +import org.jeecg.modules.base.enums.*; import org.jeecg.modules.config.datasource.DataSourceSwitcher; import org.jeecg.modules.eneity.event.SpectrumErrorEvent; import org.jeecg.modules.entity.vo.*; @@ -185,6 +183,16 @@ public class Sample_G_Analysis { //样品分级 Integer category = serviceQuotes.getSampleGradingService().processAutoTypeP(info, thresholds); middleData.setAnalyses_category(category); + if (category >= 3) { + GardsTransportStatus transportStatus = new GardsTransportStatus(); + transportStatus.setSampleId(this.sampleData.getSampleId()); + transportStatus.setDescription(""); + transportStatus.setTransportStatus(0); + transportStatus.setCloseStatus(0); + transportStatus.setModdate(new Date()); + boolean result = serviceQuotes.getGardsTransportStatusService().save(transportStatus); + } + } catch (Exception e) { } @@ -233,6 +241,7 @@ public class Sample_G_Analysis { final Instant instant = DateUtils.parseDate(middleData.sample_collection_start).toInstant(); final LocalDateTime collectTime = instant.atZone(ZoneId.systemDefault()).toLocalDateTime(); info.setCollectionDate(collectTime); + info.setCollectStop(this.sampleData.getCollectStop()); info.setDatasource(DSType.ARMDARR.getType()); info.setFullOrPrel(this.sampleData.getSpectralQualifie()); info.setBetaOrGamma(SpectrumType.GAMMA.getType()); @@ -1117,7 +1126,7 @@ public class Sample_G_Analysis { gardsAnalyses.setScacPath(middleData.getAnalyses_scac_filePath()); gardsAnalyses.setLogPath(middleData.getAnalyses_LogPath()); gardsAnalyses.setReportPath(middleData.getAnalyses_ReportPath()); - gardsAnalyses.setCategory((int)middleData.analyses_category); + gardsAnalyses.setCategory((int) middleData.analyses_category); return gardsAnalyses; } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/redisStream/RnManGradingConsumer.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/redisStream/RnManGradingConsumer.java index 89413b54..df8e9545 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/redisStream/RnManGradingConsumer.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/redisStream/RnManGradingConsumer.java @@ -94,7 +94,7 @@ public class RnManGradingConsumer implements StreamListener data); + + /** + * 生成带样式的HTML报告 + * @param data 报告数据 + * @param style 自定义CSS样式 + * @return 生成的HTML字符串 + */ + String generateStyledHtmlReport(Map data, String style); + + /** + * 生成HTML报告并保存到文件 + * @param data 报告数据 + * @param filePath 文件保存路径 + * @return 是否保存成功 + */ + boolean generateHtmlReportToFile(Map data, String filePath); + + /** + * 生成带模板的HTML报告 + * @param data 报告数据 + * @param templatePath HTML模板路径 + * @return 生成的HTML字符串 + */ + String generateHtmlReportWithTemplate(Map data, String templatePath); + + /** + * 生成带图表和交互功能的HTML报告 + * @param data 报告数据 + * @param includeCharts 是否包含图表 + * @param interactive 是否包含交互功能 + * @return 生成的HTML字符串 + */ + String generateAdvancedHtmlReport(Map data, boolean includeCharts, boolean interactive); + + /** + * 生成多页HTML报告 + * @param pagesData 多页数据,key为页面名称,value为页面数据 + * @return 生成的HTML字符串 + */ + String generateMultiPageHtmlReport(Map> pagesData); + + /** + * 生成HTML报告并返回字节数组(便于网络传输) + * @param data 报告数据 + * @return HTML字节数组 + */ + byte[] generateHtmlReportAsBytes(Map data); + + /** + * 生成带分页功能的HTML报告 + * @param data 报告数据 + * @param itemsPerPage 每页项目数 + * @return 生成的HTML字符串 + */ + String generatePaginatedHtmlReport(List> data, int itemsPerPage); + + /** + * 生成响应式HTML报告(适配不同设备) + * @param data 报告数据 + * @return 生成的HTML字符串 + */ + String generateResponsiveHtmlReport(Map data); + + /** + * 生成HTML报告并返回Base64编码(便于嵌入) + * @param data 报告数据 + * @return Base64编码的HTML字符串 + */ + String generateHtmlReportAsBase64(Map data); +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/RnManGardsThresholdServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/RnManGardsThresholdServiceImpl.java index dcbd64b3..f59ab76a 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/RnManGardsThresholdServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/RnManGardsThresholdServiceImpl.java @@ -25,7 +25,7 @@ public class RnManGardsThresholdServiceImpl extends ServiceImpl GardsThresholdResult */ @Override - public List findThresholdResults(String stationId) { + public List findThresholdResults(String stationId) { // 获取未分级样品 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); queryWrapper.eq(GardsThresholdResult::getStationId, stationId); diff --git a/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java b/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java index 095be8bf..3cec4e76 100644 --- a/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java +++ b/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java @@ -9,8 +9,8 @@ import org.jeecg.common.properties.SpectrumPathProperties; import org.jeecg.common.properties.TaskProperties; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.*; -import org.jeecg.modules.service.IGardsNuclLibService; import org.jeecg.modules.email.EmailReceivePolicy; +import org.jeecg.modules.service.IGardsNuclLibService; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -76,12 +76,12 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im } else { //Linux版本加载dll工具库 System.load("/usr/local/jdk/lib/libReadPHDFile.so"); - System.load("/usr/local/jdk/lib/libGammaAnaly.so"); + System.load("/usr/local/jdk/lib/libGammaAnalyALG.so"); } nuclLibService.getNuclideMap(); //根据配置文件配置邮件获取策略定义时间条件,默认EmailReceivePolicy.HISTORY_ORDER_RECEIVE.getPolicy() Date systemStartupTime = null; - if(EmailReceivePolicy.CURR_DATE_ORDER_RECEIVE.getPolicy().equals(taskProperties.getReceivePolicy())){ + if (EmailReceivePolicy.CURR_DATE_ORDER_RECEIVE.getPolicy().equals(taskProperties.getReceivePolicy())) { systemStartupTime = new Date(); } //校验临时存储目录是否存在,不存在则创建 @@ -106,13 +106,13 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im */ private void checkTempStorageDirectory() throws IOException { ApplicationHome home = new ApplicationHome(getClass()); - File tempStorageDirectory = new File(home.getSource().getParentFile().getAbsolutePath()+File.separator+taskProperties.getTemporaryStoragePath()); - if(!tempStorageDirectory.exists() || !tempStorageDirectory.isDirectory()){ + File tempStorageDirectory = new File(home.getSource().getParentFile().getAbsolutePath() + File.separator + taskProperties.getTemporaryStoragePath()); + if (!tempStorageDirectory.exists() || !tempStorageDirectory.isDirectory()) { tempStorageDirectory.setReadable(true); tempStorageDirectory.setWritable(true); tempStorageDirectory.mkdir(); taskProperties.setTemporaryStoragePath(tempStorageDirectory.getAbsolutePath()); - }else{ + } else { FileUtils.deleteDirectory(tempStorageDirectory); checkTempStorageDirectory(); } @@ -122,12 +122,12 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im * 校验存储目录是否存在,不存在则创建,存在无操作 */ private void checkStorageDirectory() { - FileUtil.mkdir(spectrumPathProperties.getRootPath()+File.separator+spectrumPathProperties.getSaveFilePath()); - FileUtil.mkdir(spectrumPathProperties.getRootPath()+File.separator+spectrumPathProperties.getLogPath()); - FileUtil.mkdir(spectrumPathProperties.getRootPath()+File.separator+spectrumPathProperties.getUndealPath()); - FileUtil.mkdir(spectrumPathProperties.getRootPath()+File.separator+spectrumPathProperties.getFilesourcePath()); - FileUtil.mkdir(spectrumPathProperties.getRootPath()+File.separator+spectrumPathProperties.getEmlPath()); - FileUtil.mkdir(spectrumPathProperties.getRootPath()+File.separator+spectrumPathProperties.getEmlErrorPath()); - FileUtil.mkdir(spectrumPathProperties.getRootPath()+File.separator+spectrumPathProperties.getErrorFilePath()); + FileUtil.mkdir(spectrumPathProperties.getRootPath() + File.separator + spectrumPathProperties.getSaveFilePath()); + FileUtil.mkdir(spectrumPathProperties.getRootPath() + File.separator + spectrumPathProperties.getLogPath()); + FileUtil.mkdir(spectrumPathProperties.getRootPath() + File.separator + spectrumPathProperties.getUndealPath()); + FileUtil.mkdir(spectrumPathProperties.getRootPath() + File.separator + spectrumPathProperties.getFilesourcePath()); + FileUtil.mkdir(spectrumPathProperties.getRootPath() + File.separator + spectrumPathProperties.getEmlPath()); + FileUtil.mkdir(spectrumPathProperties.getRootPath() + File.separator + spectrumPathProperties.getEmlErrorPath()); + FileUtil.mkdir(spectrumPathProperties.getRootPath() + File.separator + spectrumPathProperties.getErrorFilePath()); } } \ No newline at end of file diff --git a/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java b/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java index b6117186..353b2de1 100644 --- a/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java +++ b/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java @@ -78,6 +78,6 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ gammaService.readMDCParameter(); nuclLibService.getNuclideMap(); nuclCoincidenceSumSpectrumService.getNuclCoincidenceMap(); -// dataService.viewStations(); + dataService.viewStations(); } } \ No newline at end of file