优化
This commit is contained in:
parent
24fd4e9e3d
commit
0acc7c8c1f
@ -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()
|
||||
|
@ -20,18 +20,6 @@ public interface FirePointDao extends JpaRepository<FirePointEntity, Long>, 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<FirePointEntity> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, String>> downloadFirePointByVip(String yesterday);
|
||||
|
||||
|
@ -28,27 +28,6 @@ public interface FirePointService {
|
||||
*/
|
||||
List<FirePointEntity> selectTodayFirePoint(String countyCode);
|
||||
|
||||
/**
|
||||
* 查询近一个月的火点数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String selectFirePointNumMonth();
|
||||
|
||||
/**
|
||||
* 查询近一天的火点数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String selectFirePointNumDay();
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String selectFirePointNumWeek();
|
||||
|
||||
/**
|
||||
* download vip user's fire point
|
||||
*
|
||||
|
@ -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<Map<String, Object>> maps = firePointDao.selectNumByLandType(startTime, endTime);
|
||||
map.put("land", maps);
|
||||
// 查询近一个月各地区火点数量
|
||||
List<Map<String, Object>> 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<Map<String, Object>> maps = firePointDao.selectNumByLandType(startTime, endTime);
|
||||
map.put("land", maps);
|
||||
// 查询近一个月各地区火点数量
|
||||
List<Map<String, Object>> 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<Map<String, Object>> maps = firePointDao.selectNumByLandType(startTime, endTime);
|
||||
map.put("land", maps);
|
||||
// 查询近一个月各地区火点数量
|
||||
List<Map<String, Object>> maps1 = firePointDao.selectNumByArea(startTime, endTime);
|
||||
map.put("area", maps1);
|
||||
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, map, locale);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询该省所有的市
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user