| @@ -883,8 +883,20 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| PayShareAdapterService payShareServie = payServiceFactory.getPayShareAdapterService(payWay.getCode(),payAccount.getPayVersion()); | PayShareAdapterService payShareServie = payServiceFactory.getPayShareAdapterService(payWay.getCode(),payAccount.getPayVersion()); | ||||
| List<String> badNames = new ArrayList(); | |||||
| if (EnumPayMchType.DIRECT.equals(payMchType)) { | if (EnumPayMchType.DIRECT.equals(payMchType)) { | ||||
| //多商户券,抖音 直连 门店只有进件支付宝才能参加活动 todo | |||||
| //多商户券,抖音 直连 门店只有进件支付宝才能参加活动 | |||||
| if(EnumCouponMerchantType.MULTIPLE_MERCHANT.getCode().equals(record.getMerchantType())){ | |||||
| for (WxMerchant merchant:merchantList) { | |||||
| WxProfitSharingReceiver receiver = payShareServie.getReceiver(mallTenantEntity, merchant.getId(), null, payMchType.getCode()); | |||||
| if (receiver == null) { | |||||
| badNames.add(merchant.getName()); | |||||
| } | |||||
| if(!MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus())){ | |||||
| badNames.add(merchant.getName()); | |||||
| } | |||||
| } | |||||
| } | |||||
| // WxMerchant makeMerchant = getDirectPayAccountMerchant(merchantList,record); | // WxMerchant makeMerchant = getDirectPayAccountMerchant(merchantList,record); | ||||
| // if (null == makeMerchant) { | // if (null == makeMerchant) { | ||||
| @@ -913,16 +925,15 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| // } | // } | ||||
| // } | // } | ||||
| } else if (EnumPayShare.YES.equals(isShare)) { | } else if (EnumPayShare.YES.equals(isShare)) { | ||||
| List<String> badNames = new ArrayList(); | |||||
| for (WxMerchant merchant:merchantList) { | for (WxMerchant merchant:merchantList) { | ||||
| boolean isBad = toTalPayMchTypeMerchantIsBad(payShareServie,payAccount,merchant.getName(),merchant.getId(),payMchType,plat); | boolean isBad = toTalPayMchTypeMerchantIsBad(payShareServie,payAccount,merchant.getName(),merchant.getId(),payMchType,plat); | ||||
| if (isBad) { | if (isBad) { | ||||
| badNames.add(merchant.getName()); | badNames.add(merchant.getName()); | ||||
| } | } | ||||
| } | } | ||||
| if(!badNames.isEmpty()){ | |||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), JSONArray.toJSONString(badNames)+"未配置分账账户"); | |||||
| } | |||||
| } | |||||
| if(!badNames.isEmpty()){ | |||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), JSONArray.toJSONString(badNames)+"未配置分账账户"); | |||||
| } | } | ||||
| } | } | ||||
| return merchantList; | return merchantList; | ||||
| @@ -966,26 +977,34 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| if (receiver == null) { | if (receiver == null) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if (EnumAppPlat.TOUTIAO.equals(plat)) { | |||||
| if (EnumAppPlat.TOUTIAO.equals(plat)) {//抖音只能开通支付宝 | |||||
| QueryMerchantResult openPayResult = payAccount.getOpenPayResult(); | QueryMerchantResult openPayResult = payAccount.getOpenPayResult(); | ||||
| if(!EnumYesOrNo.YES.getCode().equals(openPayResult.getAlipay()) | if(!EnumYesOrNo.YES.getCode().equals(openPayResult.getAlipay()) | ||||
| && !EnumYesOrNo.YES.getCode().equals(openPayResult.getWx()) | |||||
| && !EnumYesOrNo.YES.getCode().equals(openPayResult.getHz())){ | |||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "分账模式未设置开通支付渠道"); | |||||
| } | |||||
| if(EnumYesOrNo.YES.getCode().equals(openPayResult.getAlipay()) | |||||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus())){ | |||||
| return true; | |||||
| } | |||||
| if(EnumYesOrNo.YES.getCode().equals(openPayResult.getWx()) | |||||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus())){ | |||||
| return true; | |||||
| || EnumYesOrNo.YES.getCode().equals(openPayResult.getWx()) | |||||
| || EnumYesOrNo.YES.getCode().equals(openPayResult.getHz())){ | |||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "分账模式设置错误"); | |||||
| } | } | ||||
| if(EnumYesOrNo.YES.getCode().equals(openPayResult.getHz()) | |||||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getHzImportStatus())){ | |||||
| if(!MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus())){ | |||||
| return true; | return true; | ||||
| } | } | ||||
| // if(!EnumYesOrNo.YES.getCode().equals(openPayResult.getAlipay()) | |||||
| // && !EnumYesOrNo.YES.getCode().equals(openPayResult.getWx()) | |||||
| // && !EnumYesOrNo.YES.getCode().equals(openPayResult.getHz())){ | |||||
| // throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "分账模式未设置开通支付渠道"); | |||||
| // } | |||||
| // if(EnumYesOrNo.YES.getCode().equals(openPayResult.getAlipay()) | |||||
| // && !MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus())){ | |||||
| // return true; | |||||
| // } | |||||
| // if(EnumYesOrNo.YES.getCode().equals(openPayResult.getWx()) | |||||
| // && !MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus())){ | |||||
| // return true; | |||||
| // } | |||||
| // if(EnumYesOrNo.YES.getCode().equals(openPayResult.getHz()) | |||||
| // && !MerchantImportStatus.improt_success.getCode().equals(receiver.getHzImportStatus())){ | |||||
| // return true; | |||||
| // } | |||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||