From 63f94f4d6f94ccc202f2046252e5b0ef643f8de1 Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 27 Jun 2024 14:10:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E9=AB=98=E5=BE=B7?= =?UTF-8?q?=E5=95=86=E5=AE=B6=E6=8E=A8=E9=80=81=E9=9D=99=E6=80=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=8A=B6=E6=80=81=E3=80=81=E9=AB=98=E5=BE=B7=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E5=95=86=E5=AE=B6=E9=9D=99=E6=80=81=E8=AF=A6=E7=BB=86?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/thirdparty/AMapController.java | 29 +++++++++++++++++++ .../test/java/SpringBootTestController.java | 2 +- .../pile/dto/amap/GetStationInfoDTO.java | 7 +++++ .../pile/mapper/PileStationInfoMapper.java | 3 +- .../pile/service/PileStationInfoService.java | 3 +- .../impl/PileStationInfoServiceImpl.java | 5 ++-- .../mapper/pile/PileStationInfoMapper.xml | 9 +++++- .../thirdparty/amap/service/AMapService.java | 9 ++++++ .../amap/service/impl/AMapServiceImpl.java | 26 +++++++++++++++-- 9 files changed, 85 insertions(+), 8 deletions(-) diff --git a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/AMapController.java b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/AMapController.java index 95bea49cd..4c4d6fa6f 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/AMapController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/AMapController.java @@ -60,6 +60,35 @@ public class AMapController extends BaseController { } + /** + * 高德拉取商家静态详细信息 + * @param requestMap + * @return + */ + @PostMapping("/getStationInfo") + public AMapCommonResult getStationInfo(@RequestParam Map requestMap) { + AMapCommonResult result = new AMapCommonResult(); + String paramString = JSON.toJSONString(requestMap); + logger.info("高德拉取商家静态详细信息 params:{}", paramString); + try { + // Map map = JSON.parseObject(paramString, Map.class); + // Map paramMap = (Map)JSON.parse(paramString); + if (AMapUtils.checkSign(requestMap)) { + // true 验签成功 + String bizContent = requestMap.get("biz_content"); + GetStationInfoDTO dto = JSON.parseObject(bizContent, GetStationInfoDTO.class); + List stationInfos = aMapService.getStationInfosV2(dto); + result = result.successResponse(stationInfos); + logger.info("高德拉取商家静态详细信息 success result:{}", JSON.toJSONString(result)); + return result; + } + } catch (Exception e) { + + } + return null; + } + + @PostMapping("/pushStationStatus") public AMapCommonResult pushStationStatus(@RequestBody QueryPileDTO dto) { AMapCommonResult result = new AMapCommonResult(); diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index 4fa9933aa..3af7b2933 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -2587,7 +2587,7 @@ public class SpringBootTestController { // String s = aMapService.pushChargingDeviceDynamics(pileConnectorCode); GetStationInfoDTO dto = new GetStationInfoDTO(); dto.setType("page"); - aMapService.getStationInfos(dto); + // aMapService.getStationInfos(dto); } @Test diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/amap/GetStationInfoDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/amap/GetStationInfoDTO.java index 79abe4dff..f82bb299d 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/amap/GetStationInfoDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/amap/GetStationInfoDTO.java @@ -2,6 +2,8 @@ package com.jsowell.pile.dto.amap; import lombok.Data; +import java.util.List; + /** * 高德地图查询充电站信息DTO * @@ -18,4 +20,9 @@ public class GetStationInfoDTO { // 每页记录数,最大20 private Integer pageSize; + + /** + * 站点id列表 + */ + private List idList; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java index 68ada5aab..6c92e1efa 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileStationInfoMapper.java @@ -3,6 +3,7 @@ package com.jsowell.pile.mapper; import com.jsowell.pile.domain.PileStationInfo; import com.jsowell.pile.dto.QueryStationDTO; import com.jsowell.pile.dto.QueryStationInfoDTO; +import com.jsowell.pile.dto.amap.GetStationInfoDTO; import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO; import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; import com.jsowell.pile.vo.ningxiajiaotou.NXJTStationInfoVO; @@ -83,7 +84,7 @@ public interface PileStationInfoMapper { List getStationInfoForLianLian(@Param("dto") QueryStationInfoDTO dto); - List getStationInfoForAmap(); + List getStationInfoForAmap(@Param("dto") GetStationInfoDTO dto); List queryByStationDeptIds(@Param("stationDeptIds") List stationDeptIds); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileStationInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileStationInfoService.java index a09c51b48..c30dca4f5 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileStationInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileStationInfoService.java @@ -5,6 +5,7 @@ import com.jsowell.pile.domain.PileStationInfo; import com.jsowell.pile.dto.FastCreateStationDTO; import com.jsowell.pile.dto.QueryStationDTO; import com.jsowell.pile.dto.QueryStationInfoDTO; +import com.jsowell.pile.dto.amap.GetStationInfoDTO; import com.jsowell.pile.dto.lutongyunting.BindParkingPlatformDTO; import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO; import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; @@ -110,7 +111,7 @@ public interface PileStationInfoService { List getStationInfosByThirdParty(QueryStationInfoDTO dto); - List getStationInfosByAmap(); + List getStationInfosByAmap(GetStationInfoDTO dto); List queryByStationDeptIds(List stationIds); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index 5685a66a4..ebd87b4cd 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -24,6 +24,7 @@ import com.jsowell.pile.domain.ThirdpartyParkingConfig; import com.jsowell.pile.dto.FastCreateStationDTO; import com.jsowell.pile.dto.QueryStationDTO; import com.jsowell.pile.dto.QueryStationInfoDTO; +import com.jsowell.pile.dto.amap.GetStationInfoDTO; import com.jsowell.pile.dto.lutongyunting.BindParkingPlatformDTO; import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO; import com.jsowell.pile.mapper.PileStationInfoMapper; @@ -235,8 +236,8 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { } @Override - public List getStationInfosByAmap() { - return pileStationInfoMapper.getStationInfoForAmap(); + public List getStationInfosByAmap(GetStationInfoDTO dto) { + return pileStationInfoMapper.getStationInfoForAmap(dto); } @Override diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml index 2bc6381ae..4296bf5a9 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileStationInfoMapper.xml @@ -560,9 +560,16 @@