From 183e12c805dc3e95fb998539813d57e98e3288ea Mon Sep 17 00:00:00 2001 From: PQZ Date: Mon, 31 Mar 2025 16:47:26 +0800 Subject: [PATCH] 1 --- .../member/service/IMemberPointsService.java | 15 ++++++++++-- .../service/impl/MemberPointsServiceImpl.java | 24 +++++++++++++++++++ .../service/impl/MemberUserServiceImpl.java | 15 ++++++------ .../com/ruoyi/member/vo/MemberUserVO.java | 6 +++-- .../src/main/resources/application.yml | 3 ++- .../ruoyi/common/config/DlRightsConfig.java | 2 ++ 6 files changed, 52 insertions(+), 13 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberPointsService.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberPointsService.java index 8a0471d..abd901b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberPointsService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberPointsService.java @@ -28,9 +28,20 @@ public interface IMemberPointsService extends IService { /** * 新增积分变动记录 + * + * @param memberPoints {@link MemberPoints} * @author PQZ * @date 15:29 2025/3/29 - * @param memberPoints {@link MemberPoints} - **/ + **/ void savePoints(MemberPoints memberPoints); + + /** + * 获取积分 + * + * @param userId 用户id + * @return java.lang.Integer + * @author PQZ + * @date 16:11 2025/3/31 + **/ + Integer getBloggerBalance(Long userId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberPointsServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberPointsServiceImpl.java index ba53249..cf3a3a8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberPointsServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberPointsServiceImpl.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.config.DlRightsConfig; import com.ruoyi.common.core.domain.DlBaseEntity; import com.ruoyi.member.domain.MemberPoints; import com.ruoyi.member.mapper.MemberPointsMapper; @@ -71,4 +72,27 @@ public class MemberPointsServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper + .eq(MemberPoints::getUserId,userId) + .eq(DlBaseEntity::getDelFlag,0) + .orderByDesc(DlBaseEntity::getCreateTime); + List list = list(lambdaQueryWrapper); + if (list.isEmpty()){ + return 0; + } else { + return list.get(0).getBalance(); + } + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberUserServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberUserServiceImpl.java index 7896f57..0acdff2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberUserServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberUserServiceImpl.java @@ -16,10 +16,7 @@ import com.ruoyi.constant.DictConstants; import com.ruoyi.framework.web.service.TokenService; import com.ruoyi.member.domain.MemberUser; import com.ruoyi.member.mapper.MemberUserMapper; -import com.ruoyi.member.service.IMemberAddressService; -import com.ruoyi.member.service.IMemberBusiCardService; -import com.ruoyi.member.service.IMemberCardService; -import com.ruoyi.member.service.IMemberUserService; +import com.ruoyi.member.service.*; import com.ruoyi.member.vo.MemberUserVO; import com.ruoyi.system.mapper.SysUserMapper; import org.springframework.beans.factory.annotation.Autowired; @@ -54,6 +51,8 @@ public class MemberUserServiceImpl extends ServiceImpl cards; /**通告主发布的通告列表*/ List notices; - /**博主报名的通告列表*/ - List noticeVos; /**名片信息*/ List busiCards; /**地址信息*/ List addresses; + /**积分*/ + int pointsBalance; + /**报名次数*/ + int report; } diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 89821ac..070d060 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -153,4 +153,5 @@ wx-app: # 普通用户权益值 dl-rights: # 每月发布通告额度 - addNotice: 3 \ No newline at end of file + addNotice: 3 + report: 5 \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/DlRightsConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/DlRightsConfig.java index b959425..c7d45b5 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/config/DlRightsConfig.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/DlRightsConfig.java @@ -10,5 +10,7 @@ import org.springframework.stereotype.Component; public class DlRightsConfig { /** 每月发布通告额度 */ private Integer addNotice; + /** 每日可报名次数上限*/ + private Integer report; }