Compare commits
	
		
			4 Commits
		
	
	
		
			87db775c31
			...
			9629957e59
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 9629957e59 | ||
|   | 05780dd983 | ||
|   | c65ea8d58f | ||
|   | 21203a73ac | 
| @ -53,4 +53,6 @@ public class BaseConstants { | ||||
|     public static final String PROPERTY_EXPIRED = "property_expired"; | ||||
|     /** 档案分类字典 */ | ||||
|     public static final String ARCHIVES_TYPE = "archives_type"; | ||||
|     /**卡片关联关系主表*/ | ||||
|     public static final String ACTIVE_RULE_COUPON_ACTIVE = "dl_active_main"; | ||||
| } | ||||
|  | ||||
| @ -0,0 +1,118 @@ | ||||
| package cn.iocoder.yudao.module.member.controller.admin; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveMain; | ||||
| import cn.iocoder.yudao.module.member.service.ActiveMainService; | ||||
| import cn.iocoder.yudao.module.member.vo.ActiveMainPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.ActiveMainRespVO; | ||||
| import cn.iocoder.yudao.module.member.vo.ActiveMainSaveReqVO; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| 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 javax.annotation.Resource; | ||||
| import javax.validation.Valid; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Tag(name = "管理后台 - 营销活动") | ||||
| @RestController | ||||
| @RequestMapping("/member/active-main") | ||||
| @Validated | ||||
| public class ActiveMainController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private ActiveMainService activeMainService; | ||||
| 
 | ||||
