使用天地图反查填补历史数据

This commit is contained in:
liuchengqian 2024-12-03 08:59:46 +08:00
parent 6117738019
commit 92471c02fa
2 changed files with 6 additions and 7 deletions

View File

@ -124,7 +124,7 @@ public class DispatchFirePointController {
return criteriaBuilder.or(predicateList.toArray(new Predicate[predicateList.size()])); return criteriaBuilder.or(predicateList.toArray(new Predicate[predicateList.size()]));
}; };
//未审核的普通火点列表 //未审核的普通火点列表
PageRequest pageRequest = PageRequest.of(1, 1000, Sort.by(Sort.Direction.DESC, "satelliteTime")); PageRequest pageRequest = PageRequest.of(1, 100, Sort.by(Sort.Direction.DESC, "satelliteTime"));
List<FirePointOrdinaryEntity> list = firePointOrdinaryDao.findAll(specificationOrdinary, pageRequest).getContent(); List<FirePointOrdinaryEntity> list = firePointOrdinaryDao.findAll(specificationOrdinary, pageRequest).getContent();
if (list.isEmpty()) { if (list.isEmpty()) {
break; break;

View File

@ -1,5 +1,6 @@
package com.xkrs.utilsnew; package com.xkrs.utilsnew;
import cn.hutool.core.util.StrUtil;
import com.xkrs.model.bean.AddressBean; import com.xkrs.model.bean.AddressBean;
import com.xkrs.model.vo.TianDiTuGeocodeVo; import com.xkrs.model.vo.TianDiTuGeocodeVo;
import org.apache.hc.core5.util.TextUtils; import org.apache.hc.core5.util.TextUtils;
@ -19,17 +20,15 @@ public class FirePointAddressUtils {
//填充AddressBean数据 //填充AddressBean数据
AddressBean addressBean = new AddressBean(); AddressBean addressBean = new AddressBean();
addressBean.setSuccess(true); addressBean.setSuccess(true);
addressBean.setProCode(addressComponent.provinceCode.substring(3, 9)); addressBean.setProCode(StrUtil.isEmpty(addressComponent.provinceCode) ? "" : addressComponent.provinceCode.substring(3, 9));
addressBean.setProName(addressComponent.province); addressBean.setProName(addressComponent.province);
addressBean.setCityCode(addressComponent.cityCode.substring(3, 9)); addressBean.setCityCode(StrUtil.isEmpty(addressComponent.cityCode) ? "" : addressComponent.cityCode.substring(3, 9));
addressBean.setCityName(addressComponent.city); addressBean.setCityName(addressComponent.city);
addressBean.setCountyCode(addressComponent.countyCode.substring(3, 9)); addressBean.setCountyCode(StrUtil.isEmpty(addressComponent.countyCode) ? "" : addressComponent.countyCode.substring(3, 9));
addressBean.setCountyName(addressComponent.county); addressBean.setCountyName(addressComponent.county);
addressBean.setTownCode(addressComponent.townCode.substring(3, 12)); addressBean.setTownCode(StrUtil.isEmpty(addressComponent.townCode) ? "" : addressComponent.townCode.substring(3, 12));
addressBean.setTownName(addressComponent.town); addressBean.setTownName(addressComponent.town);
addressBean.setFirePointAddress(geocode.result.formattedAddress); addressBean.setFirePointAddress(geocode.result.formattedAddress);
//检查AddressBean的合法性
checkValidAddress(addressBean);
return addressBean; return addressBean;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();