| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | Goods goods = this.getById(goodsId); |
| | | |
| | | if(null == goods || goods.getDelFlag() == 1){ |
| | | throw new RuntimeException("商品不存在"); |
| | | } |
| | |
| | | GoodsShop goodsShop = goodsShopMapper.selectOne(new LambdaQueryWrapper<GoodsShop>() |
| | | .eq(GoodsShop::getGoodsId, goodsId)); |
| | | Shop shop1 = shopMapper.selectById(goodsShop.getShopId()); |
| | | ArrayList<Shop> shops = new ArrayList<>(); |
| | | shops.add(shop1); |
| | | goodsVO.setShopList(shops); |
| | | |
| | | goodsVO.setShop(shop1); |
| | | //已售数量 |
| | | Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 1).getData(); |
| | | goodsVO.setSaleNum(integer); |
| | | |
| | | return goodsVO; |
| | | |
| | | } |
| | |
| | | public List<GoodsVO> getGoodsListByShopId(PageInfo<GoodsVO> pageInfo, Integer shopId) { |
| | | //查询该门店商品 |
| | | List<GoodsVO> goods = goodsMapper.selectListByShopId(pageInfo, shopId); |
| | | if (goods == null) { |
| | | return null; |
| | | } |
| | | for (GoodsVO good : goods) { |
| | | //价格 |
| | | Price price = getPrice( good.getGoodsId()); |