refactor(mall): 优化分类服务接口实现
- 移除了 PdfUtil 类中的未使用代码- 简化了 TzCategoryServiceImpl 中的分类添加逻辑- 增加了 TzCategoryServiceImpl 中根据父级 ID 查询子类信息的方法注释
This commit is contained in:
@@ -8,6 +8,9 @@ import com.aspose.words.SaveFormat;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* @author Maosw
|
||||
*/
|
||||
public class PdfUtil {
|
||||
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user