mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
add 联联平台推送停止充电结果 接口
This commit is contained in:
@@ -107,4 +107,11 @@ public interface LianLianService {
|
||||
* @return
|
||||
*/
|
||||
String pushChargeStatus(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送停止充电结果(仅在 交易记录的帧类型中调用)
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushStopChargeResult(String orderCode);
|
||||
}
|
||||
|
||||
@@ -565,8 +565,6 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
vo.setStartChargeSeqStat(3); // 3-停止中
|
||||
}
|
||||
return vo;
|
||||
|
||||
// TODO 推送停止充电结果
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -832,6 +830,53 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送停止充电结果(仅在 交易记录的帧类型中调用)
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String pushStopChargeResult(String orderCode) {
|
||||
String url = TEST_URL + "notification_stop_charge_result";
|
||||
// 根据订单号查询订单信息
|
||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
if (orderInfo == null) {
|
||||
return null;
|
||||
}
|
||||
String orderStatus = orderInfo.getOrderStatus();
|
||||
String successFlag = "1";
|
||||
if (StringUtils.equals(orderStatus, OrderStatusEnum.IN_THE_CHARGING.getValue())) {
|
||||
// 充电中
|
||||
orderStatus = "2";
|
||||
}else if (StringUtils.equals(orderStatus, OrderStatusEnum.ORDER_COMPLETE.getValue())) {
|
||||
// 订单完成
|
||||
orderStatus = "4";
|
||||
successFlag = "0";
|
||||
}else {
|
||||
orderStatus = "5";
|
||||
}
|
||||
// 获取token
|
||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 拼装联联平台参数
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("StartChargeSeq", orderCode);
|
||||
json.put("StartChargeSeqStat", Integer.valueOf(orderStatus));
|
||||
json.put("ConnectorID", orderInfo.getPileConnectorCode());
|
||||
json.put("SuccStat", successFlag);
|
||||
json.put("FailReason", 0);
|
||||
|
||||
String jsonString = JSONObject.toJSONString(json);
|
||||
|
||||
// 发送请求
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// private ChargeDetail setChargeDetail(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) {
|
||||
// ChargeDetail detail = new ChargeDetail();
|
||||
//
|
||||
@@ -844,8 +889,6 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
// detail.setDetailSeviceMoney();
|
||||
// }
|
||||
|
||||
// TODO 推送停止充电结果 notification_stop_charge_result
|
||||
|
||||
// TODO 推送充电订单信息 notification_charge_order_info
|
||||
|
||||
// TODO 推送订单对账结果信息 check_charge_orders
|
||||
|
||||
Reference in New Issue
Block a user