From f0ae3f78275d9756a40cd992c40b1a28a4071908 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Sun, 28 Mar 2021 23:28:28 +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/WechatPayController.java | 7 ++++++- .../java/com/hai/service/impl/HighUserServiceImpl.java | 1 + .../java/com/hai/service/pay/impl/NotifyServiceImpl.java | 4 +--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java index 9192519b..7908936e 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java @@ -45,7 +45,12 @@ public class WechatPayController { String notifyXml = null; // 微信支付系统发送的数据(格式) notifyXml = IOUtil.inputStreamToString(request.getInputStream(), "UTF-8"); - /*if (SignatureUtil.reCheckIsSignValidFromWeiXin(notifyXml, SysConst.getSysConfig().getWxApiKey(), "UTF-8")) { + log.info("微信支付系统发送的数据:" + notifyXml); + SortedMap map = XmlUtil.parseXmlToTreeMap(notifyXml, "UTF-8"); + + resXml = notifyService.wechatNotify(map); + +/* if (SignatureUtil.reCheckIsSignValidFromWeiXin(notifyXml, SysConst.getSysConfig().getWxApiKey(), "UTF-8")) { log.info("微信支付系统发送的数据:" + notifyXml); SortedMap map = XmlUtil.parseXmlToTreeMap(notifyXml, "UTF-8"); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java index fd8f8a3c..7c3a531a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java @@ -116,6 +116,7 @@ public class HighUserServiceImpl implements HighUserService { } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户金币处理异常"); } + highUserMapper.updateByPrimaryKey(user); HighGoldRec highGoldRec = new HighGoldRec(); highGoldRec.setUserId(user.getId()); diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/NotifyServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/NotifyServiceImpl.java index c81c165c..d8cd592b 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/NotifyServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/NotifyServiceImpl.java @@ -75,10 +75,8 @@ public class NotifyServiceImpl implements NotifyService { if ("SUCCESS".equals(paramsMap.get("return_code")) && "SUCCESS".equals(paramsMap.get("result_code"))) { log.info("微信支付 -> 异步通知:支付成功,进入订单处理"); - String orderScene = paramsMap.get("attach"); - JSONObject object = JSONObject.parseObject(orderScene); // 订单类型 - String orderType = object.getString("orderScene"); + String orderType = paramsMap.get("attach"); PayService payService = getPayService(orderType); if (payService != null) { payService.paySuccess(paramsMap, "WechatPay"); // 商户内部实际的交易业务处理