From b559701d5e19a62d4430c68bf1474ddea7e64de9 Mon Sep 17 00:00:00 2001 From: "DESKTOP-4U0TDEF\\20371" <2037158277@qq.com> Date: Fri, 16 Jul 2021 09:22:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A4=9A=E6=9D=A1=E4=BB=B6=E6=9F=A5=E8=AF=A2=E7=81=AB=E7=82=B9?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/controller/FirePointController.java | 29 +++++++++++++++++++ .../com/xkrs/service/FirePointService.java | 11 +++++++ .../service/impl/FirePointServiceImpl.java | 18 ++++++++++++ 3 files changed, 58 insertions(+) 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); + } }