优化
This commit is contained in:
parent
be7f873791
commit
46fe03c6be
@ -8,11 +8,8 @@ import com.xkrs.service.FirePointService;
|
|||||||
import com.xkrs.service.StreetService;
|
import com.xkrs.service.StreetService;
|
||||||
import com.xkrs.service.impl.FirePointServiceImpl;
|
import com.xkrs.service.impl.FirePointServiceImpl;
|
||||||
import com.xkrs.straw.dao.SysUserDao;
|
import com.xkrs.straw.dao.SysUserDao;
|
||||||
import com.xkrs.straw.model.entity.SysUserEntity;
|
|
||||||
import com.xkrs.straw.utils.FirePointQueryManager;
|
import com.xkrs.straw.utils.FirePointQueryManager;
|
||||||
import com.xkrs.utils.FirePointQueryHelper;
|
import com.xkrs.utils.FirePointQueryHelper;
|
||||||
import com.xkrs.utils.TokenUtil;
|
|
||||||
import org.apache.hc.core5.util.TextUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.context.i18n.LocaleContextHolder;
|
import org.springframework.context.i18n.LocaleContextHolder;
|
||||||
@ -126,7 +123,7 @@ public class FirePointController {
|
|||||||
@PostMapping("/selectFirePoint")
|
@PostMapping("/selectFirePoint")
|
||||||
public String selectFirePoint(@RequestHeader(value = "Authorization") String token, @RequestBody Map map) {
|
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");
|
String startTime = (String) map.get("startTime");
|
||||||
// 结束时间
|
// 结束时间
|
||||||
@ -135,16 +132,7 @@ public class FirePointController {
|
|||||||
String satelliteType = (String) map.get("satelliteType");
|
String satelliteType = (String) map.get("satelliteType");
|
||||||
// 植被类型
|
// 植被类型
|
||||||
String landType = (String) map.get("landType");
|
String landType = (String) map.get("landType");
|
||||||
// 验证token
|
return firePointService.queryFirePoint(token, code, startTime, endTime, satelliteType, landType);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user