From cd301e0d8f2ea3adc3d50ff3fc9b19a34b539f79 Mon Sep 17 00:00:00 2001
From: huangzhen <867217663@qq.com>
Date: 星期一, 19 二月 2024 09:10:25 +0800
Subject: [PATCH] 解决日报在linux上无法生成的问题

---
 src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/GasWarnLogServiceImpl.java |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/GasWarnLogServiceImpl.java b/src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/GasWarnLogServiceImpl.java
index ace5444..8fda170 100644
--- a/src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/GasWarnLogServiceImpl.java
+++ b/src/main/java/com/gkhy/fourierSpecialGasMonitor/service/impl/GasWarnLogServiceImpl.java
@@ -201,9 +201,16 @@
         if (reqDTO == null && reqDTO .getCountTime() == null)
             throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL,"参数不能为空");
         Integer countTime = reqDTO.getCountTime();
-        WindRoseTimeSlotQuery query = WindRoseEnum.getQueryObject(countTime).getTimeSlotByStrategy();
+        List<GasConcentration> gasConcentrations;
+        if (reqDTO.getCountTime().equals(WindRoseEnum.CUSTOM_TIME.getState())){
+            if (reqDTO.getStartTime() == null && reqDTO.getEndTime() == null)
+                throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL,"参数不能为空");
+            gasConcentrations = gasConcentrationRepository.findAllByDataReceivingTimeBetweenOrderByDataReceivingTimeDesc(reqDTO.getStartTime(), reqDTO.getEndTime());
+        }else {
+            WindRoseTimeSlotQuery query = WindRoseEnum.getQueryObject(countTime).getTimeSlotByStrategy();
+             gasConcentrations = gasConcentrationRepository.findAllByDataReceivingTimeBetweenOrderByDataReceivingTimeDesc(query.getStartTime(), query.getEndTime());
+        }
         Result result = Result.success();
-        List<GasConcentration> gasConcentrations = gasConcentrationRepository.findAllByDataReceivingTimeBetweenOrderByDataReceivingTimeDesc(query.getStartTime(), query.getEndTime());
         if (CollectionUtils.isEmpty(gasConcentrations))
             return result;
         List<WindRoseByTimeRespDTO> collect = gasConcentrations.stream().map(gasConcentration -> {

--
Gitblit v1.9.2