提交 52f3d6ad 作者: xiaowang

新增推荐

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