diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java index 6e796dd..0cd052b 100644 --- a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java +++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java @@ -52,7 +52,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers(HttpMethod.GET,"/selectCityName").permitAll() .antMatchers(HttpMethod.GET,"/weather/cityName").permitAll() .antMatchers(HttpMethod.GET,"/weather/cityId").permitAll() - .antMatchers(HttpMethod.GET,"/selectFirePoint").permitAll() + .antMatchers(HttpMethod.GET,"/selectFirePointByCode").permitAll() .antMatchers(HttpMethod.POST,"/updateTypeByFireCode").permitAll() .antMatchers(HttpMethod.GET,"/api/user/verificationCode").permitAll() .antMatchers(HttpMethod.POST,"/uploadFileMore").permitAll() diff --git a/src/main/java/com/xkrs/controller/FirePointController.java b/src/main/java/com/xkrs/controller/FirePointController.java index 6c36af8..278dd36 100644 --- a/src/main/java/com/xkrs/controller/FirePointController.java +++ b/src/main/java/com/xkrs/controller/FirePointController.java @@ -270,7 +270,7 @@ public class FirePointController { * @param fireCode * @return */ - @GetMapping("/selectFirePoint") + @GetMapping("/selectFirePointByCode") public String selectFirePoint(@RequestParam("fireCode") String fireCode){ // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 118e453..08f5351 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -161,11 +161,14 @@ public class FirePointServiceImpl implements FirePointService { public List selectFirePoint(String proCode,String cityCode, String satelliteType, String landType, String startTime, String endTime) { List byProCode = cityDao.findByProCode(proCode); String proName = byProCode.get(0).getProName(); - LocalDate localDate = DateTimeUtil.stringToDate(endTime); - // 结束时间 - LocalDate localDate1 = localDate.plusDays(1); - String dateToString = DateTimeUtil.dateToString(localDate1); - return query.selectFirePointByPro(proName,cityCode, satelliteType, landType, startTime, dateToString); + if(!"".equals(startTime) && !"".equals(endTime)){ + LocalDate localDate = DateTimeUtil.stringToDate(endTime); + // 结束时间 + LocalDate localDate1 = localDate.plusDays(1); + String dateToString = DateTimeUtil.dateToString(localDate1); + return query.selectFirePointByPro(proName,cityCode, satelliteType, landType, startTime, dateToString); + } + return query.selectFirePointByPro(proName,cityCode, satelliteType, landType, startTime, endTime); } /** @@ -184,11 +187,14 @@ public class FirePointServiceImpl implements FirePointService { //List byCityCode = cityDao.findByCityCode(cityCodeOne.substring(0,3)); List byCityCode = countyDao.findByCityCode(cityCodeOne); String cityName = byCityCode.get(0).getCityName(); - LocalDate localDate = DateTimeUtil.stringToDate(endTime); - // 结束时间 - LocalDate localDate1 = localDate.plusDays(1); - String dateToString = DateTimeUtil.dateToString(localDate1); - return query.selectFirePointByCity(cityName,cityCode,satelliteType,landType,startTime,dateToString); + if(!"".equals(startTime) && !"".equals(endTime)){ + LocalDate localDate = DateTimeUtil.stringToDate(endTime); + // 结束时间 + LocalDate localDate1 = localDate.plusDays(1); + String dateToString = DateTimeUtil.dateToString(localDate1); + return query.selectFirePointByCity(cityName,cityCode,satelliteType,landType,startTime,dateToString); + } + return query.selectFirePointByCity(cityName,cityCode,satelliteType,landType,startTime,endTime); } /** @@ -203,11 +209,15 @@ public class FirePointServiceImpl implements FirePointService { @Cacheable(keyGenerator = "keyGenerator", unless="#result == null") @Override public List selectFirePointByCounty(String cityCode, String satelliteType, String landType, String startTime, String endTime) { - LocalDate localDate = DateTimeUtil.stringToDate(endTime); - // 结束时间 - LocalDate localDate1 = localDate.plusDays(1); - String dateToString = DateTimeUtil.dateToString(localDate1); - return query.selectFirePointByCounty(cityCode,satelliteType,landType,startTime,dateToString); + + if(!"".equals(startTime) && !"".equals(endTime)){ + LocalDate localDate = DateTimeUtil.stringToDate(endTime); + // 结束时间 + LocalDate localDate1 = localDate.plusDays(1); + String dateToString = DateTimeUtil.dateToString(localDate1); + return query.selectFirePointByCounty(cityCode,satelliteType,landType,startTime,dateToString); + } + return query.selectFirePointByCounty(cityCode,satelliteType,landType,startTime,endTime); } /**