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);