mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
新增 高德商家推送静态信息状态、高德拉取商家静态详细信息接口
This commit is contained in:
@@ -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")
|
||||
public AMapCommonResult pushStationStatus(@RequestBody QueryPileDTO dto) {
|
||||
AMapCommonResult result = new AMapCommonResult();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<String> idList;
|
||||
}
|
||||
|
||||
@@ -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<ThirdPartyStationInfoVO> getStationInfoForLianLian(@Param("dto") QueryStationInfoDTO dto);
|
||||
|
||||
|
||||
List<PileStationInfo> getStationInfoForAmap();
|
||||
List<PileStationInfo> getStationInfoForAmap(@Param("dto") GetStationInfoDTO dto);
|
||||
|
||||
List<String> queryByStationDeptIds(@Param("stationDeptIds") List<String> stationDeptIds);
|
||||
|
||||
|
||||
@@ -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<ThirdPartyStationInfoVO> getStationInfosByThirdParty(QueryStationInfoDTO dto);
|
||||
|
||||
List<PileStationInfo> getStationInfosByAmap();
|
||||
List<PileStationInfo> getStationInfosByAmap(GetStationInfoDTO dto);
|
||||
|
||||
List<String> queryByStationDeptIds(List<String> stationIds);
|
||||
|
||||
|
||||
@@ -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<PileStationInfo> getStationInfosByAmap() {
|
||||
return pileStationInfoMapper.getStationInfoForAmap();
|
||||
public List<PileStationInfo> getStationInfosByAmap(GetStationInfoDTO dto) {
|
||||
return pileStationInfoMapper.getStationInfoForAmap(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -560,9 +560,16 @@
|
||||
|
||||
<select id="getStationInfoForAmap" resultMap="PileStationInfoResult">
|
||||
<include refid="selectPileStationInfoVo"/>
|
||||
where del_flag = '0'
|
||||
where
|
||||
del_flag = '0'
|
||||
and public_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 id="NXJTQueryStationsInfo" resultType="com.jsowell.pile.vo.ningxiajiaotou.NXJTStationInfoVO">
|
||||
|
||||
@@ -40,5 +40,14 @@ public interface AMapService {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class AMapServiceImpl implements AMapService {
|
||||
PageUtils.startPage(pageNo, pageSize);
|
||||
// 查询站点信息
|
||||
sw.start("查询站点信息");
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap();
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap(dto);
|
||||
|
||||
PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos);
|
||||
sw.stop();
|
||||
@@ -123,7 +123,7 @@ public class AMapServiceImpl implements AMapService {
|
||||
PageUtils.startPage(pageNo, pageSize);
|
||||
|
||||
// 第一次查询,得到站点
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap();
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByAmap(dto);
|
||||
PageInfo<PileStationInfo> pageInfo = new PageInfo<>(stationInfos);
|
||||
List<PileStationInfo> stationList = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(stationList)) {
|
||||
@@ -252,6 +252,28 @@ public class AMapServiceImpl implements AMapService {
|
||||
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 站点信息
|
||||
|
||||
Reference in New Issue
Block a user