Browse Source

fix(wechat):修正微信分账服务中子商户ID设置错误

- 将分账请求中的子商户ID从partyFunding更正为receiverRecords
- 确保使用正确的接收方记录来设置子商户ID- 修复因错误的子商户ID导致的分账失败问题
wzq 3 days ago
parent
commit
944a97bb0e

+ 3 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/pay/config/WeChatProfitSharingService.java

@@ -343,9 +343,10 @@ public class WeChatProfitSharingService {
         List<AppProfitSharingInfo> appProfitSharingInfos = appProfitSharingInfoMapper.selectList(Wrappers.lambdaQuery(AppProfitSharingInfo.class).eq(AppProfitSharingInfo::getOrderId,
                 appOrder.getId()));
 
-        List<AppProfitSharingInfo> partyFunding = appProfitSharingInfos.stream().filter(e -> e.getType() == 2).collect(Collectors.toList());
+        List<AppProfitSharingInfo> receivers = appProfitSharingInfos.stream().filter(e -> e.getType() == 1).collect(Collectors.toList());
+//        List<AppProfitSharingInfo> partyFunding = appProfitSharingInfos.stream().filter(e -> e.getType() == 2).collect(Collectors.toList());
         HashMap<String, String> map = new HashMap<>();
-        map.put("sub_mchid", partyFunding.get(0).getMchId());
+        map.put("sub_mchid", receivers.get(0).getMchId());
         map.put("transaction_id", appOrder.getTransactionId());
 
         String params = WechatPayV3Utils.formatUrlParam(map);