diff --git a/src/main/java/com/xkrs/controller/FirePointController.java b/src/main/java/com/xkrs/controller/FirePointController.java index 89c4b59..2246142 100644 --- a/src/main/java/com/xkrs/controller/FirePointController.java +++ b/src/main/java/com/xkrs/controller/FirePointController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; import java.util.Locale; +import java.util.Map; import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; @@ -81,4 +82,32 @@ public class FirePointController { } return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale); } + + /** + * 动态多条件查询火点信息 + * @param map + * @param token + * @return + */ + @PostMapping("/selectFirePoint") + @PreAuthorize("hasAnyAuthority('auth_general_user')") + public String selectFirePoint(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ + // 获取区域信息 + Locale locale = LocaleContextHolder.getLocale(); + // 区县编码 + String cityCode = (String) map.get("cityCode"); + // 卫星类型 + String satelliteType = (String) map.get("satelliteType"); + // 植被类型 + String landType = (String) map.get("landType"); + // 开始时间 + String startTime = (String) map.get("startTime"); + // 结束时间 + String endTime = (String) map.get("endTime"); + List firePointEntities = firePointService.selectFirePoint(cityCode, satelliteType, landType, startTime, endTime); + if(firePointEntities == null || firePointEntities.size() == 0){ + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有火点数据",locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale); + } } diff --git a/src/main/java/com/xkrs/service/FirePointService.java b/src/main/java/com/xkrs/service/FirePointService.java index a7f1be9..99196e1 100644 --- a/src/main/java/com/xkrs/service/FirePointService.java +++ b/src/main/java/com/xkrs/service/FirePointService.java @@ -24,4 +24,15 @@ public interface FirePointService { * @return */ List selectTodayFirePoint(); + + /** + * 动态多条件查询火点信息 + * @param cityCode + * @param satelliteType + * @param landType + * @param startTime + * @param endTime + * @return + */ + List selectFirePoint(String cityCode,String satelliteType,String landType,String startTime,String endTime); } diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index a98ecaa..56c67a3 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -6,6 +6,7 @@ import com.xkrs.model.qo.FirePointQo; import com.xkrs.service.FirePointService; import com.xkrs.utils.AddressUtils; import com.xkrs.utils.DateTimeUtil; +import com.xkrs.utils.Query; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -26,6 +27,9 @@ public class FirePointServiceImpl implements FirePointService { @Resource private FirePointDao firePointDao; + @Resource + private Query query; + /** * 添加火点信息 * @param firePointQo @@ -61,4 +65,18 @@ public class FirePointServiceImpl implements FirePointService { String addTime = DateTimeUtil.dateToString(LocalDate.now()); return firePointDao.selectTodayFirePoint(addTime); } + + /** + * 动态多条件查询火点信息 + * @param cityCode + * @param satelliteType + * @param landType + * @param startTime + * @param endTime + * @return + */ + @Override + public List selectFirePoint(String cityCode, String satelliteType, String landType, String startTime, String endTime) { + return query.selectFirePoint(cityCode, satelliteType, landType, startTime, endTime); + } }