From 5a44632f8ffda577dccec6700cb6dcf666d09159 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Sun, 28 Mar 2021 19:44:04 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cweb/controller/pay/OrderController.java | 8 +++++--- .../main/java/com/hai/common/pay/entity/OrderType.java | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index 1991772e..94f1950b 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -89,12 +89,14 @@ public class OrderController { } JSONObject jsonObject = JSONObject.parseObject(reqBodyStr); Long orderId = jsonObject.getLong("orderId"); - String openId = jsonObject.getString("openId"); // openId - if ( orderId == null || StringUtils.isBlank(openId)) { + String orderType = jsonObject.getString("orderScene"); // 订单类型 + String openId = jsonObject.getString("openId"); // openId + if ( orderId == null || StringUtils.isBlank(orderType) || StringUtils.isBlank(openId)) { log.error("orderToPay error!", "参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } + HighOrder order = highOrderService.getOrderById(orderId); if(order == null) { log.error("OrderController --> orderToPay() ERROR", "未找到订单信息"); @@ -142,7 +144,7 @@ public class OrderController { weChatPayReqInfo.setSpbill_create_ip("139.159.177.244"); //终端ip weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getNotifyUrl()); //通知url weChatPayReqInfo.setTrade_type("JSAPI"); //交易类型 - // weChatPayReqInfo.setAttach(map.get("orderScene").toString()); //附加数据,区分订单类型 + weChatPayReqInfo.setAttach(map.get("orderScene").toString()); //附加数据,区分订单类型 Map payMap = new HashMap<>(); payMap.put("app_id",SysConst.getSysConfig().getWxSubAppId()); diff --git a/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java b/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java index b1a6dd6f..11eea92d 100644 --- a/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java +++ b/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java @@ -3,7 +3,6 @@ package com.hai.common.pay.entity; public enum OrderType { // 建议将支付频率高的模块放在前面 GOODS_ORDER("GOODS_ORDER", "goodsOrderService", "购买商品"), - GOLD("GOLD", "", "金币充值"), TEST("TEST", "testPayService", "支付测试") ;