Commit 8380af56 by 徐康

商品券白名单

parent a1a190f3
......@@ -26,6 +26,8 @@ public class GetCouponDetailResponseDto {
private String activeCode;
private String title;
private Integer type;
//type=0时,subType=1为黑名单,否则为白名单
private Integer subType;
private Integer status;
private String create_time;
private String redeem_time;
......
......@@ -26,6 +26,7 @@ import cn.freemud.entities.vo.coupon.CouponAvailableReqVo;
import cn.freemud.entities.vo.coupon.CouponStateVo;
import cn.freemud.entities.vo.coupon.Product;
import cn.freemud.enums.*;
import cn.freemud.interceptor.ServiceException;
import cn.freemud.redis.RedisCache;
import cn.freemud.service.CommonService;
import cn.freemud.service.CouponService;
......@@ -564,6 +565,12 @@ public class CouponServiceImpl implements CouponService {
&& !Objects.equals(couponDetailResponseDto.getDetails().get(0).getStatus(), CouponStatus.STATUS_2.getCode())) {
return null;
}
if(CouponTypeEnum.TYPE_0.getCode().equals(couponDetailResponseDto.getDetails().get(0).getType())
&& Integer.valueOf(1).equals(couponDetailResponseDto.getDetails().get(0).getSubType())) {
throw new ServiceException(ResponseResult.SHOPPING_CART_PRODUCT_CAN_NOT_USE, "老版本不支持商品券黑名单商品,请升级小程序。");
}
// List<String> couPonstoreIds = Lists.newArrayList();
//TODO 判断该券是否在这个门店下(一个券可以在多个门店下使用)
if (CollectionUtils.isNotEmpty(couponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS())) {
......@@ -755,9 +762,14 @@ public class CouponServiceImpl implements CouponService {
if (!CouponStatus.STATUS_0.getCode().equals(detail.getStatus()) && !CouponStatus.STATUS_2.getCode().equals(detail.getStatus())) continue;
for (GetCouponDetailResponseDto.ActiveProduct activeProduct : detail.getActiveProduct()) {
if (goodsId.equals(activeProduct.getProductIdPartner())) {
productValid = true;
couponActivityDetail = detail;
couponType = CouponTypeEnum.TYPE_4.getCode();
if(CouponTypeEnum.TYPE_0.getCode().equals(detail.getType()) && Integer.valueOf(1).equals(detail.getSubType())) {
//券码传过来的是黑名单
return null;
} else {
productValid = true;
couponActivityDetail = detail;
couponType = CouponTypeEnum.TYPE_4.getCode();
}
break;
}
}
......@@ -861,6 +873,11 @@ public class CouponServiceImpl implements CouponService {
return null;
}
if(CouponTypeEnum.TYPE_0.getCode().equals(couponDetailResponseDto.getDetails().get(0).getType())
&& Integer.valueOf(1).equals(couponDetailResponseDto.getDetails().get(0).getSubType())) {
throw new ServiceException(ResponseResult.SHOPPING_CART_PRODUCT_CAN_NOT_USE, "老版本不支持商品券黑名单商品,请升级小程序。");
}
//券返回的商品id
List<String> skuIds = Lists.newArrayList();
String skuId = couponDetailResponseDto.getDetails().get(0).getActiveProduct().get(0).getProductIdPartner();
......
......@@ -25,7 +25,7 @@ public interface CardBinClient {
GetAppKeyResponseDto getAppKey(GetAppKeyRequestDto requestDto);
/**
* 活动信息批量查询
* 活动信息批量查询 疑似黑白名单接口但是出参没有商品信息
* @param requestDto
* @return
*/
......
......@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
public interface CouponAdapterClient {
/**
* 获取可用券信息
* 获取可用券信息 需要券码改造为黑白名单接口,出参中的商品信息没有使用
*
* @param couponAvailableReqVo
* @return
......
......@@ -16,7 +16,7 @@ import java.util.Map;
@FeignClient(name = "OPEN-STORE-ONLINE-COUPON-SERVICE", url = "${saas.coupononlineclient.feign.url}", configuration = FormSupportConfig.class)
public interface CouponOnlineClient {
/**
* 查询券详情
* 查询券详情 黑白名单接口
*/
@IgnoreFeignLogAnnotation(logMessage = "getCouponDetails",excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE)
@PostMapping(value = "/code_v4", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
......
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