|
|
|
@ -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<String , Object> 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========================="); |
|
|
|
|