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

[支付][修改]:分账部分APPID,MCHID获取方式调整

release_toaliyun_real
hupeng 7 лет назад
Родитель
Сommit
7c03c4786a
2 измененных файлов: 26 добавлений и 44 удалений
  1. +10
    -18
      mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java
  2. +16
    -26
      mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingReceiverServiceImpl.java

+ 10
- 18
mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java Просмотреть файл

@@ -142,10 +142,8 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ


try { try {


WxAppinfo subAppInfo = getAppinfo(wxPayOrder);
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(subAppInfo.getPayId());
//WxPayAccount mainPayAccount = wxPayAccountMapper.selectByPrimaryKey(new Long(EnumPayDomain.PAY_DOMAIN_MASTER_ACCOUNT_ID.getCode()));
//WxAppinfo mainAppInfo = wxAppinfoMapper.selectByPrimaryKey(new Long(EnumPayDomain.PAY_DOMAIN_MASTER_APPINFO_ID.getCode()));
WxAppinfo appInfo = getAppinfo(wxPayOrder);
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(appInfo.getPayId());


WxOrder wxOrder = wxOrderMapper.selectByPrimaryKey(wxPayOrder.getOrderId()); WxOrder wxOrder = wxOrderMapper.selectByPrimaryKey(wxPayOrder.getOrderId());


@@ -173,12 +171,10 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ


//分账提交 //分账提交
WxProfitSharingP wxProfitSharingP = new WxProfitSharingP(); WxProfitSharingP wxProfitSharingP = new WxProfitSharingP();
//wxProfitSharingP.setAppid(mainAppInfo.getAppId());
//wxProfitSharingP.setMch_id(mainPayAccount.getMchId());
wxProfitSharingP.setAppid(subAppInfo.getAppId());
wxProfitSharingP.setAppid(appInfo.getParentAppId());
wxProfitSharingP.setMch_id(payAccount.getMchId()); wxProfitSharingP.setMch_id(payAccount.getMchId());
wxProfitSharingP.setSub_appid(subAppInfo.getAppId());
wxProfitSharingP.setSub_mch_id(payAccount.getMchId());
wxProfitSharingP.setSub_appid(appInfo.getAppId());
wxProfitSharingP.setSub_mch_id(payAccount.getSubMchId());
wxProfitSharingP.setNonce_str(Utility.generate32UUID()); wxProfitSharingP.setNonce_str(Utility.generate32UUID());
wxProfitSharingP.setTransaction_id(wxPayOrder.getTransactionId()); wxProfitSharingP.setTransaction_id(wxPayOrder.getTransactionId());
wxProfitSharingP.setOut_trade_no(record.getId().toString()); wxProfitSharingP.setOut_trade_no(record.getId().toString());
@@ -256,11 +252,8 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ


WxProfitSharingOrder record = new WxProfitSharingOrder(); WxProfitSharingOrder record = new WxProfitSharingOrder();
try { try {
WxAppinfo subAppInfo = getAppinfo(wxPayOrder);
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(subAppInfo.getPayId());
//WxPayAccount mainPayAccount = wxPayAccountMapper.selectByPrimaryKey(new Long(EnumPayDomain.PAY_DOMAIN_MASTER_ACCOUNT_ID.getCode()));

WxOrder wxOrder = wxOrderMapper.selectByPrimaryKey(wxPayOrder.getOrderId());
WxAppinfo appInfo = getAppinfo(wxPayOrder);
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(appInfo.getPayId());


//是否已创建分账订单 //是否已创建分账订单
record.setOrderId(wxPayOrder.getId()); record.setOrderId(wxPayOrder.getId());
@@ -268,11 +261,10 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
if (record == null) if (record == null)
throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND.getCode(), ErrorCode.ORDER_IS_NOT_FIND.getMessage()); throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND.getCode(), ErrorCode.ORDER_IS_NOT_FIND.getMessage());


//分账提交
WxProfitSharingQueryP wxProfitSharingQueryP = new WxProfitSharingQueryP();
//wxProfitSharingP.setMch_id(mainPayAccount.getMchId());
//分账查询提交
WxProfitSharingQueryP wxProfitSharingQueryP = new WxProfitSharingQueryP();;
wxProfitSharingQueryP.setMch_id(payAccount.getMchId()); wxProfitSharingQueryP.setMch_id(payAccount.getMchId());
wxProfitSharingQueryP.setSub_mch_id(payAccount.getMchId());
wxProfitSharingQueryP.setSub_mch_id(payAccount.getSubMchId());
wxProfitSharingQueryP.setNonce_str(Utility.generate32UUID()); wxProfitSharingQueryP.setNonce_str(Utility.generate32UUID());
wxProfitSharingQueryP.setTransaction_id(wxPayOrder.getTransactionId()); wxProfitSharingQueryP.setTransaction_id(wxPayOrder.getTransactionId());
wxProfitSharingQueryP.setOut_trade_no(record.getId().toString()); wxProfitSharingQueryP.setOut_trade_no(record.getId().toString());


+ 16
- 26
mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingReceiverServiceImpl.java Просмотреть файл

@@ -85,15 +85,12 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv
@Override @Override
public ResultData addReceiver(WxMerchant merchant) { public ResultData addReceiver(WxMerchant merchant) {


WxAppinfo subAppInfo = new WxAppinfo();
subAppInfo.setTenantId(merchant.getTenantId());
subAppInfo.setType(EnumAppType.C.getCode());

subAppInfo = wxAppinfoMapper.findList(subAppInfo).get(0);
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(subAppInfo.getPayId());
//WxPayAccount mainPayAccount = wxPayAccountMapper.selectByPrimaryKey(new Long(EnumPayDomain.PAY_DOMAIN_MASTER_ACCOUNT_ID.getCode()));
//WxAppinfo mainAppInfo = wxAppinfoMapper.selectByPrimaryKey(new Long(EnumPayDomain.PAY_DOMAIN_MASTER_APPINFO_ID.getCode()));
WxAppinfo appInfo = new WxAppinfo();
appInfo.setTenantId(merchant.getTenantId());
appInfo.setType(EnumAppType.C.getCode());


appInfo = wxAppinfoMapper.findList(appInfo).get(0);
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(appInfo.getPayId());


WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); WxProfitSharingReceiver receiver = new WxProfitSharingReceiver();
receiver.setMerchantId(merchant.getId()); receiver.setMerchantId(merchant.getId());
@@ -108,12 +105,10 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv


//添加分账账户 //添加分账账户
WxProfitSharingReceiverP wxProfitSharingReceiverP = new WxProfitSharingReceiverP(); WxProfitSharingReceiverP wxProfitSharingReceiverP = new WxProfitSharingReceiverP();
//wxProfitSharingP.setAppid(mainAppInfo.getAppId());
//wxProfitSharingP.setMch_id(mainPayAccount.getMchId());
wxProfitSharingReceiverP.setAppid(subAppInfo.getAppId());
wxProfitSharingReceiverP.setAppid(appInfo.getParentAppId());
wxProfitSharingReceiverP.setMch_id(payAccount.getMchId()); wxProfitSharingReceiverP.setMch_id(payAccount.getMchId());
wxProfitSharingReceiverP.setSub_appid(subAppInfo.getAppId());
wxProfitSharingReceiverP.setSub_mch_id(payAccount.getMchId());
wxProfitSharingReceiverP.setSub_appid(appInfo.getAppId());
wxProfitSharingReceiverP.setSub_mch_id(payAccount.getSubMchId());
wxProfitSharingReceiverP.setNonce_str(Utility.generate32UUID()); wxProfitSharingReceiverP.setNonce_str(Utility.generate32UUID());




@@ -151,15 +146,12 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv


@Override @Override
public ResultData delReceiver(WxMerchant merchant) { public ResultData delReceiver(WxMerchant merchant) {
WxAppinfo subAppInfo = new WxAppinfo();
subAppInfo.setTenantId(merchant.getTenantId());
subAppInfo.setType(EnumAppType.C.getCode());

subAppInfo = wxAppinfoMapper.findList(subAppInfo).get(0);
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(subAppInfo.getPayId());
//WxPayAccount mainPayAccount = wxPayAccountMapper.selectByPrimaryKey(new Long(EnumPayDomain.PAY_DOMAIN_MASTER_ACCOUNT_ID.getCode()));
//WxAppinfo mainAppInfo = wxAppinfoMapper.selectByPrimaryKey(new Long(EnumPayDomain.PAY_DOMAIN_MASTER_APPINFO_ID.getCode()));
WxAppinfo appInfo = new WxAppinfo();
appInfo.setTenantId(merchant.getTenantId());
appInfo.setType(EnumAppType.C.getCode());


appInfo = wxAppinfoMapper.findList(appInfo).get(0);
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(appInfo.getPayId());


WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); WxProfitSharingReceiver receiver = new WxProfitSharingReceiver();
receiver.setMerchantId(merchant.getId()); receiver.setMerchantId(merchant.getId());
@@ -174,12 +166,10 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv


//删除分账账户 //删除分账账户
WxProfitSharingReceiverP wxProfitSharingReceiverP = new WxProfitSharingReceiverP(); WxProfitSharingReceiverP wxProfitSharingReceiverP = new WxProfitSharingReceiverP();
//wxProfitSharingP.setAppid(mainAppInfo.getAppId());
//wxProfitSharingP.setMch_id(mainPayAccount.getMchId());
wxProfitSharingReceiverP.setAppid(subAppInfo.getAppId());
wxProfitSharingReceiverP.setAppid(appInfo.getParentAppId());
wxProfitSharingReceiverP.setMch_id(payAccount.getMchId()); wxProfitSharingReceiverP.setMch_id(payAccount.getMchId());
wxProfitSharingReceiverP.setSub_appid(subAppInfo.getAppId());
wxProfitSharingReceiverP.setSub_mch_id(payAccount.getMchId());
wxProfitSharingReceiverP.setSub_appid(appInfo.getAppId());
wxProfitSharingReceiverP.setSub_mch_id(payAccount.getSubMchId());
wxProfitSharingReceiverP.setNonce_str(Utility.generate32UUID()); wxProfitSharingReceiverP.setNonce_str(Utility.generate32UUID());






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