Commit d8862251 by weijiguang

下单时校验订单中sku数量

parent 6a086d5e
......@@ -131,8 +131,10 @@ public class Goods extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
private Date recommendDate;
/** 是否推荐 */
private String recommend;
/** 是否特惠 */
private String preferential;
/** 商品sku数量 */
......
......@@ -288,19 +288,21 @@ public class ShopServiceImpl implements IShopService {
shopRecommend.setShopId(String.valueOf(shopId));
shopRecommend.setGoodsId(String.valueOf(goods.getId()));
shopRecommend.setType("1");
goods.setPreferential("1");
goods.setRecommend("1");
List<ShopRecommend> shopRecommends = shopRecommendMapper.selectShopRecommendList(shopRecommend);
if (shopRecommends.size() > 0) {
if (CollectionUtils.isEmpty(shopRecommends)) {
goods.setRecommend("0");
}
if (!StringUtils.isEmpty(goods.getRecommendTag())) {
goods.setRecommendTagList(JSON.parseArray(goods.getRecommendTag(), String.class));
} else {
goods.setRecommend("1");
}
shopRecommend.setType("2");
shopRecommends = shopRecommendMapper.selectShopRecommendList(shopRecommend);
if (shopRecommends.size() > 0) {
if (CollectionUtils.isEmpty(shopRecommends)) {
goods.setPreferential("0");
} else {
goods.setPreferential("1");
}
if (!StringUtils.isEmpty(goods.getRecommendTag())) {
goods.setRecommendTagList(JSON.parseArray(goods.getRecommendTag(), String.class));
}
goods.setSalesVolume(orderMapper.selectSalesVolume(shopId, goods.getId()));
......
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