From 9505fe33b4bdbcc7a5b031cf7a0fe80fa7f19fcd Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 25 Oct 2022 19:57:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=AB=E7=82=B9=E8=BD=AC=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/service/impl/FirePointServiceImpl.java | 12 ++++++++++++ src/main/java/com/xkrs/utils/GaoDeApiUtil.java | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) 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");