From 498c434621b3d9b8f800a91e2eb9f4a4e82f0bfe Mon Sep 17 00:00:00 2001 From: YUANYE <418471657@qq.com> Date: Thu, 3 Jun 2021 09:41:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=88=86=E8=B4=A6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cweb/controller/pay/WechatPayController.java | 16 ++++++++++------ .../hai/model/WxSharingOrderRequestModel.java | 10 +++++----- 2 files changed, 15 insertions(+), 11 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 359d503c..137f8b64 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 @@ -26,9 +26,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.BufferedOutputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.SortedMap; +import java.util.*; @Controller @RequestMapping(value = "/wechatpay") @@ -169,13 +167,19 @@ public class WechatPayController { wxSharingOrderRequest.setAppid("wx637bd6f7314daa46"); wxSharingOrderRequest.setNonce_str(WxUtils.makeNonStr()); - List list = new ArrayList<>(); +/* List list = new ArrayList<>(); WxSharingReceiversVO receiversVO = new WxSharingReceiversVO(); receiversVO.setAccount(wxSharingOrderRequest.getSub_mch_id()); receiversVO.setType("MERCHANT_ID"); receiversVO.setRelation_type("SERVICE_PROVIDER"); - list.add(receiversVO); - wxSharingOrderRequest.setReceivers(JSONObject.toJSONString(list)); + list.add(receiversVO);*/ + + Map receiversVO = new HashMap<>(); + receiversVO.put("type", "MERCHANT_ID"); + receiversVO.put("relation_type", "SERVICE_PROVIDER"); + receiversVO.put("account", wxSharingOrderRequest.getSub_mch_id()); + receiversVO.put("name", "个体户"); + wxSharingOrderRequest.setReceiver(JSONObject.toJSONString(receiversVO)); BeanMap beanMap = BeanMap.create(wxSharingOrderRequest); wxSharingOrderRequest.setSign(WxUtils.makeSign(beanMap, "SHA256" ,"SHA256")); diff --git a/hai-service/src/main/java/com/hai/model/WxSharingOrderRequestModel.java b/hai-service/src/main/java/com/hai/model/WxSharingOrderRequestModel.java index 78842c49..65a6bf3b 100644 --- a/hai-service/src/main/java/com/hai/model/WxSharingOrderRequestModel.java +++ b/hai-service/src/main/java/com/hai/model/WxSharingOrderRequestModel.java @@ -62,7 +62,7 @@ public class WxSharingOrderRequestModel { /** * 分账接收方列表(单次分账不能即是支付商户又是接收商户,多次分账没有限制) */ - private String receivers; + private String receiver; public String getMch_id() { return mch_id; @@ -152,11 +152,11 @@ public class WxSharingOrderRequestModel { this.amount = amount; } - public String getReceivers() { - return receivers; + public String getReceiver() { + return receiver; } - public void setReceivers(String receivers) { - this.receivers = receivers; + public void setReceiver(String receiver) { + this.receiver = receiver; } }