| @@ -1607,32 +1607,35 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| } | |||
| } | |||
| if (makeMerchant == null) { | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "没有收款商户"); | |||
| } | |||
| PayShareAdapterService payShareServie = payServiceFactory.getPayShareAdapterService(payWay.getCode(),payAccount.getPayVersion()); | |||
| WxProfitSharingReceiver receiver = payShareServie.getReceiver(makeMerchant, makeMerchant.getId(), null, payMchType.getCode()); | |||
| if (receiver == null) { | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "收款商户[\""+makeMerchant.getName()+"\"]未配置收款账户"); | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到所属商户"); | |||
| } | |||
| wxCoupon.setMakeMerchantId(makeMerchant.getId()); | |||
| //如果是直连,抖音,多商户券必须只配置支付宝 | |||
| if (EnumAppPlat.TOUTIAO.equals(plat)) { | |||
| if (!MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getHzImportStatus())) { | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "收款商户[\""+makeMerchant.getName()+"\"]未配置收款账户"); | |||
| if(wxCoupon.getSalePrice() != null && wxCoupon.getSalePrice() > 0) { | |||
| PayShareAdapterService payShareServie = payServiceFactory.getPayShareAdapterService(payWay.getCode(),payAccount.getPayVersion()); | |||
| WxProfitSharingReceiver receiver = payShareServie.getReceiver(makeMerchant, makeMerchant.getId(), null, payMchType.getCode()); | |||
| if (receiver == null) { | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "所属商户[\""+makeMerchant.getName()+"\"]未配置收款账户"); | |||
| } | |||
| if(EnumCouponMerchantType.MULTIPLE_MERCHANT.getCode().equals(wxCoupon.getMerchantType())){ | |||
| if (MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus()) | |||
| //如果是直连,抖音,多商户券必须只配置支付宝 | |||
| if (EnumAppPlat.TOUTIAO.equals(plat)) { | |||
| if (!MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getHzImportStatus())) { | |||
| }else { | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "收款商户[\""+makeMerchant.getName()+"\"]配置收款账户错误,只能配置支付宝."); | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "所属商户[\""+makeMerchant.getName()+"\"]未配置收款账户"); | |||
| } | |||
| if(EnumCouponMerchantType.MULTIPLE_MERCHANT.getCode().equals(wxCoupon.getMerchantType())){ | |||
| if (MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getHzImportStatus())) { | |||
| }else { | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "所属商户[\""+makeMerchant.getName()+"\"]配置收款账户错误,只能配置支付宝."); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| wxCoupon.setMakeMerchantId(makeMerchant.getId()); | |||
| }else{ | |||
| wxCoupon.setMakeMerchantId(0l); | |||
| } | |||