| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ComShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.panzhihua.service_community.dao.ComShopGoodsDAO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.service_community.dao.ComShopStoreDAO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopStoreDO; |
| | | import com.panzhihua.service_community.service.ComShopStoreService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | /** |
| | | * 查询店铺列表 |
| | | * @param comShopStoreDTO 请求参数 |
| | | * @param pageComShopStoreDTO 请求参数 |
| | | * @return 店铺列表 |
| | | */ |
| | | |
| | | @Override |
| | | public R pageStoreList(PageComShopStoreDTO comShopStoreDTO){ |
| | | Page page = new Page<>(comShopStoreDTO.getPageNum(),comShopStoreDTO.getPageSize()); |
| | | return R.ok(this.baseMapper.pageShopStore(page,comShopStoreDTO)); |
| | | public R pageStoreList(PageComShopStoreDTO pageComShopStoreDTO) { |
| | | Page page = new Page<>(pageComShopStoreDTO.getPageNum(), pageComShopStoreDTO.getPageSize()); |
| | | IPage<PageShopStoreVO> comShopStoreVOIPage = this.baseMapper.pageShopStore(page, pageComShopStoreDTO); |
| | | return R.ok(comShopStoreVOIPage); |
| | | } |
| | | |
| | | /** |
| | |
| | | if(storeDO.getStatus().equals(ComShopStoreDO.status.no)){ |
| | | return R.fail(402,"店铺已被禁用"); |
| | | } |
| | | ComShopStoreVO shopStoreVO = new ComShopStoreVO(); |
| | | PageShopStoreVO shopStoreVO = new PageShopStoreVO(); |
| | | BeanUtils.copyProperties(storeDO, shopStoreVO); |
| | | |
| | | //查询店铺下商品信息 |
| | |
| | | |
| | | @Override |
| | | public R deleteStore(Long[] id) { |
| | | ComShopStoreDO storeDO = new ComShopStoreDO(); |
| | | storeDO.setDeleteStatus(2); |
| | | LambdaQueryWrapper<ComShopStoreDO> query = new LambdaQueryWrapper<ComShopStoreDO>().eq(ComShopStoreDO::getId, id); |
| | | int update = this.baseMapper.update(storeDO, query); |
| | | LambdaQueryWrapper<ComShopStoreDO> query = new LambdaQueryWrapper<ComShopStoreDO>().in(ComShopStoreDO::getId, id); |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(query); |
| | | comShopStoreDO.setDeleteStatus(2); |
| | | int update = this.baseMapper.updateById(comShopStoreDO); |
| | | return update > 0 ? R.ok() : R.fail(); |
| | | } |
| | | |
| | |
| | | BeanUtils.copyProperties(comShopStoreDO,shopStoreVO); |
| | | return R.ok(shopStoreVO); |
| | | } |
| | | |
| | | @Override |
| | | public R getUserStoreInfo(Long userId) { |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>().eq(ComShopStoreDO::getDeleteStatus, 1).eq(ComShopStoreDO::getSysUserId, userId)); |
| | | if (comShopStoreDO == null) { |
| | | R.fail(500,"商铺不存在"); |
| | | } |
| | | ShopStoreVO shopStoreVO = new ShopStoreVO(); |
| | | BeanUtils.copyProperties(comShopStoreDO,shopStoreVO); |
| | | return R.ok(shopStoreVO); |
| | | } |
| | | } |