mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-15 07:18:31 +08:00
111
This commit is contained in:
@@ -25,7 +25,7 @@ import java.util.Objects;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电结束Handler
|
* 充电结束Handler
|
||||||
*
|
* 0x19
|
||||||
* GBT-27930 充电桩与 BMS 充电结束阶段报文
|
* GBT-27930 充电桩与 BMS 充电结束阶段报文
|
||||||
* @author JS-ZZA
|
* @author JS-ZZA
|
||||||
* @date 2022/9/19 13:27
|
* @date 2022/9/19 13:27
|
||||||
|
|||||||
@@ -155,8 +155,15 @@ public class AMapServiceImpl implements AMapService {
|
|||||||
List<AMapPictures> picturesList;
|
List<AMapPictures> picturesList;
|
||||||
AMapStationInfo aMapInfo;
|
AMapStationInfo aMapInfo;
|
||||||
for (PileStationInfo stationInfo : stationList) {
|
for (PileStationInfo stationInfo : stationList) {
|
||||||
aMapInfo = new AMapStationInfo();
|
|
||||||
String stationId = String.valueOf(stationInfo.getId());
|
String stationId = String.valueOf(stationInfo.getId());
|
||||||
|
// 判断当前站点计费模板是否为空
|
||||||
|
List<AMapPriceChargingInfo> aMapPriceChargingInfos = priceInfoMap.get(stationId);
|
||||||
|
if (CollectionUtils.isEmpty(aMapPriceChargingInfos)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
aMapInfo = new AMapStationInfo();
|
||||||
|
|
||||||
aMapInfo.setStationID(stationId);
|
aMapInfo.setStationID(stationId);
|
||||||
aMapInfo.setOperatorID(Constants.OPERATORID_LIANLIAN);
|
aMapInfo.setOperatorID(Constants.OPERATORID_LIANLIAN);
|
||||||
aMapInfo.setEquipmentOwnerID(Constants.OPERATORID_LIANLIAN);
|
aMapInfo.setEquipmentOwnerID(Constants.OPERATORID_LIANLIAN);
|
||||||
@@ -182,7 +189,6 @@ public class AMapServiceImpl implements AMapService {
|
|||||||
aMapInfo.setBusineHours(stationInfo.getBusinessHours());
|
aMapInfo.setBusineHours(stationInfo.getBusinessHours());
|
||||||
|
|
||||||
// 计费模板
|
// 计费模板
|
||||||
List<AMapPriceChargingInfo> aMapPriceChargingInfos = priceInfoMap.get(stationId);
|
|
||||||
aMapInfo.setPriceChargingInfo(aMapPriceChargingInfos);
|
aMapInfo.setPriceChargingInfo(aMapPriceChargingInfos);
|
||||||
// 站点设备信息
|
// 站点设备信息
|
||||||
List<AMapEquipmentInfo> equipmentInfos = equipmentInfoMap.get(stationId);
|
List<AMapEquipmentInfo> equipmentInfos = equipmentInfoMap.get(stationId);
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.jsowell.thirdparty.amap.util;
|
package com.jsowell.thirdparty.amap.util;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.jsowell.common.util.id.SnUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
@@ -29,6 +32,8 @@ public class AMapUtils {
|
|||||||
// private static String PRD_URL;
|
// private static String PRD_URL;
|
||||||
private static String API_URL;
|
private static String API_URL;
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(AMapUtils.class);
|
||||||
|
|
||||||
@Value("${aMap.merchantPrivateKey}")
|
@Value("${aMap.merchantPrivateKey}")
|
||||||
public void setMerchantPrivateKey(String merchantPrivateKey) {
|
public void setMerchantPrivateKey(String merchantPrivateKey) {
|
||||||
AMapUtils.MERCHANT_PRIVATE_KEY = merchantPrivateKey;
|
AMapUtils.MERCHANT_PRIVATE_KEY = merchantPrivateKey;
|
||||||
@@ -114,7 +119,8 @@ public class AMapUtils {
|
|||||||
ResponseEntity<String> resp = restTemplate.postForEntity(API_URL, entity, String.class);
|
ResponseEntity<String> resp = restTemplate.postForEntity(API_URL, entity, String.class);
|
||||||
if (resp.getBody() != null && !"".equals(resp.getBody())) {
|
if (resp.getBody() != null && !"".equals(resp.getBody())) {
|
||||||
JSONObject respObj = JSONObject.parseObject(resp.getBody());
|
JSONObject respObj = JSONObject.parseObject(resp.getBody());
|
||||||
System.out.println("高德返回结果:" + respObj);
|
logger.info("高德返回结果:{}", respObj);
|
||||||
|
// System.out.println("高德返回结果:" + respObj);
|
||||||
return JSONObject.toJSONString(respObj);
|
return JSONObject.toJSONString(respObj);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user