From 27fbde9362485b38378e5a1abcb76d3e2a2a909e Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 20 二月 2025 10:17:34 +0800
Subject: [PATCH] jtt808初始化
---
server/web/src/main/java/com/doumee/jtt808/web/service/Jtt808Service.java | 5 +++++
server/services/src/main/java/com/doumee/core/dingding/DingDingNotice.java | 1 -
server/services/src/main/java/com/doumee/core/utils/PositionUtil.java | 24 ++++++++++++++++++++++++
server/services/src/main/java/com/doumee/dao/business/web/response/MiniProgrammeDTO.java | 10 +++++-----
4 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/core/dingding/DingDingNotice.java b/server/services/src/main/java/com/doumee/core/dingding/DingDingNotice.java
index cd4c44a..583a55a 100644
--- a/server/services/src/main/java/com/doumee/core/dingding/DingDingNotice.java
+++ b/server/services/src/main/java/com/doumee/core/dingding/DingDingNotice.java
@@ -62,7 +62,6 @@
}
/**
* 閽夐拤閫氱煡 - 绔欑偣閫氫俊寮傚父涓婃姤
- * @param ddUrl
* @throws Exception
*/
public static void siteNoLink(List<Sites> siteList,String token,String robotCode,String chatToken) throws Exception{
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..fdd1f5f 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;
@@ -12,7 +13,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;
+ }
/**
* 鍒ゆ柇鍧愭爣鐐规槸鍚﹀湪澶氳竟褰㈠尯鍩熷唴
*
diff --git a/server/services/src/main/java/com/doumee/dao/business/web/response/MiniProgrammeDTO.java b/server/services/src/main/java/com/doumee/dao/business/web/response/MiniProgrammeDTO.java
index 3d84636..b6c53ef 100644
--- a/server/services/src/main/java/com/doumee/dao/business/web/response/MiniProgrammeDTO.java
+++ b/server/services/src/main/java/com/doumee/dao/business/web/response/MiniProgrammeDTO.java
@@ -70,16 +70,16 @@
@ApiModelProperty("鍋滄鏈嶅姟缁撴潫")
private String leaseNoticeUrl = "";
@ApiModelProperty("鐢佃溅涓存椂鍋滆溅闄愬埗 0鍋滆溅鐐瑰唴鍋滆溅 1杩愯惀鍖哄煙鍐呭仠杞�")
- private String pauseBikeType;
+ private String pauseBikeType="";
@ApiModelProperty("鍔ㄨ溅涓村仠鑷姩鍏抽攣鏃堕暱锛堝垎閽燂級")
- private String pauseAutoCloseTime;
+ private String pauseAutoCloseTime="";
@ApiModelProperty("浣庣數鍘嬮璀﹀�硷紙浼忥級")
- private String lowBikeVoltage;
+ private String lowBikeVoltage="";
@ApiModelProperty("婊$數鐢靛帇锛堜紡锛�")
- private String fullBikeVoltage;
+ private String fullBikeVoltage="";
@ApiModelProperty("杩愯惀鍖哄煙缁忕含搴﹂泦鍚�")
- private String parkLatLngList;
+ private String parkLatLngList="";
/**
* 瀵硅薄椹煎嘲灞炴�ц浆涓嬪垝绾�
diff --git a/server/web/src/main/java/com/doumee/jtt808/web/service/Jtt808Service.java b/server/web/src/main/java/com/doumee/jtt808/web/service/Jtt808Service.java
index ad6648b..5e9d50d 100644
--- a/server/web/src/main/java/com/doumee/jtt808/web/service/Jtt808Service.java
+++ b/server/web/src/main/java/com/doumee/jtt808/web/service/Jtt808Service.java
@@ -29,6 +29,7 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ConcurrentReferenceHashMap;
@@ -50,6 +51,10 @@
@Service
public class Jtt808Service {
+ @Value("${tencent.map.remoteHost:}")
+ private String mapHost;
+ @Value("${tencent.map.appKey:}")
+ private String mapKey;
@Autowired
private MessageManager messageManager;
@Autowired
--
Gitblit v1.9.3