Commit e400f241 by 林永健

feat(marketing): 添加商品现售价和最低限价字段支持

- 在 MarketingActivityService 中查询并设置商品现售价和最低限价
- 更新数据库映射文件添加 minimum_price 字段到插入语句
- 扩展 GoodsTypeInfoDTO 添加 currentPrice 和 minimumPrice 字段
- 修改 MarketingActivityCreateReqDTO 活动名称长度限制从20字增加到30字
- 修改 MarketingActivityProductReqDTO 选项卡名称长度限制从20字增加到30字
- 修改 MarketingActivityTagReqDTO 标签名称长度限制从10字减少到8字
- 更新 MarketingActivityProduct 和 MarketingActivityProductItem 实体类添加价格字段
- 在查询映射中添加现售价和最低限价的数据库字段映射
1 parent 76e916f1
...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
/** /**
* 商品类型信息DTO(用于查询 goods_type/goods_type_name) * 商品类型信息DTO(用于查询 goods_type/goods_type_name)
...@@ -26,4 +27,12 @@ public class GoodsTypeInfoDTO implements Serializable { ...@@ -26,4 +27,12 @@ public class GoodsTypeInfoDTO implements Serializable {
/** 商品类型名称 */ /** 商品类型名称 */
@ApiModelProperty(notes = "商品类型名称") @ApiModelProperty(notes = "商品类型名称")
private String goodsTypeName; private String goodsTypeName;
/** 现售价 */
@ApiModelProperty(notes = "现售价")
private BigDecimal currentPrice;
/** 最低限价 */
@ApiModelProperty(notes = "最低限价")
private BigDecimal minimumPrice;
} }
...@@ -21,7 +21,7 @@ public class MarketingActivityCreateReqDTO implements Serializable { ...@@ -21,7 +21,7 @@ public class MarketingActivityCreateReqDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 活动名称 */ /** 活动名称 */
@ApiModelProperty(notes = "活动名称,最多20字", required = true) @ApiModelProperty(notes = "活动名称,最多30字", required = true)
private String activityName; private String activityName;
/** 活动开始时间(yyyy-MM-dd HH:00) */ /** 活动开始时间(yyyy-MM-dd HH:00) */
......
...@@ -44,6 +44,10 @@ public class MarketingActivityProductItemRespDTO implements Serializable { ...@@ -44,6 +44,10 @@ public class MarketingActivityProductItemRespDTO implements Serializable {
@ApiModelProperty(notes = "子商品现售价") @ApiModelProperty(notes = "子商品现售价")
private BigDecimal currentPrice; private BigDecimal currentPrice;
/** 子商品最低限价 */
@ApiModelProperty(notes = "子商品最低限价")
private BigDecimal minimumPrice;
/** 优惠价 */ /** 优惠价 */
@ApiModelProperty(notes = "优惠价") @ApiModelProperty(notes = "优惠价")
private BigDecimal discountPrice; private BigDecimal discountPrice;
......
...@@ -42,7 +42,7 @@ public class MarketingActivityProductReqDTO implements Serializable { ...@@ -42,7 +42,7 @@ public class MarketingActivityProductReqDTO implements Serializable {
private Integer sortOrder; private Integer sortOrder;
/** 选项卡名称 */ /** 选项卡名称 */
@ApiModelProperty(notes = "选项卡名称,最多20字", required = true) @ApiModelProperty(notes = "选项卡名称,最多30字", required = true)
private String tabName; private String tabName;
/** 选项卡描述 */ /** 选项卡描述 */
......
...@@ -65,6 +65,14 @@ public class MarketingActivityProductRespDTO implements Serializable { ...@@ -65,6 +65,14 @@ public class MarketingActivityProductRespDTO implements Serializable {
@ApiModelProperty(notes = "优惠价") @ApiModelProperty(notes = "优惠价")
private BigDecimal discountPrice; private BigDecimal discountPrice;
/** 现售价 */
@ApiModelProperty(notes = "现售价(快照)")
private BigDecimal currentPrice;
/** 最低限价 */
@ApiModelProperty(notes = "最低限价(快照)")
private BigDecimal minimumPrice;
/** 销售激励 */ /** 销售激励 */
@ApiModelProperty(notes = "销售激励金额") @ApiModelProperty(notes = "销售激励金额")
private BigDecimal salesIncentive; private BigDecimal salesIncentive;
......
...@@ -24,6 +24,6 @@ public class MarketingActivityTagReqDTO implements Serializable { ...@@ -24,6 +24,6 @@ public class MarketingActivityTagReqDTO implements Serializable {
private Integer tagId; private Integer tagId;
/** 标签名称 */ /** 标签名称 */
@ApiModelProperty(notes = "标签名称,最多10字", required = true) @ApiModelProperty(notes = "标签名称,最多8字", required = true)
private String tagName; private String tagName;
} }
...@@ -94,6 +94,18 @@ public class MarketingActivityProduct implements Serializable { ...@@ -94,6 +94,18 @@ public class MarketingActivityProduct implements Serializable {
private BigDecimal discountPrice; private BigDecimal discountPrice;
/** /**
* 现售价(快照)
*/
@Column(name = "current_price")
private BigDecimal currentPrice;
/**
* 最低限价(快照)
*/
@Column(name = "minimum_price")
private BigDecimal minimumPrice;
/**
* 销售激励金额 * 销售激励金额
*/ */
@Column(name = "sales_incentive") @Column(name = "sales_incentive")
......
...@@ -64,6 +64,12 @@ public class MarketingActivityProductItem implements Serializable { ...@@ -64,6 +64,12 @@ public class MarketingActivityProductItem implements Serializable {
private BigDecimal currentPrice; private BigDecimal currentPrice;
/** /**
* 子商品最低限价(快照)
*/
@Column(name = "minimum_price")
private BigDecimal minimumPrice;
/**
* 优惠价 * 优惠价
*/ */
@Column(name = "discount_price") @Column(name = "discount_price")
......
...@@ -504,10 +504,12 @@ public class MarketingActivityService { ...@@ -504,10 +504,12 @@ public class MarketingActivityService {
p.setPackageCode(req.getPackageCode()); p.setPackageCode(req.getPackageCode());
p.setSortOrder(req.getSortOrder() != null ? req.getSortOrder() : i); p.setSortOrder(req.getSortOrder() != null ? req.getSortOrder() : i);
// 查询 goods_type/goods_type_name // 查询 goods_type/goods_type_name/现售价/最低限价
GoodsTypeInfoDTO goodsTypeInfo = lookupGoodsTypeInfo(req.getGoodsCode(), req.getPackageCode()); GoodsTypeInfoDTO goodsTypeInfo = lookupGoodsTypeInfo(req.getGoodsCode(), req.getPackageCode());
p.setGoodsType(goodsTypeInfo.getGoodsType()); p.setGoodsType(goodsTypeInfo.getGoodsType());
p.setGoodsTypeName(goodsTypeInfo.getGoodsTypeName()); p.setGoodsTypeName(goodsTypeInfo.getGoodsTypeName());
p.setCurrentPrice(goodsTypeInfo.getCurrentPrice());
p.setMinimumPrice(goodsTypeInfo.getMinimumPrice());
p.setTabName(req.getTabName()); p.setTabName(req.getTabName());
p.setTabDescription(req.getTabDescription()); p.setTabDescription(req.getTabDescription());
...@@ -550,10 +552,11 @@ public class MarketingActivityService { ...@@ -550,10 +552,11 @@ public class MarketingActivityService {
item.setActivityProductId(activityProductId); item.setActivityProductId(activityProductId);
item.setGoodsCode(req.getGoodsCode()); item.setGoodsCode(req.getGoodsCode());
item.setGoodsName(req.getGoodsName()); item.setGoodsName(req.getGoodsName());
// 查询 goods_type/goods_type_name // 查询 goods_type/goods_type_name/最低限价
GoodsTypeInfoDTO gti = lookupGoodsTypeInfoByGoodsCode(req.getGoodsCode()); GoodsTypeInfoDTO gti = lookupGoodsTypeInfoByGoodsCode(req.getGoodsCode());
item.setGoodsType(gti.getGoodsType()); item.setGoodsType(gti.getGoodsType());
item.setGoodsTypeName(gti.getGoodsTypeName()); item.setGoodsTypeName(gti.getGoodsTypeName());
item.setMinimumPrice(gti.getMinimumPrice());
item.setCurrentPrice(req.getCurrentPrice()); item.setCurrentPrice(req.getCurrentPrice());
item.setDiscountPrice(req.getDiscountPrice()); item.setDiscountPrice(req.getDiscountPrice());
item.setSalesIncentive(req.getSalesIncentive()); item.setSalesIncentive(req.getSalesIncentive());
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
<insert id="batchInsert"> <insert id="batchInsert">
INSERT INTO dj_marketing_activity_product_item INSERT INTO dj_marketing_activity_product_item
(activity_product_id, goods_code, goods_name, goods_type, goods_type_name, (activity_product_id, goods_code, goods_name, goods_type, goods_type_name,
current_price, discount_price, sales_incentive, current_price, minimum_price, discount_price, sales_incentive,
created_by, created_date, deleted_flag) created_by, created_date, deleted_flag)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.activityProductId}, #{item.goodsCode}, #{item.goodsName}, (#{item.activityProductId}, #{item.goodsCode}, #{item.goodsName},
#{item.goodsType}, #{item.goodsTypeName}, #{item.currentPrice}, #{item.goodsType}, #{item.goodsTypeName}, #{item.currentPrice},
#{item.discountPrice}, #{item.salesIncentive}, #{item.minimumPrice}, #{item.discountPrice}, #{item.salesIncentive},
#{item.createdBy}, #{item.createdDate}, #{item.deletedFlag}) #{item.createdBy}, #{item.createdDate}, #{item.deletedFlag})
</foreach> </foreach>
</insert> </insert>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
INSERT INTO dj_marketing_activity_product INSERT INTO dj_marketing_activity_product
(activity_id, car_series_id, product_type, goods_code, package_code, (activity_id, car_series_id, product_type, goods_code, package_code,
sort_order, goods_type, goods_type_name, tab_name, tab_description, sort_order, goods_type, goods_type_name, tab_name, tab_description,
discount_price, sales_incentive, discount_price, current_price, minimum_price, sales_incentive,
is_main_push, main_image_url, thumb_image_url, detail_image_url, is_main_push, main_image_url, thumb_image_url, detail_image_url,
created_by, created_date, deleted_flag) created_by, created_date, deleted_flag)
VALUES VALUES
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#{item.goodsCode}, #{item.packageCode}, #{item.goodsCode}, #{item.packageCode},
#{item.sortOrder}, #{item.goodsType}, #{item.goodsTypeName}, #{item.sortOrder}, #{item.goodsType}, #{item.goodsTypeName},
#{item.tabName}, #{item.tabDescription}, #{item.tabName}, #{item.tabDescription},
#{item.discountPrice}, #{item.salesIncentive}, #{item.discountPrice}, #{item.currentPrice}, #{item.minimumPrice}, #{item.salesIncentive},
#{item.isMainPush}, #{item.mainImageUrl}, #{item.thumbImageUrl}, #{item.detailImageUrl}, #{item.isMainPush}, #{item.mainImageUrl}, #{item.thumbImageUrl}, #{item.detailImageUrl},
#{item.createdBy}, #{item.createdDate}, #{item.deletedFlag}) #{item.createdBy}, #{item.createdDate}, #{item.deletedFlag})
</foreach> </foreach>
......
...@@ -62,9 +62,11 @@ ...@@ -62,9 +62,11 @@
</foreach> </foreach>
</select> </select>
<!-- 根据 goodsCode 查询 goods_type/goods_type_name --> <!-- 根据 goodsCode 查询 goods_type/goods_type_name/现售价/最低限价 -->
<select id="findGoodsTypeInfo" resultType="cn.com.glsx.dj.strategy.dto.GoodsTypeInfoDTO"> <select id="findGoodsTypeInfo" resultType="cn.com.glsx.dj.strategy.dto.GoodsTypeInfoDTO">
SELECT gi.goods_type AS goodsType, gi.goods_type_name AS goodsTypeName SELECT gi.goods_type AS goodsType, gi.goods_type_name AS goodsTypeName,
COALESCE(mgi.sell_price, 0) AS currentPrice,
COALESCE(mgi.min_sell_price, 0) AS minimumPrice
FROM dj_car_life_merchant_goods_info mgi FROM dj_car_life_merchant_goods_info mgi
JOIN dj_car_life_upgrade_goods ug ON ug.id = mgi.upgrade_goods_id AND ug.deleted_flag = 'N' JOIN dj_car_life_upgrade_goods ug ON ug.id = mgi.upgrade_goods_id AND ug.deleted_flag = 'N'
JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N' JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!