'提交代码'

dev-discount
199901012 4 years ago
parent d699158700
commit 5a44632f8f
  1. 8
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  2. 1
      hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java

@ -89,12 +89,14 @@ public class OrderController {
} }
JSONObject jsonObject = JSONObject.parseObject(reqBodyStr); JSONObject jsonObject = JSONObject.parseObject(reqBodyStr);
Long orderId = jsonObject.getLong("orderId"); Long orderId = jsonObject.getLong("orderId");
String openId = jsonObject.getString("openId"); // openId String orderType = jsonObject.getString("orderScene"); // 订单类型
if ( orderId == null || StringUtils.isBlank(openId)) { String openId = jsonObject.getString("openId"); // openId
if ( orderId == null || StringUtils.isBlank(orderType) || StringUtils.isBlank(openId)) {
log.error("orderToPay error!", "参数错误"); log.error("orderToPay error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
HighOrder order = highOrderService.getOrderById(orderId); HighOrder order = highOrderService.getOrderById(orderId);
if(order == null) { if(order == null) {
log.error("OrderController --> orderToPay() ERROR", "未找到订单信息"); log.error("OrderController --> orderToPay() ERROR", "未找到订单信息");
@ -142,7 +144,7 @@ public class OrderController {
weChatPayReqInfo.setSpbill_create_ip("139.159.177.244"); //终端ip weChatPayReqInfo.setSpbill_create_ip("139.159.177.244"); //终端ip
weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getNotifyUrl()); //通知url weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getNotifyUrl()); //通知url
weChatPayReqInfo.setTrade_type("JSAPI"); //交易类型 weChatPayReqInfo.setTrade_type("JSAPI"); //交易类型
// weChatPayReqInfo.setAttach(map.get("orderScene").toString()); //附加数据,区分订单类型 weChatPayReqInfo.setAttach(map.get("orderScene").toString()); //附加数据,区分订单类型
Map<String,String> payMap = new HashMap<>(); Map<String,String> payMap = new HashMap<>();
payMap.put("app_id",SysConst.getSysConfig().getWxSubAppId()); payMap.put("app_id",SysConst.getSysConfig().getWxSubAppId());

@ -3,7 +3,6 @@ package com.hai.common.pay.entity;
public enum OrderType { public enum OrderType {
// 建议将支付频率高的模块放在前面 // 建议将支付频率高的模块放在前面
GOODS_ORDER("GOODS_ORDER", "goodsOrderService", "购买商品"), GOODS_ORDER("GOODS_ORDER", "goodsOrderService", "购买商品"),
GOLD("GOLD", "", "金币充值"),
TEST("TEST", "testPayService", "支付测试") TEST("TEST", "testPayService", "支付测试")
; ;

Loading…
Cancel
Save