Commit f0a00d81 by 徐康

不核销配置的券

parent 57630dab
......@@ -36,6 +36,7 @@ import com.google.common.base.Throwables;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.*;
......@@ -60,6 +61,9 @@ public class CouponClientServiceImpl implements CouponClientService {
@Autowired
private EmailAlertService emailAlertService;
@Value("${mccafe.universal.coupon.code}")
private String withOrderBuyCouponCode;
@Override
public CouponRedeemResponse redeem(MCCafeCouponRequest mcCafeCouponRequest) {
return couponOfflineMCCafeClient.redeem(mcCafeCouponRequest);
......@@ -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.DISCOUNT_COUPON)
|| orderAdapter.getQueryOrderAccountType(OldOrderAccountType.getByCode(account.getType())).equals(QueryOrderAccountType.FREIGHT_COUPON))
&& !withOrderBuyCouponCode.equals(account.getAccountId())
).collect(Collectors.toList());
if (CollectionUtils.isEmpty(accountList)) {
return null;
......@@ -147,7 +152,7 @@ public class CouponClientServiceImpl implements CouponClientService {
|| OldOrderAccountType.COUPON.equals(OldOrderAccountType.getByCode(account.getType()))
|| OldOrderAccountType.DISCOUNT_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)) {
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