|     /** | ||||
|      * 创建营销活动 | ||||
|      * | ||||
|      * @param createReqVO ActiveMainSaveReqVO实体 | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.String> | ||||
|      * @author PQZ | ||||
|      * @date 14:12 2024/9/19 | ||||
|      **/ | ||||
|     @PostMapping("/create") | ||||
|     @Operation(summary = "创建营销活动") | ||||
|     @PreAuthorize("@ss.hasPermission('member:active-main:create')") | ||||
|     public CommonResult<Boolean> createActiveMain(@Valid @RequestBody ActiveMainSaveReqVO createReqVO) { | ||||
|         activeMainService.saveActiveMain(createReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 更新营销活动 | ||||
|      * | ||||
|      * @param updateReqVO ActiveMainSaveReqVO实体 | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean> | ||||
|      * @author PQZ | ||||
|      * @date 14:12 2024/9/19 | ||||
|      **/ | ||||
|     @PutMapping("/update") | ||||
|     @Operation(summary = "更新营销活动") | ||||
|     @PreAuthorize("@ss.hasPermission('member:active-main:update')") | ||||
|     public CommonResult<Boolean> updateActiveMain(@Valid @RequestBody ActiveMainSaveReqVO updateReqVO) { | ||||
|         activeMainService.saveActiveMain(updateReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 删除营销活动 | ||||
|      * | ||||
|      * @param id 营销活动id | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean> | ||||
|      * @author PQZ | ||||
|      * @date 14:12 2024/9/19 | ||||
|      **/ | ||||
|     @DeleteMapping("/delete") | ||||
|     @Operation(summary = "删除营销活动") | ||||
|     @Parameter(name = "id", description = "编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('member:active-main:delete')") | ||||
|     public CommonResult<Boolean> deleteActiveMain(@RequestParam("id") String id) { | ||||
|         activeMainService.deleteActiveMain(id); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 通过营销活动id获取营销活动 | ||||
|      * | ||||
|      * @param id 营销活动id | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.member.vo.ActiveMainRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 14:13 2024/9/19 | ||||
|      **/ | ||||
|     @GetMapping("/get") | ||||
|     @Operation(summary = "获得营销活动") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('member:active-main:query')") | ||||
|     public CommonResult<ActiveMainRespVO> getActiveMain(@RequestParam("id") String id) { | ||||
|         ActiveMain activeMain = activeMainService.getActiveMain(id); | ||||
|         return success(BeanUtils.toBean(activeMain, ActiveMainRespVO.class)); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询营销活动 | ||||
|      * | ||||
|      * @param pageReqVO ActiveMainPageReqVO | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.framework.common.pojo.PageResult < cn.iocoder.yudao.module.member.vo.ActiveMainRespVO>> | ||||
|      * @author PQZ | ||||
|      * @date 14:13 2024/9/19 | ||||
|      **/ | ||||
|     @GetMapping("/page") | ||||
|     @Operation(summary = "获得营销活动分页") | ||||
|     @PreAuthorize("@ss.hasPermission('member:active-main:query')") | ||||
|     public CommonResult<IPage<?>> getActiveMainPage(ActiveMainPageReqVO pageReqVO, | ||||
|                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||||
|                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | ||||
|         Page<ActiveMainRespVO> page = new Page<>(pageNo, pageSize); | ||||
|         return success(activeMainService.queryListPage(pageReqVO, page)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| package cn.iocoder.yudao.module.member.controller.admin; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| @Tag(name = "管理后台 - 营销活动规则") | ||||
| @RestController | ||||
| @RequestMapping("/member/active-rule") | ||||
| @Validated | ||||
| public class ActiveRuleController { | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| package cn.iocoder.yudao.module.member.controller.admin; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| @Tag(name = "管理后台 - 营销活动、规则及会员等级与基础卡券关联关系") | ||||
| @RestController | ||||
| @RequestMapping("/member/active-rule-coupon") | ||||
| @Validated | ||||
| public class ActiveRuleCouponController { | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,142 @@ | ||||
| package cn.iocoder.yudao.module.member.controller.admin; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import cn.iocoder.yudao.module.member.service.MemberCouponService; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberCouponPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberCouponRespVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberCouponSaveReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelRespVO; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| 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 javax.annotation.Resource; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| import javax.validation.Valid; | ||||
| import java.io.IOException; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Tag(name = "管理后台 - 基础卡券") | ||||
| @RestController | ||||
| @RequestMapping("/member/coupon") | ||||
| @Validated | ||||
| public class MemberCouponController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private MemberCouponService couponService; | ||||
| 
 | ||||
|     /** | ||||
|      * 创建基础卡券 | ||||
|      * | ||||
|      * @param createReqVO MemberCouponSaveReqVO | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.String> | ||||
|      * @author PQZ | ||||
|      * @date 14:19 2024/9/19 | ||||
|      **/ | ||||
|     @PostMapping("/create") | ||||
|     @Operation(summary = "创建基础卡券") | ||||
|     @PreAuthorize("@ss.hasPermission('member:coupon:create')") | ||||
|     public CommonResult<Boolean> createCoupon(@Valid @RequestBody MemberCouponSaveReqVO saveReqVO) { | ||||
|         couponService.saveCoupon(saveReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 更新基础卡券 | ||||
|      * | ||||
|      * @param updateReqVO MemberCouponSaveReqVO | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean> | ||||
|      * @author PQZ | ||||
|      * @date 14:19 2024/9/19 | ||||
|      **/ | ||||
|     @PutMapping("/update") | ||||
|     @Operation(summary = "更新基础卡券") | ||||
|     @PreAuthorize("@ss.hasPermission('member:coupon:update')") | ||||
|     public CommonResult<Boolean> updateCoupon(@Valid @RequestBody MemberCouponSaveReqVO saveReqVO) { | ||||
|         couponService.saveCoupon(saveReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 复制附属权益 | ||||
|      * | ||||
|      * @param saveReqVO MemberCouponSaveReqVO实体 | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean> | ||||
|      * @author PQZ | ||||
|      * @date 21:34 2024/9/19 | ||||
|      **/ | ||||
|     @PostMapping("/copy") | ||||
|     @Operation(summary = "复制附属权益") | ||||
|     @PreAuthorize("@ss.hasPermission('member:coupon:update')") | ||||
|     public CommonResult<Boolean> copyCoupon(@Valid @RequestBody MemberCouponSaveReqVO saveReqVO) { | ||||
|         couponService.copyMemberCoupon(saveReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 删除基础卡券 | ||||
|      * | ||||
|      * @param id 基础卡券id | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean> | ||||
|      * @author PQZ | ||||
|      * @date 14:19 2024/9/19 | ||||
|      **/ | ||||
|     @DeleteMapping("/delete") | ||||
|     @Operation(summary = "删除基础卡券") | ||||
|     @Parameter(name = "id", description = "编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('member:coupon:delete')") | ||||
|     public CommonResult<Boolean> deleteCoupon(@RequestParam("id") String id) { | ||||
|         couponService.deleteCoupon(id); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 通过id获取基础卡券 | ||||
|      * | ||||
|      * @param id 卡券id | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.member.vo.MemberCouponRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 14:20 2024/9/19 | ||||
|      **/ | ||||
|     @GetMapping("/get") | ||||
|     @Operation(summary = "获得基础卡券") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('member:coupon:query')") | ||||
|     public CommonResult<MemberCouponRespVO> getCoupon(@RequestParam("id") String id) { | ||||
|         return success(couponService.getCoupon(id)); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询基础卡券信息 | ||||
|      * | ||||
|      * @param pageReqVO MemberCouponPageReqVO实体 | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.framework.common.pojo.PageResult < cn.iocoder.yudao.module.member.vo.MemberCouponRespVO>> | ||||
|      * @author PQZ | ||||
|      * @date 14:20 2024/9/19 | ||||
|      **/ | ||||
|     @GetMapping("/page") | ||||
|     @Operation(summary = "获得基础卡券分页") | ||||
|     @PreAuthorize("@ss.hasPermission('member:coupon:query')") | ||||
|     public CommonResult<IPage<?>> getCouponPage(@Valid MemberCouponPageReqVO pageReqVO, | ||||
|                                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||||
|                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | ||||
|         Page<MemberCouponRespVO> page = new Page<>(pageNo, pageSize); | ||||
|         return success(couponService.queryListPage(pageReqVO, page)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,119 @@ | ||||
| package cn.iocoder.yudao.module.member.controller.admin; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberLevel; | ||||
| import cn.iocoder.yudao.module.member.service.MemberLevelService; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelRespVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelSaveReqVO; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| 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 javax.annotation.Resource; | ||||
| import javax.validation.Valid; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| 
 | ||||
| @Tag(name = "管理后台 - 会员等级") | ||||
| @RestController | ||||
| @RequestMapping("/member/level") | ||||
| @Validated | ||||
| public class MemberLevelController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private MemberLevelService levelService; | ||||
| 
 | ||||
|     /** | ||||
|      * 创建会员等级 | ||||
|      * | ||||
|      * @param createReqVO MemberLevelSaveReqVO实体 | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.String> | ||||
|      * @author PQZ | ||||
|      * @date 13:37 2024/9/19 | ||||
|      **/ | ||||
|     @PostMapping("/create") | ||||
|     @Operation(summary = "创建会员等级") | ||||
|     @PreAuthorize("@ss.hasPermission('member:level:create')") | ||||
|     public CommonResult<Boolean> createLevel(@Valid @RequestBody MemberLevelSaveReqVO createReqVO) { | ||||
|         levelService.saveLevel(createReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 更新会员等级 | ||||
|      * | ||||
|      * @param updateReqVO MemberLevelSaveReqVO实体 | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean> | ||||
|      * @author PQZ | ||||
|      * @date 13:37 2024/9/19 | ||||
|      **/ | ||||
|     @PutMapping("/update") | ||||
|     @Operation(summary = "更新会员等级") | ||||
|     @PreAuthorize("@ss.hasPermission('member:level:update')") | ||||
|     public CommonResult<Boolean> updateLevel(@Valid @RequestBody MemberLevelSaveReqVO updateReqVO) { | ||||
|         levelService.saveLevel(updateReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 删除会员等级 | ||||
|      * | ||||
|      * @param id 会员等级id | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean> | ||||
|      * @author PQZ | ||||
|      * @date 13:38 2024/9/19 | ||||
|      **/ | ||||
|     @DeleteMapping("/delete") | ||||
|     @Operation(summary = "删除会员等级") | ||||
|     @Parameter(name = "id", description = "编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('member:level:delete')") | ||||
|     public CommonResult<Boolean> deleteLevel(@RequestParam("id") String id) { | ||||
|         levelService.deleteLevel(id); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 获取会员等级 | ||||
|      * | ||||
|      * @param id 会员等级id | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.member.vo.MemberLevelRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 13:38 2024/9/19 | ||||
|      **/ | ||||
|     @GetMapping("/get") | ||||
|     @Operation(summary = "获得会员等级") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('member:level:query')") | ||||
|     public CommonResult<MemberLevelRespVO> getLevel(@RequestParam("id") String id) { | ||||
|         MemberLevel level = levelService.getLevel(id); | ||||
|         return success(BeanUtils.toBean(level, MemberLevelRespVO.class)); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 分页获取会员等级 | ||||
|      * | ||||
|      * @param pageReqVO MemberLevelPageReqVO实体 | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.framework.common.pojo.PageResult < cn.iocoder.yudao.module.member.vo.MemberLevelRespVO>> | ||||
|      * @author PQZ | ||||
|      * @date 13:38 2024/9/19 | ||||
|      **/ | ||||
|     @GetMapping("/page") | ||||
|     @Operation(summary = "获得会员等级分页") | ||||
|     @PreAuthorize("@ss.hasPermission('member:level:query')") | ||||
|     public CommonResult<IPage<?>> getLevelPage(MemberLevelPageReqVO pageReqVO, | ||||
|                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||||
|                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | ||||
|         Page<MemberLevelRespVO> page = new Page<>(pageNo, pageSize); | ||||
|         return success(levelService.queryListPage(pageReqVO,page)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,65 @@ | ||||
| package cn.iocoder.yudao.module.member.entity; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import com.baomidou.mybatisplus.annotation.*; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动 DO | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @TableName("dl_active_main") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class ActiveMain extends TenantBaseDO { | ||||
| 
 | ||||
|     /** | ||||
|      * 主键标识 | ||||
|      */ | ||||
|     @TableId(type = IdType.ASSIGN_UUID) | ||||
|     private String id; | ||||
|     /** | ||||
|      * 活动名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 活动类型(充值有礼;注册有礼;开卡有礼) | ||||
|      */ | ||||
|     private String type; | ||||
|     /** | ||||
|      * 活动开始时间 | ||||
|      */ | ||||
|     private LocalDateTime beginTime; | ||||
|     /** | ||||
|      * 活动结束时间 | ||||
|      */ | ||||
|     private LocalDateTime endTime; | ||||
|     /** | ||||
|      * 活动状态 | ||||
|      */ | ||||
|     private String status; | ||||
|     /** | ||||
|      * 活动描述 | ||||
|      */ | ||||
|     private String remark; | ||||
|     /** | ||||
|      * 是否有充值规则 | ||||
|      */ | ||||
|     private String isRechRule; | ||||
|     /**优惠券是否打包(打包则参加活动关联优惠券全部赠与,非打包则选择赠与)*/ | ||||
|     private String isPack; | ||||
|     /**是否关联卡券*/ | ||||
|     private String isCoupon; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,52 @@ | ||||
| package cn.iocoder.yudao.module.member.entity; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import com.baomidou.mybatisplus.annotation.*; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动规则 DO | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @TableName("dl_active_rule") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class ActiveRule extends TenantBaseDO { | ||||
| 
 | ||||
|     /** | ||||
|      * 主键标识 | ||||
|      */ | ||||
|     @TableId(type = IdType.ASSIGN_UUID) | ||||
|     private String id; | ||||
|     /** | ||||
|      * 活动id | ||||
|      */ | ||||
|     private String activeId; | ||||
|     /** | ||||
|      * 规则名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 会员等级 | ||||
|      */ | ||||
|     private String memberLevel; | ||||
|     /** | ||||
|      * 充值金额 | ||||
|      */ | ||||
|     private BigDecimal rechAmount; | ||||
|     /** | ||||
|      * 赠送金额 | ||||
|      */ | ||||
|     private String giveAmount; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,43 @@ | ||||
| package cn.iocoder.yudao.module.member.entity; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import com.baomidou.mybatisplus.annotation.*; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动、规则及会员等级与基础卡券关联关系 DO | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @TableName("dl_active_rule_coupon") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class ActiveRuleCoupon extends TenantBaseDO { | ||||
| 
 | ||||
|     /** | ||||
|      * 主键标识 | ||||
|      */ | ||||
|     @TableId(type = IdType.ASSIGN_UUID) | ||||
|     private String id; | ||||
|     /** | ||||
|      * 基础卡券表id | ||||
|      */ | ||||
|     private String couponId; | ||||
|     /** | ||||
|      * 营销活动、规则、会员等级表id | ||||
|      */ | ||||
|     private String mainId; | ||||
|     /** | ||||
|      * 主表名称 | ||||
|      */ | ||||
|     private String mainTable; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,76 @@ | ||||
| package cn.iocoder.yudao.module.member.entity; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.LocalDateTime; | ||||
| import com.baomidou.mybatisplus.annotation.*; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| 
 | ||||
| /** | ||||
|  * 基础卡券 DO | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @TableName("dl_member_coupon") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class MemberCoupon extends TenantBaseDO { | ||||
|     /** | ||||
|      * 主键标识 | ||||
|      */ | ||||
|     @TableId(type = IdType.ASSIGN_UUID) | ||||
|     private String id; | ||||
|     /** | ||||
|      * 卡券名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 卡券类型(保养卡、服务券、礼包券) | ||||
|      */ | ||||
|     private String type; | ||||
|     /** | ||||
|      * 适用车型(数据字典) | ||||
|      */ | ||||
|     private String carModel; | ||||
|     /** | ||||
|      * 开始有效期 | ||||
|      */ | ||||
|     private LocalDateTime beginTime; | ||||
|     /** | ||||
|      * 结束有效期 | ||||
|      */ | ||||
|     private LocalDateTime endTime; | ||||
|     /** | ||||
|      * 适用子公司 | ||||
|      */ | ||||
|     private String corpIds; | ||||
|     /** | ||||
|      * 面额 | ||||
|      */ | ||||
|     private BigDecimal amount; | ||||
|     /**单价*/ | ||||
|     private BigDecimal unitPrice; | ||||
|     /**附属权益id*/ | ||||
|     private String parentId; | ||||
|     /** | ||||
|      * 效果图片 | ||||
|      */ | ||||
|     private String image; | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|     /** | ||||
|      * 核销规则(记次核销、面额核销、一次性核销) | ||||
|      */ | ||||
|     private String outRule; | ||||
| } | ||||
| @ -0,0 +1,57 @@ | ||||
| package cn.iocoder.yudao.module.member.entity; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; | ||||
| import com.baomidou.mybatisplus.annotation.IdType; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
| 
 | ||||
| import java.math.BigDecimal; | ||||
| 
 | ||||
| /** | ||||
|  * 会员等级 DO | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @TableName("dl_member_level") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class MemberLevel extends TenantBaseDO { | ||||
| 
 | ||||
|     /** | ||||
|      * 主键标识 | ||||
|      */ | ||||
|     @TableId(type = IdType.ASSIGN_UUID) | ||||
|     private String id; | ||||
|     /** | ||||
|      * 等级排序 | ||||
|      */ | ||||
|     private String sort; | ||||
|     /** | ||||
|      * 等级名称 | ||||
|      */ | ||||
|     private String name; | ||||
|     /** | ||||
|      * 状态(01启用,02禁用) | ||||
|      */ | ||||
|     private String status; | ||||
|     /** | ||||
|      * 升级所需积分 | ||||
|      */ | ||||
|     private String growthValue; | ||||
|     /**会员折扣*/ | ||||
|     private BigDecimal discount; | ||||
|     /** | ||||
|      * 等级说明 | ||||
|      */ | ||||
|     private String remark; | ||||
|     /** | ||||
|      * 等级权益 | ||||
|      */ | ||||
|     private String userEquity; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,32 @@ | ||||
| package cn.iocoder.yudao.module.member.mapper; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveMain; | ||||
| import cn.iocoder.yudao.module.member.vo.ActiveMainPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.ActiveMainRespVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelRespVO; | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动 Mapper | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Mapper | ||||
| public interface ActiveMainMapper extends BaseMapper<ActiveMain> { | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询活动规则 | ||||
|      * | ||||
|      * @param entity ActiveMainPageReqVO实体 | ||||
|      * @param page   分页参数 | ||||
|      * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.member.vo.ActiveMainRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 14:10 2024/9/19 | ||||
|      **/ | ||||
|     IPage<ActiveMainRespVO> selectListPage(@Param("entity") ActiveMainPageReqVO entity, Page<ActiveMainRespVO> page); | ||||
| } | ||||
| @ -0,0 +1,17 @@ | ||||
| package cn.iocoder.yudao.module.member.mapper; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveRuleCoupon; | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动、规则及会员等级与基础卡券关联关系 Mapper | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Mapper | ||||
| public interface ActiveRuleCouponMapper extends BaseMapper<ActiveRuleCoupon> { | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,16 @@ | ||||
| package cn.iocoder.yudao.module.member.mapper; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveRule; | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动规则 Mapper | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Mapper | ||||
| public interface ActiveRuleMapper extends BaseMapper<ActiveRule> { | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,32 @@ | ||||
| package cn.iocoder.yudao.module.member.mapper; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberCouponPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberCouponRespVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelRespVO; | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| /** | ||||
|  * 基础卡券 Mapper | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Mapper | ||||
| public interface MemberCouponMapper extends BaseMapper<MemberCoupon> { | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询基础卡券信息 | ||||
|      * | ||||
|      * @param entity MemberCouponPageReqVO实体 | ||||
|      * @param page   分页参数 | ||||
|      * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.member.vo.MemberCouponRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 14:06 2024/9/19 | ||||
|      **/ | ||||
|     IPage<MemberCouponRespVO> selectListPage(@Param("entity") MemberCouponPageReqVO entity, Page<MemberCouponRespVO> page); | ||||
| } | ||||
| @ -0,0 +1,34 @@ | ||||
| package cn.iocoder.yudao.module.member.mapper; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.company.entity.Company; | ||||
| import cn.iocoder.yudao.module.company.vo.CompanyReqVO; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberLevel; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelRespVO; | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| /** | ||||
|  * 会员等级 Mapper | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Mapper | ||||
| public interface MemberLevelMapper extends BaseMapper<MemberLevel> { | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询会员 | ||||
|      * | ||||
|      * @param entity MemberLevelPageReqVO实体 | ||||
|      * @param page   分页参数 | ||||
|      * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.member.vo.MemberLevelRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 13:48 2024/9/19 | ||||
|      **/ | ||||
|     IPage<MemberLevelRespVO> selectListPage(@Param("entity") MemberLevelPageReqVO entity, Page<MemberLevelRespVO> page); | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,56 @@ | ||||
| package cn.iocoder.yudao.module.member.service; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveMain; | ||||
| import cn.iocoder.yudao.module.member.vo.*; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| 
 | ||||
| import javax.validation.Valid; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动 Service 接口 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| public interface ActiveMainService extends IService<ActiveMain> { | ||||
| 
 | ||||
|     /** | ||||
|      * 保存营销活动 | ||||
|      * | ||||
|      * @param saveReqVO ActiveMainSaveReqVO | ||||
|      * @author PQZ | ||||
|      * @date 14:14 2024/9/19 | ||||
|      **/ | ||||
|     void saveActiveMain(ActiveMainSaveReqVO saveReqVO); | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 删除营销活动 | ||||
|      * | ||||
|      * @param id 编号 | ||||
|      */ | ||||
|     void deleteActiveMain(String id); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据营销活动获取详情 | ||||
|      * @author PQZ | ||||
|      * @date 18:23 2024/9/19 | ||||
|      * @param id 营销活动id | ||||
|      * @return cn.iocoder.yudao.module.member.vo.ActiveMainRespVO | ||||
|     **/ | ||||
|     ActiveMainRespVO getActiveMain(String id); | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询营销活动 | ||||
|      * | ||||
|      * @param pageReqVO ActiveMainPageReqVO实体 | ||||
|      * @param page      分页参数 | ||||
|      * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.member.vo.ActiveMainRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 14:17 2024/9/19 | ||||
|      **/ | ||||
|     IPage<ActiveMainRespVO> queryListPage(ActiveMainPageReqVO pageReqVO, Page<ActiveMainRespVO> page); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,46 @@ | ||||
| package cn.iocoder.yudao.module.member.service; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveRuleCoupon; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动、规则及会员等级与基础卡券关联关系 Service 接口 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| public interface ActiveRuleCouponService extends IService<ActiveRuleCoupon> { | ||||
| 
 | ||||
|     /** | ||||
|      * 根据主表id删除关联关系 | ||||
|      * | ||||
|      * @param id 主表id | ||||
|      * @author PQZ | ||||
|      * @date 17:56 2024/9/19 | ||||
|      **/ | ||||
|     void deleteByMainId(String id); | ||||
| 
 | ||||
|     /** | ||||
|      * 保存关联关系 | ||||
|      * | ||||
|      * @param list      卡券id集合 | ||||
|      * @param mainId    主表id | ||||
|      * @param mainTable 主表名称 | ||||
|      * @author PQZ | ||||
|      * @date 17:57 2024/9/19 | ||||
|      **/ | ||||
|     void saveActiveRuleCoupon(List<MemberCoupon> list, String mainId, String mainTable); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据主表id查询关联关系 | ||||
|      * | ||||
|      * @param id 主表id | ||||
|      * @return java.util.List<cn.iocoder.yudao.module.member.entity.ActiveRuleCoupon> | ||||
|      * @author PQZ | ||||
|      * @date 17:59 2024/9/19 | ||||
|      **/ | ||||
|     List<MemberCoupon> queryByMainId(String id); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,42 @@ | ||||
| package cn.iocoder.yudao.module.member.service; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveRule; | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动规则 Service 接口 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| public interface ActiveRuleService extends IService<ActiveRule> { | ||||
| 
 | ||||
|     /** | ||||
|      * 保存活动规则 | ||||
|      * | ||||
|      * @param list     活动规则集合 | ||||
|      * @param activeId 活动id | ||||
|      * @author PQZ | ||||
|      * @date 18:15 2024/9/19 | ||||
|      **/ | ||||
|     void saveActiveRule(List<ActiveRule> list, String activeId); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据活动id删除活动规则 | ||||
|      * @author PQZ | ||||
|      * @date 18:16 2024/9/19 | ||||
|      * @param activeId 活动id | ||||
|     **/ | ||||
|     void deleteByActiveId(String activeId); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据活动id查询活动规则 | ||||
|      * @author PQZ | ||||
|      * @date 18:17 2024/9/19 | ||||
|      * @param activeId 活动id | ||||
|      * @return java.util.List<cn.iocoder.yudao.module.member.entity.ActiveRule> | ||||
|     **/ | ||||
|     List<ActiveRule> listByActiveId(String activeId); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,65 @@ | ||||
| package cn.iocoder.yudao.module.member.service; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import cn.iocoder.yudao.module.member.vo.*; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| 
 | ||||
| import javax.validation.Valid; | ||||
| 
 | ||||
| /** | ||||
|  * 基础卡券 Service 接口 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| public interface MemberCouponService extends IService<MemberCoupon> { | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 保存基础卡券信息 | ||||
|      * | ||||
|      * @param saveReqVO TODO | ||||
|      * @return void | ||||
|      * @author PQZ | ||||
|      * @date 14:22 2024/9/19 | ||||
|      **/ | ||||
|     void saveCoupon(@Valid MemberCouponSaveReqVO saveReqVO); | ||||
| 
 | ||||
|     /** | ||||
|      * 删除基础卡券 | ||||
|      * | ||||
|      * @param id 编号 | ||||
|      */ | ||||
|     void deleteCoupon(String id); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询基础卡券及附属信息 | ||||
|      * @author PQZ | ||||
|      * @date 21:55 2024/9/19 | ||||
|      * @param id 卡券id | ||||
|      * @return cn.iocoder.yudao.module.member.vo.MemberCouponRespVO | ||||
|     **/ | ||||
|     MemberCouponRespVO getCoupon(String id); | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询基础卡券信息 | ||||
|      * | ||||
|      * @param pageReqVO MemberCouponPageReqVO实体 | ||||
|      * @param page      分页参数 | ||||
|      * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.member.vo.MemberCouponRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 14:22 2024/9/19 | ||||
|      **/ | ||||
|     IPage<MemberCouponRespVO> queryListPage(MemberCouponPageReqVO pageReqVO, Page<MemberCouponRespVO> page); | ||||
| 
 | ||||
|     /** | ||||
|      * 复制卡券附属权益 | ||||
|      * @author PQZ | ||||
|      * @date 21:25 2024/9/19 | ||||
|      * @param saveReqVO MemberCouponSaveReqVO | ||||
|     **/ | ||||
|     void copyMemberCoupon(MemberCouponSaveReqVO saveReqVO); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,57 @@ | ||||
| package cn.iocoder.yudao.module.member.service; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.MemberLevel; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelRespVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelSaveReqVO; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| 
 | ||||
| /** | ||||
|  * 会员等级 Service 接口 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| public interface MemberLevelService extends IService<MemberLevel> { | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 保存会员等级 | ||||
|      * | ||||
|      * @param saveReqVO MemberLevelSaveReqVO | ||||
|      * @author PQZ | ||||
|      * @date 13:39 2024/9/19 | ||||
|      **/ | ||||
|     void saveLevel(MemberLevelSaveReqVO saveReqVO); | ||||
| 
 | ||||
|     /** | ||||
|      * 删除会员等级 | ||||
|      * | ||||
|      * @param id 会员等级id | ||||
|      * @author PQZ | ||||
|      * @date 13:41 2024/9/19 | ||||
|      **/ | ||||
|     void deleteLevel(String id); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据会员等级id查询会员等级信息 | ||||
|      * | ||||
|      * @param id 会员等级id | ||||
|      * @return cn.iocoder.yudao.module.member.entity.MemberLevel | ||||
|      * @author PQZ | ||||
|      * @date 13:41 2024/9/19 | ||||
|      **/ | ||||
|     MemberLevel getLevel(String id); | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询会员等级 | ||||
|      * | ||||
|      * @param pageReqVO MemberLevelPageReqVO实体 | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.PageResult<cn.iocoder.yudao.module.member.entity.MemberLevel> | ||||
|      * @author PQZ | ||||
|      * @date 13:42 2024/9/19 | ||||
|      **/ | ||||
|     IPage<MemberLevelRespVO> queryListPage(MemberLevelPageReqVO pageReqVO, Page<MemberLevelRespVO> page); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,112 @@ | ||||
| package cn.iocoder.yudao.module.member.service.impl; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveMain; | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveRule; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import cn.iocoder.yudao.module.member.mapper.ActiveMainMapper; | ||||
| import cn.iocoder.yudao.module.member.service.ActiveMainService; | ||||
| import cn.iocoder.yudao.module.member.service.ActiveRuleCouponService; | ||||
| import cn.iocoder.yudao.module.member.service.ActiveRuleService; | ||||
| import cn.iocoder.yudao.module.member.vo.ActiveMainPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.ActiveMainRespVO; | ||||
| import cn.iocoder.yudao.module.member.vo.ActiveMainSaveReqVO; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.common.BaseConstants.ACTIVE_RULE_COUPON_ACTIVE; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动 Service 实现类 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Service | ||||
| @Validated | ||||
| public class ActiveMainServiceImpl extends ServiceImpl<ActiveMainMapper, ActiveMain> implements ActiveMainService { | ||||
| 
 | ||||
|     @Resource | ||||
|     private ActiveMainMapper activeMainMapper; | ||||
|     @Resource | ||||
|     private ActiveRuleService ruleService; | ||||
|     @Resource | ||||
|     private ActiveRuleCouponService activeRuleCouponService; | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 保存营销活动 | ||||
|      * | ||||
|      * @param saveReqVO ActiveMainSaveReqVO | ||||
|      * @author PQZ | ||||
|      * @date 14:14 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public void saveActiveMain(ActiveMainSaveReqVO saveReqVO) { | ||||
|         //保存活动 | ||||
|         ActiveMain activeMain = BeanUtils.toBean(saveReqVO, ActiveMain.class); | ||||
|         saveOrUpdate(activeMain); | ||||
|         //保存规则 | ||||
|         if (!saveReqVO.getRuleList().isEmpty()){ | ||||
|             ruleService.saveActiveRule(saveReqVO.getRuleList(),activeMain.getId()); | ||||
|         } | ||||
|         //保存卡券关联关系 | ||||
|         activeRuleCouponService.saveActiveRuleCoupon(saveReqVO.getCouponList(),activeMain.getId(),ACTIVE_RULE_COUPON_ACTIVE); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 删除活动 | ||||
|      * | ||||
|      * @param id 活动id | ||||
|      * @author PQZ | ||||
|      * @date 18:27 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public void deleteActiveMain(String id) { | ||||
|         // 删除 | ||||
|         activeMainMapper.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 根据营销活动获取详情 | ||||
|      * | ||||
|      * @param id 营销活动id | ||||
|      * @return cn.iocoder.yudao.module.member.vo.ActiveMainRespVO | ||||
|      * @author PQZ | ||||
|      * @date 18:23 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public ActiveMainRespVO getActiveMain(String id) { | ||||
|         ActiveMain activeMain = activeMainMapper.selectById(id); | ||||
|         ActiveMainRespVO result = BeanUtils.toBean(activeMain, ActiveMainRespVO.class); | ||||
|         //查询关联规则 | ||||
|         List<ActiveRule> ruleList = ruleService.listByActiveId(id); | ||||
|         //删除关联卡券 | ||||
|         List<MemberCoupon> couponList = activeRuleCouponService.queryByMainId(id); | ||||
|         result.setRuleList(ruleList); | ||||
|         result.setCouponList(couponList); | ||||
|         return result; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询营销活动 | ||||
|      * | ||||
|      * @param pageReqVO ActiveMainPageReqVO实体 | ||||
|      * @param page      分页参数 | ||||
|      * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.member.vo.ActiveMainRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 14:17 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public IPage<ActiveMainRespVO> queryListPage(ActiveMainPageReqVO pageReqVO, Page<ActiveMainRespVO> page) { | ||||
|         return activeMainMapper.selectListPage(pageReqVO, page); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,94 @@ | ||||
| package cn.iocoder.yudao.module.member.service.impl; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveRuleCoupon; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import cn.iocoder.yudao.module.member.mapper.ActiveRuleCouponMapper; | ||||
| import cn.iocoder.yudao.module.member.service.ActiveRuleCouponService; | ||||
| import cn.iocoder.yudao.module.member.service.MemberCouponService; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.stream.Collectors; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动、规则及会员等级与基础卡券关联关系 Service 实现类 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Service | ||||
| @Validated | ||||
| public class ActiveRuleCouponServiceImpl extends ServiceImpl<ActiveRuleCouponMapper, ActiveRuleCoupon> implements ActiveRuleCouponService { | ||||
| 
 | ||||
|     @Resource | ||||
|     private MemberCouponService couponService; | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 根据主表id删除关联关系 | ||||
|      * | ||||
|      * @param id 主表id | ||||
|      * @author PQZ | ||||
|      * @date 17:56 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public void deleteByMainId(String id) { | ||||
|         LambdaQueryWrapper<ActiveRuleCoupon> lambdaQueryWrapper = new LambdaQueryWrapper<>(); | ||||
|         lambdaQueryWrapper.eq(ActiveRuleCoupon::getMainId,id); | ||||
|         remove(lambdaQueryWrapper); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 保存关联关系 | ||||
|      * | ||||
|      * @param list      卡券id集合 | ||||
|      * @param mainId    主表id | ||||
|      * @param mainTable 主表名称 | ||||
|      * @author PQZ | ||||
|      * @date 17:57 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public void saveActiveRuleCoupon(List<MemberCoupon> list, String mainId, String mainTable) { | ||||
|         //删除原有关联关系 | ||||
|         deleteByMainId(mainId); | ||||
|         List<ActiveRuleCoupon> couponList = new ArrayList<>(); | ||||
|         //组装现有关联关系 | ||||
|         list.forEach(item -> { | ||||
|             ActiveRuleCoupon couponItem = new ActiveRuleCoupon(); | ||||
|             couponItem.setCouponId(item.getId()); | ||||
|             couponItem.setMainTable(mainTable); | ||||
|             couponItem.setMainId(mainId); | ||||
|             couponList.add(couponItem); | ||||
|         }); | ||||
|         saveBatch(couponList); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 根据主表id查询关联关系 | ||||
|      * | ||||
|      * @param id 主表id | ||||
|      * @return java.util.List<cn.iocoder.yudao.module.member.entity.ActiveRuleCoupon> | ||||
|      * @author PQZ | ||||
|      * @date 17:59 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public List<MemberCoupon> queryByMainId(String id) { | ||||
|         //查询关联关系 | ||||
|         LambdaQueryWrapper<ActiveRuleCoupon> lambdaQueryWrapper = new LambdaQueryWrapper<>(); | ||||
|         lambdaQueryWrapper.eq(ActiveRuleCoupon::getMainId,id).eq(ActiveRuleCoupon::getDeleted,"0"); | ||||
|         List<ActiveRuleCoupon> list = list(lambdaQueryWrapper); | ||||
|         List<String> idList = list.stream().map(ActiveRuleCoupon::getCouponId).collect(Collectors.toList()); | ||||
|         //查询关联卡券信息 | ||||
|         List<MemberCoupon> result = new ArrayList<>(); | ||||
|         if (!idList.isEmpty()){ | ||||
|             LambdaQueryWrapper<MemberCoupon> couponLambdaQueryWrapper = new LambdaQueryWrapper<>(); | ||||
|             couponLambdaQueryWrapper.in(MemberCoupon::getId,idList).eq(MemberCoupon::getDeleted,"0"); | ||||
|             result = couponService.list(couponLambdaQueryWrapper); | ||||
|         } | ||||
|         return result; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,72 @@ | ||||
| package cn.iocoder.yudao.module.member.service.impl; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveRule; | ||||
| import cn.iocoder.yudao.module.member.mapper.ActiveRuleMapper; | ||||
| import cn.iocoder.yudao.module.member.service.ActiveRuleService; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 营销活动规则 Service 实现类 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Service | ||||
| @Validated | ||||
| public class ActiveRuleServiceImpl extends ServiceImpl<ActiveRuleMapper, ActiveRule> implements ActiveRuleService { | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 保存活动规则 | ||||
|      * | ||||
|      * @param list     活动规则集合 | ||||
|      * @param activeId 活动id | ||||
|      * @author PQZ | ||||
|      * @date 18:15 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public void saveActiveRule(List<ActiveRule> list, String activeId) { | ||||
|         //根据活动id删除活动规则 | ||||
|         deleteByActiveId(activeId); | ||||
|         //保存 | ||||
|         list.forEach(item -> { | ||||
|             item.setId(null); | ||||
|             item.setActiveId(activeId); | ||||
|         }); | ||||
|         saveBatch(list); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 根据活动id删除活动规则 | ||||
|      * | ||||
|      * @param activeId 活动id | ||||
|      * @author PQZ | ||||
|      * @date 18:16 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public void deleteByActiveId(String activeId) { | ||||
|         LambdaQueryWrapper<ActiveRule> lambdaQueryWrapper = new LambdaQueryWrapper<>(); | ||||
|         lambdaQueryWrapper.eq(ActiveRule::getActiveId,activeId); | ||||
|         remove(lambdaQueryWrapper); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 根据活动id查询活动规则 | ||||
|      * | ||||
|      * @param activeId 活动id | ||||
|      * @return java.util.List<cn.iocoder.yudao.module.member.entity.ActiveRule> | ||||
|      * @author PQZ | ||||
|      * @date 18:17 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public List<ActiveRule> listByActiveId(String activeId) { | ||||
|         LambdaQueryWrapper<ActiveRule> lambdaQueryWrapper = new LambdaQueryWrapper<>(); | ||||
|         lambdaQueryWrapper.eq(ActiveRule::getActiveId,activeId).eq(BaseDO::getDeleted,'0'); | ||||
|         return list(lambdaQueryWrapper); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,132 @@ | ||||
| package cn.iocoder.yudao.module.member.service.impl; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import cn.iocoder.yudao.module.member.mapper.MemberCouponMapper; | ||||
| import cn.iocoder.yudao.module.member.service.MemberCouponService; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberCouponPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberCouponRespVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberCouponSaveReqVO; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| 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 org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 基础卡券 Service 实现类 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Service | ||||
| @Validated | ||||
| public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper, MemberCoupon> implements MemberCouponService { | ||||
| 
 | ||||
|     @Resource | ||||
|     private MemberCouponMapper couponMapper; | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 保存基础卡券信息 | ||||
|      * | ||||
|      * @param saveReqVO MemberCouponSaveReqVO实体 | ||||
|      * @return void | ||||
|      * @author PQZ | ||||
|      * @date 14:22 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public void saveCoupon(MemberCouponSaveReqVO saveReqVO) { | ||||
|         MemberCoupon memberCoupon = BeanUtils.toBean(saveReqVO, MemberCoupon.class); | ||||
|         saveOrUpdate(memberCoupon); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void deleteCoupon(String id) { | ||||
|         // 删除 | ||||
|         couponMapper.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 查询基础卡券及附属信息 | ||||
|      * @author PQZ | ||||
|      * @date 21:55 2024/9/19 | ||||
|      * @param id 卡券id | ||||
|      * @return cn.iocoder.yudao.module.member.vo.MemberCouponRespVO | ||||
|      **/ | ||||
|     @Override | ||||
|     public MemberCouponRespVO getCoupon(String id) { | ||||
|         //查询本身数据 | ||||
|         MemberCoupon memberCoupon = getById(id); | ||||
|         MemberCouponRespVO result = BeanUtils.toBean(memberCoupon,MemberCouponRespVO.class); | ||||
|         //查询附属权益 | ||||
|         LambdaQueryWrapper<MemberCoupon> lambdaQueryWrapper = new LambdaQueryWrapper<>(); | ||||
|         lambdaQueryWrapper.eq(MemberCoupon::getParentId,id).eq(BaseDO::getDeleted,'0'); | ||||
|         List<MemberCoupon> list = list(lambdaQueryWrapper); | ||||
|         result.setCouponList(list); | ||||
|         return result; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询基础卡券信息 | ||||
|      * | ||||
|      * @param pageReqVO MemberCouponPageReqVO实体 | ||||
|      * @param page      分页参数 | ||||
|      * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.member.vo.MemberCouponRespVO> | ||||
|      * @author PQZ | ||||
|      * @date 14:22 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public IPage<MemberCouponRespVO> queryListPage(MemberCouponPageReqVO pageReqVO, Page<MemberCouponRespVO> page) { | ||||
|         return couponMapper.selectListPage(pageReqVO, page); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 复制卡券附属权益 | ||||
|      * | ||||
|      * @param saveReqVO MemberCouponSaveReqVO | ||||
|      * @author PQZ | ||||
|      * @date 21:25 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void copyMemberCoupon(MemberCouponSaveReqVO saveReqVO) { | ||||
|         //原始数据 | ||||
|         LambdaQueryWrapper<MemberCoupon> lambdaQueryWrapper = new LambdaQueryWrapper<>(); | ||||
|         lambdaQueryWrapper.eq(MemberCoupon::getParentId, saveReqVO.getId()).eq(BaseDO::getDeleted, '0'); | ||||
|         List<MemberCoupon> oldList = list(lambdaQueryWrapper); | ||||
|         //组装复制数据 | ||||
|         if (!oldList.isEmpty()) { | ||||
|             //要保存的数据集合 | ||||
|             List<MemberCoupon> saveList = new ArrayList<>(); | ||||
|             //选中的目标数据 | ||||
|             List<MemberCoupon> targetList = saveReqVO.getCouponList(); | ||||
|             if (targetList != null && !targetList.isEmpty()) { | ||||
|                 targetList.forEach(targetItem -> { | ||||
|                     //深拷贝 | ||||
|                     MemberCoupon target = BeanUtils.toBean(targetItem,MemberCoupon.class); | ||||
|                     oldList.forEach(oldItem -> { | ||||
|                         //深拷贝 | ||||
|                         MemberCoupon saveItem = BeanUtils.toBean(oldItem,MemberCoupon.class); | ||||
|                         saveItem.setId(null); | ||||
|                         saveItem.setParentId(target.getId()); | ||||
|                         saveItem.setCreateTime(null); | ||||
|                         saveItem.setCreator(null); | ||||
|                         saveList.add(saveItem); | ||||
|                     }); | ||||
|                 }); | ||||
|             } | ||||
|             saveBatch(saveList); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,86 @@ | ||||
| package cn.iocoder.yudao.module.member.service.impl; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberLevel; | ||||
| import cn.iocoder.yudao.module.member.mapper.MemberLevelMapper; | ||||
| import cn.iocoder.yudao.module.member.service.MemberLevelService; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelRespVO; | ||||
| import cn.iocoder.yudao.module.member.vo.MemberLevelSaveReqVO; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| 
 | ||||
| /** | ||||
|  * 会员等级 Service 实现类 | ||||
|  * | ||||
|  * @author pqz | ||||
|  */ | ||||
| @Service | ||||
| @Validated | ||||
| public class MemberLevelServiceImpl extends ServiceImpl<MemberLevelMapper, MemberLevel> implements MemberLevelService { | ||||
| 
 | ||||
|     @Resource | ||||
|     private MemberLevelMapper levelMapper; | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 保存会员等级 | ||||
|      * | ||||
|      * @param saveReqVO MemberLevelSaveReqVO | ||||
|      * @author PQZ | ||||
|      * @date 13:39 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public void saveLevel(MemberLevelSaveReqVO saveReqVO) { | ||||
|         MemberLevel memberLevel = BeanUtils.toBean(saveReqVO, MemberLevel.class); | ||||
|         saveOrUpdate(memberLevel); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 删除会员等级 | ||||
|      * | ||||
|      * @param id 会员等级id | ||||
|      * @author PQZ | ||||
|      * @date 13:41 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public void deleteLevel(String id) { | ||||
|         // 删除 | ||||
|         levelMapper.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 根据会员等级id查询会员等级信息 | ||||
|      * | ||||
|      * @param id 会员等级id | ||||
|      * @return cn.iocoder.yudao.module.member.entity.MemberLevel | ||||
|      * @author PQZ | ||||
|      * @date 13:41 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public MemberLevel getLevel(String id) { | ||||
|         return levelMapper.selectById(id); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询会员等级 | ||||
|      * | ||||
|      * @param pageReqVO MemberLevelPageReqVO实体 | ||||
|      * @param page | ||||
|      * @return cn.iocoder.yudao.framework.common.pojo.PageResult<cn.iocoder.yudao.module.member.entity.MemberLevel> | ||||
|      * @author PQZ | ||||
|      * @date 13:42 2024/9/19 | ||||
|      **/ | ||||
|     @Override | ||||
|     public IPage<MemberLevelRespVO> queryListPage(MemberLevelPageReqVO pageReqVO, Page<MemberLevelRespVO> page) { | ||||
|         return levelMapper.selectListPage(pageReqVO,page); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,19 @@ | ||||
| package cn.iocoder.yudao.module.member.vo; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveMain; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| 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; | ||||
| 
 | ||||
| @Schema(description = "管理后台 - 营销活动分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class ActiveMainPageReqVO extends ActiveMain { | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,22 @@ | ||||
| package cn.iocoder.yudao.module.member.vo; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveMain; | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveRule; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.time.LocalDateTime; | ||||
| import com.alibaba.excel.annotation.*; | ||||
| 
 | ||||
| @Schema(description = "管理后台 - 营销活动 Response VO") | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| public class ActiveMainRespVO extends ActiveMain { | ||||
|     /**活动关联卡券*/ | ||||
|     private List<MemberCoupon> couponList; | ||||
|     /**活动关联规则*/ | ||||
|     private List<ActiveRule> ruleList; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,23 @@ | ||||
| package cn.iocoder.yudao.module.member.vo; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveMain; | ||||
| import cn.iocoder.yudao.module.member.entity.ActiveRule; | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import javax.validation.constraints.*; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @Schema(description = "管理后台 - 营销活动新增/修改 Request VO") | ||||
| @Data | ||||
| public class ActiveMainSaveReqVO extends ActiveMain { | ||||
| 
 | ||||
|     /**活动关联卡券*/ | ||||
|     private List<MemberCoupon> couponList; | ||||
|     /**活动关联规则*/ | ||||
|     private List<ActiveRule> ruleList; | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| package cn.iocoder.yudao.module.member.vo; | ||||
| 
 | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import java.math.BigDecimal; | ||||
| 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; | ||||
| 
 | ||||
| @Schema(description = "管理后台 - 基础卡券分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class MemberCouponPageReqVO extends MemberCoupon { | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,19 @@ | ||||
| package cn.iocoder.yudao.module.member.vo; | ||||
| 
 | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Schema(description = "管理后台 - 基础卡券 Response VO") | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| public class MemberCouponRespVO extends MemberCoupon { | ||||
|     /**附属权益集合*/ | ||||
|     private List<MemberCoupon> couponList; | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,19 @@ | ||||
| package cn.iocoder.yudao.module.member.vo; | ||||
| 
 | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.MemberCoupon; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import javax.validation.constraints.*; | ||||
| import java.math.BigDecimal; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @Schema(description = "管理后台 - 基础卡券新增/修改 Request VO") | ||||
| @Data | ||||
| public class MemberCouponSaveReqVO extends MemberCoupon { | ||||
|     /**基础卡券集合*/ | ||||
|     private List<MemberCoupon> couponList; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| package cn.iocoder.yudao.module.member.vo; | ||||
| 
 | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.MemberLevel; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| 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; | ||||
| 
 | ||||
| @Schema(description = "管理后台 - 会员等级分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class MemberLevelPageReqVO extends MemberLevel { | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| package cn.iocoder.yudao.module.member.vo; | ||||
| 
 | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.MemberLevel; | ||||
| import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @Schema(description = "管理后台 - 会员等级 Response VO") | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| public class MemberLevelRespVO extends MemberLevel { | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.member.vo; | ||||
| 
 | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.member.entity.MemberLevel; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @Schema(description = "管理后台 - 会员等级新增/修改 Request VO") | ||||
| @Data | ||||
| public class MemberLevelSaveReqVO extends MemberLevel { | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,28 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.member.mapper.ActiveMainMapper"> | ||||
| 
 | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
| 
 | ||||
|     <select id="selectListPage" resultType="cn.iocoder.yudao.module.member.vo.ActiveMainRespVO"> | ||||
|         SELECT | ||||
|         * | ||||
|         FROM | ||||
|         dl_active_main dam | ||||
|         <where> | ||||
|             dam.deleted = 0 | ||||
|             <if test="entity.name != null  and entity.name != ''"> | ||||
|                 and dam.name like concat('%', #{entity.name}, '%') | ||||
|             </if> | ||||
|             <if test="entity.type != null  and entity.type != ''"> | ||||
|                 and dam.type like concat('%', #{entity.type}, '%') | ||||
|             </if> | ||||
|         </where> | ||||
|         ORDER BY dam.create_time DESC | ||||
|     </select> | ||||
| </mapper> | ||||
| @ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.member.mapper.ActiveRuleCouponMapper"> | ||||
| 
 | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
| 
 | ||||
| </mapper> | ||||
| @ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.member.mapper.ActiveRuleMapper"> | ||||
| 
 | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
| 
 | ||||
| </mapper> | ||||
| @ -0,0 +1,37 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.member.mapper.MemberCouponMapper"> | ||||
| 
 | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
| 
 | ||||
|     <select id="selectListPage" resultType="cn.iocoder.yudao.module.member.vo.MemberCouponRespVO"> | ||||
|         SELECT | ||||
|         * | ||||
|         FROM | ||||
|         dl_member_coupon dmc | ||||
|         <where> | ||||
|             dmc.deleted = 0 | ||||
|             <if test="entity.parentId == null"> | ||||
|                 and dmc.parent_id is null | ||||
|             </if> | ||||
|             <if test="entity.parentId != null  and entity.parentId != ''"> | ||||
|                 and dmc.parent_id like concat('%', #{entity.parentId}, '%') | ||||
|             </if> | ||||
|             <if test="entity.name != null  and entity.name != ''"> | ||||
|                 and dmc.name like concat('%', #{entity.name}, '%') | ||||
|             </if> | ||||
|             <if test="entity.type != null  and entity.type != ''"> | ||||
|                 and dmc.type like concat('%', #{entity.type}, '%') | ||||
|             </if> | ||||
|             <if test="entity.outRule != null  and entity.outRule != ''"> | ||||
|                 and dmc.out_rule like concat('%', #{entity.outRule}, '%') | ||||
|             </if> | ||||
|         </where> | ||||
|         ORDER BY dmc.create_time DESC | ||||
|     </select> | ||||
| </mapper> | ||||
| @ -0,0 +1,26 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.member.mapper.MemberLevelMapper"> | ||||
| 
 | ||||
|     <!-- | ||||
|         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||||
|         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||||
|         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||||
|         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||
|      --> | ||||
| 
 | ||||
|     <select id="selectListPage" resultType="cn.iocoder.yudao.module.member.vo.MemberLevelRespVO"> | ||||
|         SELECT | ||||
|             * | ||||
|         FROM | ||||
|             dl_member_level dml | ||||
|         <where> | ||||
|             dml.deleted = 0 | ||||
|             <if test="entity.name != null  and entity.name != ''"> | ||||
|                 and dml.name like concat('%', #{entity.name}, '%') | ||||
|             </if> | ||||
|         </where> | ||||
|         ORDER BY dml.create_time DESC | ||||
| 
 | ||||
|     </select> | ||||
| </mapper> | ||||
| @ -16,7 +16,7 @@ | ||||
|             <if test="entity.name != null  and entity.name != ''"> | ||||
|                 and dbs.name like concat('%', #{entity.name}, '%') | ||||
|             </if> | ||||
|             <if test="entity.name != null  and entity.name != ''"> | ||||
|             <if test="entity.corpId != null  and entity.corpId != ''"> | ||||
|                 and dbs.corp_id like concat('%', #{entity.corpId}, '%') | ||||
|             </if> | ||||
|         </where> | ||||
|  | ||||
| @ -68,7 +68,7 @@ import static cn.iocoder.yudao.module.rescue.utils.RescueSysLoginService.generat | ||||
|  */ | ||||
| @RestController | ||||
| @Slf4j | ||||
| @RequestMapping("/rescue") | ||||
| @RequestMapping("/rescue/login") | ||||
| public class SysLoginController { | ||||
|     @Resource | ||||
|     private AdminAuthService loginService; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user