dev
袁野 5 months ago
parent bc3420a59f
commit c2040cab21
  1. 25
      service/src/main/java/com/hfkj/service/coupon/channel/PetroConfig.java

@ -22,28 +22,15 @@ import java.util.UUID;
**/ **/
public class PetroConfig { public class PetroConfig {
private static String reqUrl; private static String reqUrl = CommonSysConst.getSysConfig().getGzPetroUrl();
private static String petroAppKey; private static String petroAppKey= CommonSysConst.getSysConfig().getGzPetroAppKey();
private static String petroAppid; private static String petroAppid= CommonSysConst.getSysConfig().getGzPetroAppid();
private static String petroAesKey; private static String petroAesKey= CommonSysConst.getSysConfig().getGzPetroAesKey();
private static Logger log = LoggerFactory.getLogger(PetroConfig.class); 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 * @Author Sum1Dream
@ -113,15 +100,13 @@ public class PetroConfig {
req.put("jsonData", bizContent); req.put("jsonData", bizContent);
//生成签名 //生成签名
String sign = PetroEncryptUtil.generateSign(req); String sign = PetroEncryptUtil.generateSign(req);
log.info("获取电子券-请求参数: " + JSON.toJSONString(req));
Map<String , Object> postData = new HashMap<>(); Map<String , Object> postData = new HashMap<>();
postData.put("sign" , sign); postData.put("sign" , sign);
postData.put("timestamp" , req.get("timestamp")); postData.put("timestamp" , req.get("timestamp"));
postData.put("jsonData" , bizContent); postData.put("jsonData" , bizContent);
postData.put("nonce" , req.get("nonce")); postData.put("nonce" , req.get("nonce"));
postData.put("appId", petroAppid); postData.put("appId", petroAppid);
log.info("获取电子券-请求参数: " + JSON.toJSONString(req));
JSONObject object = HttpsUtils.doPost(reqUrl + "/outapi/getCouponYt", postData); JSONObject object = HttpsUtils.doPost(reqUrl + "/outapi/getCouponYt", postData);
log.info("获取电子券-回调参数: " + JSON.toJSONString(object)); log.info("获取电子券-回调参数: " + JSON.toJSONString(object));
log.info("========================请求任务End========================="); log.info("========================请求任务End=========================");

Loading…
Cancel
Save