refactor(mall): 优化分类服务接口实现

- 移除了 PdfUtil 类中的未使用代码- 简化了 TzCategoryServiceImpl 中的分类添加逻辑- 增加了 TzCategoryServiceImpl 中根据父级 ID 查询子类信息的方法注释
This commit is contained in:
清晨
2025-05-12 14:44:09 +08:00
parent ad2776df97
commit 1d180d33a9
2 changed files with 10 additions and 5 deletions

View File

@@ -78,11 +78,7 @@ public class TzCategoryServiceImpl implements ITzCategoryService {
}
bo.setRecTime(new Date());
TzCategory add = MapstructUtils.convert(bo, TzCategory.class);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setCategoryId(add.getCategoryId());
}
return flag;
return baseMapper.insert(add) > 0;
}
/**
@@ -115,6 +111,12 @@ public class TzCategoryServiceImpl implements ITzCategoryService {
return baseMapper.deleteByIds(ids) > 0;
}
/**
* 根据父级ID查询子类信息
*
* @param parentId
* @return
*/
@Override
public List<TzCategoryVo> listByParentId(Long parentId) {
return baseMapper.selectVoList(new LambdaQueryWrapper<TzCategory>().eq(TzCategory::getParentId, parentId).eq(TzCategory::getStatus,1).eq(TzCategory::getSubset,1));