From 9c4e126685fd263709242382338f7edaee5b0b8e Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Wed, 28 May 2025 16:50:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=98=AF=E5=90=A6vip?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E3=80=81=E6=89=A3=E9=99=A4=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/service/AiVipLogService.java | 4 ++ .../service/impl/AiVipLogServiceImpl.java | 37 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/src/main/java/com/peanut/modules/common/service/AiVipLogService.java b/src/main/java/com/peanut/modules/common/service/AiVipLogService.java index 7ba240ee..997e23af 100644 --- a/src/main/java/com/peanut/modules/common/service/AiVipLogService.java +++ b/src/main/java/com/peanut/modules/common/service/AiVipLogService.java @@ -7,4 +7,8 @@ public interface AiVipLogService extends IService { void openAiVip(int aiBuyConfigId); + boolean isAiVip(); + + void userCount(); + } diff --git a/src/main/java/com/peanut/modules/common/service/impl/AiVipLogServiceImpl.java b/src/main/java/com/peanut/modules/common/service/impl/AiVipLogServiceImpl.java index 3a7fe801..51c64676 100644 --- a/src/main/java/com/peanut/modules/common/service/impl/AiVipLogServiceImpl.java +++ b/src/main/java/com/peanut/modules/common/service/impl/AiVipLogServiceImpl.java @@ -1,6 +1,8 @@ package com.peanut.modules.common.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.peanut.common.utils.DateUtil; import com.peanut.common.utils.DateUtils; import com.peanut.common.utils.ShiroUtils; import com.peanut.modules.common.dao.AiBuyConfigDao; @@ -13,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; +import java.util.List; @Slf4j @Service("commonAiVipLogService") @@ -42,4 +45,38 @@ public class AiVipLogServiceImpl extends ServiceImpl impl } } + + @Override + public boolean isAiVip() { + List aiVipLogs = this.list(new LambdaQueryWrapper() + .eq(AiVipLog::getUserId,ShiroUtils.getUId()) + .orderByAsc(AiVipLog::getStartTime)); + for (AiVipLog aiVipLog:aiVipLogs){ + if (aiVipLog.getSurplusCount()>0&&new Date().getTime() aiVipLogs = this.list(new LambdaQueryWrapper() + .eq(AiVipLog::getUserId,ShiroUtils.getUId()) + .orderByAsc(AiVipLog::getStartTime)); + boolean flag = false; + for (AiVipLog aiVipLog:aiVipLogs){ + if (aiVipLog.getSurplusCount()>0&&new Date().getTime()