1.
phpcjl
2024-12-09 4015063181b8b718781fac3cbe97f1d963dae54f
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -7,13 +7,12 @@
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.api.domain.Goods;
import com.ruoyi.other.api.domain.GoodsArea;
import com.ruoyi.other.api.domain.GoodsVip;
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.api.domain.*;
import com.ruoyi.other.enums.GoodsStatus;
import com.ruoyi.other.mapper.GoodsAreaMapper;
import com.ruoyi.other.mapper.GoodsMapper;
import com.ruoyi.other.mapper.GoodsShopMapper;
import com.ruoyi.other.mapper.ShopMapper;
import com.ruoyi.other.service.GoodsService;
import com.ruoyi.other.service.GoodsVipService;
import com.ruoyi.other.service.VipSettingService;
@@ -26,6 +25,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
 * <p>
@@ -49,6 +49,10 @@
    private GoodsVipService goodsVipService;
    @Resource
    private AppUserClient appUserClient;
    @Resource
    private GoodsShopMapper goodsShopMapper;
    @Resource
    private ShopMapper shopMapper;
    @Override
    public List<GoodsVO> goodsList(Goods search) {
@@ -99,7 +103,14 @@
        }
        Goods goods = this.getById(goodsId);
        List<GoodsShop> goodsShopList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>()
                .eq(GoodsShop::getGoodsId, goodsId));
        List<Integer> shopIds = goodsShopList.stream().map(GoodsShop::getShopId).collect(Collectors.toList());
        List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>()
                .in(Shop::getId, shopIds));
        GoodsVO goodsVO = new GoodsVO();
        goodsVO.setShopList(shopList);
        BeanUtils.copyBeanProp(goodsVO, goods);
        goodsVO.setGoodsId(goods.getId());
        goodsVO.setGoodsName(goods.getName());