From 4d4e6c810d99235e97beab7a8cbdbe8706a5e505 Mon Sep 17 00:00:00 2001
From: huangzhen <867217663@qq.com>
Date: Tue, 05 Sep 2023 13:57:25 +0800
Subject: [PATCH] 新增一些功能
---
src/main/java/com/gkhy/fourierSpecialGasMonitor/schedule/DailyReportSchedule.java | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/gkhy/fourierSpecialGasMonitor/schedule/DailyReportSchedule.java b/src/main/java/com/gkhy/fourierSpecialGasMonitor/schedule/DailyReportSchedule.java
index 722471f..28b8834 100644
--- a/src/main/java/com/gkhy/fourierSpecialGasMonitor/schedule/DailyReportSchedule.java
+++ b/src/main/java/com/gkhy/fourierSpecialGasMonitor/schedule/DailyReportSchedule.java
@@ -93,7 +93,7 @@
String startTime = now.format(execformatter);
RBucket<List<GasCategory>> bucket = redissonClient.getBucket("gas_category_cache_info");
List<GasCategory> gasCategories = bucket.get();
- //logger.info("【##】开始生成日报 ,时间:"+startTime);
+ logger.info("【##】开始生成日报 ,时间:"+startTime);
OPCPackage opcPackage = null;
//加载文档
XWPFDocument doc = null;
@@ -164,7 +164,8 @@
} catch (IOException e) {
e.printStackTrace();
}
- List<GasConcentration> gasConcentrations = gasConcentrationService.listDatabyTimeSlot(LocalDateTime.now().minusDays(2).with(LocalDate.MIN), LocalDateTime.now());
+ List<GasConcentration> gasConcentrations = gasConcentrationService.listDatabyTimeSlot(LocalDateTime.of(now.minusDays(1).toLocalDate(), LocalTime.MIN)
+ , LocalDateTime.of(now.minusDays(1).toLocalDate(), LocalTime.MAX));
if (!CollectionUtils.isEmpty(gasConcentrations)) {
for (int i = 0; i < 30; i++) {
String series = gasCategories.get(i).getMolecularFormula() + "浓度观测结果";
@@ -182,8 +183,8 @@
Map<Integer, String> regionMap = allRegion.stream()
.collect(Collectors.toMap(Region::getId, Region::getName));
if (!CollectionUtils.isEmpty(gasFluxes)) {
- for (int i = 1; i <= 1; i++) {
- for (int j = 0; j < 1; j++) {
+ for (int i = 1; i <= areaNum.size(); i++) {
+ for (int j = 0; j < 20; j++) {
drawBarChart(gasFluxes, fileurl, regionMap.get(i), "柱形图" + gasCategories.get(j).getMolecularFormula(), i, j + 1);
}
}
@@ -198,7 +199,7 @@
MonitorDailyReport save = monitorDailyReportService.save(report);
if (save == null)
throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_DATABASE_FAIL,"日常报表保存失败");
- //logger.info("【##】日报生成成功!!! ,时间:"+endTime+",所耗时间: "+execTime+"s");
+ logger.info("【##】日报生成成功!!! ,时间:"+endTime+",所耗时间: "+execTime+"s");
}
public void drawBarChart(List<GasFlux> gasFluxes,String fileurl,String series,String molecularFormula,Integer i,Integer j) {
@@ -432,7 +433,7 @@
private Map<String, Object> dataMap(List<GasCategory> gasCategories){
LocalDateTime now = LocalDateTime.now();
String today = now.format(formatter);
- String yesterday = LocalDateTime.now().plusDays(1).format(formatter);
+ String yesterday = LocalDateTime.now().minusDays(1).format(formatter);
//要替换的map,key为占位符,value为要被替换的值
Map<String, Object> map = new HashMap<>();
map.put("${today}", today);
--
Gitblit v1.9.2