提交 52f3d6ad 作者: xiaowang

新增推荐

上级 98540b94
...@@ -71,7 +71,7 @@ public class MallGoodsDO implements Serializable { ...@@ -71,7 +71,7 @@ public class MallGoodsDO implements Serializable {
private Integer sort; private Integer sort;
/** /**
* 商品热度 * 商品热度
* */ */
private Integer hot; private Integer hot;
private Integer priceShow; private Integer priceShow;
...@@ -82,6 +82,8 @@ public class MallGoodsDO implements Serializable { ...@@ -82,6 +82,8 @@ public class MallGoodsDO implements Serializable {
private Integer deleted; private Integer deleted;
private Integer recommend;
private String url; private String url;
private Integer type; private Integer type;
private Integer imgId; private Integer imgId;
...@@ -99,14 +101,16 @@ public class MallGoodsDO implements Serializable { ...@@ -99,14 +101,16 @@ public class MallGoodsDO implements Serializable {
this.goodsLabel = mallGoodsVO.getGoodsLabel(); this.goodsLabel = mallGoodsVO.getGoodsLabel();
this.labelShow = mallGoodsVO.getLabelShow(); this.labelShow = mallGoodsVO.getLabelShow();
this.priceShow = mallGoodsVO.getPriceShow(); this.priceShow = mallGoodsVO.getPriceShow();
this.recommend = mallGoodsVO.getRecommend();
this.goodsDetails = mallGoodsVO.getGoodsDetails(); this.goodsDetails = mallGoodsVO.getGoodsDetails();
this.hot = mallGoodsVO.getHot(); this.hot = mallGoodsVO.getHot();
} }
public MallGoodsVO buildMallGoodsVO() { public MallGoodsVO buildMallGoodsVO() {
return MallGoodsVO.builder().id(id).userAccountId(userAccountId).tradeName(tradeName).description(description) return MallGoodsVO.builder().id(id).userAccountId(userAccountId).tradeName(tradeName)
.categoryPrimaryId(categoryPrimaryId).categorySubId(categorySubId).shelfStatus(shelfStatus).priceShow(priceShow) .description(description).categoryPrimaryId(categoryPrimaryId).categorySubId(categorySubId)
.goodsLabel(goodsLabel).labelShow(labelShow).createTime(createTime).goodsDetails(goodsDetails).build(); .shelfStatus(shelfStatus).priceShow(priceShow).goodsLabel(goodsLabel).labelShow(labelShow)
.createTime(createTime).goodsDetails(goodsDetails).recommend(recommend).build();
} }
public MallGoodsVO buildListMallGoodsVO() { public MallGoodsVO buildListMallGoodsVO() {
...@@ -116,7 +120,7 @@ public class MallGoodsDO implements Serializable { ...@@ -116,7 +120,7 @@ public class MallGoodsDO implements Serializable {
goodsResourcesVO.setUrl(url); goodsResourcesVO.setUrl(url);
goodsResourcesVO.setType(type); goodsResourcesVO.setType(type);
resourcesList.add(goodsResourcesVO); resourcesList.add(goodsResourcesVO);
return MallGoodsVO.builder().id(id).userAccountId(userAccountId).tradeName(tradeName).resourcesList(resourcesList) return MallGoodsVO.builder().id(id).userAccountId(userAccountId).recommend(recommend).tradeName(tradeName).resourcesList(resourcesList)
.categoryPrimaryId(categoryPrimaryId).labelShow(labelShow).goodsLabel(goodsLabel).categorySubId(categorySubId) .categoryPrimaryId(categoryPrimaryId).labelShow(labelShow).goodsLabel(goodsLabel).categorySubId(categorySubId)
.shelfStatus(shelfStatus).createTime(createTime).description(description).priceShow(priceShow).build(); .shelfStatus(shelfStatus).createTime(createTime).description(description).priceShow(priceShow).build();
} }
......
...@@ -63,6 +63,10 @@ public class MallGoodsVO implements Serializable { ...@@ -63,6 +63,10 @@ public class MallGoodsVO implements Serializable {
@ApiModelProperty(value = "标签是否显示 0否 1是") @ApiModelProperty(value = "标签是否显示 0否 1是")
private Integer labelShow; private Integer labelShow;
@ApiModelProperty(value = "是否推荐 0否 1是")
@NotNull(message = "是否推荐不能为空", groups = {Update.class, Create.class})
private Integer recommend;
@ApiModelProperty(value = "规格") @ApiModelProperty(value = "规格")
@NotEmpty(message = "规格不能为空", groups = {Update.class, Create.class}) @NotEmpty(message = "规格不能为空", groups = {Update.class, Create.class})
private List<SpecAttrVO> specAttrList; private List<SpecAttrVO> specAttrList;
......
...@@ -32,6 +32,9 @@ public class MallGoodsInfoQO { ...@@ -32,6 +32,9 @@ public class MallGoodsInfoQO {
@ApiModelProperty(value = "商品状态 0:下架 1:上架") @ApiModelProperty(value = "商品状态 0:下架 1:上架")
private Integer shelfStatus; private Integer shelfStatus;
@ApiModelProperty(value = "是否推荐 0:否 1:是")
private Integer recommend;
@ApiModelProperty(value = "页码", required = true, example = "1") @ApiModelProperty(value = "页码", required = true, example = "1")
@NotNull( @NotNull(
message = "页码不能为空", message = "页码不能为空",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
mg.user_account_id, mg.user_account_id,
mg.goods_label, mg.goods_label,
mg.label_show, mg.label_show,
mg.recommend,
mg.category_sub_id, mg.category_sub_id,
mg.goods_label, mg.goods_label,
img.id as imgId, img.url, img.id as imgId, img.url,
...@@ -74,7 +75,7 @@ ...@@ -74,7 +75,7 @@
<result column="url" property="url"/> <result column="url" property="url"/>
<result column="is_deleted" property="deleted"/> <result column="is_deleted" property="deleted"/>
<result column="shelf_status" property="shelfStatus"/> <result column="shelf_status" property="shelfStatus"/>
<collection property="priceStockDOS" ofType="com.mmc.pms.entity.mall.PriceStockDO" > <collection property="priceStockDOS" ofType="com.mmc.pms.entity.mall.PriceStockDO">
<id column="productSpecId" property="id"/> <id column="productSpecId" property="id"/>
<result column="product_spec" property="productSpec"/> <result column="product_spec" property="productSpec"/>
<result column="sku_image" property="skuImage"/> <result column="sku_image" property="skuImage"/>
......
...@@ -15,10 +15,12 @@ ...@@ -15,10 +15,12 @@
label_show, label_show,
goods_details, goods_details,
user_account_id, user_account_id,
recommend,
price_show, price_show,
sort) sort)
values ( #{goodsNo}, #{tradeName}, #{description}, #{categoryPrimaryId}, #{categorySubId} values ( #{goodsNo}, #{tradeName}, #{description}, #{categoryPrimaryId}, #{categorySubId}
, #{shelfStatus}, #{goodsLabel}, #{labelShow}, #{goodsDetails}, #{userAccountId}, #{priceShow}, #{sort}) , #{shelfStatus}, #{goodsLabel}, #{labelShow}, #{goodsDetails}
, #{userAccountId}, #{recommend}, #{priceShow}, #{sort})
</insert> </insert>
<insert id="batchInsertMallGoodsResources"> <insert id="batchInsertMallGoodsResources">
...@@ -69,7 +71,8 @@ ...@@ -69,7 +71,8 @@
goods_label = #{mallGoodsDO.goodsLabel}, goods_label = #{mallGoodsDO.goodsLabel},
label_show = #{mallGoodsDO.labelShow}, label_show = #{mallGoodsDO.labelShow},
goods_details = #{mallGoodsDO.goodsDetails}, goods_details = #{mallGoodsDO.goodsDetails},
price_show = #{mallGoodsDO.priceShow} price_show = #{mallGoodsDO.priceShow},
recommend = #{mallGoodsDO.recommend}
WHERE id = #{mallGoodsDO.id} WHERE id = #{mallGoodsDO.id}
</update> </update>
<update id="updateMallGoodsSort"> <update id="updateMallGoodsSort">
...@@ -158,6 +161,7 @@ ...@@ -158,6 +161,7 @@
goods_details, goods_details,
user_account_id, user_account_id,
price_show, price_show,
recommend,
sort, sort,
create_time create_time
FROM mall_goods FROM mall_goods
...@@ -205,6 +209,7 @@ ...@@ -205,6 +209,7 @@
mg.user_account_id, mg.user_account_id,
mg.description, mg.description,
mg.price_show, mg.price_show,
mg.recommend,
img.id as imgId, img.id as imgId,
img.url, img.url,
img.type img.type
...@@ -226,6 +231,9 @@ ...@@ -226,6 +231,9 @@
<if test="shelfStatus != null"> <if test="shelfStatus != null">
and mg.shelf_status = #{shelfStatus} and mg.shelf_status = #{shelfStatus}
</if> </if>
<if test="recommend != null">
and mg.recommend = #{recommend}
</if>
</where> </where>
ORDER BY ORDER BY
mg.shelf_status DESC , mg.sort DESC,mg.create_time DESC mg.shelf_status DESC , mg.sort DESC,mg.create_time DESC
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论