|
|
|
@@ -20,6 +20,7 @@ import com.iformall.pay.WxRefundOrderSP; |
|
|
|
import com.iformall.service.WxOrderService; |
|
|
|
import com.iformall.service.WxRefundOrderService; |
|
|
|
import com.iformall.service.helper.WxPayOrderServiceHelper; |
|
|
|
import com.iformall.service.order.OrderFactory; |
|
|
|
import com.iformall.service.pay.PayServiceFactory; |
|
|
|
import com.iformall.service.pay.service.refund.entity.RefundAdapterResult; |
|
|
|
import com.iformall.service.pay.service.refund.entity.RefundNotifyAdapterResult; |
|
|
|
@@ -85,25 +86,23 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
PayServiceFactory payServiceFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean isMerchantOrder(WxOrder wxOrder, Long merchantId) { |
|
|
|
if (wxOrder.getType().equals(EnumOrderType.COUPON.getCode())) { |
|
|
|
WxCoupon wxCoupon = wxCouponMapper.selectById(wxOrder.getProductId(),wxOrder.getTenantId()); |
|
|
|
if (wxCoupon != null) { |
|
|
|
//如券包就没有商户 |
|
|
|
WxCouponMerchant wxCouponMerchant = new WxCouponMerchant(); |
|
|
|
wxCouponMerchant.setProductId(wxCoupon.getId()); |
|
|
|
wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); |
|
|
|
List<WxCouponMerchant> couponMerchantList = wxCouponMerchantMapper.findList(wxCouponMerchant); |
|
|
|
if (couponMerchantList.stream().anyMatch(cm -> cm.getMerchantId().equals(merchantId))) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (EnumCouponType.mustHasMerchant(wxCoupon.getType())) { |
|
|
|
WxCouponMerchant wxCouponMerchant = new WxCouponMerchant(); |
|
|
|
wxCouponMerchant.setProductId(wxCoupon.getId()); |
|
|
|
wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); |
|
|
|
List<WxCouponMerchant> couponMerchantList = wxCouponMerchantMapper.findList(wxCouponMerchant); |
|
|
|
if (couponMerchantList.stream().anyMatch(cm -> cm.getMerchantId().equals(merchantId))) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
}else { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (wxOrder.getType().equals(EnumOrderType.MICROPAY.getCode())) { |
|
|
|
WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectById(wxOrder.getProductId()); |
|
|
|
|