From d4a891e6c496d67ca828f4dd849e0c0d6027af41 Mon Sep 17 00:00:00 2001 From: xiaqing Date: Fri, 15 Sep 2023 23:21:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=A4=E4=B8=AAAPP?= =?UTF-8?q?=E7=AB=AF=E6=8E=A5=E5=8F=A3=201.=E8=8E=B7=E5=8F=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=B8=AA=E4=BA=BA=E7=AD=BE=E5=88=B0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=202.=E7=94=A8=E6=88=B7=E7=AD=BE=E5=88=B0=E6=8E=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/member/enums/ErrorCodeConstants.java | 1 + .../member/convert/signin/MemberSignInRecordConvert.java | 1 - .../member/dal/mysql/signin/MemberSignInConfigMapper.java | 4 +++- .../member/service/signin/MemberSignInRecordServiceImpl.java | 5 +++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java index cf375f4e4..f3b6369a6 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java @@ -39,6 +39,7 @@ public interface ErrorCodeConstants { ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(1004009001, "签到天数规则已存在"); //========== 签到配置 1004010000 ========== + ErrorCode SIGN_IN_RECORD_EXISTS = new ErrorCode(1004010000,"用户重复签到"); //========== 用户等级 1004011000 ========== diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java index a11cfc8a5..edac5edae 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java @@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.controller.admin.signin.vo.record.MemberSignInRecordRespVO; import cn.iocoder.yudao.module.member.controller.app.signin.vo.record.AppMemberSignInRecordRespVO; -import cn.iocoder.yudao.module.member.controller.app.signin.vo.AppMemberSignInRecordRespVO; import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java index e3a9aa964..211ead33d 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java @@ -4,6 +4,8 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 签到规则 Mapper * @@ -16,7 +18,7 @@ public interface MemberSignInConfigMapper extends BaseMapperX selectListByStatus(Integer status) { + default List selectListByStatus(Integer status) { return selectList(MemberSignInConfigDO::getStatus, status); } } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java index 76468cb21..02759db19 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.member.service.signin; +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; @@ -37,7 +38,7 @@ public class MemberSignInRecordServiceImpl implements MemberSignInRecordService @Resource private MemberSignInRecordMapper memberSignInRecordMapper; - + @Resource private MemberSignInRecordMapper signInRecordMapper; @Resource private MemberSignInConfigMapper signInConfigMapper; @@ -134,7 +135,7 @@ public class MemberSignInRecordServiceImpl implements MemberSignInRecordService /**2.获取签到对应的分数**/ //获取所有的签到规则,按照天数排序,只获取启用的 List configDOList = signInConfigMapper.selectList(new LambdaQueryWrapperX () - .eq(MemberSignInConfigDO::getEnable, 1) + .eq(MemberSignInConfigDO::getStatus, CommonStatusEnum.ENABLE.getStatus()) .orderByAsc(MemberSignInConfigDO::getDay)); //如果签到的天数大于最大启用的规则天数,直接给最大签到的分数 MemberSignInConfigDO lastConfig = configDOList.get(configDOList.size() - 1);