xiaoyong931011
2021-09-24 d867207d4bf46378718927444c7cef404b4a6a03
src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsCategoryService.java
@@ -5,6 +5,7 @@
import cc.mrbird.febs.mall.entity.MallGoodsCategory;
import cc.mrbird.febs.mall.mapper.MallGoodsCategoryMapper;
import cc.mrbird.febs.mall.service.IAdminMallGoodsCategoryService;
import cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryVo;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@@ -27,7 +28,7 @@
    @Override
    public IPage<MallGoodsCategory> getCategoryList(MallGoodsCategory mallGoodsCategory, QueryRequest request) {
        Page<MallGoodsCategory> page = new Page<>(request.getPageNum(), request.getPageSize());
        IPage<MallGoodsCategory> mallGoodsCategorys = this.baseMapper.selectCategoryList(page, mallGoodsCategory);
        IPage<MallGoodsCategory> mallGoodsCategorys = this.baseMapper.selectCategoryListInPage(page, mallGoodsCategory);
        return mallGoodsCategorys;
    }
@@ -44,7 +45,7 @@
        MallGoodsCategory goodsCategory = new MallGoodsCategory();
        goodsCategory.setName(name);
        goodsCategory.setIsComand(mallGoodsCategory.getIsComand());
        goodsCategory.setIsRecommend(mallGoodsCategory.getIsRecommend());
        if(ObjectUtil.isNotEmpty(mallGoodsCategory.getParentId())){
            Long parentId = mallGoodsCategory.getParentId();
            MallGoodsCategory mallGoodsCategoryParent = mallGoodsCategoryMapper.selectById(parentId);
@@ -54,6 +55,8 @@
            }else{
                goodsCategory.setParentIds(mallGoodsCategory.getParentId()+",");
            }
        }else{
            goodsCategory.setParentId(0L);
        }
        mallGoodsCategoryMapper.insert(goodsCategory);
        return new FebsResponse().success();
@@ -65,4 +68,9 @@
        return mallGoodsCategorys;
    }
    @Override
    public AdminMallGoodsCategoryVo getMallGoodsCategoryInfoById(long id) {
        return mallGoodsCategoryMapper.getMallGoodsCategoryInfoById(id);
    }
}