Commit f0a00d81 by 徐康

不核销配置的券

parent 57630dab
...@@ -36,6 +36,7 @@ import com.google.common.base.Throwables; ...@@ -36,6 +36,7 @@ import com.google.common.base.Throwables;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
...@@ -60,6 +61,9 @@ public class CouponClientServiceImpl implements CouponClientService { ...@@ -60,6 +61,9 @@ public class CouponClientServiceImpl implements CouponClientService {
@Autowired @Autowired
private EmailAlertService emailAlertService; private EmailAlertService emailAlertService;
@Value("${mccafe.universal.coupon.code}")
private String withOrderBuyCouponCode;
@Override @Override
public CouponRedeemResponse redeem(MCCafeCouponRequest mcCafeCouponRequest) { public CouponRedeemResponse redeem(MCCafeCouponRequest mcCafeCouponRequest) {
return couponOfflineMCCafeClient.redeem(mcCafeCouponRequest); return couponOfflineMCCafeClient.redeem(mcCafeCouponRequest);
...@@ -75,6 +79,7 @@ public class CouponClientServiceImpl implements CouponClientService { ...@@ -75,6 +79,7 @@ public class CouponClientServiceImpl implements CouponClientService {
|| orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.PRODUCT_COUPON) || orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.PRODUCT_COUPON)
|| orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.DISCOUNT_COUPON) || orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.DISCOUNT_COUPON)
|| orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.FREIGHT_COUPON)) || orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.FREIGHT_COUPON))
&& !withOrderBuyCouponCode.equals(account.getAccountId())
).collect(Collectors.toList()); ).collect(Collectors.toList());
if (CollectionUtils.isEmpty(accountList)) { if (CollectionUtils.isEmpty(accountList)) {
return null; return null;
...@@ -147,7 +152,7 @@ public class CouponClientServiceImpl implements CouponClientService { ...@@ -147,7 +152,7 @@ public class CouponClientServiceImpl implements CouponClientService {
|| OldOrderAccountType.COUPON.equals(OldOrderAccountType.getByCode(account.getType())) || OldOrderAccountType.COUPON.equals(OldOrderAccountType.getByCode(account.getType()))
|| OldOrderAccountType.DISCOUNT_COUPON.equals(OldOrderAccountType.getByCode(account.getType())) || OldOrderAccountType.DISCOUNT_COUPON.equals(OldOrderAccountType.getByCode(account.getType()))
|| OldOrderAccountType.FREIGHT_COUPON.equals(OldOrderAccountType.getByCode(account.getType())) || OldOrderAccountType.FREIGHT_COUPON.equals(OldOrderAccountType.getByCode(account.getType()))
)).collect(Collectors.toList()); ) && !withOrderBuyCouponCode.equals(account.getAccountId())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(accountList)) { if (CollectionUtils.isEmpty(accountList)) {
return null; return null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment