Pu Zhibing
2025-04-03 1f09f6daaf73bc83cceb4ae22b862b7b365635cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.ruoyi.other.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.mapper.GoodsShopMapper;
import com.ruoyi.other.api.domain.GoodsShop;
import com.ruoyi.other.service.GoodsShopService;
import com.ruoyi.other.vo.ShopGoodsList;
import com.ruoyi.other.vo.ShopGoodsListVo;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.feignClient.SysUserClient;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author luodangjia
 * @since 2024-11-20
 */
@Service
public class GoodsShopServiceImpl extends ServiceImpl<GoodsShopMapper, GoodsShop> implements GoodsShopService {
    
    @Resource
    private TokenService tokenService;
    
    @Resource
    private SysUserClient sysUserClient;
    
    
    
    /**
     * 获取门店授权的服务商品
     * @param shopGoodsListVo
     * @return
     */
    @Override
    public PageInfo<ShopGoodsList> getShopGoodsList(ShopGoodsListVo shopGoodsListVo) {
        PageInfo<ShopGoodsList> pageInfo = new PageInfo(shopGoodsListVo.getPageCurr(), shopGoodsListVo.getPageSize());
        Long userid = tokenService.getLoginUser().getUserid();
        SysUser sysUser = sysUserClient.getSysUser(userid).getData();
        List<ShopGoodsList> shopGoodsList = this.baseMapper.getShopGoodsList(pageInfo, sysUser.getObjectId(), shopGoodsListVo.getId(), shopGoodsListVo.getName(), shopGoodsListVo.getGoodsCategoryId());
        return pageInfo.setRecords(shopGoodsList);
    }
}