This commit is contained in:
liuchengqian 2023-03-03 09:54:43 +08:00
parent be7f873791
commit 46fe03c6be

View File

@ -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<FirePointEntity> 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);
}
/**