From 0ddccda5827c283ac2e0b49fa599183d22306400 Mon Sep 17 00:00:00 2001 From: Derran Date: Mon, 9 Feb 2026 18:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=BF=E7=94=A8=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/user/response/UserListProductByVipVo.java | 3 +++ .../dam/query/product/impl/ProductQueryServiceImpl.java | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dating-agency-mall-server/src/main/java/com/qniao/dam/api/query/product/user/response/UserListProductByVipVo.java b/dating-agency-mall-server/src/main/java/com/qniao/dam/api/query/product/user/response/UserListProductByVipVo.java index a60fa54..ba9b15a 100644 --- a/dating-agency-mall-server/src/main/java/com/qniao/dam/api/query/product/user/response/UserListProductByVipVo.java +++ b/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 vipRightList; diff --git a/dating-agency-mall-server/src/main/java/com/qniao/dam/query/product/impl/ProductQueryServiceImpl.java b/dating-agency-mall-server/src/main/java/com/qniao/dam/query/product/impl/ProductQueryServiceImpl.java index 1ace88e..97598ec 100644 --- a/dating-agency-mall-server/src/main/java/com/qniao/dam/query/product/impl/ProductQueryServiceImpl.java +++ b/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); } } }