From e3bb203a5a50655349ca32d898fe978e2cfd9470 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Wed, 31 Aug 2022 10:54:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=81=AB=E7=82=B9=E6=94=BE?= =?UTF-8?q?=E5=BC=80=E6=97=B6=E9=97=B4=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/FirePointServiceImpl.java | 32 ++++++++++--------- .../com/xkrs/utils/FirePointQueryHelper.java | 2 +- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index d9070b0..f9a4bc3 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -474,7 +474,7 @@ public class FirePointServiceImpl implements FirePointService { /** * 查询今天的火点信息 */ - @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") +// @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") @Override public List selectTodayFirePoint(String countyCode) { @@ -492,7 +492,7 @@ public class FirePointServiceImpl implements FirePointService { /** * 查询近一周的火点信息 */ - @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") +// @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") @Override public List selectFirePointBetweenSeven() { @@ -510,19 +510,21 @@ public class FirePointServiceImpl implements FirePointService { /** * 查询近一个月的火点信息 */ - @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") +// @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") @Override public List selectFirePointByMonth(String countyCode) { - LocalDateTime startTime1 = LocalDateTime.now().minusMonths(1); - LocalDateTime startTime2 = LocalDateTime.of(startTime1.getYear(), startTime1.getMonth(), startTime1.getDayOfMonth(), 0, 0, 0, 0); - String startTimeString = DateTimeUtils.localDateTimeToString(startTime2); - - LocalDateTime endTime1 = LocalDateTime.now().plusDays(1); - LocalDateTime endTime2 = LocalDateTime.of(endTime1.getYear(), endTime1.getMonth(), endTime1.getDayOfMonth(), 0, 0, 0, 0); - String endTimeString = DateTimeUtils.localDateTimeToString(endTime2); - - return firePointQueryHelper.queryFirePoint(countyCode, startTimeString, endTimeString, null, null); +// LocalDateTime startTime1 = LocalDateTime.now().minusMonths(1); +// LocalDateTime startTime2 = LocalDateTime.of(startTime1.getYear(), startTime1.getMonth(), startTime1.getDayOfMonth(), 0, 0, 0, 0); +// String startTimeString = DateTimeUtils.localDateTimeToString(startTime2); +// +// LocalDateTime endTime1 = LocalDateTime.now().plusDays(1); +// LocalDateTime endTime2 = LocalDateTime.of(endTime1.getYear(), endTime1.getMonth(), endTime1.getDayOfMonth(), 0, 0, 0, 0); +// String endTimeString = DateTimeUtils.localDateTimeToString(endTime2); +// +// return firePointQueryHelper.queryFirePoint(countyCode, startTimeString, endTimeString, null, null); + List firePointEntities = firePointQueryHelper.queryFirePoint(countyCode, null, null, null, null); + return firePointEntities; } /** @@ -643,7 +645,7 @@ public class FirePointServiceImpl implements FirePointService { * * @return */ - @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") +// @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") @Override public String selectFirePointNumMonth() { Map map = new HashMap(3); @@ -668,7 +670,7 @@ public class FirePointServiceImpl implements FirePointService { * * @return */ - @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") +// @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") @Override public String selectFirePointNumDay() { Map map = new HashMap(3); @@ -693,7 +695,7 @@ public class FirePointServiceImpl implements FirePointService { * * @return */ - @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") +// @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") @Override public String selectFirePointNumWeek() { Map map = new HashMap(3); diff --git a/src/main/java/com/xkrs/utils/FirePointQueryHelper.java b/src/main/java/com/xkrs/utils/FirePointQueryHelper.java index 62fa3a1..5126daa 100644 --- a/src/main/java/com/xkrs/utils/FirePointQueryHelper.java +++ b/src/main/java/com/xkrs/utils/FirePointQueryHelper.java @@ -41,7 +41,7 @@ public class FirePointQueryHelper { LocalDateTime lastMonth1 = LocalDateTime.now().minusDays(30); LocalDateTime lastMonth2 = LocalDateTime.of(lastMonth1.getYear(), lastMonth1.getMonth(), lastMonth1.getDayOfMonth(), 0, 0, 0, 0); String lastMonthString = DateTimeUtils.localDateTimeToString(lastMonth2); - predicateList.add(criteriaBuilder.greaterThanOrEqualTo(root.get("satelliteTime").as(String.class), lastMonthString)); +// predicateList.add(criteriaBuilder.greaterThanOrEqualTo(root.get("satelliteTime").as(String.class), lastMonthString)); //开始时间查询条件 if (!TextUtils.isEmpty(startTime)) { LocalDateTime startTime1 = DateTimeUtils.stringToLocalDateTime(startTime);