This commit is contained in:
BOOL\25024
2024-06-27 14:10:34 +08:00
9 changed files with 85 additions and 8 deletions

View File

@@ -60,6 +60,35 @@ public class AMapController extends BaseController {
} }
/**
* 高德拉取商家静态详细信息
* @param requestMap
* @return
*/
@PostMapping("/getStationInfo")
public AMapCommonResult getStationInfo(@RequestParam Map<String, String> requestMap) {
AMapCommonResult result = new AMapCommonResult();
String paramString = JSON.toJSONString(requestMap);
logger.info("高德拉取商家静态详细信息 params:{}", paramString);
try {
// Map map = JSON.parseObject(paramString, Map.class);
// Map<String, String> paramMap = (Map<String, String>)JSON.parse(paramString);
if (AMapUtils.checkSign(requestMap)) {
// true 验签成功
String bizContent = requestMap.get("biz_content");
GetStationInfoDTO dto = JSON.parseObject(bizContent, GetStationInfoDTO.class);
List<AMapStationInfo> stationInfos = aMapService.getStationInfosV2(dto);
result = result.successResponse(stationInfos);
logger.info("高德拉取商家静态详细信息 success result:{}", JSON.toJSONString(result));
return result;
}
} catch (Exception e) {
}
return null;
}
@PostMapping("/pushStationStatus") @PostMapping("/pushStationStatus")
public AMapCommonResult pushStationStatus(@RequestBody QueryPileDTO dto) { public AMapCommonResult pushStationStatus(@RequestBody QueryPileDTO dto) {
AMapCommonResult result = new AMapCommonResult(); AMapCommonResult result = new AMapCommonResult();

View File

@@ -2587,7 +2587,7 @@ public class SpringBootTestController {
// String s = aMapService.pushChargingDeviceDynamics(pileConnectorCode); // String s = aMapService.pushChargingDeviceDynamics(pileConnectorCode);
GetStationInfoDTO dto = new GetStationInfoDTO(); GetStationInfoDTO dto = new GetStationInfoDTO();
dto.setType("page"); dto.setType("page");
aMapService.getStationInfos(dto); // aMapService.getStationInfos(dto);
} }
@Test @Test

View File

@@ -2,6 +2,8 @@ package com.jsowell.pile.dto.amap;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* 高德地图查询充电站信息DTO * 高德地图查询充电站信息DTO
* *
@@ -18,4 +20,9 @@ public class GetStationInfoDTO {
// 每页记录数最大20 // 每页记录数最大20
private Integer pageSize; private Integer pageSize;
/**
* 站点id列表
*/
private List<String> idList;
} }

View File

@@ -3,6 +3,7 @@ package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.PileStationInfo; import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.dto.QueryStationDTO; import com.jsowell.pile.dto.QueryStationDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO; import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.dto.amap.GetStationInfoDTO;
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO; import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO;
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
import com.jsowell.pile.vo.ningxiajiaotou.NXJTStationInfoVO; import com.jsowell.pile.vo.ningxiajiaotou.NXJTStationInfoVO;
@@ -83,7 +84,7 @@ public interface PileStationInfoMapper {
List<ThirdPartyStationInfoVO> getStationInfoForLianLian(@Param("dto") QueryStationInfoDTO dto); List<ThirdPartyStationInfoVO> getStationInfoForLianLian(@Param("dto") QueryStationInfoDTO dto);
List<PileStationInfo> getStationInfoForAmap(); List<PileStationInfo> getStationInfoForAmap(@Param("dto") GetStationInfoDTO dto);
List<String> queryByStationDeptIds(@Param("stationDeptIds") List<String> stationDeptIds); List<String> queryByStationDeptIds(@Param("stationDeptIds") List<String> stationDeptIds);

View File

@@ -5,6 +5,7 @@ import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.dto.FastCreateStationDTO; import com.jsowell.pile.dto.FastCreateStationDTO;
import com.jsowell.pile.dto.QueryStationDTO; import com.jsowell.pile.dto.QueryStationDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO; 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.lutongyunting.BindParkingPlatformDTO;
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO; import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO;
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
@@ -110,7 +111,7 @@ public interface PileStationInfoService {
List<ThirdPartyStationInfoVO> getStationInfosByThirdParty(QueryStationInfoDTO dto); List<ThirdPartyStationInfoVO> getStationInfosByThirdParty(QueryStationInfoDTO dto);
List<PileStationInfo> getStationInfosByAmap(); List<PileStationInfo> getStationInfosByAmap(GetStationInfoDTO dto);
List<String> queryByStationDeptIds(List<String> stationIds); List<String> queryByStationDeptIds(List<String> stationIds);

View File

@@ -24,6 +24,7 @@ import com.jsowell.pile.domain.ThirdpartyParkingConfig;
import com.jsowell.pile.dto.FastCreateStationDTO; import com.jsowell.pile.dto.FastCreateStationDTO;
import com.jsowell.pile.dto.QueryStationDTO; import com.jsowell.pile.dto.QueryStationDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO; 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.lutongyunting.BindParkingPlatformDTO;
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO; import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO;
import com.jsowell.pile.mapper.PileStationInfoMapper; import com.jsowell.pile.mapper.PileStationInfoMapper;
@@ -235,8 +236,8 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
} }
@Override @Override
public List<PileStationInfo> getStationInfosByAmap() { public List<PileStationInfo> getStationInfosByAmap(GetStationInfoDTO dto) {
return pileStationInfoMapper.getStationInfoForAmap(); return pileStationInfoMapper.getStationInfoForAmap(dto);
} }
@Override @Override

