feat(pricing): 添加优惠券管理功能

- 新增 CouponManagementController 控制器,实现优惠券配置和领取记录的管理
- 新增 ICouponManagementService 接口和 CouponManagementServiceImpl 实现类,提供优惠券管理服务
- 在 PricingConfigController 中添加获取所有优惠券配置和领取记录的接口
- 新增 BundleProductListTypeHandler 类,用于处理一口价商品列表的序列化和反序列化
- 更新 PriceCouponClaimRecordMapper 和 PriceCouponConfigMapper,添加管理端所需的查询接口
This commit is contained in:
2025-08-18 04:33:58 +08:00
parent 16e07ee9ef
commit 4787efd328
7 changed files with 813 additions and 0 deletions

View File

@@ -0,0 +1,107 @@
package com.ycwl.basic.pricing.service;
import com.github.pagehelper.PageInfo;
import com.ycwl.basic.pricing.entity.PriceCouponClaimRecord;
import com.ycwl.basic.pricing.entity.PriceCouponConfig;
import com.ycwl.basic.pricing.enums.CouponStatus;
import java.util.List;
import java.util.Map;
/**
* 优惠券管理服务接口(管理端)
*/
public interface ICouponManagementService {
// ==================== 优惠券配置管理 ====================
/**
* 创建优惠券配置
*/
Long createCouponConfig(PriceCouponConfig config);
/**
* 更新优惠券配置
*/
boolean updateCouponConfig(PriceCouponConfig config);
/**
* 删除优惠券配置
*/
boolean deleteCouponConfig(Long id);
/**
* 启用/禁用优惠券配置
*/
boolean updateCouponConfigStatus(Long id, Boolean isActive);
/**
* 查询所有优惠券配置(包含禁用的)
*/
List<PriceCouponConfig> getAllCouponConfigs();
/**
* 分页查询优惠券配置
*/
PageInfo<PriceCouponConfig> getCouponConfigsPage(Integer pageNum, Integer pageSize,
Boolean isActive, String couponName);
/**
* 根据状态查询优惠券配置
*/
List<PriceCouponConfig> getCouponConfigsByStatus(Boolean isActive);
/**
* 根据ID查询优惠券配置
*/
PriceCouponConfig getCouponConfigById(Long id);
// ==================== 优惠券领取记录查询 ====================
/**
* 查询所有优惠券领取记录
*/
List<PriceCouponClaimRecord> getAllClaimRecords();
/**
* 分页查询优惠券领取记录
*/
PageInfo<PriceCouponClaimRecord> getClaimRecordsPage(Integer pageNum, Integer pageSize,
Long userId, Long couponId, CouponStatus status,
String startTime, String endTime);
/**
* 根据用户ID查询优惠券领取记录
*/
List<PriceCouponClaimRecord> getClaimRecordsByUserId(Long userId);
/**
* 根据优惠券ID查询领取记录
*/
List<PriceCouponClaimRecord> getClaimRecordsByCouponId(Long couponId);
/**
* 根据状态查询领取记录
*/
List<PriceCouponClaimRecord> getClaimRecordsByStatus(CouponStatus status);
/**
* 查询优惠券使用统计
*/
Map<String, Object> getCouponUsageStats(Long couponId);
/**
* 查询优惠券配置详细统计
*/
Map<String, Object> getCouponDetailStats(Long couponId);
/**
* 查询时间范围内的统计数据
*/
Map<String, Object> getPeriodStats(String startDate, String endDate);
/**
* 查询所有优惠券的使用统计概览
*/
List<Map<String, Object>> getAllCouponUsageOverview();
}