|
@@ -23,7 +23,9 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: 基础资料-知识-分类
|
|
@@ -58,12 +60,13 @@ public class CategoryController extends JeecgController<Category, ICategoryServi
|
|
|
HttpServletRequest req) {
|
|
|
String hasQuery = req.getParameter("hasQuery");
|
|
|
// if (hasQuery != null && "true".equals(hasQuery)) {
|
|
|
- QueryWrapper<Category> queryWrapper = QueryGenerator.initQueryWrapper(category, req.getParameterMap());
|
|
|
- List<Category> list = categoryService.queryTreeListNoPage(queryWrapper);
|
|
|
- IPage<Category> pageList = new Page<>(1, 10, list.size());
|
|
|
- pageList.setRecords(list);
|
|
|
- System.out.println("hasQuery:" + hasQuery);
|
|
|
- return Result.OK(pageList);
|
|
|
+ QueryWrapper<Category> queryWrapper = QueryGenerator.initQueryWrapper(category, req.getParameterMap());
|
|
|
+ List<Category> list1 = categoryService.queryTreeListNoPage(queryWrapper);
|
|
|
+ IPage<Category> pageList = new Page<>(1, 10, list1.size());
|
|
|
+ List<Category> list = list1.stream().sorted(Comparator.comparingInt(p -> p.getSortNo())).collect(Collectors.toList());
|
|
|
+ pageList.setRecords(list);
|
|
|
+ System.out.println("hasQuery:" + hasQuery);
|
|
|
+ return Result.OK(pageList);
|
|
|
// } else {
|
|
|
// System.out.println("hasQuery:" + hasQuery);
|
|
|
// String parentId = category.getPid();
|