From 513a62aa3477539fe7e96f907b9541420495293e Mon Sep 17 00:00:00 2001 From: zhengfangyuan Date: Sat, 20 Aug 2022 17:06:43 +0800 Subject: [PATCH] fix pay v3 --- .../db/migration/V2022080800001_pay_v3.sql | 204 ++++++++++++++++++ .../schedule/CouponOrderExpiringSchedule.java | 2 +- .../domain/dto/WxProfitShareAppInoDto.java | 3 +- .../domain/dto/WxSharingOrderDto.java | 4 + .../domain/po/WxProfitSharingOrder.java | 6 +- .../domain/vo/WxProfitSharingOrderVo.java | 1 + .../main/java/com/iformall/pay/WxPayV3.java | 11 + .../service/WxProfitSharingOrderService.java | 2 +- .../impl/WxCouponOrderServiceImpl.java | 13 ++ .../service/impl/WxOrderServiceImpl.java | 2 + .../impl/WxProfitSharingOrderServiceImpl.java | 10 +- .../service/pay/PayServiceFactory.java | 20 ++ .../appPay/WxMiniAppPayV3AdapterService.java | 28 ++- .../service/share/PayShareAdapterService.java | 20 +- .../share/PayShareBaseAdapterService.java | 55 +++++ .../share/douyin/TtPayShareService.java | 2 + .../share/wx/v2/WxPayShareService.java | 51 +---- .../share/wx/v3/WxPayShareV3Service.java | 89 ++++++-- .../wx/v3/entity/V3PayShareUnfreezeReq.java | 12 ++ .../mapper/WxProfitSharingOrderMapper.xml | 18 +- 20 files changed, 461 insertions(+), 92 deletions(-) create mode 100644 mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareUnfreezeReq.java diff --git a/mallinkAdmin/src/main/resources/db/migration/V2022080800001_pay_v3.sql b/mallinkAdmin/src/main/resources/db/migration/V2022080800001_pay_v3.sql index 1a05cef4f..44b8dbcd8 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V2022080800001_pay_v3.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V2022080800001_pay_v3.sql @@ -2038,5 +2038,209 @@ alter table wx_appinfo drop column pay_bill_id; UPDATE wx_pay_account SET pay_version = 1 WHERE mch_id > 0 ; UPDATE wx_pay_account SET pay_version = 3 WHERE mch_id = 0 ; +alter table wx_profit_sharing_order_0 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_1 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_2 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_3 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_4 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_5 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_6 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_7 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_8 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_9 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_10 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_11 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_12 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_13 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_14 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_15 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_16 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_17 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_18 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_19 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_20 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_21 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_22 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_23 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_24 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_25 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_26 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_27 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_28 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_29 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_30 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_31 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_32 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_33 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_34 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_35 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_36 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_37 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_38 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_39 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_40 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_41 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_42 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_43 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_44 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_45 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_46 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_47 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_48 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_49 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_50 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_51 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_52 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_53 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_54 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_55 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_56 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_57 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_58 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_59 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_60 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_61 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_62 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_63 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_64 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_65 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_66 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_67 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_68 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_69 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_70 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_71 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_72 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_73 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_74 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_75 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_76 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_77 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_78 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_79 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_80 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_81 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_82 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_83 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_84 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_85 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_86 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_87 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_88 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_89 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_90 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_91 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_92 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_93 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_94 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_95 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_96 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_97 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_98 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; +alter table wx_profit_sharing_order_99 add column pay_merchant_id int(20) comment "收款商户号,直连时必须设置" after merchant_id; + +alter table wx_profit_sharing_order_0 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_1 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_2 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_3 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_4 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_5 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_6 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_7 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_8 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_9 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_10 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_11 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_12 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_13 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_14 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_15 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_16 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_17 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_18 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_19 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_20 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_21 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_22 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_23 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_24 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_25 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_26 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_27 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_28 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_29 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_30 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_31 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_32 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_33 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_34 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_35 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_36 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_37 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_38 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_39 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_40 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_41 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_42 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_43 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_44 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_45 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_46 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_47 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_48 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_49 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_50 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_51 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_52 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_53 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_54 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_55 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_56 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_57 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_58 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_59 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_60 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_61 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_62 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_63 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_64 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_65 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_66 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_67 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_68 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_69 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_70 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_71 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_72 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_73 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_74 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_75 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_76 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_77 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_78 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_79 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_80 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_81 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_82 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_83 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_84 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_85 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_86 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_87 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_88 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_89 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_90 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_91 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_92 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_93 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_94 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_95 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_96 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_97 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_98 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; +alter table wx_profit_sharing_order_99 add column pay_merchant_mch_id varchar(60) comment "收款商户平台账号,直连时必须设置" after pay_merchant_id; + + + redis清除B、C端token weapp:token: redis清除 payAccount: diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java index 8596c7939..73ea10b1e 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java @@ -223,7 +223,7 @@ public class CouponOrderExpiringSchedule { wxSharingOrderDto.setShareAmount(wxPayOrder.getChildOrderShare(co.getOrderId()).getShareAmount()); } //wxSharingOrderDto.setShareAmount(wxPayOrder.getPayAmount()); - wxProfitSharingOrderService.finishSharingOrder(wxSharingOrderDto,wxPayOrder.getPayVendor(),wxPayOrder.getShare()); + wxProfitSharingOrderService.finishSharingOrder(wxPayOrder,wxSharingOrderDto,wxPayOrder.getPayVendor(),wxPayOrder.getShare()); } } catch (MallinkException e) { diff --git a/mallinkService/src/main/java/com/iformall/domain/dto/WxProfitShareAppInoDto.java b/mallinkService/src/main/java/com/iformall/domain/dto/WxProfitShareAppInoDto.java index 8af5e1f2e..e1b96ebec 100644 --- a/mallinkService/src/main/java/com/iformall/domain/dto/WxProfitShareAppInoDto.java +++ b/mallinkService/src/main/java/com/iformall/domain/dto/WxProfitShareAppInoDto.java @@ -3,6 +3,7 @@ package com.iformall.domain.dto; import java.io.Serializable; import com.iformall.domain.po.WxAppinfo; +import com.iformall.domain.po.WxPayOrder; import lombok.Data; @@ -16,6 +17,4 @@ public class WxProfitShareAppInoDto implements Serializable{ private WxAppinfo appinfo; private Integer payWay; - - } diff --git a/mallinkService/src/main/java/com/iformall/domain/dto/WxSharingOrderDto.java b/mallinkService/src/main/java/com/iformall/domain/dto/WxSharingOrderDto.java index 3d8a46d40..c719670d2 100644 --- a/mallinkService/src/main/java/com/iformall/domain/dto/WxSharingOrderDto.java +++ b/mallinkService/src/main/java/com/iformall/domain/dto/WxSharingOrderDto.java @@ -20,6 +20,10 @@ public class WxSharingOrderDto extends TenantEntity { private Integer payAmount; @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") private Long merchantId; + @io.swagger.annotations.ApiModelProperty(value="支付时收款商户",name="payMerchantId") + private Long payMerchantId; + @io.swagger.annotations.ApiModelProperty(value="支付时收款商户号",name="payMerchantMchId") + private String payMerchantMchId; @io.swagger.annotations.ApiModelProperty(value="分账金额(总金额扣除手续费后的金额)",name="shareAmount") private Integer shareAmount; @io.swagger.annotations.ApiModelProperty(value="分账通道费差()",name="rateAmount") diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java index adb2f281b..fb1937e67 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java @@ -16,8 +16,12 @@ public class WxProfitSharingOrder extends TenantEntity { private Long outSettleNo; - @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") + @io.swagger.annotations.ApiModelProperty(value="核销商户ID",name="merchantId") private Long merchantId; + @io.swagger.annotations.ApiModelProperty(value="支付时收款商户,直连模式必须有",name="payMerchantId") + private Long payMerchantId; + @io.swagger.annotations.ApiModelProperty(value="支付时收款商户平台账号,直连模式必须有",name="payMerchantMchId") + private String payMerchantMchId; @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") private Long orderId; @io.swagger.annotations.ApiModelProperty(value="支付渠道: (抖音分账用)",name="payVendor") diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxProfitSharingOrderVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxProfitSharingOrderVo.java index 5053010ec..c8544c768 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxProfitSharingOrderVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxProfitSharingOrderVo.java @@ -18,6 +18,7 @@ public class WxProfitSharingOrderVo extends TenantEntity { private Long id; private Long merchantId; + private String mchId; @Excel(name="商户名称",width = 20,orderNum = "2") private String merchantName; diff --git a/mallinkService/src/main/java/com/iformall/pay/WxPayV3.java b/mallinkService/src/main/java/com/iformall/pay/WxPayV3.java index fa4a09a49..abfab8a60 100644 --- a/mallinkService/src/main/java/com/iformall/pay/WxPayV3.java +++ b/mallinkService/src/main/java/com/iformall/pay/WxPayV3.java @@ -21,6 +21,7 @@ import com.iformall.service.pay.service.pay.wx.sft.entity.SFTPayQueryReq; import com.iformall.service.pay.service.pay.wx.v3.entity.V3CombinePayCommonMiniAppReq; import com.iformall.service.pay.service.pay.wx.v3.entity.V3PayCommonMiniAppReq; import com.iformall.service.pay.service.pay.wx.v3.entity.V3PayQueryReq; +import com.iformall.service.pay.service.share.wx.v3.entity.V3PayShareUnfreezeReq; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,6 +46,8 @@ public class WxPayV3 { private static final String PAY_COMMON_CLOSE_ORDER_URL = "https://api.mch.weixin.qq.com/v3/pay/partner/transactions/out-trade-no/%s/close"; //小程序下单-合单支付-关闭订单 private static final String PAY_COMBINE_CLOSE_ORDER_URL = "https://api.mch.weixin.qq.com/v3/combine-transactions/out-trade-no/%s/close"; + //小程序下单-解冻 + private static final String UNFREEZE_URL = "https://api.mch.weixin.qq.com/v3/profitsharing/orders/unfreeze"; //小程序下单-分账 private static final String SHARE_URL = "https://api.mch.weixin.qq.com/v3/ecommerce/profitsharing/orders"; @@ -158,5 +161,13 @@ public class WxPayV3 { return payService.postV3WithWechatpaySerial(String.format(PAY_COMBINE_CLOSE_ORDER_URL, closeOrder.getCombine_out_trade_no()), JSON.toJSONString(closeOrder)); } + /** + * 分账-解冻https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_1_5.shtml + * @throws WxPayException + */ + public static String payCombineClose(WxPayService payService,V3PayShareUnfreezeReq req) throws WxPayException { + return payService.postV3WithWechatpaySerial(UNFREEZE_URL, JSON.toJSONString(req)); + } + } diff --git a/mallinkService/src/main/java/com/iformall/service/WxProfitSharingOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxProfitSharingOrderService.java index 9c568e44f..50dff36a6 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxProfitSharingOrderService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxProfitSharingOrderService.java @@ -41,7 +41,7 @@ public interface WxProfitSharingOrderService { /** * 结束分账订单 */ - ResultData finishSharingOrder(WxSharingOrderDto sharingOrderDto,Integer payway,Integer share); + ResultData finishSharingOrder(WxPayOrder payOrder,WxSharingOrderDto sharingOrderDto,Integer payway,Integer share); PageInfo listAsPage(WxProfitSharingOrderQueryVo order, Integer pageNum, Integer pageSize); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java index 324a4871c..cd0f05cfb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -29,6 +29,7 @@ import com.iformall.pay.WxPayConstant; import com.iformall.service.*; import com.iformall.service.order.OrderAdapterService; import com.iformall.service.order.OrderFactory; +import com.iformall.service.order.entity.WxComposeChildOrderShare; import com.iformall.service.order.entity.WxComposeOrder; import com.iformall.service.order.util.OrderHelper; import com.iformall.service.pay.PayServiceFactory; @@ -1719,9 +1720,21 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { } } if(wxPayOrder != null){ + WxOrder order = wxOrderService.getById(couponOrder.getOrderId(), wxPayOrder.getTenantId()); + if (null == order) { + logger.error("租户"+wxPayOrder.getTenantId()+"券订单"+couponOrder.getId()+"未查询到订单."); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"租户"+wxPayOrder.getTenantId()+"券订单"+couponOrder.getId()+"未查询到订单."); + } WxSharingOrderDto wxSharingOrderDto = new WxSharingOrderDto(); wxSharingOrderDto.setCUserId(wxPayOrder.getCUserId()); wxSharingOrderDto.setMerchantId(merchantId); + WxComposeChildOrderShare childShare = wxPayOrder.getChildOrderShare(order.getId()); + if (null == childShare) { + logger.error("租户"+wxPayOrder.getTenantId()+"订单"+order.getId()+"在支付订单"+wxPayOrder.getId()+"未查询到."); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"租户"+wxPayOrder.getTenantId()+"订单"+order.getId()+"在支付订单"+wxPayOrder.getId()+"未查询到."); + } + wxSharingOrderDto.setPayMerchantId(childShare.getMerchantId()); + wxSharingOrderDto.setPayMerchantMchId(childShare.getMerchantUid()); if (mulityShare) { wxSharingOrderDto.setType(EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getCode()); }else { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index 1bdfe5e40..dfe95016e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -2570,6 +2570,8 @@ public class WxOrderServiceImpl implements WxOrderService { sharingOrder.updateTenantInfo(wxPayOrder); sharingOrder.setTransactionId(wxPayOrder.getTransactionId()); wxProfitSharingOrderService.createSharingOrder(sharingOrder,payWay.getCode(),wxPayOrder.getPayVersion(),wxPayOrder.getMchType(),wxPayOrder.getShare()); + + } else { logger.error("微信分账: 未找到payorder or merchant at orderid-" + orderId); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java index 79cb9bed6..a4bf7bd0a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java @@ -137,8 +137,9 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ if (wxProfitSharingOrder.getType().equals(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()) || wxProfitSharingOrder.getType().equals(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE_FINISH.getCode())){ WxPayOrder wxPayOrder = wxPayOrderMapper.selectById(wxProfitSharingOrder.getOrderId(),wxProfitSharingOrder.getTenantId()); - if (wxPayOrder == null) + if (wxPayOrder == null) { throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND.getCode(),"wxProfitSharingOrder["+wxProfitSharingOrder.getId()+"] 没有payOrder信息."); + } appinfo = getAppinfo(wxPayOrder.getTenantId(),wxPayOrder.getPayVendor()); payWay = wxPayOrder.getPayVendor(); } else if(wxProfitSharingOrder.getType().equals(EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getCode()) @@ -151,8 +152,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ } else { throw new MallinkException(ErrorCode.PROFIT_SHARING_QUERY_UNKNOWN_TYPE); } - - WxProfitShareAppInoDto rt = new WxProfitShareAppInoDto(); + WxProfitShareAppInoDto rt = new WxProfitShareAppInoDto(); rt.setAppinfo(appinfo); rt.setPayWay(payWay); return rt; @@ -204,7 +204,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ } - PayShareResult shareResult = payServiceFactory.getPayShareAdapterService(dto.getPayWay(),payAccount.getPayVersion()).haveReciversShare(appInfo, payAccount, frecord, + PayShareResult shareResult = payServiceFactory.getPayShareAdapterService(dto.getPayWay(),payAccount.getPayVersion()).haveReciversShare(appInfo, payAccount,frecord, sharingOrder.getTransactionId(), JSONArray.parseArray(JSON.toJSONString(receivers)), EnumProfitSharingOrderType.getEnum(sharingOrder.getType())); WxProfitSharingOrder updSharingOrder = new WxProfitSharingOrder(); updSharingOrder.updateTenantInfo(sharingOrder); @@ -431,7 +431,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ // 分账完结 @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) - public ResultData finishSharingOrder(WxSharingOrderDto sharingOrderDto,Integer payWay,Integer share) { + public ResultData finishSharingOrder(WxPayOrder payOrder,WxSharingOrderDto sharingOrderDto,Integer payWay,Integer share) { final IdWorker idworker = IdWorker.get(); if ((EnumPayWay.PAY_WAY_WECHAT.getCode().equals(payWay) diff --git a/mallinkService/src/main/java/com/iformall/service/pay/PayServiceFactory.java b/mallinkService/src/main/java/com/iformall/service/pay/PayServiceFactory.java index 7c9797725..6888692d7 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/PayServiceFactory.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/PayServiceFactory.java @@ -10,6 +10,8 @@ import com.iformall.service.pay.service.refund.wx.v3.WxRefundV3AdapterService; import com.iformall.service.pay.service.share.douyin.TtPayShareService; import com.iformall.service.pay.service.share.wx.sft.WxPayShareSFTService; import com.iformall.service.pay.service.share.wx.v2.WxPayShareService; +import com.iformall.service.pay.service.share.wx.v3.WxPayShareV3Service; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.iformall.common.ErrorCode; @@ -66,6 +68,8 @@ public class PayServiceFactory { WxPayShareService wxShareService; @Autowired WxPayShareSFTService wxPayShareSFTService; + @Autowired + WxPayShareV3Service wxPayShareV3Service; @Autowired TtPayShareService ttShareService; @@ -145,6 +149,22 @@ public class PayServiceFactory { shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_PASSWD.getCode()+"_"+EnumPayVersion.WX_PAY_V3_SFT.getCode(), wxPayShareSFTService); shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_CREDIT.getCode()+"_"+EnumPayVersion.WX_PAY_V3_SFT.getCode(), wxPayShareSFTService); shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_GIFTLIST.getCode()+"_"+EnumPayVersion.WX_PAY_V3_SFT.getCode(), wxPayShareSFTService); + + shareMap.put(EnumPayWay.PAY_WAY_WECHAT.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_WECHAT_MA.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_POS_NEU.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_MERCHANT.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_VERRIFY.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_B_MA.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_CAR_STOP.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_SYSTEM_SEND.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_BATCH_SEND.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_TRADE.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_PASSWD.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_CREDIT.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + shareMap.put(EnumPayWay.PAY_WAY_NOT_UNPAY_GIFTLIST.getCode()+"_"+EnumPayVersion.WX_PAY_V3.getCode(), wxPayShareV3Service); + + } return shareMap; } 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 d0ac4fdb6..a667294c3 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 @@ -73,7 +73,15 @@ public class WxMiniAppPayV3AdapterService extends BaseWxPayV3AdapterService impl req.setSp_appid(String.valueOf(appInfo.getParentAppId())); req.setSp_mchid(payAccount.getMchId()); req.setSub_appid(appInfo.getAppId()); - req.setSub_mchid(getMerchantUid(record,composeOrder.getSingleOrder())); + //直连 + if (payAccount.getMchType() == EnumPayMchType.DIRECT.getCode()) { + req.setSub_mchid(getMerchantUid(record,composeOrder.getSingleOrder())); + //总分 + }else if (payAccount.getMchType() == EnumPayMchType.TOTAL.getCode()) { + req.setSub_mchid(payAccount.getSubMchId()); + }else { + throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"当前支付模式非法"); + } req.setDescription(appInfo.getName()+"-"+productName); req.setOut_trade_no(String.valueOf(composeOrder.getMainOrderId())); req.setNotify_url(payAccount.getPayNotifyV3Url()); @@ -121,11 +129,20 @@ public class WxMiniAppPayV3AdapterService extends BaseWxPayV3AdapterService impl req.setCombine_appid(appInfo.getAppId()); req.setCombine_mchid(payAccount.getMchId()); req.setCombine_out_trade_no(String.valueOf(composeOrder.getMainOrderId())); - + if (payAccount.getMchType() != EnumPayMchType.TOTAL.getCode() && payAccount.getMchType() != EnumPayMchType.DIRECT.getCode()) { + throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"当前支付模式非法"); + } + List suborders = new ArrayList(); for (WxOrder order : childOrders) { V3CombineItemOrder so = new V3CombineItemOrder(); - String subMchId = getMerchantUid(record,order); + String subMchId = null; + //总分 + if (payAccount.getMchType() == EnumPayMchType.TOTAL.getCode()) { + subMchId = payAccount.getSubMchId(); + }else if (payAccount.getMchType() == EnumPayMchType.DIRECT.getCode()) { + subMchId = getMerchantUid(record,order); + } so.initByWxOrder(payAccount, order, subMchId, appInfo, productName, String.valueOf(record.getId())); suborders.add(so); } @@ -154,11 +171,6 @@ public class WxMiniAppPayV3AdapterService extends BaseWxPayV3AdapterService impl throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"当前支付配置非服务商模式,不能使用该产品."); } - //只能直连模式, - if (payAccount.getMchType() != EnumPayMchType.DIRECT.getCode()) { - throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"当前支付版本不支持非直连模式"); - } - WxPayService payService = maUtil.getWxPayService(appInfo, payAccount); if (null == childOrders || childOrders.size() <= 0 ) { diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareAdapterService.java b/mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareAdapterService.java index f58fad05d..d0b53245a 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareAdapterService.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareAdapterService.java @@ -47,6 +47,24 @@ public interface PayShareAdapterService { */ public PayShareCalculateAmount calculateAmount(Integer payAmount,Integer officialCommissionRate,WxPayAccount payAccount); + /** + * 查询商户的收款账号信息 + * @param tenantEntity + * @param merchantId + * @param ttPayWay + * @return + */ + List getReceiverList(TenantEntity tenantEntity, Long merchantId, Integer ttPayWay); + + /** + * 创建分账记录 + * @param sharingOrderDto + * @param mchType + * @param share + * @return + */ + WxProfitSharingOrder createSharingOrder(WxSharingOrderDto sharingOrderDto, Integer mchType,Integer share); + /** * 无分账接收方分账 ,钱直接分给小程序方 调用API分账 * @param appInfo @@ -124,7 +142,5 @@ public interface PayShareAdapterService { ResultData handerSharingOrder(WxPayOrder payOrder, WxProfitSharingOrder sharingOrder); - WxProfitSharingOrder createSharingOrder(WxSharingOrderDto sharingOrderDto, Integer mchType,Integer share); - List getReceiverList(TenantEntity tenantEntity, Long merchantId, Integer ttPayWay); } diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareBaseAdapterService.java b/mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareBaseAdapterService.java index f22ad2a7a..2c399441c 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareBaseAdapterService.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareBaseAdapterService.java @@ -1,11 +1,66 @@ package com.iformall.service.pay.service.share; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.iformall.common.ErrorCode; +import com.iformall.domain.dto.WxSharingOrderDto; +import com.iformall.domain.po.WxProfitSharingReceiver; import com.iformall.enums.EnumProfitSharingReceiverType; +import com.iformall.exception.MallinkException; public abstract class PayShareBaseAdapterService implements PayShareAdapterService{ @Override public EnumProfitSharingReceiverType getShareAccount(Integer accountType) { return EnumProfitSharingReceiverType.getEnum(accountType); } + + protected String calReceiversAmount(WxSharingOrderDto sharingOrderDto,List psReceiverList) { + if (psReceiverList != null && psReceiverList.size() > 50) { + throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID); + } + + if (psReceiverList == null || psReceiverList.size() == 0) { //没有分账账户, + throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_UNKNOWN); + } + + if (psReceiverList.size() > 1 &&//计算分账账户合法性 + psReceiverList.stream().filter(r->(r.getParameter() == null)).count() > 0) { + throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID); + } + + //计算分账金额合法性 + psReceiverList.stream().forEach(r-> + { + if (r.getParameter() == null){ + r.setSharingAmount(sharingOrderDto.getShareAmount()); + r.setRateAmount(sharingOrderDto.getRateAmount()); + r.setRealRateAmount(sharingOrderDto.getRealRateAmount()); + r.setCommissionAmount(sharingOrderDto.getCommissionAmount()); + } else { + r.setSharingAmount(sharingOrderDto.getShareAmount()*Integer.valueOf(r.getParameter())/10000); + } + }); + if (psReceiverList.stream().mapToInt(r->r.getSharingAmount()).sum() > sharingOrderDto.getShareAmount()){ + throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_UNKNOWN); + } + + // 添加分账接收方 + JSONArray receivers = new JSONArray(); + psReceiverList.stream().forEach(receiver->{ + JSONObject jo = new JSONObject(); + jo.put("type",this.getShareAccount(receiver.getReceiverType()).getMessage()); + jo.put("account",receiver.getReceiverAccount()); + jo.put("amount", receiver.getSharingAmount()); + jo.put("rateAmount", receiver.getRateAmount()); + jo.put("realRateAmount", receiver.getRateAmount()); + jo.put("commissionAmount", receiver.getCommissionAmount()); + //jo.put("description",receiver.getReceiverComments()); //改为存ID, + jo.put("description",receiver.getId().toString()); //为重试做准备 + receivers.add(jo); + }); + return receivers.toJSONString(); + } } diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/share/douyin/TtPayShareService.java b/mallinkService/src/main/java/com/iformall/service/pay/service/share/douyin/TtPayShareService.java index d10c80dba..26218b7f5 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/service/share/douyin/TtPayShareService.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/share/douyin/TtPayShareService.java @@ -382,6 +382,8 @@ public class TtPayShareService extends PayShareBaseAdapterService{ record.setOrderId(sharingOrderDto.getOrderId()); record.setPayAmount(sharingOrderDto.getPayAmount()); record.setMerchantId(sharingOrderDto.getMerchantId()); + record.setPayMerchantId(sharingOrderDto.getPayMerchantId()); + record.setPayMerchantMchId(sharingOrderDto.getPayMerchantMchId()); record.setSharingStatus(this.getSharingOrderInitialStatus()); record.setCreateTime(currentDate); record.setUpdateTime(currentDate); diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java index dde0b8302..38eb0e530 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java @@ -454,7 +454,7 @@ public class WxPayShareService extends PayShareBaseAdapterService{ throw new MallinkException(ErrorCode.SYS_PARAMETER_TYPE_ERROR.getCode(),"微信直连模式待开发"); } if(EnumYesOrNo.NO.getCode().equals(share)){ - throw new MallinkException(ErrorCode.SYS_PARAMETER_TYPE_ERROR.getCode(),"微信不分账"); + throw new MallinkException(ErrorCode.SYS_PARAMETER_TYPE_ERROR.getCode(),"微信未开启分账"); } //是否已创建分账订单 WxProfitSharingOrder record = new WxProfitSharingOrder(); @@ -478,56 +478,13 @@ public class WxPayShareService extends PayShareBaseAdapterService{ record.setPayTimeStart(sharingOrderDto.getPayTimeStart()); record.setPayTimeEnd(sharingOrderDto.getPayTimeEnd()); record.setType(sharingOrderDto.getType()); + record.setPayMerchantId(sharingOrderDto.getPayMerchantId()); + record.setPayMerchantMchId(sharingOrderDto.getPayMerchantMchId()); wxProfitSharingOrderMapper.insert(record); } List psReceiverList = getReceiverList(sharingOrderDto, sharingOrderDto.getMerchantId(), null); - - if (psReceiverList != null && psReceiverList.size() > 50) { - throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID); - } - - if (psReceiverList == null || psReceiverList.size() == 0) { //没有分账账户, - throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_UNKNOWN); - } - - if (psReceiverList.size() > 1 &&//计算分账账户合法性 - psReceiverList.stream().filter(r->(r.getParameter() == null)).count() > 0) { - throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID); - } - - //计算分账金额合法性 - psReceiverList.stream().forEach(r-> - { - if (r.getParameter() == null){ - r.setSharingAmount(sharingOrderDto.getShareAmount()); - r.setRateAmount(sharingOrderDto.getRateAmount()); - r.setRealRateAmount(sharingOrderDto.getRealRateAmount()); - r.setCommissionAmount(sharingOrderDto.getCommissionAmount()); - } else { - r.setSharingAmount(sharingOrderDto.getShareAmount()*Integer.valueOf(r.getParameter())/10000); - } - }); - if (psReceiverList.stream().mapToInt(r->r.getSharingAmount()).sum() > sharingOrderDto.getShareAmount()){ - throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_UNKNOWN); - } - - // 添加分账接收方 - JSONArray receivers = new JSONArray(); - psReceiverList.stream().forEach(receiver->{ - JSONObject jo = new JSONObject(); - jo.put("type",this.getShareAccount(receiver.getReceiverType()).getMessage()); - jo.put("account",receiver.getReceiverAccount()); - jo.put("amount", receiver.getSharingAmount()); - jo.put("rateAmount", receiver.getRateAmount()); - jo.put("realRateAmount", receiver.getRateAmount()); - jo.put("commissionAmount", receiver.getCommissionAmount()); - //jo.put("description",receiver.getReceiverComments()); //改为存ID, - jo.put("description",receiver.getId().toString()); //为重试做准备 - receivers.add(jo); - }); - - record.setReceivers(receivers.toJSONString()); + record.setReceivers(calReceiversAmount(sharingOrderDto, psReceiverList)); wxProfitSharingOrderMapper.updateById(record); return record; diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java index 3d62f19bd..50ae20fe5 100644 --- a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java @@ -40,6 +40,7 @@ import com.iformall.service.pay.service.share.entity.PayShareCalculateAmount; import com.iformall.service.pay.service.share.entity.PayShareQueryResult; import com.iformall.service.pay.service.share.entity.PayShareResult; import com.iformall.service.pay.service.share.entity.ShareNotifyAdapterResult; +import com.iformall.service.pay.service.share.wx.v3.entity.V3PayShareUnfreezeReq; import com.iformall.utils.BeanUtils; import com.iformall.utils.Utility; import com.iformall.utils.XmlUtil; @@ -57,15 +58,6 @@ public class WxPayShareV3Service extends PayShareBaseAdapterService{ @Autowired WxProfitSharingReceiverService wxProfitSharingReceiverService; - final JSONObject statusMap = JSON.parseObject( - "{\"ACCEPTED\":3," + - "\"PROCESSING\": 4," + - "\"FINISHED\": 5," + - "\"CLOSED\": 6}"); - - - - @Override public Integer getSubsidyType() { return EnumMerchantSubsidyType.WECHAT.getCode(); @@ -73,7 +65,7 @@ public class WxPayShareV3Service extends PayShareBaseAdapterService{ @Override public Integer getProfitSharingType() { - return EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode(); + return EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT_v2.getCode(); } @Override @@ -88,15 +80,27 @@ public class WxPayShareV3Service extends PayShareBaseAdapterService{ return new PayShareCalculateAmount(payAmount,mallCharge,realRateAmount,0); } + //无需分账,直接解冻 @Override public PayShareResult noReciverShare(WxAppinfo appInfo,WxPayAccount payAccount,WxProfitSharingOrder record,String transcationId,Integer amount) { - - return null; + V3PayShareUnfreezeReq req = new V3PayShareUnfreezeReq(); + //直连模式 + if (payAccount.getMchType() == EnumPayMchType.DIRECT.getCode()) { + req.setSub_mchid(record.getPayMerchantMchId()); + }else { + req.setSub_mchid(payAccount.getSubMchId()); + } + return null; } @Override public PayShareResult haveReciversShare(WxAppinfo appInfo,WxPayAccount payAccount,WxProfitSharingOrder record,String transcationId,JSONArray receivers,EnumProfitSharingOrderType shareType ) throws MallinkException { - return null; + //只能直连模式, + if (payAccount.getMchType() != EnumPayMchType.DIRECT.getCode()) { + throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"当前支付版本不支持非直连模式"); + } + + return null; } @@ -162,20 +166,63 @@ public class WxPayShareV3Service extends PayShareBaseAdapterService{ @Override public WxProfitSharingOrder createSharingOrder(WxSharingOrderDto sharingOrderDto, Integer mchType,Integer share) { - if(EnumPayMchType.DIRECT.getCode().equals(mchType)){ - throw new MallinkException(ErrorCode.SYS_PARAMETER_TYPE_ERROR.getCode(),"微信直连模式待开发"); - } if(EnumYesOrNo.NO.getCode().equals(share)){ - throw new MallinkException(ErrorCode.SYS_PARAMETER_TYPE_ERROR.getCode(),"微信不分账"); + throw new MallinkException(ErrorCode.SYS_PARAMETER_TYPE_ERROR.getCode(),"微信分账未开启"); } - - - return null; + //是否已创建分账订单 + WxProfitSharingOrder record = new WxProfitSharingOrder(); + record.updateTenantInfo(sharingOrderDto); + record.setOrderId(sharingOrderDto.getOrderId()); + record = wxProfitSharingOrderMapper.selectOne(new QueryWrapper(record)); + if (record == null) { + //创建分账订单 + Date currentDate = new Date(); + record = new WxProfitSharingOrder(); + final IdWorker idworker = IdWorker.get(); + record.setId(idworker.nextId()); + record.updateTenantInfo(sharingOrderDto); + record.setTransactionId(sharingOrderDto.getTransactionId()); + record.setOrderId(sharingOrderDto.getOrderId()); + record.setPayAmount(sharingOrderDto.getPayAmount()); + record.setMerchantId(sharingOrderDto.getMerchantId()); + //直连模式, + if (mchType != EnumPayMchType.DIRECT.getCode()) { + if (null == sharingOrderDto.getPayMerchantId()) { + throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"当前订单的收款商户查询为空"); + } + if (StringUtils.isBlank(sharingOrderDto.getPayMerchantMchId())) { + throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"当前订单的收款商户特约商户号进件信息查询为空"); + } + record.setPayMerchantId(sharingOrderDto.getPayMerchantId()); + record.setPayMerchantMchId(sharingOrderDto.getPayMerchantMchId()); + } + record.setSharingStatus(this.getSharingOrderInitialStatus()); + record.setCreateTime(currentDate); + record.setUpdateTime(currentDate); + record.setPayTimeStart(sharingOrderDto.getPayTimeStart()); + record.setPayTimeEnd(sharingOrderDto.getPayTimeEnd()); + record.setType(sharingOrderDto.getType()); + wxProfitSharingOrderMapper.insert(record); + } + //如果是总分模式,则需要加上收款账户 + if (mchType != EnumPayMchType.TOTAL.getCode()) { + List psReceiverList = getReceiverList(sharingOrderDto, sharingOrderDto.getMerchantId(), null); + record.setReceivers(calReceiversAmount(sharingOrderDto, psReceiverList)); + wxProfitSharingOrderMapper.updateById(record); + } + return record; } @Override public List getReceiverList(TenantEntity tenantEntity, Long merchantId, Integer ttPayWay) { - return null; + //查询进件特约商户 + WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(tenantEntity, merchantId, EnumAppPlat.WX, EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT_v2); + if (null == receiver) { + return null; + } + List retList = new ArrayList(); + retList.add(receiver); + return retList; } diff --git a/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareUnfreezeReq.java b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareUnfreezeReq.java new file mode 100644 index 000000000..1df2dc711 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareUnfreezeReq.java @@ -0,0 +1,12 @@ +package com.iformall.service.pay.service.share.wx.v3.entity; + +import lombok.Data; + +@Data +public class V3PayShareUnfreezeReq { + + private String sub_mchid;//微信支付分配的子商户号 + private String transaction_id;//微信支付订单号 + private String out_order_no;//商户系统内部的分账单号 + private String description;//分账的原因描述 +} diff --git a/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml index 33547cd4a..89bfbbb49 100644 --- a/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml @@ -6,8 +6,9 @@ - + + @@ -24,7 +25,7 @@ - `id`,`tenant_id`,`parent_tenant_id`,`out_settle_no`,`merchant_id`,`order_id`,`pay_vendor`,`pay_amount`,`pay_time_end`,`pay_time_start`,`transaction_id`,`sharing_order_no`,`type`,`receivers`,`error_msg`,`sharing_status`,`update_time`,`create_time` + `id`,`tenant_id`,`parent_tenant_id`,`out_settle_no`,`merchant_id`,`pay_merchant_id`,`pay_merchant_mch_id`,`order_id`,`pay_vendor`,`pay_amount`,`pay_time_end`,`pay_time_start`,`transaction_id`,`sharing_order_no`,`type`,`receivers`,`error_msg`,`sharing_status`,`update_time`,`create_time` @@ -48,8 +49,15 @@ and `merchant_id` = #{merchantId} - - + + + + and `pay_merchant_id` = #{payMerchantId} + + + + and `pay_merchant_mch_id` = #{payMerchantMchId} + and `order_id` = #{orderId} @@ -134,6 +142,8 @@ + +