| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.mall.entity.MallAddressWorld; |
| | | import cc.mrbird.febs.mall.entity.MallGoods; |
| | | import cc.mrbird.febs.mall.entity.MallGoodsCategory; |
| | | import cc.mrbird.febs.mall.mapper.MallAddressWorldMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallGoodsCategoryMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallGoodsMapper; |
| | | import cc.mrbird.febs.mall.service.IApiMallGoodsCategoryService; |
| | | import cc.mrbird.febs.mall.vo.AdminWorldAddressVo; |
| | | import cc.mrbird.febs.mall.vo.MallGoodsCategoryVo; |
| | |
| | | public class ApiMallGoodsCategoryServiceImpl extends ServiceImpl<MallGoodsCategoryMapper, MallGoodsCategory> implements IApiMallGoodsCategoryService { |
| | | |
| | | private final MallAddressWorldMapper mallAddressWorldMapper; |
| | | private final MallGoodsMapper mallGoodsMapper; |
| | | |
| | | @Override |
| | | public List<MallGoodsCategoryVo> findAllCategoryList() { |
| | | return this.baseMapper.selectAllCategoryList(); |
| | | List<MallGoodsCategoryVo> mallGoodsCategoryVos = this.baseMapper.selectAllCategoryList(); |
| | | if(CollUtil.isNotEmpty(mallGoodsCategoryVos)){ |
| | | mallGoodsCategoryVos.forEach(item -> { |
| | | Long id = item.getId(); |
| | | List<MallGoods> mallGoods = mallGoodsMapper.selectList( |
| | | new LambdaQueryWrapper<MallGoods>() |
| | | .select(MallGoods::getId) |
| | | .eq(MallGoods::getCategoryId, id)); |
| | | if(CollUtil.isNotEmpty(mallGoods)){ |
| | | mallGoodsCategoryVos.remove(item); |
| | | } |
| | | }); |
| | | } |
| | | return mallGoodsCategoryVos; |
| | | } |
| | | |
| | | @Override |