|
@@ -16,7 +16,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
|
+import java.util.Comparator;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 基础资料-知识-分类
|
|
* @Description: 基础资料-知识-分类
|
|
@@ -104,7 +106,8 @@ public class CategoryServiceImpl extends ServiceImpl<KmsCategoryMapper, Category
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<Category> queryTreeListNoPage(QueryWrapper<Category> queryWrapper) {
|
|
public List<Category> queryTreeListNoPage(QueryWrapper<Category> queryWrapper) {
|
|
- List<Category> dataList = baseMapper.selectList(queryWrapper);
|
|
|
|
|
|
+ List<Category> dataList1 = baseMapper.selectList(queryWrapper);
|
|
|
|
+ List<Category> dataList = dataList1.stream().sorted(Comparator.comparingInt(p -> p.getSortNo())).collect(Collectors.toList());
|
|
List<Category> mapList = new ArrayList<>();
|
|
List<Category> mapList = new ArrayList<>();
|
|
for (Category data : dataList) {
|
|
for (Category data : dataList) {
|
|
String pidVal = data.getPid();
|
|
String pidVal = data.getPid();
|
|
@@ -145,7 +148,7 @@ public class CategoryServiceImpl extends ServiceImpl<KmsCategoryMapper, Category
|
|
List<SelectTreeModel> selectTreeModels = baseMapper.queryListByPidPrivilege(pid, null, sql);
|
|
List<SelectTreeModel> selectTreeModels = baseMapper.queryListByPidPrivilege(pid, null, sql);
|
|
//获取公共数据
|
|
//获取公共数据
|
|
selectTreeModels.addAll(baseMapper.queryListByPidNoPrivilege(pid, null));
|
|
selectTreeModels.addAll(baseMapper.queryListByPidNoPrivilege(pid, null));
|
|
-
|
|
|
|
|
|
+ selectTreeModels.stream().sorted(Comparator.comparingInt(p -> p.getSort())).collect(Collectors.toList());
|
|
return selectTreeModels;
|
|
return selectTreeModels;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -161,6 +164,7 @@ public class CategoryServiceImpl extends ServiceImpl<KmsCategoryMapper, Category
|
|
List<SelectTreeModel> selectTreeModels = baseMapper.queryListByPidPrivilege(pid, null, sql);
|
|
List<SelectTreeModel> selectTreeModels = baseMapper.queryListByPidPrivilege(pid, null, sql);
|
|
//获取公共数据
|
|
//获取公共数据
|
|
selectTreeModels.addAll(baseMapper.queryListByPidNoPrivilege(pid, null));
|
|
selectTreeModels.addAll(baseMapper.queryListByPidNoPrivilege(pid, null));
|
|
|
|
+ selectTreeModels.stream().sorted(Comparator.comparingInt(p -> p.getSort())).collect(Collectors.toList());
|
|
return selectTreeModels;
|
|
return selectTreeModels;
|
|
}
|
|
}
|
|
|
|
|