'提交代码'

dev-discount
= 3 years ago
parent 60294b413e
commit c038c77784
  1. 13
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  2. 2
      hai-cweb/src/main/java/com/cweb/controller/tPigController.java
  3. 21
      hai-service/src/main/java/com/hai/config/QianZhuConfig.java

@ -166,7 +166,18 @@ public class HighTestController {
@ApiOperation(value = "测试") @ApiOperation(value = "测试")
public ResponseData test1() { public ResponseData test1() {
try { try {
return ResponseMsgUtil.success(QianZhuConfig.getToken("user"+new Date().getTime(), "user"+new Date().getTime(), "17726395120")); return ResponseMsgUtil.success(QianZhuConfig.payKfcOrder("20210708222409597071866"));
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/test2", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "测试")
public ResponseData test2() {
try {
return ResponseMsgUtil.success(QianZhuConfig.getByOrderNo("20210711203753363044210"));
} catch (Exception e) { } catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e); log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);

@ -47,7 +47,7 @@ public class tPigController {
String url = ""; String url = "";
if (token.getBoolean("success")) { if (token.getBoolean("success")) {
JSONObject data = token.getJSONObject("data"); JSONObject data = token.getJSONObject("data");
url = "https://m.qianzhu8.com/kfc/?platformId=" + CommonSysConst.getSysConfig().getQinzhuPlatformId() + "&token=" + data.getString("accessToken"); url = "https://m-test.qianzhu8.com/kfc/?platformId=" + CommonSysConst.getSysConfig().getQinzhuPlatformId() + "&token=" + data.getString("accessToken");
} }
return ResponseMsgUtil.success(url); return ResponseMsgUtil.success(url);

@ -41,6 +41,27 @@ public class QianZhuConfig {
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getQinzhuUrl()+"/api/v2/platform/getToken", map); return HttpsUtils.doGet(CommonSysConst.getSysConfig().getQinzhuUrl()+"/api/v2/platform/getToken", map);
} }
public static JSONObject getByOrderNo(String orderNo) throws Exception {
Map<String,Object> map = new HashMap<>();
map.put("platformId", CommonSysConst.getSysConfig().getQinzhuPlatformId());
map.put("timestamp", new Date().getTime());
map.put("orderNo", orderNo);
map.put("sign", MD5Util.encode(generateSignature(map,CommonSysConst.getSysConfig().getQinzhuSecret()).getBytes()).toLowerCase());
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getQinzhuUrl()+"/openApi/v1/kfcOrders/getByOrderNo", JSONObject.toJSONString(map));
}
public static JSONObject payKfcOrder(String orderNo) throws Exception {
Map<String,Object> map = new HashMap<>();
map.put("platformId", CommonSysConst.getSysConfig().getQinzhuPlatformId());
map.put("timestamp", new Date().getTime());
map.put("notifyUrl", "");
map.put("orderNo", orderNo);
map.put("sign", MD5Util.encode(generateSignature(map,CommonSysConst.getSysConfig().getQinzhuSecret()).getBytes()).toLowerCase());
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getQinzhuUrl()+"/openApi/v1/orders/payKfcOrder", JSONObject.toJSONString(map));
}
/** /**
* 生成签名 * 生成签名
* @param data 数据 * @param data 数据

Loading…
Cancel
Save