Commit 3eac39b6 by weijiguang

恢复部分代码

parent aab0b5e1
......@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.soss.common.exception.ServiceException;
import com.soss.common.utils.StringUtils;
import com.soss.system.domain.*;
import com.soss.system.domain.vo.SkuCountVo;
import com.soss.system.domain.vo.orderTaking.*;
import com.soss.system.mapper.*;
import jodd.util.StringPool;
......@@ -74,45 +75,10 @@ public class OrderTakingServiceImpl {
ImagesVo imagesVo = new ImagesVo();
imagesVo.setLeft(bannerService.getKDSBannerByShopId(shopId));
orderTakingVo.setImages(imagesVo);
// String menuLeft = sysConfigService.selectConfigByKey("menu.left");
// if (StringUtils.isNotEmpty(menuLeft)) {
// if (menuLeft.startsWith("[")) {
// imagesVo.setLeft(JSONArray.parseArray(menuLeft));
// } else {
// imagesVo.setLeft(JSONArray.parseArray(JSONArray.toJSONString(Collections.singletonList(menuLeft))));
// }
// }
// imagesVo.setRight(JSONObject.parseObject(sysConfigService.selectConfigByKey("menu.right")));
orderTakingVo.setCountOfOrder(sysConfigService.selectConfigByKey("goods.limit"));
orderTakingVo.setTips(sysConfigService.selectConfigByKey("tips.address"));
List<CategoryVo> categoryVos = new ArrayList<>();
// CategoryVo preferentialCategoryVo = new CategoryVo();
// categoryVos.add(preferentialCategoryVo);
// preferentialCategoryVo.setId(0L);
// preferentialCategoryVo.setName("今日特惠");
// //查询出该店铺今日特惠的商品
// List<GoodsVo> goodsVos = shopRecommendMapper.selectShopGoodsByTyepe("2", shopId);
// preferentialCategoryVo.setGoods(goodsVos);
// if(!CollectionUtils.isEmpty(goodsVos)){
// for (GoodsVo goodsVo : goodsVos) {
// GoodsTag goodsTag = new GoodsTag();
// goodsTag.setState("1");
// goodsVo.setSpecs(buildGoodsSpec(goodsVo.getSpecString()));
// goodsVo.setSpecString(null);
// goodsTag.setGoodsId(Long.parseLong(goodsVo.getGoodsId()));
// goodsVo.setPics(JSONObject.parseObject(goodsVo.getPictures()));
// goodsVo.setPictures(null);
// List<GoodsTag> goodsTags = goodsTagMapper.selectGoodsTagList(goodsTag);
// List<String> tags = goodsTags.stream().map(GoodsTag::getTag).collect(Collectors.toList());
// goodsVo.setTags(tags);
// //获取产品信息
// List<SkuVo> skuVos = shopGoodsSkuMapper.selectSkuByGoodAndShop(shopId, goodsVo.getGoodsId());
// buildSkuRules(skuVos);
// goodsVo.setSkus(skuVos);
// }
// }
//推荐
// List<String> recommendGoodsId = new ArrayList<>();
List<RecommendVo> recommendVos = new ArrayList<>();
List<GoodsVo> recommendGoods = shopRecommendMapper.selectShopGoodsByTyepe("1", shopId);
......@@ -168,7 +134,7 @@ public class OrderTakingServiceImpl {
categoryVo.setIcon(category.getIcon());
List<Goods> goodsList = shopGoodsMapper.selectShopCategoryGoodsByCategoryId(shopId, category.getId());
List<GoodsVo> goodsVoList = new ArrayList<>();
categoryVo.setGoods(goodsVoList);
List<GoodsVo> selloutList = new ArrayList<>();
if (!CollectionUtils.isEmpty(goodsList)) {
for (Goods good : goodsList) {
GoodsVo goodsVo = new GoodsVo();
......@@ -203,9 +169,18 @@ public class OrderTakingServiceImpl {
List<SkuVo> skuVos = shopGoodsSkuMapper.selectSkuByGoodAndShop(shopId, goodsVo.getGoodsId());
buildSkuRules(skuVos);
goodsVo.setSkus(skuVos);
SkuCountVo skuCountVo = shopGoodsSkuMapper.getSkuCount(shopId, good.getId());
if (skuCountVo == null || skuCountVo.getSellin() == null || skuCountVo.getSellin() <= 0) {
selloutList.add(goodsVo);
} else {
goodsVoList.add(goodsVo);
}
}
}
if (!CollectionUtils.isEmpty(selloutList)) {
goodsVoList.addAll(selloutList);
}
categoryVo.setGoods(goodsVoList);
categoryVos.add(categoryVo);
}
}
......
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