Browse Source

用户使用联系卡

master
张彭杰 1 month ago
parent
commit
0ddccda582
2 changed files with 7 additions and 5 deletions
  1. 3
      dating-agency-mall-server/src/main/java/com/qniao/dam/api/query/product/user/response/UserListProductByVipVo.java
  2. 9
      dating-agency-mall-server/src/main/java/com/qniao/dam/query/product/impl/ProductQueryServiceImpl.java

3
dating-agency-mall-server/src/main/java/com/qniao/dam/api/query/product/user/response/UserListProductByVipVo.java

@ -49,6 +49,9 @@ public class UserListProductByVipVo {
@ApiModelProperty("购买次数限制")
private PurchaseTimeLimitTypeEnum purchaseTimeLimit;
@ApiModelProperty("是否允许购买")
private Boolean isAllowPurchase = true;
//会员权益
@ApiModelProperty("会员权益")
private List<VipRightVo> vipRightList;

9
dating-agency-mall-server/src/main/java/com/qniao/dam/query/product/impl/ProductQueryServiceImpl.java

@ -154,12 +154,11 @@ public class ProductQueryServiceImpl implements ProductQueryService {
if (CollUtil.isNotEmpty(list)) {
list.forEach(record -> {
if (Objects.nonNull(record.getPurchaseTimeLimit())) {
if (PurchaseTimeLimitTypeEnum.UNLIMITED.equals(record.getPurchaseTimeLimit())) {
resultList.add(record);
} else {
resultList.add(record);
if (PurchaseTimeLimitTypeEnum.FIRST_TIME_ONLY.equals(record.getPurchaseTimeLimit())) {
int count = purchaseProductRecordQueryService.countPurchasedBy(record.getProductSpecId(), userId);
if (count < record.getPurchaseTimeLimit().getValue()) {
resultList.add(record);
if (count >= record.getPurchaseTimeLimit().getValue()) {
record.setIsAllowPurchase(false);
}
}
}

Loading…
Cancel
Save