Commit 28f7af27 by weijiguang

商品列表添加特惠标签字段

parent 7a544c1c
......@@ -66,7 +66,7 @@ public class Goods extends BaseEntity {
* 特惠标签
*/
@Excel(name = "特惠标签")
private BigDecimal recommendTag;
private String recommendTag;
/**
* 制作用时 单位 秒
......@@ -145,6 +145,9 @@ public class Goods extends BaseEntity {
@Excel(name = "商品编码")
private String code;
/** 是否特惠商品 */
private String isRecommend;
private List<String> goodsTagList;
public List<String> getGoodsTagList() {
......
......@@ -26,7 +26,11 @@ public class GoodsVo {
private String specString;
/** 特惠商品 */
private String isRecommend;
/** 特惠标签 */
private String recommendTag;
private String category;
}
......@@ -104,7 +104,7 @@ public class OrderTakingServiceImpl {
// }
// }
//推荐
List<String> recommendGoodsId = new ArrayList<>();
// List<String> recommendGoodsId = new ArrayList<>();
List<RecommendVo> recommendVos = new ArrayList<>();
List<GoodsVo> recommendGoods = shopRecommendMapper.selectShopGoodsByTyepe("1", shopId);
......@@ -125,7 +125,7 @@ public class OrderTakingServiceImpl {
goodsVo.setSpecString(null);
goodsVo.setPics(JSONObject.parseObject(goodsVo.getPictures()));
goodsVo.setPictures(null);
recommendGoodsId.add(goodsVo.getGoodsId());
// recommendGoodsId.add(goodsVo.getGoodsId());
GoodsTag goodsTag = new GoodsTag();
goodsTag.setState("1");
goodsTag.setGoodsId(Long.parseLong(goodsVo.getGoodsId()));
......@@ -174,11 +174,13 @@ public class OrderTakingServiceImpl {
goodsVo.setSpecs(buildGoodsSpec(good.getSpec()));
goodsVo.setCategory(good.getCategory());
goodsVo.setSpecString(null);
if(recommendGoodsId.contains(String.valueOf(good.getId()))){
goodsVo.setIsRecommend("1");
}else{
goodsVo.setIsRecommend("0");
}
goodsVo.setIsRecommend(good.getIsRecommend());
goodsVo.setRecommendTag(good.getRecommendTag());
// if(recommendGoodsId.contains(String.valueOf(good.getId()))){
// goodsVo.setIsRecommend("1");
// }else{
// goodsVo.setIsRecommend("0");
// }
GoodsTag goodsTag = new GoodsTag();
goodsTag.setState("1");
goodsTag.setGoodsId(Long.parseLong(goodsVo.getGoodsId()));
......
......@@ -92,10 +92,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
g.remarks,
g.shelf_at as shelfAt,
g.code,
'1' as state
from shop_goods sg, goods g where sg.goods_id = g.id and g.state ='3' and g.is_deleted = 0
and shop_id = #{shopId} and category like concat('%,', #{categoryId}, ',%')
order by sg.turn
'1' as state,
case when sr.id>0 then 1 else 0 end as isRecommend,
sr.recommend_tag
from goods g
LEFT JOIN shop_goods sg ON g.id = sg.goods_id
LEFT JOIN shop_recommend sr ON g.id = sr.goods_id and sr.`type` = 2
where g.state ='3' and g.is_deleted = 0 and sg.shop_id = #{shopId} and category like concat('%,', #{categoryId}, ',%')
order by sr.recommend_price DESC,sg.turn
</select>
<select id="selectShopNoAddGoods" resultType="com.soss.system.domain.Goods">
select id, name, category, price, discount, take_time, spec, pics, `desc`, remarks, state, is_deleted, created_at, updated_at, code,shelf_at from goods
......
......@@ -135,8 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and sr.`type` = #{type}
and sr.shop_id =#{shopId}
and sr.state ='1' and g.is_deleted ='0'
order by
sr.recommend_price desc,sr.turn
order by sr.turn
</select>
<select id="selectShopRecommendGoods" resultType="com.soss.system.domain.Goods">
select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment