Просмотр исходного кода

fix pay v3

release_toaliyun_real
zhengfangyuan 3 лет назад
Родитель
Сommit
513a62aa34
20 измененных файлов: 461 добавлений и 92 удалений
  1. +204
    -0
      mallinkAdmin/src/main/resources/db/migration/V2022080800001_pay_v3.sql
  2. +1
    -1
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java
  3. +1
    -2
      mallinkService/src/main/java/com/iformall/domain/dto/WxProfitShareAppInoDto.java
  4. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/dto/WxSharingOrderDto.java
  5. +5
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java
  6. +1
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxProfitSharingOrderVo.java
  7. +11
    -0
      mallinkService/src/main/java/com/iformall/pay/WxPayV3.java
  8. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxProfitSharingOrderService.java
  9. +13
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  10. +2
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
  11. +5
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java
  12. +20
    -0
      mallinkService/src/main/java/com/iformall/service/pay/PayServiceFactory.java
  13. +20
    -8
      mallinkService/src/main/java/com/iformall/service/pay/service/pay/wx/v3/miniApp/appPay/WxMiniAppPayV3AdapterService.java
  14. +18
    -2
      mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareAdapterService.java
  15. +55
    -0
      mallinkService/src/main/java/com/iformall/service/pay/service/share/PayShareBaseAdapterService.java
  16. +2
    -0
      mallinkService/src/main/java/com/iformall/service/pay/service/share/douyin/TtPayShareService.java
  17. +4
    -47
      mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v2/WxPayShareService.java
  18. +68
    -21
      mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/WxPayShareV3Service.java
  19. +12
    -0
      mallinkService/src/main/java/com/iformall/service/pay/service/share/wx/v3/entity/V3PayShareUnfreezeReq.java
  20. +14
    -4
      mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml

+ 204
- 0
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:

+ 1
- 1
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) {


+ 1
- 2
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;

}

+ 4
- 0
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")


+ 5
- 1
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")


+ 1
- 0
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;


+ 11
- 0
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));
}
}

+ 1
- 1
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<WxProfitSharingOrderVo> listAsPage(WxProfitSharingOrderQueryVo order, Integer pageNum, Integer pageSize);


+ 13
- 0
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 {


+ 2
- 0
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);
}


+ 5
- 5
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)


+ 20
- 0
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;
}


+ 20
- 8
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<V3CombineItemOrder> suborders = new ArrayList<V3CombineItemOrder>();
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 ) {


+ 18
- 2
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<WxProfitSharingReceiver> 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<WxProfitSharingReceiver> getReceiverList(TenantEntity tenantEntity, Long merchantId, Integer ttPayWay);
}

+ 55
- 0
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<WxProfitSharingReceiver> 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();
}

}

+ 2
- 0
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);


+ 4
- 47
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<WxProfitSharingReceiver> 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;


+ 68
- 21
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<WxProfitSharingReceiver> psReceiverList = getReceiverList(sharingOrderDto, sharingOrderDto.getMerchantId(), null);
record.setReceivers(calReceiversAmount(sharingOrderDto, psReceiverList));
wxProfitSharingOrderMapper.updateById(record);
}
return record;
}

@Override
public List<WxProfitSharingReceiver> 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<WxProfitSharingReceiver> retList = new ArrayList<WxProfitSharingReceiver>();
retList.add(receiver);
return retList;
}



+ 12
- 0
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;//分账的原因描述
}

+ 14
- 4
mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml Просмотреть файл

@@ -6,8 +6,9 @@
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="out_settle_no" jdbcType="BIGINT" property="outSettleNo" />

<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="pay_merchant_id" jdbcType="BIGINT" property="payMerchantId" />
<result column="pay_merchant_mch_id" jdbcType="VARCHAR" property="payMerchantMchId" />
<result column="order_id" jdbcType="BIGINT" property="orderId" />
<result column="pay_vendor" jdbcType="INTEGER" property="payVendor"/>
<result column="pay_amount" jdbcType="INTEGER" property="payAmount" />
@@ -24,7 +25,7 @@
</resultMap>
<sql id="allColumns">
`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`
</sql>

<sql id="dynamicWhereConditions">
@@ -48,8 +49,15 @@
<if test=" null != merchantId ">
and `merchant_id` = #{merchantId}
</if>
</if>
<if test=" null != payMerchantId ">
and `pay_merchant_id` = #{payMerchantId}
</if>
<if test=" null != payMerchantMchId and '' != payMerchantMchId">
and `pay_merchant_mch_id` = #{payMerchantMchId}
</if>
<if test=" null != orderId ">
and `order_id` = #{orderId}
@@ -134,6 +142,8 @@
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="pay_merchant_id" jdbcType="BIGINT" property="payMerchantId" />
<result column="pay_merchant_mch_id" jdbcType="VARCHAR" property="payMerchantMchId" />
<result column="merchant_name" jdbcType="VARCHAR" property="merchantName" />
<result column="order_id" jdbcType="BIGINT" property="orderId" />
<result column="pay_amount" jdbcType="INTEGER" property="payAmount" />


Загрузка…
Отмена
Сохранить