|
|
|
@ -5,9 +5,13 @@ 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.IDGenerator; |
|
|
|
|
import com.hai.common.utils.WxUtils; |
|
|
|
|
import com.hai.config.CommonSysConfig; |
|
|
|
|
import com.hai.config.CommonSysConst; |
|
|
|
|
import com.hai.config.HuiLianTongUnionCardConfig; |
|
|
|
|
import com.hai.dao.HighGasOrderPushMapper; |
|
|
|
|
import com.hai.dao.OutRechargeOrderMapper; |
|
|
|
@ -52,6 +56,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { |
|
|
|
|
@Resource |
|
|
|
|
private HighUserService highUserService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private OutRechargeOrderService outRechargeOrderService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<OutRechargeOrder> getListRechargeOrder(Map<String, String> map) { |
|
|
|
|
OutRechargeOrderExample example = new OutRechargeOrderExample(); |
|
|
|
@ -314,6 +321,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { |
|
|
|
|
} |
|
|
|
|
order.setPaySerialNo(consumptionResult.getString("orderId")); // 支付流水号
|
|
|
|
|
order.setPayRealPrice(order.getPayPrice()); // 实付金额
|
|
|
|
|
if (order.getRechargeType() == 1) { |
|
|
|
|
outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue()); |
|
|
|
|
} |
|
|
|
|
order.setStatus(2); |
|
|
|
|
order.setPayType(2); |
|
|
|
|
order.setPayTime(new Date()); // 支付时间
|
|
|
|
@ -351,22 +361,23 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public JSONObject getMobile(String phone) throws Exception { |
|
|
|
|
public JSONObject getMobile(String phone , Integer amount) throws Exception { |
|
|
|
|
|
|
|
|
|
String timestamp = String.valueOf(System.currentTimeMillis()); |
|
|
|
|
|
|
|
|
|
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("mobile" , phone); |
|
|
|
|
map.put("amount" , amount); |
|
|
|
|
map.put("out_order_id" , "CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5)); |
|
|
|
|
map.put("app_key" , CommonSysConst.getSysConfig().getCzAppKey()); |
|
|
|
|
map.put("timestamp" , timestamp.substring(0,timestamp.length()-3)); |
|
|
|
|
map.put("is_fast" , "1"); |
|
|
|
|
map.put("notify_url" , "https://hsgcs.dctpay.com/crest/czOrder/orderRefundNotify"); |
|
|
|
|
map.put("notify_url" , CommonSysConst.getSysConfig().getCzNotifyUrl()); |
|
|
|
|
|
|
|
|
|
StringBuilder signStr = new StringBuilder(WxUtils.generateSignature(map)); |
|
|
|
|
String signStr = WxUtils.generateSignatureAppSecret(map, CommonSysConst.getSysConfig().getTelApiSecret() , WXPayConstants.SignType.MD5); |
|
|
|
|
|
|
|
|
|
map.put("sign" , WxUtils.MD5(String.valueOf(signStr.append("key=kg5n9br7evt4q8lp")),true)); |
|
|
|
|
map.put("sign" , signStr); |
|
|
|
|
|
|
|
|
|
JSONObject object = HttpsUtils.doPost("https://hfcs.dmjvip.com/index.php/third/mobile/createOrder" , map); |
|
|
|
|
return object; |
|
|
|
|
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getCzUrl() , map); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|