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:
@@ -121,4 +121,18 @@ public interface LianLianService {
|
||||
* @return
|
||||
*/
|
||||
String pushChargeOrderInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送订单结算信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
String pushOrderSettlementInfo(PushOrderSettlementDTO dto);
|
||||
|
||||
/**
|
||||
* 查询订单结算信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String queryOrderSettlementInfo(String orderCode);
|
||||
}
|
||||
|
||||
@@ -910,6 +910,59 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送订单结算信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String pushOrderSettlementInfo(PushOrderSettlementDTO dto) {
|
||||
String orderCode = dto.getStartChargeSeq();
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("StartChargeSeq", orderCode);
|
||||
json.put("ConnectorID", dto.getConnectorID());
|
||||
int confirmResult = Constants.one;
|
||||
// 根据订单号查询订单信息
|
||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
if (orderInfo == null || orderDetail == null) {
|
||||
return null;
|
||||
}
|
||||
// 都不为空,根据传过来的数据进行修改数据库信息
|
||||
confirmResult = Constants.zero;
|
||||
orderDetail.setTotalUsedElectricity(dto.getTotalPower()); // 累计充电量
|
||||
orderDetail.setTotalOrderAmount(dto.getTotalMoney()); // 累计总金额
|
||||
|
||||
orderBasicInfoService.updateOrderDetail(orderDetail);
|
||||
|
||||
json.put("ConfirmResult", confirmResult);
|
||||
String jsonString = JSONObject.toJSONString(json);
|
||||
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单结算信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String queryOrderSettlementInfo(String orderCode) {
|
||||
String url = TEST_URL + "query_order_settlement_info";
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("StartChargeSeq", orderCode);
|
||||
String jsonString = JSONObject.toJSONString(json);
|
||||
// 获取令牌
|
||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
||||
if (StringUtils.isBlank(token)){
|
||||
return null;
|
||||
}
|
||||
// 发送请求
|
||||
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();
|
||||
//
|
||||
@@ -922,8 +975,6 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
// detail.setDetailSeviceMoney();
|
||||
// }
|
||||
|
||||
// TODO 推送充电订单信息 notification_charge_order_info
|
||||
|
||||
|
||||
// TODO 推送订单对账结果信息 check_charge_orders
|
||||
|
||||
@@ -934,13 +985,6 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// TODO 推送订单结算信息 notification_order_settlement_info
|
||||
|
||||
// TODO 查询订单结算信息 query_order_settlement_info
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取桩列表信息
|
||||
* @param pileStationInfo
|
||||
|
||||
Reference in New Issue
Block a user