feat(memberCenter): 新增促销活动功能并优化会员模块
- 新增促销活动相关实体、Mapper、Service及Controller - 优化会员创建和积分充值逻辑 -移除全局跨域配置,改为在具体接口中处理跨域问题 - 重构邀请码获取和收益展示接口,提高代码可读性feature/comment
parent
468d14a3e6
commit
40bc8128eb
|
@ -2,16 +2,20 @@ package com.mcwl.web.controller.memberCenter;
|
|||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.memberCenter.domain.MemberConsume;
|
||||
import com.mcwl.memberCenter.domain.Member;
|
||||
import com.mcwl.memberCenter.domain.MemberLevel;
|
||||
import com.mcwl.memberCenter.service.MemberBenefitService;
|
||||
import com.mcwl.memberCenter.domain.dto.RechargePointsDto;
|
||||
import com.mcwl.memberCenter.domain.dto.UserMemberDto;
|
||||
import com.mcwl.memberCenter.service.MemberConsumeService;
|
||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
||||
import com.mcwl.memberCenter.service.MemberService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import com.mcwl.memberCenter.domain.vo.PointsVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -30,6 +34,7 @@ public class MemberController {
|
|||
|
||||
private final MemberBenefitService memberBenefitService;
|
||||
|
||||
private final MemberLevelService memberLevelService;
|
||||
|
||||
/**
|
||||
* 创建用户会员
|
||||
|
@ -40,40 +45,35 @@ public class MemberController {
|
|||
@PostMapping("createMember")
|
||||
public AjaxResult createMemberCenter(@RequestBody UserMemberDto userMemberDto) {
|
||||
Long userId = userMemberDto.getUserId();
|
||||
if (!Optional.ofNullable(userId).isPresent()) {
|
||||
return AjaxResult.warn("用户未登录");
|
||||
}
|
||||
Long memberLevelId = userMemberDto.getMemberLevelId();
|
||||
if (!Optional.ofNullable(memberLevelId).isPresent()) {
|
||||
return AjaxResult.warn("会员等级未选择");
|
||||
}
|
||||
String paymentMethod = userMemberDto.getPaymentMethod();
|
||||
if (!Optional.ofNullable(paymentMethod).isPresent()) {
|
||||
return AjaxResult.warn("支付方式错误,请重新支付");
|
||||
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
if (!Optional.ofNullable(sysUser).isPresent()) {
|
||||
return AjaxResult.warn("用户不存在");
|
||||
}
|
||||
|
||||
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
||||
if (!Optional.ofNullable(memberLevel).isPresent()) {
|
||||
return AjaxResult.warn("会员等级不存在");
|
||||
}
|
||||
|
||||
Member member = memberService.createUserMember(userId, memberLevelId, paymentMethod);
|
||||
if (!Optional.ofNullable(member).isPresent()) {
|
||||
return AjaxResult.warn("创建会员失败");
|
||||
}
|
||||
|
||||
return AjaxResult.success(member);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取积分余额和历史记录
|
||||
* @param userId 用户id
|
||||
* @return 积分余额和历史记录
|
||||
*/
|
||||
@GetMapping("getPoints/{id}")
|
||||
public AjaxResult getPoints(@PathVariable("id") Long userId) {
|
||||
if (!Optional.ofNullable(userId).isPresent()) {
|
||||
return AjaxResult.warn("用户未登录");
|
||||
}
|
||||
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
if (!Optional.ofNullable(sysUser).isPresent()) {
|
||||
return AjaxResult.warn("用户不存在");
|
||||
}
|
||||
@GetMapping("getPoints")
|
||||
public AjaxResult getPoints() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
Member member = memberService.getUseUserMemberByUserId(userId);
|
||||
if (!Optional.ofNullable(member).isPresent()) {
|
||||
|
@ -101,29 +101,17 @@ public class MemberController {
|
|||
@PostMapping("rechargePoints")
|
||||
public AjaxResult rechargePoints(@RequestBody RechargePointsDto rechargePointsDto) {
|
||||
Long userId = rechargePointsDto.getUserId();
|
||||
Double points = rechargePointsDto.getPoints();
|
||||
|
||||
if (userId == null) {
|
||||
return AjaxResult.warn("用户未登录");
|
||||
}
|
||||
Double amount = rechargePointsDto.getAmount();
|
||||
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
if (sysUser == null) {
|
||||
if (!Optional.ofNullable(sysUser).isPresent()) {
|
||||
return AjaxResult.warn("用户不存在");
|
||||
}
|
||||
|
||||
if (points == null) {
|
||||
return AjaxResult.warn("充值积分为空");
|
||||
}
|
||||
|
||||
if (points <= 0) {
|
||||
return AjaxResult.warn("充值积分必须大于0");
|
||||
}
|
||||
|
||||
Member member = memberService.rechargePoints(userId, points);
|
||||
Member member = memberService.rechargePoints(userId, amount * 10);
|
||||
|
||||
// 返回充值积分
|
||||
if (member == null) {
|
||||
if (!Optional.ofNullable(member).isPresent()) {
|
||||
return AjaxResult.warn("充值积分失败");
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
package com.mcwl.web.controller.memberCenter;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.memberCenter.domain.MemberPromotion;
|
||||
import com.mcwl.memberCenter.domain.Promotion;
|
||||
import com.mcwl.memberCenter.domain.dto.JoinPromotionDto;
|
||||
import com.mcwl.memberCenter.domain.dto.PromotionDto;
|
||||
import com.mcwl.memberCenter.enums.PromotionEnum;
|
||||
import com.mcwl.memberCenter.service.MemberPromotionService;
|
||||
import com.mcwl.memberCenter.service.PromotionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
/**
|
||||
* 促销活动
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("promotion")
|
||||
@RequiredArgsConstructor
|
||||
public class PromotionController {
|
||||
|
||||
private final PromotionService promotionService;
|
||||
|
||||
private final MemberPromotionService memberPromotionService;
|
||||
|
||||
|
||||
/**
|
||||
* 创建活动
|
||||
*/
|
||||
@PostMapping("createPromotion")
|
||||
public AjaxResult createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
||||
|
||||
Promotion promotion = new Promotion();
|
||||
|
||||
BeanUtil.copyProperties(promotionDto, promotion);
|
||||
|
||||
promotionService.save(promotion);
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 活动列表
|
||||
*/
|
||||
@GetMapping("promotionList")
|
||||
public AjaxResult promotionList() {
|
||||
List<Promotion> promotionList = promotionService.lambdaQuery()
|
||||
.lt(Promotion::getEndTime, new Date())
|
||||
.list();
|
||||
return AjaxResult.success(promotionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户参与的活动
|
||||
*/
|
||||
@GetMapping("myPromotionList")
|
||||
public AjaxResult myPromotionList() {
|
||||
// 获取当前用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<MemberPromotion> memberPromotionList = memberPromotionService.lambdaQuery()
|
||||
.eq(MemberPromotion::getMemberId, userId)
|
||||
.list();
|
||||
return AjaxResult.success(memberPromotionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参与活动
|
||||
*/
|
||||
@PostMapping("joinPromotion")
|
||||
public AjaxResult joinPromotion(@RequestBody @Valid JoinPromotionDto joinPromotionDto) {
|
||||
// 用户id
|
||||
Long userId = joinPromotionDto.getUserId();
|
||||
// 活动id
|
||||
Long promotionId = joinPromotionDto.getPromotionId();
|
||||
// 按活动id查询活动信息
|
||||
Promotion promotion = promotionService.getById(promotionId);
|
||||
|
||||
if (!Optional.ofNullable(promotion).isPresent()) {
|
||||
return AjaxResult.warn("活动不存在");
|
||||
}
|
||||
|
||||
if (promotion.getStartTime().after(new Date())) {
|
||||
return AjaxResult.warn("活动未开始");
|
||||
}
|
||||
|
||||
// 活动是否过期
|
||||
if (promotion.getEndTime().before(new Date())) {
|
||||
return AjaxResult.warn("活动已过期");
|
||||
}
|
||||
|
||||
String memberLevelIds = promotion.getMemberLevelId();
|
||||
if (!memberLevelIds.contains(userId.toString())) {
|
||||
return AjaxResult.warn("无法参与该活动,请查看活动条件");
|
||||
}
|
||||
MemberPromotion memberPromotion = new MemberPromotion();
|
||||
memberPromotion.setMemberId(userId);
|
||||
memberPromotion.setPromotionId(promotionId);
|
||||
memberPromotion.setStatus(PromotionEnum.EXPIRED);
|
||||
memberPromotion.setParticipationTime(new Date());
|
||||
memberPromotionService.save(memberPromotion);
|
||||
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -8,6 +8,7 @@ import com.mcwl.myInvitation.domain.dto.EarningsDisplayDto;
|
|||
import com.mcwl.myInvitation.service.InvitationService;
|
||||
import com.mcwl.myInvitation.domain.vo.EarningsDisplayVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -39,11 +40,8 @@ public class InvitationController {
|
|||
public AjaxResult getInvitationCode() {
|
||||
// 获取当前用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (userId == null) {
|
||||
return AjaxResult.warn("用户未登录");
|
||||
}
|
||||
String invitationCode = invitationService.getInvitationCode(userId);
|
||||
if (invitationCode == null) {
|
||||
if (StringUtils.isEmpty(invitationCode)) {
|
||||
return AjaxResult.warn("获取邀请码失败");
|
||||
}
|
||||
return success("操作成功", invitationCode);
|
||||
|
@ -71,9 +69,6 @@ public class InvitationController {
|
|||
@GetMapping("earningsDisplay")
|
||||
public AjaxResult earningsDisplay() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (!Optional.ofNullable(userId).isPresent()) {
|
||||
return AjaxResult.warn("用户未登录");
|
||||
}
|
||||
|
||||
EarningsDisplayVO earningsDisplayVO = new EarningsDisplayVO();
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
package com.mcwl.web.core.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
/**
|
||||
* 跨域配置
|
||||
*/
|
||||
@Configuration
|
||||
public class CorsConfig {
|
||||
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
|
||||
CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
corsConfiguration.addAllowedOrigin("*");
|
||||
corsConfiguration.addAllowedHeader("*");
|
||||
corsConfiguration.addAllowedMethod("*");
|
||||
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
|
||||
return new CorsFilter(urlBasedCorsConfigurationSource);
|
||||
}
|
||||
}
|
|
@ -59,7 +59,7 @@ public class MemberCenterTest {
|
|||
|
||||
@Test
|
||||
public void getPointsTest() {
|
||||
AjaxResult points = memberController.getPoints(1L);
|
||||
AjaxResult points = memberController.getPoints();
|
||||
System.out.println("points = " + points);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,42 @@
|
|||
package com.mcwl.memberCenter.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import com.mcwl.memberCenter.enums.PromotionEnum;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会员优惠活动关联表
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("mem_member_promotion")
|
||||
public class MemberPromotion {
|
||||
public class MemberPromotion extends BaseEntity {
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 会员ID
|
||||
*/
|
||||
private Long memberId;
|
||||
|
||||
/**
|
||||
* 优惠活动ID
|
||||
*/
|
||||
private Long promotionId;
|
||||
|
||||
/**
|
||||
* 参与时间
|
||||
*/
|
||||
private Date participationTime;
|
||||
|
||||
/**
|
||||
* 状态 “已参与”“已过期”
|
||||
*/
|
||||
private PromotionEnum status;
|
||||
|
||||
}
|
||||
|
|
|
@ -19,22 +19,39 @@ public class Promotion extends BaseEntity {
|
|||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
private String activityName;
|
||||
|
||||
/**
|
||||
* 活动开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
// 活动类型 活动类型,如“限时折扣”、“额外积分”
|
||||
/**
|
||||
* 活动类型,如“限时折扣”、“额外积分”、“活动期间内订阅或续订会员”
|
||||
*/
|
||||
private String activityType;
|
||||
|
||||
// 折扣/积分奖励 根据活动类型,这里可以是折扣率(如0.8代表8折)
|
||||
/**
|
||||
* 折扣/积分奖励 根据活动类型,这里可以是折扣率(如0.8代表8折)
|
||||
*/
|
||||
private Double activityValue;
|
||||
|
||||
// 活动的详细描述
|
||||
/**
|
||||
* 活动的详细描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
// 适用会员等级 可选字段,用于指定哪些会员等级可以享受此活动(可以用逗号分隔的会员等级ID)
|
||||
/**
|
||||
* 适用会员等级 可选字段,用于指定哪些会员等级可以享受此活动(用逗号分隔的会员等级ID)
|
||||
*/
|
||||
private String memberLevelId;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.mcwl.memberCenter.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 参与活动请求参数
|
||||
*/
|
||||
@Data
|
||||
public class JoinPromotionDto {
|
||||
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long userId;
|
||||
|
||||
@NotNull(message = "活动id不能为空")
|
||||
private Long promotionId;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.mcwl.memberCenter.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 促销活动请求参数
|
||||
*/
|
||||
@Data
|
||||
public class PromotionDto {
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
@NotBlank(message = "活动名称不能为空")
|
||||
private String activityName;
|
||||
|
||||
/**
|
||||
* 活动开始时间 校验时间格式
|
||||
*/
|
||||
@NotNull(message = "活动开始时间不能为空")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@NotNull(message = "活动结束时间不能为空")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 活动类型,如“限时折扣”、“额外积分”
|
||||
*/
|
||||
@NotBlank(message = "活动类型不能为空")
|
||||
private String activityType;
|
||||
|
||||
/**
|
||||
* 折扣/积分奖励 根据活动类型,这里可以是折扣率(如0.8代表8折)
|
||||
*/
|
||||
@NotNull(message = "折扣/积分奖励不能为空")
|
||||
@Min(value = 0, message = "折扣/积分奖励不能小于0")
|
||||
private Double activityValue;
|
||||
|
||||
/**
|
||||
* 活动的详细描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 适用会员等级 可选字段,用于指定哪些会员等级可以享受此活动(可以用逗号分隔的会员等级ID)
|
||||
*/
|
||||
private String memberLevelId;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -2,13 +2,25 @@ package com.mcwl.memberCenter.domain.dto;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 积分充值请求参数
|
||||
*/
|
||||
@Data
|
||||
public class RechargePointsDto {
|
||||
|
||||
// 用户ID
|
||||
@NotNull(message = "用户ID不能为空")
|
||||
private Long userId;
|
||||
|
||||
// 充值积分
|
||||
@NotNull(message = "充值积分不能为空")
|
||||
@Min(value = 5, message = "充值积分不能小于5")
|
||||
private Double amount;
|
||||
|
||||
// 剩余积分
|
||||
private Double points;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,16 +2,25 @@ package com.mcwl.memberCenter.domain.dto;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 创建会员请求参数
|
||||
*/
|
||||
@Data
|
||||
public class UserMemberDto {
|
||||
|
||||
// 用户ID
|
||||
@NotNull(message = "用户ID不能为空")
|
||||
private Long userId;
|
||||
|
||||
// 会员ID
|
||||
// 会员等级ID
|
||||
@NotNull(message = "会员等级ID不能为空")
|
||||
private Long memberLevelId;
|
||||
|
||||
// 支付方式
|
||||
@NotBlank(message = "支付方式不能为空")
|
||||
private String paymentMethod;
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,9 @@ import lombok.Data;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员权益VO
|
||||
*/
|
||||
@Data
|
||||
public class MemberBenefitVO {
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package com.mcwl.memberCenter.enums;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 会员参与活动状态
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PromotionEnum {
|
||||
/**
|
||||
* 参与
|
||||
*/
|
||||
PARTICIPATE("participate", "参与"),
|
||||
/**
|
||||
* 过期
|
||||
*/
|
||||
EXPIRED("expired", "过期");
|
||||
|
||||
private final String name;
|
||||
@EnumValue
|
||||
private final String value;
|
||||
|
||||
}
|
|
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.mcwl.memberCenter.domain.MemberBenefit;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 会员权益 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberBenefitMapper extends BaseMapper<MemberBenefit> {
|
||||
}
|
||||
|
|
|
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.mcwl.memberCenter.domain.MemberConsume;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 会员消费记录 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberConsumeMapper extends BaseMapper<MemberConsume> {
|
||||
}
|
||||
|
|
|
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.mcwl.memberCenter.domain.MemberLevel;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 会员等级表 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberLevelMapper extends BaseMapper<MemberLevel> {
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.mcwl.memberCenter.domain.Member;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 会员 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberMapper extends BaseMapper<Member> {
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.mcwl.memberCenter.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.memberCenter.domain.MemberBenefit;
|
||||
import com.mcwl.memberCenter.domain.MemberPromotion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 会员优惠活动关联 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberPromotionMapper extends BaseMapper<MemberPromotion> {
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.mcwl.memberCenter.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.memberCenter.domain.MemberPromotion;
|
||||
import com.mcwl.memberCenter.domain.Promotion;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 促销活动 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface PromotionMapper extends BaseMapper<Promotion> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.mcwl.memberCenter.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.memberCenter.domain.Member;
|
||||
import com.mcwl.memberCenter.domain.MemberPromotion;
|
||||
|
||||
public interface MemberPromotionService extends IService<MemberPromotion> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.mcwl.memberCenter.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.memberCenter.domain.MemberPromotion;
|
||||
import com.mcwl.memberCenter.domain.Promotion;
|
||||
|
||||
public interface PromotionService extends IService<Promotion> {
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.mcwl.memberCenter.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.memberCenter.domain.Member;
|
||||
import com.mcwl.memberCenter.domain.MemberBenefit;
|
||||
import com.mcwl.memberCenter.domain.MemberLevel;
|
||||
import com.mcwl.memberCenter.domain.MemberPromotion;
|
||||
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||
import com.mcwl.memberCenter.enums.MemberEnum;
|
||||
import com.mcwl.memberCenter.enums.MemberPeriodicEnum;
|
||||
import com.mcwl.memberCenter.mapper.MemberMapper;
|
||||
import com.mcwl.memberCenter.mapper.MemberPromotionMapper;
|
||||
import com.mcwl.memberCenter.service.MemberBenefitService;
|
||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
||||
import com.mcwl.memberCenter.service.MemberPromotionService;
|
||||
import com.mcwl.memberCenter.service.MemberService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MemberPromotionServiceImpl extends ServiceImpl<MemberPromotionMapper, MemberPromotion> implements MemberPromotionService {
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.mcwl.memberCenter.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.memberCenter.domain.MemberPromotion;
|
||||
import com.mcwl.memberCenter.domain.Promotion;
|
||||
import com.mcwl.memberCenter.mapper.MemberPromotionMapper;
|
||||
import com.mcwl.memberCenter.mapper.PromotionMapper;
|
||||
import com.mcwl.memberCenter.service.MemberPromotionService;
|
||||
import com.mcwl.memberCenter.service.PromotionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PromotionServiceImpl extends ServiceImpl<PromotionMapper, Promotion> implements PromotionService {
|
||||
|
||||
}
|
Loading…
Reference in New Issue