From 25908f5bd4a2dae4625b49d325525849feb676a4 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 28 二月 2025 09:32:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1
---
server/services/src/main/java/com/doumee/core/utils/PositionUtil.java | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/core/utils/PositionUtil.java b/server/services/src/main/java/com/doumee/core/utils/PositionUtil.java
index 74294d2..98f387a 100644
--- a/server/services/src/main/java/com/doumee/core/utils/PositionUtil.java
+++ b/server/services/src/main/java/com/doumee/core/utils/PositionUtil.java
@@ -1,6 +1,7 @@
package com.doumee.core.utils;
+import com.alibaba.fastjson.JSONObject;
import com.doumee.dao.business.web.request.LocaltionDTO;
import java.awt.geom.GeneralPath;
@@ -13,6 +14,30 @@
*/
public class PositionUtil {
+ public static String getTxMapAddrByLatAndLng(Double lat,Double lng,String host,String mapkey){
+ try {
+ if(lat == null || lng ==null){
+ return null;
+ }
+ String url =host +"/ws/geocoder/v1/?key="+mapkey+"&location="+lat+","+lng;
+ String res = HttpsUtil.get(url,false);
+ JSONObject jsonObject = JSONObject.parseObject(res );
+ String r = null;
+ if(jsonObject.getJSONObject("result")!=null){
+ if(jsonObject.getJSONObject("result").getJSONObject("formatted_addresses")!=null){
+ r =jsonObject.getJSONObject("result").getJSONObject("formatted_addresses").getString("formatted_addresses");
+ }
+ if(r!=null && !r.equals("")){
+ r =jsonObject.getJSONObject("result").getString("address");
+ }
+ }
+ return r;
+
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
/**
* 鍒ゆ柇鍧愭爣鐐规槸鍚﹀湪澶氳竟褰㈠尯鍩熷唴
*
--
Gitblit v1.9.3