1.
phpcjl
2024-12-09 4015063181b8b718781fac3cbe97f1d963dae54f
1.
2个文件已修改
33 ■■■■■ 已修改文件
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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());
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java
@@ -1,10 +1,12 @@
package com.ruoyi.other.vo;
import com.ruoyi.other.api.domain.Shop;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@ApiModel(value="商品热销对象", description="热门商品")
@Data
@@ -52,16 +54,8 @@
    @ApiModelProperty(value = "门店id")
    private Integer shopId;
    @ApiModelProperty(value = "经度")
    private String longitude;
    @ApiModelProperty(value = "门店列表")
    private List<Shop> shopList;
    @ApiModelProperty(value = "纬度")
    private String latitude;
    @ApiModelProperty(value = "门店名称")
    private String name;
    @ApiModelProperty(value = "详细地址")
    private String address;
}