|
|
|
@@ -148,26 +148,33 @@ public class HaiKangWeiShiUtil { |
|
|
|
|
|
|
|
/** |
|
|
|
* 消息订阅 3.1.8 |
|
|
|
* * 这个接口需要你们实现的时候规定下: |
|
|
|
1、POST格式, |
|
|
|
2、接口返回参数JSON格式:{errcode:0, errmsg: "success",data:null} |
|
|
|
3、接口建议接收到过车事件,立即返回接收成功 |
|
|
|
|
|
|
|
我这边根据这个 0 状态来判断你们是否接收成功,如果没成功,我这边会重发3次的 |
|
|
|
* |
|
|
|
* @param clientId |
|
|
|
* @param clientSecret |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public JSONObject subscription(WxPark wxPark,String couponNo,String carNumber,String orderNo,String token){ |
|
|
|
public JSONObject subscription(WxPark wxPark,String token){ |
|
|
|
String vendroParams = wxPark.getVendorParams(); |
|
|
|
JSONObject vp = JSON.parseObject(vendroParams); |
|
|
|
ArrayList<NameValuePair> list = new ArrayList<NameValuePair>(); |
|
|
|
list.add(new BasicNameValuePair("partnerAppKey", vp.getString("AppKey")));//商户编号 |
|
|
|
list.add(new BasicNameValuePair("projectId", vp.getString("projectId"))); |
|
|
|
list.add(new BasicNameValuePair("eventTypes", carNumber)); |
|
|
|
list.add(new BasicNameValuePair("eventTypes", "[\"771760131\",\"771760134\"]")); |
|
|
|
list.add(new BasicNameValuePair("subUrl", vp.getString("subUrl"))); |
|
|
|
String retCode = ProcBussiness(SUBSCRIPTION, list,token); |
|
|
|
if (StringUtils.isBlank(retCode)) { |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikang useCoupon error. has no result"); |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "haikang subscription error. has no result"); |
|
|
|
} |
|
|
|
JSONObject result = JSON.parseObject(retCode); |
|
|
|
if (result.getInteger("code") != 0 ) { |
|
|
|
String message = result.getString("msg"); |
|
|
|
throw new MallinkException(result.getInteger("code"), "haikang useCoupon error."+message); |
|
|
|
throw new MallinkException(result.getInteger("code"), "haikang subscription error."+message); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|