|
@@ -14,10 +14,7 @@ import org.jeecg.modules.kms.knowledge.entity.Article;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Comparator;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -107,7 +104,7 @@ public class CategoryServiceImpl extends ServiceImpl<KmsCategoryMapper, Category
|
|
|
@Override
|
|
|
public List<Category> queryTreeListNoPage(QueryWrapper<Category> queryWrapper) {
|
|
|
List<Category> dataList1 = baseMapper.selectList(queryWrapper);
|
|
|
- List<Category> dataList = dataList1.stream().sorted(Comparator.comparingInt(p -> p.getSortNo())).collect(Collectors.toList());
|
|
|
+ List<Category> dataList = dataList1.stream().sorted(Comparator.comparingInt(p -> Optional.ofNullable(p.getSortNo()).orElse(0))).collect(Collectors.toList());
|
|
|
List<Category> mapList = new ArrayList<>();
|
|
|
for (Category data : dataList) {
|
|
|
String pidVal = data.getPid();
|
|
@@ -148,7 +145,7 @@ public class CategoryServiceImpl extends ServiceImpl<KmsCategoryMapper, Category
|
|
|
List<SelectTreeModel> selectTreeModels = baseMapper.queryListByPidPrivilege(pid, null, sql);
|
|
|
//获取公共数据
|
|
|
selectTreeModels.addAll(baseMapper.queryListByPidNoPrivilege(pid, null));
|
|
|
- selectTreeModels.stream().sorted(Comparator.comparingInt(p -> p.getSort())).collect(Collectors.toList());
|
|
|
+ selectTreeModels.stream().sorted(Comparator.comparingInt(p -> Optional.ofNullable(p.getSort()).orElse(0))).collect(Collectors.toList());
|
|
|
return selectTreeModels;
|
|
|
}
|
|
|
|
|
@@ -164,7 +161,7 @@ public class CategoryServiceImpl extends ServiceImpl<KmsCategoryMapper, Category
|
|
|
List<SelectTreeModel> selectTreeModels = baseMapper.queryListByPidPrivilege(pid, null, sql);
|
|
|
//获取公共数据
|
|
|
selectTreeModels.addAll(baseMapper.queryListByPidNoPrivilege(pid, null));
|
|
|
- selectTreeModels.stream().sorted(Comparator.comparingInt(p -> p.getSort())).collect(Collectors.toList());
|
|
|
+ selectTreeModels.stream().sorted(Comparator.comparingInt(p -> Optional.ofNullable(p.getSort()).orElse(0))).collect(Collectors.toList());
|
|
|
return selectTreeModels;
|
|
|
}
|
|
|
|