diff --git a/src/main/java/com/xkrs/controller/DispatchFirePointController.java b/src/main/java/com/xkrs/controller/DispatchFirePointController.java index 5d0790f..68bc574 100644 --- a/src/main/java/com/xkrs/controller/DispatchFirePointController.java +++ b/src/main/java/com/xkrs/controller/DispatchFirePointController.java @@ -124,7 +124,7 @@ public class DispatchFirePointController { 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 list = firePointOrdinaryDao.findAll(specificationOrdinary, pageRequest).getContent(); if (list.isEmpty()) { break; diff --git a/src/main/java/com/xkrs/utilsnew/FirePointAddressUtils.java b/src/main/java/com/xkrs/utilsnew/FirePointAddressUtils.java index 3479bdb..7e572fd 100644 --- a/src/main/java/com/xkrs/utilsnew/FirePointAddressUtils.java +++ b/src/main/java/com/xkrs/utilsnew/FirePointAddressUtils.java @@ -1,5 +1,6 @@ package com.xkrs.utilsnew; +import cn.hutool.core.util.StrUtil; import com.xkrs.model.bean.AddressBean; import com.xkrs.model.vo.TianDiTuGeocodeVo; import org.apache.hc.core5.util.TextUtils; @@ -19,17 +20,15 @@ public class FirePointAddressUtils { //填充AddressBean数据 AddressBean addressBean = new AddressBean(); 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.setCityCode(addressComponent.cityCode.substring(3, 9)); + addressBean.setCityCode(StrUtil.isEmpty(addressComponent.cityCode) ? "" : addressComponent.cityCode.substring(3, 9)); 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.setTownCode(addressComponent.townCode.substring(3, 12)); + addressBean.setTownCode(StrUtil.isEmpty(addressComponent.townCode) ? "" : addressComponent.townCode.substring(3, 12)); addressBean.setTownName(addressComponent.town); addressBean.setFirePointAddress(geocode.result.formattedAddress); - //检查AddressBean的合法性 - checkValidAddress(addressBean); return addressBean; } catch (Exception e) { e.printStackTrace();