From 0acc7c8c1fa158899349a009106e25447e1a89f1 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Thu, 2 Mar 2023 13:50:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/common/config/WebSecurityConfig.java | 1 - src/main/java/com/xkrs/dao/FirePointDao.java | 12 --- .../com/xkrs/service/FirePointService.java | 21 ----- .../service/impl/FirePointServiceImpl.java | 76 ------------------- .../straw/controller/FirePointController.java | 16 ---- 5 files changed, 126 deletions(-) diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java index 94b5577..6dc567d 100644 --- a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java +++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java @@ -54,7 +54,6 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers(HttpMethod.POST, "/insertFirePoint").permitAll() .antMatchers(HttpMethod.POST, "/insertAppTask").permitAll() .antMatchers(HttpMethod.GET, "/selectAppTask").permitAll() - .antMatchers(HttpMethod.GET, "/selectFirePointNum").permitAll() .antMatchers(HttpMethod.GET, "/selectCityName").permitAll() .antMatchers(HttpMethod.GET, "/weather/cityName").permitAll() .antMatchers(HttpMethod.GET, "/weather/cityId").permitAll() diff --git a/src/main/java/com/xkrs/dao/FirePointDao.java b/src/main/java/com/xkrs/dao/FirePointDao.java index 7abc9c3..89b7c3f 100644 --- a/src/main/java/com/xkrs/dao/FirePointDao.java +++ b/src/main/java/com/xkrs/dao/FirePointDao.java @@ -20,18 +20,6 @@ public interface FirePointDao extends JpaRepository, JpaS @Query(value = "SELECT * FROM fire_point WHERE longitude = ?1 AND latitude = ?2 AND street_code = ?3 AND satellite_time = ?4 AND satellite_type = ?5 AND land_type = ?6", nativeQuery = true) List findDuplicatedData(double longitude, double latitude, String streetCode, String satelliteTime, String satelliteType, String landType); - /** - * 查询时间段内各植被类型的火点数量 - */ - @Query(value = "select la.land_name landname,count(fp.id) as num from land la left join fire_point fp on fp.land_type = la.land_name AND fp.satellite_time BETWEEN ?1 AND ?2 group by la.land_name", nativeQuery = true) - List> selectNumByLandType(String startTime, String endTime); - - /** - * 查询时间段内各地区的火点数量 - */ - @Query(value = "select ci.city_name cityname,count(fp.id) from street ci left join fire_point fp on fp.county_code like concat('%',ci.city_code,'%') AND fp.satellite_time BETWEEN ?1 AND ?2 group by ci.city_name", nativeQuery = true) - List> selectNumByArea(String startTime, String endTime); - @Query(value = "select a.really_name 姓名, a.county_name 所在市, a.telephone 手机号, a.vip_level vip, b.satellite_time 扫描时间, " + "round(cast(b.longitude as numeric) ,6) 经度, round(cast(b.latitude as numeric) ,6) 纬度, b.fire_point_address 详细地址 from sys_user a left join fire_point b on " + "case when left(a.county_code, 4) = '0000' then left(b.county_code, 4) = left(a.county_code, 4) " + "when left(a.county_code, 2) = '00' then left(b.county_code, 2) = left(a.county_code, 2) " + "else left(b.county_code, 2) = left(a.county_code, 2) end where a.vip_level > 0 and satellite_time > ?1", nativeQuery = true) List> downloadFirePointByVip(String yesterday); diff --git a/src/main/java/com/xkrs/service/FirePointService.java b/src/main/java/com/xkrs/service/FirePointService.java index d95c14c..d98bea6 100644 --- a/src/main/java/com/xkrs/service/FirePointService.java +++ b/src/main/java/com/xkrs/service/FirePointService.java @@ -28,27 +28,6 @@ public interface FirePointService { */ List selectTodayFirePoint(String countyCode); - /** - * 查询近一个月的火点数量 - * - * @return - */ - String selectFirePointNumMonth(); - - /** - * 查询近一天的火点数量 - * - * @return - */ - String selectFirePointNumDay(); - - /** - * 查询 - * - * @return - */ - String selectFirePointNumWeek(); - /** * download vip user's fire point * diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 58246cb..89be614 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -1,6 +1,5 @@ package com.xkrs.service.impl; -import com.fasterxml.jackson.databind.ObjectMapper; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.dao.CountyCodeWeiXinDao; import com.xkrs.dao.FirePointDao; @@ -306,79 +305,4 @@ public class FirePointServiceImpl implements FirePointService { return firePointQueryHelper.queryFirePoint(countyCode, startTimeString, endTimeString, null, null); } - /** - * 查询近一个月的火点数量 - * - * @return - */ -// @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") - @Override - public String selectFirePointNumMonth() { - Map map = new HashMap(3); - LocalDateTime localDateTime = LocalDateTime.now(); - LocalDateTime localDateTime2 = localDateTime.plusDays(1); - String endTime = dateTimeToString(localDateTime2); - // 当前时间减30 - LocalDateTime localDateTime1 = localDateTime.minusDays(30); - String startTime = dateTimeToString(localDateTime1); - // 查询近一个月各植被类型的火点数量 - List> maps = firePointDao.selectNumByLandType(startTime, endTime); - map.put("land", maps); - // 查询近一个月各地区火点数量 - List> maps1 = firePointDao.selectNumByArea(startTime, endTime); - map.put("area", maps1); - - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, map, locale); - } - - /** - * 查询近一天的火点数量 - * - * @return - */ -// @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") - @Override - public String selectFirePointNumDay() { - Map map = new HashMap(3); - LocalDateTime localDateTime = LocalDateTime.now(); - LocalDateTime localDateTime2 = localDateTime.plusDays(1); - String endTime = dateTimeToString(localDateTime2); - // 当前时间减1 - LocalDateTime localDateTime1 = localDateTime.minusDays(1); - String startTime = dateTimeToString(localDateTime1); - // 查询近一个月各植被类型的火点数量 - List> maps = firePointDao.selectNumByLandType(startTime, endTime); - map.put("land", maps); - // 查询近一个月各地区火点数量 - List> maps1 = firePointDao.selectNumByArea(startTime, endTime); - map.put("area", maps1); - - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, map, locale); - } - - /** - * 查询近一周的火点数量 - * - * @return - */ -// @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") - @Override - public String selectFirePointNumWeek() { - Map map = new HashMap(3); - LocalDateTime localDateTime = LocalDateTime.now(); - LocalDateTime localDateTime2 = localDateTime.plusDays(1); - String endTime = dateTimeToString(localDateTime2); - // 当前时间减7 - LocalDateTime localDateTime1 = localDateTime.minusDays(7); - String startTime = dateTimeToString(localDateTime1); - // 查询近一个月各植被类型的火点数量 - List> maps = firePointDao.selectNumByLandType(startTime, endTime); - map.put("land", maps); - // 查询近一个月各地区火点数量 - List> maps1 = firePointDao.selectNumByArea(startTime, endTime); - map.put("area", maps1); - - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, map, locale); - } - } diff --git a/src/main/java/com/xkrs/straw/controller/FirePointController.java b/src/main/java/com/xkrs/straw/controller/FirePointController.java index 93edbac..2c7b33d 100644 --- a/src/main/java/com/xkrs/straw/controller/FirePointController.java +++ b/src/main/java/com/xkrs/straw/controller/FirePointController.java @@ -150,22 +150,6 @@ public class FirePointController { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, firePointList, locale); } - /** - * 查询火点数量 - */ - @GetMapping("/selectFirePointNum") - public String selectFirePointNum(@RequestParam("keepType") String keepType) { - // keepType为1时,查询近一天的火点数量 - if ("1".equals(keepType)) { - return firePointService.selectFirePointNumDay(); - // keepType为2时,查询近一周的火点数量 - } else if ("2".equals(keepType)) { - return firePointService.selectFirePointNumWeek(); - } else { - return firePointService.selectFirePointNumMonth(); - } - } - /** * 查询该省所有的市 *