From c903a3606fa825e5ecb9eaefa4127f6f9cd1fc07 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期五, 17 四月 2026 11:53:51 +0800
Subject: [PATCH] [feat] 交易策略配置管理

---
 xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java |   46 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java
index bfb5b6f..c08b40a 100644
--- a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java
+++ b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java
@@ -1,38 +1,42 @@
 package com.xiaopeng.map.controller;
 
 
-import com.alibaba.fastjson2.JSON;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.xiaopeng.api.dto.map.HistoryPointDto;
 import com.xiaopeng.api.dto.map.OrderRouteAndFareDto;
 import com.xiaopeng.api.dto.map.RouteAndFareDto;
-import com.xiaopeng.api.dto.operation.LonLatDto;
 import com.xiaopeng.api.feignClient.order.XpOrderClient;
-import com.xiaopeng.api.model.order.XpOrder;
+import com.xiaopeng.api.dto.WeatherDTO;
 import com.xiaopeng.api.vo.map.PointByIpVo;
-import com.xiaopeng.api.vo.map.XpDistanceAndDurationVo;
 import com.xiaopeng.api.vo.operation.RouteVo;
-import com.xiaopeng.common.core.constant.CacheConstants;
 import com.xiaopeng.common.core.domain.R;
 import com.xiaopeng.common.redis.service.RedisService;
 import com.xiaopeng.map.mangodb.model.GeoPoint;
 import com.xiaopeng.map.mangodb.service.XpGeoFencingPolygonService;
 import com.xiaopeng.map.utils.AmapWalkingRouteUtil;
 import com.xiaopeng.map.utils.GDMapGeocodingUtil;
-import com.xiaopeng.map.utils.mangoUtils.MongoGeoFenceUtil;
 import com.xiaopeng.unifiedverification.interceptor.XpClientCheck;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
 import org.bson.Document;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.mongodb.core.MongoTemplate;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.stream.Collectors;
 
 @Slf4j
 @RestController
@@ -175,4 +179,32 @@
         return R.ok(pointByIpVo);
     }
 
+
+    @Value("${map.urls.weather:https://restapi.amap.com/v3/weather/weatherInfo?key=%s&city=%s}")
+    String WEATHER_URL;
+
+    @Autowired
+    ObjectMapper om;
+
+    @Value("${map.apikey:66ae577f63898dae3016d599fda57221}")
+    String key;
+
+    @ApiOperation(value = "获取天气信息", tags = {"内部-调价"})
+    @GetMapping("/logan/inner/weatherInfo")
+    public R<WeatherDTO> weather(@RequestParam String city) throws IOException {
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
+            HttpGet httpGet = new HttpGet(String.format(WEATHER_URL, key, city));
+            try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
+                HttpEntity entity = response.getEntity();
+                if (entity != null) {
+                    String resp = EntityUtils.toString(entity, StandardCharsets.UTF_8);
+                    System.out.println(resp);
+                    return R.ok(om.readValue(resp, WeatherDTO.class));
+                }
+                return R.fail("获取天气信息失败");
+            }
+        }
+    }
+
 }

--
Gitblit v1.7.1