diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 207ed8c..9064da4 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -1,5 +1,6 @@ package com.xkrs.service.impl; +import com.fasterxml.jackson.databind.ObjectMapper; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.dao.*; import com.xkrs.model.entity.*; @@ -264,6 +265,7 @@ public class FirePointServiceImpl implements FirePointService { FirePointEntity firePoint = getFirePointByShanDongFirePoint(shanDongFirePoint); log.info("-------转存新火点"); firePointDao.save(firePoint); + forwardPoint(firePoint); //发送消息通知 sendBroadcast(firePoint); return true; @@ -404,6 +406,7 @@ public class FirePointServiceImpl implements FirePointService { FirePointEntity firePoint = getFirePointByShanDongFirePoint(existShanDongFirePoint); log.info("-------转存新火点"); firePointDao.save(firePoint); + forwardPoint(firePoint); //发送消息通知 sendBroadcast(firePoint); } @@ -504,6 +507,15 @@ public class FirePointServiceImpl implements FirePointService { return content; } + private void forwardPoint(FirePointEntity firePointEntity) { + try { + String url = "http://118.24.27.47:10734/insertfirepointchannelThree"; + HttpClientUtils.sendHttpPost(url, new ObjectMapper().writeValueAsString(firePointEntity)); + } catch (Exception e) { + e.printStackTrace(); + } + } + /** * 下载VIP用户火点数据 */ diff --git a/src/main/java/com/xkrs/utils/GaoDeApiUtil.java b/src/main/java/com/xkrs/utils/GaoDeApiUtil.java index ab58188..a571f6d 100644 --- a/src/main/java/com/xkrs/utils/GaoDeApiUtil.java +++ b/src/main/java/com/xkrs/utils/GaoDeApiUtil.java @@ -57,7 +57,7 @@ public class GaoDeApiUtil { public static void main(String[] args) { List location = new ArrayList<>(); - location.add("117.849,35.59209"); + location.add("118.06454,37.8562"); GaoDeIgGeocodeVo geocode = geocode(location); System.out.println("sdfghjm");