|
@@ -17,6 +17,7 @@ import com.bizmatics.mhfire.service.enums.BsSaTwoCode;
|
|
|
import com.bizmatics.mhfire.service.util.GouldUtil;
|
|
|
import com.bizmatics.mhfire.service.vo.UnitAlCheckVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -60,14 +61,16 @@ public class UnitServiceImpl implements UnitService {
|
|
|
for (List<UnitPO> listLimit:subSets) {
|
|
|
String addressList = listLimit.stream().map(UnitPO::getAddress).collect(Collectors.joining("|"));
|
|
|
List<LocateInfo> lonLat = GouldUtil.getLonLat(addressList);
|
|
|
- for (UnitPO unitPo:listLimit) {
|
|
|
- unitPo.setLatitude(lonLat.get(listLimit.indexOf(unitPo)).getLatitude());
|
|
|
- unitPo.setLongitude(lonLat.get(listLimit.indexOf(unitPo)).getLongitude());
|
|
|
- unitPo.setDistrict(lonLat.get(listLimit.indexOf(unitPo)).getDistrict());
|
|
|
- unitPo.setStreet(lonLat.get(listLimit.indexOf(unitPo)).getStreet());
|
|
|
+ if (CollectionUtils.isNotEmpty(lonLat)){
|
|
|
+ for (UnitPO unitPo:listLimit) {
|
|
|
+ unitPo.setLatitude(lonLat.get(listLimit.indexOf(unitPo)).getLatitude());
|
|
|
+ unitPo.setLongitude(lonLat.get(listLimit.indexOf(unitPo)).getLongitude());
|
|
|
+ unitPo.setDistrict(lonLat.get(listLimit.indexOf(unitPo)).getDistrict());
|
|
|
+ unitPo.setStreet(lonLat.get(listLimit.indexOf(unitPo)).getStreet());
|
|
|
|
|
|
+ }
|
|
|
+ unitMapper.updateList(listLimit);
|
|
|
}
|
|
|
- unitMapper.updateList(listLimit);
|
|
|
}
|
|
|
return new CommonPage<>(list, page.getTotal(), page.getSize(), page.getCurrent());
|
|
|
|