| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.constant.TokenConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.ServletUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.vo.Price; |
| | | import com.ruoyi.other.api.domain.*; |
| | |
| | | public PageInfo<GoodsVO> goodsList(Goods search) { |
| | | PageInfo<GoodsVO> pageInfo = new PageInfo(search.getPageCurr(), search.getPageSize()); |
| | | List<GoodsVO> list = this.baseMapper.goodsList(pageInfo, search.getGoodsCategoryId(), search.getName()); |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | Long userId = null; |
| | | String token = SecurityUtils.getToken(ServletUtils.getRequest()); |
| | | if(StringUtils.isNotEmpty(token)){ |
| | | userId = tokenService.getLoginUserApplet().getUserid(); |
| | | } |
| | | for (GoodsVO goods : list) { |
| | | R<Price> r = remoteOrderGoodsClient.getGoodsPrice(loginUserApplet.getUserid(), goods.getGoodsId(), null); |
| | | //游客展示基础售价 |
| | | if(null != userId){ |
| | | R<Price> r = remoteOrderGoodsClient.getGoodsPrice(userId, goods.getGoodsId(), null); |
| | | if (null != r.getData()){ |
| | | Price price = r.getData(); |
| | | goods.setSellingPrice(price.getCash()); |
| | | goods.setIntegral(price.getPoint()); |
| | | } |
| | | } |
| | | } |
| | | return pageInfo.setRecords(list); |
| | |
| | | |
| | | for (GoodsShop goodsShop : goodsShops) { |
| | | Shop shop = shopMapper.selectById(goodsShop.getShopId()); |
| | | if(null != shop){ |
| | | goodsShop.setShopName(shop.getName()); |
| | | goodsShop.setOwnerName(shop.getShopManager()); |
| | | goodsShop.setPhone(shop.getPhone()); |
| | | goodsShop.setAddress(shop.getAddress()); |
| | | } |
| | | } |
| | | goods.setGoodsShopList(goodsShops); |
| | | |
| | | // 指定用户 |