puzhibing
2025-01-13 acccff9860b271d55c55dc87486f7c20b9896e6c
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsShopServiceImpl.java
New file
@@ -0,0 +1,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);
   }
}