会员: 规范代码, 用户等级, 用户分组

This commit is contained in:
owen 2023-08-22 01:15:16 +08:00
parent 9d9638b15b
commit 7b2f639324
30 changed files with 15 additions and 380 deletions

View File

@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -63,15 +62,6 @@ public class MemberGroupController {
return success(MemberGroupConvert.INSTANCE.convert(group));
}
@GetMapping("/list")
@Operation(summary = "获得用户分组列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('member:group:query')")
public CommonResult<List<MemberGroupRespVO>> getGroupList(@RequestParam("ids") Collection<Long> ids) {
List<MemberGroupDO> list = groupService.getGroupList(ids);
return success(MemberGroupConvert.INSTANCE.convertList(list));
}
@GetMapping("/list-all-simple")
@Operation(summary = "获取会员分组精简信息列表", description = "只包含被开启的会员分组,主要用于前端的下拉选项")
public CommonResult<List<MemberGroupSimpleRespVO>> getSimpleGroupList() {

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.member.controller.admin.group.vo;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@ -21,6 +23,7 @@ public class MemberGroupBaseVO {
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "状态不能为空")
@InEnum(CommonStatusEnum.class)
private Integer status;
}

View File

@ -2,10 +2,6 @@ package cn.iocoder.yudao.module.member.controller.admin.level;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogExcelVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogExportReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogRespVO;
import cn.iocoder.yudao.module.member.convert.level.MemberExperienceLogConvert;
@ -16,17 +12,15 @@ import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
// TODO @疯狂要不 Log 改成 Record PointRecord 保持一致
@Tag(name = "管理后台 - 会员经验记录")
@ -38,16 +32,6 @@ public class MemberExperienceLogController {
@Resource
private MemberExperienceLogService experienceLogService;
// TODO @疯狂不允许删除经验哈
@DeleteMapping("/delete")
@Operation(summary = "删除会员经验记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('member:experience-log:delete')")
public CommonResult<Boolean> deleteExperienceLog(@RequestParam("id") Long id) {
experienceLogService.deleteExperienceLog(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得会员经验记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@ -57,16 +41,6 @@ public class MemberExperienceLogController {
return success(MemberExperienceLogConvert.INSTANCE.convert(experienceLog));
}
// TODO @疯狂这个接口可以删除哈应该用不到
@GetMapping("/list")
@Operation(summary = "获得会员经验记录列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('member:experience-log:query')")
public CommonResult<List<MemberExperienceLogRespVO>> getExperienceLogList(@RequestParam("ids") Collection<Long> ids) {
List<MemberExperienceLogDO> list = experienceLogService.getExperienceLogList(ids);
return success(MemberExperienceLogConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得会员经验记录分页")
@PreAuthorize("@ss.hasPermission('member:experience-log:query')")
@ -75,17 +49,4 @@ public class MemberExperienceLogController {
return success(MemberExperienceLogConvert.INSTANCE.convertPage(pageResult));
}
// TODO @疯狂导出可以先不支持场景不多
@GetMapping("/export-excel")
@Operation(summary = "导出会员经验记录 Excel")
@PreAuthorize("@ss.hasPermission('member:experience-log:export')")
@OperateLog(type = EXPORT)
public void exportExperienceLogExcel(@Valid MemberExperienceLogExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<MemberExperienceLogDO> list = experienceLogService.getExperienceLogList(exportReqVO);
// 导出 Excel
List<MemberExperienceLogExcelVO> datas = MemberExperienceLogConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "会员经验记录.xls", "数据", MemberExperienceLogExcelVO.class, datas);
}
}

View File

@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -62,16 +61,6 @@ public class MemberLevelController {
return success(MemberLevelConvert.INSTANCE.convert(level));
}
// TODO @疯狂这个应该用不到哈
@GetMapping("/list")
@Operation(summary = "获得会员等级列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('member:level:query')")
public CommonResult<List<MemberLevelRespVO>> getLevelList(@RequestParam("ids") Collection<Long> ids) {
List<MemberLevelDO> list = levelService.getLevelList(ids);
return success(MemberLevelConvert.INSTANCE.convertList(list));
}
@GetMapping("/list-all-simple")
@Operation(summary = "获取会员等级精简信息列表", description = "只包含被开启的会员等级,主要用于前端的下拉选项")
public CommonResult<List<MemberLevelSimpleRespVO>> getSimpleLevelList() {

View File

@ -2,10 +2,6 @@ package cn.iocoder.yudao.module.member.controller.admin.level;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogExcelVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogExportReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogRespVO;
import cn.iocoder.yudao.module.member.convert.level.MemberLevelLogConvert;
@ -16,17 +12,15 @@ import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
// TODO @疯狂是不是不用这个 controller因为日志只是为了记录db 可以查询和审计即可目前暂时不需要开放出来
@Tag(name = "管理后台 - 会员等级记录")
@ -38,16 +32,6 @@ public class MemberLevelLogController {
@Resource
private MemberLevelLogService levelLogService;
// TODO @疯狂这个不允许删除哈
@DeleteMapping("/delete")
@Operation(summary = "删除会员等级记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('member:level-log:delete')")
public CommonResult<Boolean> deleteLevelLog(@RequestParam("id") Long id) {
levelLogService.deleteLevelLog(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得会员等级记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@ -57,16 +41,6 @@ public class MemberLevelLogController {
return success(MemberLevelLogConvert.INSTANCE.convert(levelLog));
}
// TODO @疯狂这个接口应该没用
@GetMapping("/list")
@Operation(summary = "获得会员等级记录列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('member:level-log:query')")
public CommonResult<List<MemberLevelLogRespVO>> getLevelLogList(@RequestParam("ids") Collection<Long> ids) {
List<MemberLevelLogDO> list = levelLogService.getLevelLogList(ids);
return success(MemberLevelLogConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得会员等级记录分页")
@PreAuthorize("@ss.hasPermission('member:level-log:query')")
@ -74,18 +48,4 @@ public class MemberLevelLogController {
PageResult<MemberLevelLogDO> pageResult = levelLogService.getLevelLogPage(pageVO);
return success(MemberLevelLogConvert.INSTANCE.convertPage(pageResult));
}
// TODO @疯狂导出可以去掉先
@GetMapping("/export-excel")
@Operation(summary = "导出会员等级记录 Excel")
@PreAuthorize("@ss.hasPermission('member:level-log:export')")
@OperateLog(type = EXPORT)
public void exportLevelLogExcel(@Valid MemberLevelLogExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<MemberLevelLogDO> list = levelLogService.getLevelLogList(exportReqVO);
// 导出 Excel
List<MemberLevelLogExcelVO> datas = MemberLevelLogConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "会员等级记录.xls", "数据", MemberLevelLogExcelVO.class, datas);
}
}

View File

@ -8,8 +8,6 @@ import javax.validation.constraints.NotNull;
/**
* 会员经验记录 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*
* @author owen
*/
@Data
public class MemberExperienceLogBaseVO {

View File

@ -1,48 +0,0 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo.experience;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.member.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 会员经验记录 Excel VO
*
* @author owen
*/
@Data
public class MemberExperienceLogExcelVO {
@ExcelProperty("编号")
private Long id;
@ExcelProperty("用户编号")
private Long userId;
@ExcelProperty(value = "业务类型", converter = DictConvert.class)
@DictFormat(DictTypeConstants.MEMBER_EXPERIENCE_BIZ_TYPE)
private Integer bizType;
@ExcelProperty("业务编号")
private String bizId;
@ExcelProperty("标题")
private String title;
@ExcelProperty("经验")
private Integer experience;
@ExcelProperty("变更后的经验")
private Integer totalExperience;
@ExcelProperty("描述")
private String description;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo.experience;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员经验记录 Excel 导出 Request VO参数和 MemberExperienceLogPageReqVO 是一致的")
@Data
public class MemberExperienceLogExportReqVO {
@Schema(description = "用户编号", example = "3638")
private Long userId;
@Schema(description = "业务类型", example = "1")
private Integer bizType;
@Schema(description = "业务编号", example = "12164")
private String bizId;
@Schema(description = "标题", example = "增加经验")
private String title;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -11,9 +11,6 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员经验记录分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -7,9 +7,6 @@ import lombok.ToString;
import java.time.LocalDateTime;
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员经验记录 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -14,8 +14,6 @@ import javax.validation.constraints.Positive;
/**
* 会员等级 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*
* @author owen
*/
@Data
public class MemberLevelBaseVO {

View File

@ -5,10 +5,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
// TODO @疯狂项目的 vo controller 不写 author 信息哈只写 swagger 注解
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员等级创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -6,9 +6,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员等级分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -7,9 +7,6 @@ import lombok.ToString;
import java.time.LocalDateTime;
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员等级 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
// TODO @疯狂不需要继承 MemberLevelBaseVO
@Schema(description = "管理后台 - 会员等级 Response VO")
@Data
@ToString(callSuper = true)

View File

@ -7,9 +7,6 @@ import lombok.ToString;
import javax.validation.constraints.NotNull;
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员等级更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -8,8 +8,6 @@ import javax.validation.constraints.NotNull;
/**
* 会员等级记录 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*
* @author owen
*/
@Data
public class MemberLevelLogBaseVO {

View File

@ -1,46 +0,0 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo.log;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 会员等级记录 Excel VO
*
* @author owen
*/
@Data
public class MemberLevelLogExcelVO {
@ExcelProperty("编号")
private Long id;
@ExcelProperty("用户编号")
private Long userId;
@ExcelProperty("等级编号")
private Long levelId;
@ExcelProperty("会员等级")
private Integer level;
@ExcelProperty("享受折扣")
private Integer discount;
@ExcelProperty("升级经验")
private Integer experience;
@ExcelProperty("会员此时的经验")
private Integer userExperience;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("描述")
private String description;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo.log;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员等级记录 Excel 导出 Request VO参数和 MemberLevelLogPageReqVO 是一致的")
@Data
public class MemberLevelLogExportReqVO {
@Schema(description = "用户编号", example = "25923")
private Long userId;
@Schema(description = "等级编号", example = "25985")
private Long levelId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -11,9 +11,6 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员等级记录分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -7,9 +7,6 @@ import lombok.ToString;
import java.time.LocalDateTime;
/**
* @author owen
*/
@Schema(description = "管理后台 - 会员等级记录 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.member.convert.level;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogExcelVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogRespVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceLogDO;
import org.mapstruct.Mapper;
@ -25,6 +24,4 @@ public interface MemberExperienceLogConvert {
PageResult<MemberExperienceLogRespVO> convertPage(PageResult<MemberExperienceLogDO> page);
List<MemberExperienceLogExcelVO> convertList02(List<MemberExperienceLogDO> list);
}

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.member.convert.level;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogExcelVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogRespVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelLogDO;
import org.mapstruct.Mapper;
@ -25,6 +24,4 @@ public interface MemberLevelLogConvert {
PageResult<MemberLevelLogRespVO> convertPage(PageResult<MemberLevelLogDO> page);
List<MemberLevelLogExcelVO> convertList02(List<MemberLevelLogDO> list);
}

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.ip.core.Area;
import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import cn.iocoder.yudao.module.member.dal.dataobject.group.MemberGroupDO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
import com.baomidou.mybatisplus.annotation.KeySequence;
@ -121,7 +122,7 @@ public class MemberUserDO extends TenantBaseDO {
/**
* 会员级别编号
*
* 关联 {@link MemberLevelDO#getLevel()} 字段
* 关联 {@link MemberLevelDO#getId()} 字段
*/
private Long levelId;
/**
@ -130,6 +131,8 @@ public class MemberUserDO extends TenantBaseDO {
private Integer experience;
/**
* 用户分组编号
*
* 关联 {@link MemberGroupDO#getId()} 字段
*/
private Long groupId;

View File

@ -3,13 +3,10 @@ package cn.iocoder.yudao.module.member.dal.mysql.level;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogExportReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceLogDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 会员经验记录 Mapper
*
@ -28,14 +25,4 @@ public interface MemberExperienceLogMapper extends BaseMapperX<MemberExperienceL
.orderByDesc(MemberExperienceLogDO::getId));
}
default List<MemberExperienceLogDO> selectList(MemberExperienceLogExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<MemberExperienceLogDO>()
.eqIfPresent(MemberExperienceLogDO::getUserId, reqVO.getUserId())
.eqIfPresent(MemberExperienceLogDO::getBizId, reqVO.getBizId())
.eqIfPresent(MemberExperienceLogDO::getBizType, reqVO.getBizType())
.eqIfPresent(MemberExperienceLogDO::getTitle, reqVO.getTitle())
.betweenIfPresent(MemberExperienceLogDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MemberExperienceLogDO::getId));
}
}

View File

@ -3,13 +3,10 @@ package cn.iocoder.yudao.module.member.dal.mysql.level;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogExportReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelLogDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 会员等级记录 Mapper
*
@ -26,12 +23,4 @@ public interface MemberLevelLogMapper extends BaseMapperX<MemberLevelLogDO> {
.orderByDesc(MemberLevelLogDO::getId));
}
default List<MemberLevelLogDO> selectList(MemberLevelLogExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<MemberLevelLogDO>()
.eqIfPresent(MemberLevelLogDO::getUserId, reqVO.getUserId())
.eqIfPresent(MemberLevelLogDO::getLevelId, reqVO.getLevelId())
.betweenIfPresent(MemberLevelLogDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MemberLevelLogDO::getId));
}
}

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.member.service.level;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogExportReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceLogDO;
import cn.iocoder.yudao.module.member.enums.MemberExperienceBizTypeEnum;
@ -16,13 +15,6 @@ import java.util.List;
*/
public interface MemberExperienceLogService {
/**
* 删除会员经验记录
*
* @param id 编号
*/
void deleteExperienceLog(Long id);
/**
* 获得会员经验记录
*
@ -47,14 +39,6 @@ public interface MemberExperienceLogService {
*/
PageResult<MemberExperienceLogDO> getExperienceLogPage(MemberExperienceLogPageReqVO pageReqVO);
/**
* 获得会员经验记录列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 会员经验记录列表
*/
List<MemberExperienceLogDO> getExperienceLogList(MemberExperienceLogExportReqVO exportReqVO);
/**
* 创建 手动调整 经验变动记录
*

View File

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.member.service.level;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogExportReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceLogDO;
import cn.iocoder.yudao.module.member.dal.mysql.level.MemberExperienceLogMapper;
@ -14,9 +13,6 @@ import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.EXPERIENCE_LOG_NOT_EXISTS;
/**
* 会员经验记录 Service 实现类
*
@ -29,19 +25,6 @@ public class MemberExperienceLogServiceImpl implements MemberExperienceLogServic
@Resource
private MemberExperienceLogMapper experienceLogMapper;
@Override
public void deleteExperienceLog(Long id) {
// 校验存在
validateExperienceLogExists(id);
// 删除
experienceLogMapper.deleteById(id);
}
private void validateExperienceLogExists(Long id) {
if (experienceLogMapper.selectById(id) == null) {
throw exception(EXPERIENCE_LOG_NOT_EXISTS);
}
}
@Override
public MemberExperienceLogDO getExperienceLog(Long id) {
@ -58,11 +41,6 @@ public class MemberExperienceLogServiceImpl implements MemberExperienceLogServic
return experienceLogMapper.selectPage(pageReqVO);
}
@Override
public List<MemberExperienceLogDO> getExperienceLogList(MemberExperienceLogExportReqVO exportReqVO) {
return experienceLogMapper.selectList(exportReqVO);
}
@Override
public void createAdjustLog(Long userId, int experience, int totalExperience) {
// 管理员调整时, 没有业务编号, 记录对应的枚举值

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.member.service.level;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogExportReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelLogDO;
@ -48,14 +47,6 @@ public interface MemberLevelLogService {
*/
PageResult<MemberLevelLogDO> getLevelLogPage(MemberLevelLogPageReqVO pageReqVO);
/**
* 获得会员等级记录列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 会员等级记录列表
*/
List<MemberLevelLogDO> getLevelLogList(MemberLevelLogExportReqVO exportReqVO);
/**
* 创建记录 取消等级
*

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.member.service.level;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogExportReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelLogDO;
@ -58,11 +57,6 @@ public class MemberLevelLogServiceImpl implements MemberLevelLogService {
return levelLogMapper.selectPage(pageReqVO);
}
@Override
public List<MemberLevelLogDO> getLevelLogList(MemberLevelLogExportReqVO exportReqVO) {
return levelLogMapper.selectList(exportReqVO);
}
@Override
public void createCancelLog(Long userId, String reason) {
MemberLevelLogDO levelLogDO = new MemberLevelLogDO();