From 46fe03c6be878a7822bdafd7ff09ee570ccaa9d2 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Fri, 3 Mar 2023 09:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../straw/controller/FirePointController.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/xkrs/straw/controller/FirePointController.java b/src/main/java/com/xkrs/straw/controller/FirePointController.java index 080da37..eef3166 100644 --- a/src/main/java/com/xkrs/straw/controller/FirePointController.java +++ b/src/main/java/com/xkrs/straw/controller/FirePointController.java @@ -8,11 +8,8 @@ import com.xkrs.service.FirePointService; import com.xkrs.service.StreetService; import com.xkrs.service.impl.FirePointServiceImpl; import com.xkrs.straw.dao.SysUserDao; -import com.xkrs.straw.model.entity.SysUserEntity; import com.xkrs.straw.utils.FirePointQueryManager; import com.xkrs.utils.FirePointQueryHelper; -import com.xkrs.utils.TokenUtil; -import org.apache.hc.core5.util.TextUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.i18n.LocaleContextHolder; @@ -126,7 +123,7 @@ public class FirePointController { @PostMapping("/selectFirePoint") public String selectFirePoint(@RequestHeader(value = "Authorization") String token, @RequestBody Map map) { // 区县编码 - String cityCode = (String) map.get("cityCode"); + String code = (String) map.get("cityCode"); // 开始时间 String startTime = (String) map.get("startTime"); // 结束时间 @@ -135,16 +132,7 @@ public class FirePointController { String satelliteType = (String) map.get("satelliteType"); // 植被类型 String landType = (String) map.get("landType"); - // 验证token - String tokenUserName = TokenUtil.obtainUserNameByToken(token); - SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); - // 用于查询的区划编码,可能是省市区县街道任意级别 - String queryCode = TextUtils.isEmpty(cityCode) ? sysUserEntity.getCountyCode() : cityCode; - List firePointList = firePointQueryHelper.queryFirePoint(queryCode, startTime, endTime, satelliteType, landType); - if (firePointList == null || firePointList.size() == 0) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时还没有火点数据", locale); - } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, firePointList, locale); + return firePointService.queryFirePoint(token, code, startTime, endTime, satelliteType, landType); } /**