dev-discount
袁野 3 years ago
parent eb1c32ef47
commit 1f74d6efbb
  1. 1
      hai-service/src/main/java/com/hai/common/utils/WxUtils.java
  2. 2
      hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java
  3. 12
      hai-service/src/main/java/com/hai/service/HighTestService.java
  4. 25
      hai-service/src/main/java/com/hai/service/impl/HighTestServiceImpl.java

@ -248,6 +248,7 @@ public class WxUtils {
}
}
public static String generateSignature(final Map<String, Object> data) throws Exception {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);

@ -132,7 +132,7 @@ public class HuiLianTongUnionCardConfig {
dataMap.put("appId", signCode);
// Md5加密
dataMap.put("sign", WxUtils.generateSignature(map, "chg;l;l23e2!~%^&22ovndfgf*@11212ouower=@=HSG!Business#Controller!" , WXPayConstants.SignType.MD5));
return requestMembership("tetcextra/TCheckEMsgUnionCardVipRights" , dataMap);
return requestMembership("etcextra/checkEMsgUnionCardVipRights" , dataMap);
} catch (Exception e) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_TIMED_OUT, "");

@ -1,5 +1,7 @@
package com.hai.service;
import com.alibaba.fastjson.JSONObject;
/**
* @serviceName HltMerchantService.java
* @author Sum1Dream
@ -30,4 +32,14 @@ public interface HighTestService {
*/
void getUserDiscount(Long id) throws Exception;
/**
* @Author Sum1Dream
* @name getMobile.java
* @Description // 请求话费
* @Date 5:02 下午 2022/1/17
* @Param [java.lang.String]
* @return com.alibaba.fastjson.JSONObject
*/
JSONObject getMobile(String phone) throws Exception;
}

@ -1,10 +1,15 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.WxUtils;
import com.hai.dao.HighUserEtcMapper;
import com.hai.entity.HighDiscountAgentCode;
import com.hai.entity.HighUser;
@ -133,4 +138,24 @@ public class HighTestServiceImpl implements HighTestService {
num++;
}
}
@Override
public JSONObject getMobile(String phone) throws Exception {
Map<String , Object> map = new HashMap<>();
map.put("mobile" , "18090580471");
map.put("amount" , "0.01");
map.put("out_order_id" , "CZ20220110895732352345");
map.put("app_key" , "kg5n9br7evt4q8lp");
map.put("timestamp" , DateUtil.date2String(new Date(),"yyyyMMddHHmmss"));
map.put("is_fast" , "1");
map.put("notify_url" , "https://hsgcs.dctpay.com/crest/czOrder/orderRefundNotify");
StringBuilder signStr = new StringBuilder(WxUtils.generateSignature(map));
map.put("sign" , WxUtils.MD5(String.valueOf(signStr.append("key=kg5n9br7evt4q8lp")),true));
JSONObject object = HttpsUtils.doPost("https://hfcs.dmjvip.com/index.php/third/mobile/createOrder" , map);
return object;
}
}

Loading…
Cancel
Save