View File

@@ -560,9 +560,16 @@
<select id="getStationInfoForAmap" resultMap="PileStationInfoResult"> <select id="getStationInfoForAmap" resultMap="PileStationInfoResult">
<include refid="selectPileStationInfoVo"/> <include refid="selectPileStationInfoVo"/>
where del_flag = '0' where
del_flag = '0'
and public_flag = '1' and public_flag = '1'
and amap_flag = '1' and amap_flag = '1'
<if test="dto.idList != null and dto.idList.size() != 0">
and id in
<foreach collection="dto.idList" item="id" open="(" separator="," close=")">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select> </select>
<select id="NXJTQueryStationsInfo" resultType="com.jsowell.pile.vo.ningxiajiaotou.NXJTStationInfoVO"> <select id="NXJTQueryStationsInfo" resultType="com.jsowell.pile.vo.ningxiajiaotou.NXJTStationInfoVO">

View File

@@ -40,5 +40,14 @@ public interface AMapService {
List<AMapStationInfo> getStationInfosV2(GetStationInfoDTO dto); List<AMapStationInfo> getStationInfosV2(GetStationInfoDTO dto);
/**
* 推送站点信息
* 站点状态如有变化,(上线、下线)调用此接口
* @param stationIds 站点idList
* @param status 更改站点状态1上线0下线
* @return
*/
String pushStationInfo(List<String> stationIds, String status) throws Exception;
Map<String, List<AMapEquipmentInfo>> getPileListByStationIdList(List<String> stationIdList); Map<String, List<AMapEquipmentInfo>> getPileListByStationIdList(List<String> stationIdList);
} }

View File

@@ -85,7 +85,7 @@ public class AMapServiceImpl implements AMapService {
PageUtils.startPage(pageNo, pageSize); PageUtils.startPage(pageNo, pageSize);
// 查询站点信息 // 查询站点信息
sw.start("查询站点信息"); sw.start("查询站点信息");
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap(); List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap(dto);
PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos); PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos);
sw.stop(); sw.stop();
@@ -123,7 +123,7 @@ public class AMapServiceImpl implements AMapService {
PageUtils.startPage(pageNo, pageSize); PageUtils.startPage(pageNo, pageSize);
// 第一次查询,得到站点 // 第一次查询,得到站点
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap(); List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap(dto);
PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos); PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos);
List<PileStationInfo> stationList = pageInfo.getList(); List<PileStationInfo> stationList = pageInfo.getList();
if (CollectionUtils.isEmpty(stationList)) { if (CollectionUtils.isEmpty(stationList)) {
@@ -252,6 +252,28 @@ public class AMapServiceImpl implements AMapService {
return resultList; return resultList;
} }
/**
* 推送站点信息
* 站点状态如有变化,(上线、下线)调用此接口
* @param stationIds 站点idList
* @param status 更改站点状态1上线0下线
* @return
*/
@Override
public String pushStationInfo(List<String> stationIds, String status) throws Exception {
// 拼装业务参数
JSONObject jsonObject = new JSONObject();
jsonObject.put("status", status);
jsonObject.put("idList", stationIds);
String SPI = "amap.charging.pushStationInfo";
Map<String, String> map = AMapUtils.generateParamMap(jsonObject, SPI);
// 调用高德接口
return AMapUtils.sendPost(map);
}
/** /**
* 拼装高德需要的格式数据 * 拼装高德需要的格式数据
* @param stationInfo 站点信息 * @param stationInfo 站点信息