Pu Zhibing
2024-12-26 a988a89e6b0cd75a5df4691eb8196c0ef9513a05
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -134,14 +134,19 @@
        goodsVO.setSellingPrice(sellingPrice);
        goodsVO.setIntegral(integral);
        List<GoodsShop> goodsShopList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>()
                .eq(GoodsShop::getGoodsId, goodsId));
        if (!CollectionUtils.isEmpty(goodsShopList)){
            List<Integer> shopIds = goodsShopList.stream().map(GoodsShop::getShopId).collect(Collectors.toList());
        if(goods.getAppointStore() == 2){
            List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>()
                    .in(Shop::getId, shopIds));
                    .in(Shop::getDelFlag, 0));
            goodsVO.setShopList(shopList);
        }else{
            List<GoodsShop> goodsShopList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>()
                    .eq(GoodsShop::getGoodsId, goodsId));
            if (!CollectionUtils.isEmpty(goodsShopList)){
                List<Integer> shopIds = goodsShopList.stream().map(GoodsShop::getShopId).collect(Collectors.toList());
                List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>()
                        .in(Shop::getId, shopIds));
                goodsVO.setShopList(shopList);
            }
        }
        return goodsVO;
    }