KKSU
2025-01-08 a0bf7c7be9e52bf179db59117fc3660c24604a96
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsCategoryServiceImpl.java
@@ -1,9 +1,11 @@
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;
@@ -27,10 +29,24 @@
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