You've already forked FrameTour-BE
feat(pricing): 支持景区维度的价格配置和优惠策略控制
- 新增按景区ID查询商品配置和阶梯价格配置的方法 - 扩展价格计算服务以支持景区级别的优惠策略 - 更新优惠券和代金券提供者以使用景区维度配置 - 修改商品配置服务实现多级查询优先级(景区特定->景区默认->全局特定->全局默认) - 添加商品类型能力服务测试用例 - 增强价格计算逻辑的容错性和向后兼容性
This commit is contained in:
@@ -33,6 +33,14 @@ public interface PriceProductConfigMapper extends BaseMapper<PriceProductConfig>
|
||||
*/
|
||||
@Select("SELECT * FROM price_product_config WHERE product_type = #{productType} AND product_id = #{productId} AND is_active = 1")
|
||||
PriceProductConfig selectByProductTypeAndId(String productType, String productId);
|
||||
|
||||
/**
|
||||
* 根据商品类型、商品ID和景区ID查询配置(支持景区维度)
|
||||
*/
|
||||
@Select("SELECT * FROM price_product_config WHERE product_type = #{productType} AND product_id = #{productId} AND scenic_id = #{scenicId} AND is_active = 1")
|
||||
PriceProductConfig selectByProductTypeIdAndScenic(@Param("productType") String productType,
|
||||
@Param("productId") String productId,
|
||||
@Param("scenicId") String scenicId);
|
||||
|
||||
/**
|
||||
* 检查是否存在default配置(包含禁用的)
|
||||
|
||||
@@ -26,6 +26,18 @@ public interface PriceTierConfigMapper extends BaseMapper<PriceTierConfig> {
|
||||
PriceTierConfig selectByProductTypeAndQuantity(@Param("productType") String productType,
|
||||
@Param("productId") String productId,
|
||||
@Param("quantity") Integer quantity);
|
||||
|
||||
/**
|
||||
* 根据商品类型、商品ID、数量和景区ID查询匹配的阶梯价格(支持景区维度)
|
||||
*/
|
||||
@Select("SELECT * FROM price_tier_config WHERE product_type = #{productType} " +
|
||||
"AND product_id = #{productId} AND scenic_id = #{scenicId} " +
|
||||
"AND #{quantity} >= min_quantity AND #{quantity} <= max_quantity " +
|
||||
"AND is_active = 1 ORDER BY sort_order ASC LIMIT 1")
|
||||
PriceTierConfig selectByProductTypeQuantityAndScenic(@Param("productType") String productType,
|
||||
@Param("productId") String productId,
|
||||
@Param("quantity") Integer quantity,
|
||||
@Param("scenicId") String scenicId);
|
||||
|
||||
/**
|
||||
* 根据商品类型查询所有阶梯配置
|
||||
|
||||
Reference in New Issue
Block a user