From ae1f05e8f93346bbd1ad1d0659f9b3cde174e502 Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 30 Aug 2022 15:26:49 +0800 Subject: [PATCH] // test --- .../controller/callback/WxPayController.java | 17 +++++++++-------- ...WxProfitSharingReceiverApplyServiceImpl.java | 1 + .../appPay/WxMiniAppPayV3AdapterService.java | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/mallinkCallback/src/main/java/com/iformall/controller/callback/WxPayController.java b/mallinkCallback/src/main/java/com/iformall/controller/callback/WxPayController.java index 0c2e58352..33c00af53 100644 --- a/mallinkCallback/src/main/java/com/iformall/controller/callback/WxPayController.java +++ b/mallinkCallback/src/main/java/com/iformall/controller/callback/WxPayController.java @@ -192,11 +192,12 @@ public class WxPayController extends BaseController { logger.info("[" +getIpAddr() + "]微信退款回调"); Map paramMap = null; String response = ""; - String xml = ""; + String json = ""; try { - xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); - logger.info(xml); - paramMap = WxPayment.xmlToMap(xml); + json = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); + logger.info(json); + paramMap = JSON.parseObject(json,Map.class); +// paramMap = WxPayment.xmlToMap(xml); paramMap.put("tenantId", tenantId); String jsonMsg = JSON.toJSONString(paramMap); @@ -210,22 +211,22 @@ public class WxPayController extends BaseController { // response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); mqBaseProducer.sendMessage(refundSuccessMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); - logger.info("refund wxpay, notify success, req : " + xml + ", resp: " + response.toString()); + logger.info("refund wxpay, notify success, req : " + json + ", resp: " + response.toString()); return response; } catch (BizMessageException e) { - logger.error("refund wxpay, notify error, req: " + xml + ", e:" + e.getLocalizedMessage()); + logger.error("refund wxpay, notify error, req: " + json + ", e:" + e.getLocalizedMessage()); SortedMap resultMap = new TreeMap(); resultMap.put("code", "FAIL"); resultMap.put("message", e.getMessage()); return JSON.toJSONString(resultMap); } catch (MallinkException e) { - logger.error("refund wxpay, notify error, req: " + xml + ", e:" +e.getLocalizedMessage()); + logger.error("refund wxpay, notify error, req: " + json + ", e:" +e.getLocalizedMessage()); SortedMap resultMap = new TreeMap(); resultMap.put("code", "FAIL"); resultMap.put("message", e.getMessage()); return JSON.toJSONString(resultMap); } catch (Exception e) { - logger.error("refund wxpay, order create error, req: " + xml + ", e: " + e.getMessage()); + logger.error("refund wxpay, order create error, req: " + json + ", e: " + e.getMessage()); SortedMap resultMap = new TreeMap(); resultMap.put("code", "FAIL"); resultMap.put("message", e.getMessage()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java index c558f1412..fa32485eb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java @@ -156,6 +156,7 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR @Override @Transactional(rollbackFor = {Exception.class}) public ResultData handApplymentStates(WxProfitSharingReceiverApply receiverApply) { + if(receiverApply == null || !EnumSharingReceiverApplymentState.getNeedSyncList().contains(receiverApply.getApplymentState())){ // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "该状态无需同步"); return new ResultData(receiverApply); diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/pay/wx/v3/miniApp/appPay/WxMiniAppPayV3AdapterService.java b/mallinkService/src/main/java/com/iformall/service/pay/service/pay/wx/v3/miniApp/appPay/WxMiniAppPayV3AdapterService.java index e15a4d601..0608b3cbd 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/service/pay/wx/v3/miniApp/appPay/WxMiniAppPayV3AdapterService.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/pay/wx/v3/miniApp/appPay/WxMiniAppPayV3AdapterService.java @@ -202,7 +202,7 @@ public class WxMiniAppPayV3AdapterService extends BaseWxPayV3AdapterService impl throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"子订单为空"); } /* - * 普通支付/小程序支付 + * 普通支付/小程序支付 * https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_2_3.shtml */ if (childOrders.size() == 1) {