逆地理编码时更新街道编号和街道名称
This commit is contained in:
parent
329bc490f2
commit
0306cdeb0c
@ -110,33 +110,17 @@ public class FirePointServiceImpl implements FirePointService {
|
|||||||
firePointEntity.setFireImage(firePointQo.getFireImage());
|
firePointEntity.setFireImage(firePointQo.getFireImage());
|
||||||
firePointEntity.setSatelliteImage(firePointQo.getSatelliteImage());
|
firePointEntity.setSatelliteImage(firePointQo.getSatelliteImage());
|
||||||
try {
|
try {
|
||||||
bindStreetCode(firePointEntity);
|
bindStreetCodeName(firePointEntity);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.out.println("添加火点信息 逆地理编码请求街道编号失败:" + e.getMessage());
|
System.out.println("添加火点信息 逆地理编码请求街道编号失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
log.info("-------发现新火点");
|
log.info("-------发现新火点");
|
||||||
/*log.info("---------------开始进行实时通讯,将检测到的火点传给前端");
|
|
||||||
Map map = new HashMap(3);
|
|
||||||
map.put("countyCode",firePointQo.getCountyCode());
|
|
||||||
map.put("countyName",firePointQo.getCountyName());
|
|
||||||
map.put("fireCode",firePointQo.getFireCode());
|
|
||||||
map.put("latitude",firePointQo.getLatitude());
|
|
||||||
map.put("longitude",firePointQo.getLongitude());
|
|
||||||
map.put("satelliteTime",DateTimeUtil.timeMillisToString(firePointQo.getSatelliteTimeTs().longValue()));
|
|
||||||
map.put("satelliteType",firePointQo.getSatelliteType());
|
|
||||||
map.put("addTime",DateTimeUtil.dateTimeToString(LocalDateTime.now()));
|
|
||||||
map.put("detailedAddress",AddressUtils.getLatAndLng(firePointQo.getLatitude().toString(),firePointQo.getLongitude().toString()));
|
|
||||||
Map map1 = new HashMap(3);
|
|
||||||
map1.put("fire",map);
|
|
||||||
String websocket = JSON.toJSONString(map1);
|
|
||||||
// 将监测到的火点信息返给前端
|
|
||||||
WebSocketServer.broadInfo(websocket);*/
|
|
||||||
return firePointDao.save(firePointEntity);
|
return firePointDao.save(firePointEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindStreetCode(FirePointEntity firePointEntity) throws Exception {
|
private void bindStreetCodeName(FirePointEntity firePointEntity) throws Exception {
|
||||||
List<String> locationList = new ArrayList<>();
|
List<String> locationList = new ArrayList<>();
|
||||||
locationList.add(firePointEntity.getLongitude() + "," + firePointEntity.getLatitude());
|
locationList.add(firePointEntity.getLongitude() + "," + firePointEntity.getLatitude());
|
||||||
GaoDeIgGeocodeVo geocode = GaoDeApiUtil.geocode(locationList);
|
GaoDeIgGeocodeVo geocode = GaoDeApiUtil.geocode(locationList);
|
||||||
@ -145,6 +129,10 @@ public class FirePointServiceImpl implements FirePointService {
|
|||||||
townCode = townCode.substring(0, 9);
|
townCode = townCode.substring(0, 9);
|
||||||
}
|
}
|
||||||
firePointEntity.setStreetCode(townCode);
|
firePointEntity.setStreetCode(townCode);
|
||||||
|
List<StreetEntity> byStreetCode = streetDao.findByStreetCode(townCode);
|
||||||
|
if (byStreetCode != null && byStreetCode.size() > 0) {
|
||||||
|
firePointEntity.setStreetName(byStreetCode.get(0).getStreetName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user