From 21fc6020eea293e26f24f49b3090744f24d76b2f Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 2 Aug 2022 09:13:07 +0800 Subject: [PATCH] 1 --- .../java/com/hai/config/CommonSysConfig.java | 18 ++++++ .../com/hai/config/HuiLianTongConfig.java | 59 +++++++++++++++++++ .../config/HuiLianTongUnionCardConfig.java | 2 +- 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java index b7bb0d91..72fd33c4 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -47,6 +47,8 @@ public class CommonSysConfig { private String HuiLianTongUnionCardUrl; private String HuiLianTongUnionCardAccessCode; private String HuiLianTongUnionCardSignCode; + private String HuiliantongDistributorId; + private String HuiliantongSinopecUrl; private String HltMembershipLevelAccessCode; private String HltMembershipLevelSignCode; @@ -92,6 +94,22 @@ public class CommonSysConfig { private String unionSecret; private String unionRsaKey; + public String getHuiliantongDistributorId() { + return HuiliantongDistributorId; + } + + public void setHuiliantongDistributorId(String huiliantongDistributorId) { + HuiliantongDistributorId = huiliantongDistributorId; + } + + public String getHuiliantongSinopecUrl() { + return HuiliantongSinopecUrl; + } + + public void setHuiliantongSinopecUrl(String huiliantongSinopecUrl) { + HuiliantongSinopecUrl = huiliantongSinopecUrl; + } + public String getShellGroupPartnerId() { return shellGroupPartnerId; } diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java index b6f86d5d..8bd05846 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java @@ -45,6 +45,65 @@ public class HuiLianTongConfig { @Resource private HighGasOrderPushMapper highGasOrderPushMapper; + + /** + * 获取电子券类型列表 + * @return + * @throws Exception + */ + public static JSONObject getHltFuelCoupList() throws Exception { + Map map = new HashMap<>(); + map.put("serviceType", "01"); + map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongDistributorId()); + return HuiLianTongUnionCardConfig.request(CommonSysConst.getSysConfig().getHuiliantongSinopecUrl() + "/getHltFuelCoupList", map); + } + + /** + * 下单购买加油券 + * @param orderNo + * @param distCouCount + * @param couTypeCode + * @param phone + * @return + * @throws Exception + */ + public static JSONObject recharge(String orderNo, Integer distCouCount, String couTypeCode, String phone) throws Exception { + Map map = new HashMap<>(); + map.put("orderNo", orderNo); + map.put("distCouCount", distCouCount); + map.put("couTypeCode", couTypeCode); + map.put("phone", phone); + map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongDistributorId()); + return HuiLianTongUnionCardConfig.request(CommonSysConst.getSysConfig().getHuiliantongSinopecUrl()+"/recharge", map); + } + + /** + * 购买加油券充值订单 + * @param couNo 订单号 + * @return + * @throws Exception + */ + public static JSONObject getPayOrderByCouNo(String couNo) throws Exception { + Map map = new HashMap<>(); + map.put("couNo", couNo); + map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongDistributorId()); + return HuiLianTongUnionCardConfig.request(CommonSysConst.getSysConfig().getHuiliantongSinopecUrl()+"/getPayOrderByCouNo", map); + } + + /** + * 购买加油券充值订单 + * @param rechargeOrderId 订单号 + * @return + * @throws Exception + */ + public static JSONObject costRechargeOrder(String rechargeOrderId) throws Exception { + Map map = new HashMap<>(); + map.put("rechargeOrderId", rechargeOrderId); + map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongDistributorId()); + return HuiLianTongUnionCardConfig.request(CommonSysConst.getSysConfig().getHuiliantongSinopecUrl()+"/costRechargeOrder", map); + } + + /** * 获取token * @return diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java index b3832626..af033557 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java @@ -215,7 +215,7 @@ public class HuiLianTongUnionCardConfig { * @return * @throws Exception */ - private static JSONObject request(String method,Map param) throws Exception { + public static JSONObject request(String method,Map param) throws Exception { // 签名码 String signCode = CommonSysConst.getSysConfig().getHuiLianTongUnionCardSignCode();