From c2040cab215cc375b0f2d1da90989377cba7f0f3 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Mon, 27 May 2024 15:22:54 +0800 Subject: [PATCH] Changes --- .../service/coupon/channel/PetroConfig.java | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/service/src/main/java/com/hfkj/service/coupon/channel/PetroConfig.java b/service/src/main/java/com/hfkj/service/coupon/channel/PetroConfig.java index 9d0755a..0c75e21 100644 --- a/service/src/main/java/com/hfkj/service/coupon/channel/PetroConfig.java +++ b/service/src/main/java/com/hfkj/service/coupon/channel/PetroConfig.java @@ -22,28 +22,15 @@ import java.util.UUID; **/ public class PetroConfig { - private static String reqUrl; - private static String petroAppKey; - private static String petroAppid; - private static String petroAesKey; + private static String reqUrl = CommonSysConst.getSysConfig().getGzPetroUrl(); + private static String petroAppKey= CommonSysConst.getSysConfig().getGzPetroAppKey(); + private static String petroAppid= CommonSysConst.getSysConfig().getGzPetroAppid(); + private static String petroAesKey= CommonSysConst.getSysConfig().getGzPetroAesKey(); private static Logger log = LoggerFactory.getLogger(PetroConfig.class); - public static void init(Integer type) { - if (type == 1) { - reqUrl = CommonSysConst.getSysConfig().getScPetroUrl(); - petroAppKey = CommonSysConst.getSysConfig().getScPetroAppKey(); - petroAppid = CommonSysConst.getSysConfig().getScPetroAppid(); - petroAesKey = CommonSysConst.getSysConfig().getScPetroAesKey(); - } else { - reqUrl = CommonSysConst.getSysConfig().getGzPetroUrl(); - petroAppKey = CommonSysConst.getSysConfig().getGzPetroAppKey(); - petroAppid = CommonSysConst.getSysConfig().getGzPetroAppid(); - petroAesKey = CommonSysConst.getSysConfig().getGzPetroAesKey(); - } - } /** * @Author Sum1Dream @@ -113,15 +100,13 @@ public class PetroConfig { req.put("jsonData", bizContent); //生成签名 String sign = PetroEncryptUtil.generateSign(req); - - + log.info("获取电子券-请求参数: " + JSON.toJSONString(req)); Map postData = new HashMap<>(); postData.put("sign" , sign); postData.put("timestamp" , req.get("timestamp")); postData.put("jsonData" , bizContent); postData.put("nonce" , req.get("nonce")); postData.put("appId", petroAppid); - log.info("获取电子券-请求参数: " + JSON.toJSONString(req)); JSONObject object = HttpsUtils.doPost(reqUrl + "/outapi/getCouponYt", postData); log.info("获取电子券-回调参数: " + JSON.toJSONString(object)); log.info("========================请求任务End=========================");