Commit 34c558bf by caiyt

Merge remote-tracking branch 'origin/v2' into v2

parents 6ad67b28 86c0b006
...@@ -66,7 +66,7 @@ public class Goods extends BaseEntity { ...@@ -66,7 +66,7 @@ public class Goods extends BaseEntity {
* 特惠标签 * 特惠标签
*/ */
@Excel(name = "特惠标签") @Excel(name = "特惠标签")
private BigDecimal recommendTag; private String recommendTag;
/** /**
* 制作用时 单位 秒 * 制作用时 单位 秒
...@@ -145,6 +145,9 @@ public class Goods extends BaseEntity { ...@@ -145,6 +145,9 @@ public class Goods extends BaseEntity {
@Excel(name = "商品编码") @Excel(name = "商品编码")
private String code; private String code;
/** 是否特惠商品 */
private String isRecommend;
private List<String> goodsTagList; private List<String> goodsTagList;
public List<String> getGoodsTagList() { public List<String> getGoodsTagList() {
......
...@@ -26,7 +26,11 @@ public class GoodsVo { ...@@ -26,7 +26,11 @@ public class GoodsVo {
private String specString; private String specString;
/** 特惠商品 */
private String isRecommend; private String isRecommend;
/** 特惠标签 */
private String recommendTag;
private String category; private String category;
} }
...@@ -104,7 +104,7 @@ public class OrderTakingServiceImpl { ...@@ -104,7 +104,7 @@ public class OrderTakingServiceImpl {
// } // }
// } // }
//推荐 //推荐
List<String> recommendGoodsId = new ArrayList<>(); // List<String> recommendGoodsId = new ArrayList<>();
List<RecommendVo> recommendVos = new ArrayList<>(); List<RecommendVo> recommendVos = new ArrayList<>();
List<GoodsVo> recommendGoods = shopRecommendMapper.selectShopGoodsByTyepe("1", shopId); List<GoodsVo> recommendGoods = shopRecommendMapper.selectShopGoodsByTyepe("1", shopId);
...@@ -125,7 +125,7 @@ public class OrderTakingServiceImpl { ...@@ -125,7 +125,7 @@ public class OrderTakingServiceImpl {
goodsVo.setSpecString(null); goodsVo.setSpecString(null);
goodsVo.setPics(JSONObject.parseObject(goodsVo.getPictures())); goodsVo.setPics(JSONObject.parseObject(goodsVo.getPictures()));
goodsVo.setPictures(null); goodsVo.setPictures(null);
recommendGoodsId.add(goodsVo.getGoodsId()); // recommendGoodsId.add(goodsVo.getGoodsId());
GoodsTag goodsTag = new GoodsTag(); GoodsTag goodsTag = new GoodsTag();
goodsTag.setState("1"); goodsTag.setState("1");
goodsTag.setGoodsId(Long.parseLong(goodsVo.getGoodsId())); goodsTag.setGoodsId(Long.parseLong(goodsVo.getGoodsId()));
...@@ -174,11 +174,13 @@ public class OrderTakingServiceImpl { ...@@ -174,11 +174,13 @@ public class OrderTakingServiceImpl {
goodsVo.setSpecs(buildGoodsSpec(good.getSpec())); goodsVo.setSpecs(buildGoodsSpec(good.getSpec()));
goodsVo.setCategory(good.getCategory()); goodsVo.setCategory(good.getCategory());
goodsVo.setSpecString(null); goodsVo.setSpecString(null);
if(recommendGoodsId.contains(String.valueOf(good.getId()))){ goodsVo.setIsRecommend(good.getIsRecommend());
goodsVo.setIsRecommend("1"); goodsVo.setRecommendTag(good.getRecommendTag());
}else{ // if(recommendGoodsId.contains(String.valueOf(good.getId()))){
goodsVo.setIsRecommend("0"); // goodsVo.setIsRecommend("1");
} // }else{
// goodsVo.setIsRecommend("0");
// }
GoodsTag goodsTag = new GoodsTag(); GoodsTag goodsTag = new GoodsTag();
goodsTag.setState("1"); goodsTag.setState("1");
goodsTag.setGoodsId(Long.parseLong(goodsVo.getGoodsId())); goodsTag.setGoodsId(Long.parseLong(goodsVo.getGoodsId()));
......
...@@ -40,9 +40,9 @@ public class SysBannerServiceImpl implements ISysBannerService { ...@@ -40,9 +40,9 @@ public class SysBannerServiceImpl implements ISysBannerService {
if (StringUtils.isEmpty(banner.getImage())) { if (StringUtils.isEmpty(banner.getImage())) {
throw new ServiceException("图片地址不能为空"); throw new ServiceException("图片地址不能为空");
} }
if (StringUtils.isEmpty(banner.getPage())) { // if (StringUtils.isEmpty(banner.getPage())) {
throw new ServiceException("链接地址不能为空"); // throw new ServiceException("链接地址不能为空");
} // }
if (banner.getType() == null || banner.getType() < 1 || banner.getType() > 3) { if (banner.getType() == null || banner.getType() < 1 || banner.getType() > 3) {
throw new ServiceException("类型不正确,1-小程序,2-KDS,3-点单屏"); throw new ServiceException("类型不正确,1-小程序,2-KDS,3-点单屏");
} }
...@@ -71,9 +71,9 @@ public class SysBannerServiceImpl implements ISysBannerService { ...@@ -71,9 +71,9 @@ public class SysBannerServiceImpl implements ISysBannerService {
if (StringUtils.isEmpty(banner.getImage())) { if (StringUtils.isEmpty(banner.getImage())) {
throw new ServiceException("图片地址不能为空"); throw new ServiceException("图片地址不能为空");
} }
if (StringUtils.isEmpty(banner.getPage())) { // if (StringUtils.isEmpty(banner.getPage())) {
throw new ServiceException("链接地址不能为空"); // throw new ServiceException("链接地址不能为空");
} // }
if (banner.getType() == null || banner.getType() < 1 || banner.getType() > 3) { if (banner.getType() == null || banner.getType() < 1 || banner.getType() > 3) {
throw new ServiceException("类型不正确,1-小程序,2-KDS,3-点单屏"); throw new ServiceException("类型不正确,1-小程序,2-KDS,3-点单屏");
} }
......
...@@ -92,10 +92,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -92,10 +92,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
g.remarks, g.remarks,
g.shelf_at as shelfAt, g.shelf_at as shelfAt,
g.code, g.code,
'1' as state '1' as state,
from shop_goods sg, goods g where sg.goods_id = g.id and g.state ='3' and g.is_deleted = 0 case when sr.id>0 then 1 else 0 end as isRecommend,
and shop_id = #{shopId} and category like concat('%,', #{categoryId}, ',%') sr.recommend_tag
order by sg.turn 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>
<select id="selectShopNoAddGoods" resultType="com.soss.system.domain.Goods"> <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 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" ...@@ -135,8 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and sr.`type` = #{type} and sr.`type` = #{type}
and sr.shop_id =#{shopId} and sr.shop_id =#{shopId}
and sr.state ='1' and g.is_deleted ='0' and sr.state ='1' and g.is_deleted ='0'
order by order by sr.turn
sr.recommend_price desc,sr.turn
</select> </select>
<select id="selectShopRecommendGoods" resultType="com.soss.system.domain.Goods"> <select id="selectShopRecommendGoods" resultType="com.soss.system.domain.Goods">
select 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