mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
新增 浙江省平台推送历史充电订单接口
This commit is contained in:
@@ -657,8 +657,54 @@ public class ZheJiangPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
return null;
|
||||
}
|
||||
// 调用联联平台接口
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("ChargeOrderInfo", orderInfo);
|
||||
String jsonString = JSON.toJSONString(orderInfo);
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送历史充电订单信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String notificationChargeOrderInfoHistory(String orderCode) {
|
||||
// 根据订单号查询出信息
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
|
||||
ThirdPartySecretInfoVO zheJiangPlatformSecretInfo = getZheJiangPlatformSecretInfo();
|
||||
|
||||
String operatorId = zheJiangPlatformSecretInfo.getOurOperatorId();
|
||||
String operatorSecret = zheJiangPlatformSecretInfo.getTheirOperatorSecret();
|
||||
String signSecret = zheJiangPlatformSecretInfo.getTheirSigSecret();
|
||||
String dataSecret = zheJiangPlatformSecretInfo.getTheirDataSecret();
|
||||
String dataSecretIv = zheJiangPlatformSecretInfo.getTheirDataSecretIv();
|
||||
String urlAddress = zheJiangPlatformSecretInfo.getTheirUrlPrefix();
|
||||
|
||||
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
String url = urlAddress + "supervise_notification_charge_order_info_history";
|
||||
|
||||
// 拼装成平台所需格式对象
|
||||
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
|
||||
orderInfo.setOperatorID(operatorId);
|
||||
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(orderInfo.getStationID());
|
||||
String equipmentOwnerID = ThirdPartyPlatformUtils.extractEquipmentOwnerID(pileMerchantInfoVO.getOrganizationCode());
|
||||
orderInfo.setEquipmentOwnerID(equipmentOwnerID);
|
||||
|
||||
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
|
||||
// 先将list按照 尖、峰、平、谷 时段排序
|
||||
// List<BillingPriceVO> collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList());
|
||||
// 再循环该list,拼装对应的充电价格、费率
|
||||
List<SupChargeDetails> chargeDetails = transformSupChargeDetails(orderDetail, billingList);
|
||||
orderInfo.setChargeDetails(chargeDetails);
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
return null;
|
||||
}
|
||||
// 调用联联平台接口
|
||||
String jsonString = JSON.toJSONString(orderInfo);
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user