修改根据火点编码查询火点信息接口的名称

This commit is contained in:
XinYi Song 2021-12-06 09:03:07 +08:00
parent 5b02a11b0e
commit c77b05a87b
3 changed files with 27 additions and 17 deletions

View File

@ -52,7 +52,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers(HttpMethod.GET,"/selectCityName").permitAll() .antMatchers(HttpMethod.GET,"/selectCityName").permitAll()
.antMatchers(HttpMethod.GET,"/weather/cityName").permitAll() .antMatchers(HttpMethod.GET,"/weather/cityName").permitAll()
.antMatchers(HttpMethod.GET,"/weather/cityId").permitAll() .antMatchers(HttpMethod.GET,"/weather/cityId").permitAll()
.antMatchers(HttpMethod.GET,"/selectFirePoint").permitAll() .antMatchers(HttpMethod.GET,"/selectFirePointByCode").permitAll()
.antMatchers(HttpMethod.POST,"/updateTypeByFireCode").permitAll() .antMatchers(HttpMethod.POST,"/updateTypeByFireCode").permitAll()
.antMatchers(HttpMethod.GET,"/api/user/verificationCode").permitAll() .antMatchers(HttpMethod.GET,"/api/user/verificationCode").permitAll()
.antMatchers(HttpMethod.POST,"/uploadFileMore").permitAll() .antMatchers(HttpMethod.POST,"/uploadFileMore").permitAll()

View File

@ -270,7 +270,7 @@ public class FirePointController {
* @param fireCode * @param fireCode
* @return * @return
*/ */
@GetMapping("/selectFirePoint") @GetMapping("/selectFirePointByCode")
public String selectFirePoint(@RequestParam("fireCode") String fireCode){ public String selectFirePoint(@RequestParam("fireCode") String fireCode){
// 获取区域信息 // 获取区域信息
Locale locale = LocaleContextHolder.getLocale(); Locale locale = LocaleContextHolder.getLocale();

View File

@ -161,11 +161,14 @@ public class FirePointServiceImpl implements FirePointService {
public List<FirePointEntity> selectFirePoint(String proCode,String cityCode, String satelliteType, String landType, String startTime, String endTime) { public List<FirePointEntity> selectFirePoint(String proCode,String cityCode, String satelliteType, String landType, String startTime, String endTime) {
List<CityEntity> byProCode = cityDao.findByProCode(proCode); List<CityEntity> byProCode = cityDao.findByProCode(proCode);
String proName = byProCode.get(0).getProName(); String proName = byProCode.get(0).getProName();
LocalDate localDate = DateTimeUtil.stringToDate(endTime); if(!"".equals(startTime) && !"".equals(endTime)){
// 结束时间 LocalDate localDate = DateTimeUtil.stringToDate(endTime);
LocalDate localDate1 = localDate.plusDays(1); // 结束时间
String dateToString = DateTimeUtil.dateToString(localDate1); LocalDate localDate1 = localDate.plusDays(1);
return query.selectFirePointByPro(proName,cityCode, satelliteType, landType, startTime, dateToString); 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<CityEntity> byCityCode = cityDao.findByCityCode(cityCodeOne.substring(0,3)); //List<CityEntity> byCityCode = cityDao.findByCityCode(cityCodeOne.substring(0,3));
List<CountyEntity> byCityCode = countyDao.findByCityCode(cityCodeOne); List<CountyEntity> byCityCode = countyDao.findByCityCode(cityCodeOne);
String cityName = byCityCode.get(0).getCityName(); String cityName = byCityCode.get(0).getCityName();
LocalDate localDate = DateTimeUtil.stringToDate(endTime); if(!"".equals(startTime) && !"".equals(endTime)){
// 结束时间 LocalDate localDate = DateTimeUtil.stringToDate(endTime);
LocalDate localDate1 = localDate.plusDays(1); // 结束时间
String dateToString = DateTimeUtil.dateToString(localDate1); LocalDate localDate1 = localDate.plusDays(1);
return query.selectFirePointByCity(cityName,cityCode,satelliteType,landType,startTime,dateToString); 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") @Cacheable(keyGenerator = "keyGenerator", unless="#result == null")
@Override @Override
public List<FirePointEntity> selectFirePointByCounty(String cityCode, String satelliteType, String landType, String startTime, String endTime) { public List<FirePointEntity> selectFirePointByCounty(String cityCode, String satelliteType, String landType, String startTime, String endTime) {
LocalDate localDate = DateTimeUtil.stringToDate(endTime);
// 结束时间 if(!"".equals(startTime) && !"".equals(endTime)){
LocalDate localDate1 = localDate.plusDays(1); LocalDate localDate = DateTimeUtil.stringToDate(endTime);
String dateToString = DateTimeUtil.dateToString(localDate1); // 结束时间
return query.selectFirePointByCounty(cityCode,satelliteType,landType,startTime,dateToString); 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);
} }
/** /**