Selaa lähdekoodia

作者:张哲
时间:2023/03/27
类型:开发
描述:里程碑(3) 公司统计修改(知识统计)

zizg 1 vuosi sitten
vanhempi
commit
f721ffee92

+ 8 - 7
src/main/java/com/redxun/knowledge/analysis/service/AnalysisCommonServiceImpl.java

@@ -274,25 +274,26 @@ public class AnalysisCommonServiceImpl {
             return knowledgeCompanyVo;
         }).collect(Collectors.toList());
         //排序
-        String sort = queryData.getParams().get("sort");
+        String sort = queryData.getSortField();
         if (sort != null) {
+            sort = sort + queryData.getSortOrder();
             switch (sort) {
-                case "totalDesc":
+                case "totaldesc":
                     result = result.stream().sorted((t1, t2) -> t2.getTotal().compareTo(t1.getTotal())).collect(Collectors.toList());
                     break;
-                case "totalAsc":
+                case "totalasc":
                     result = result.stream().sorted(Comparator.comparing(KnowledgeCompanyVo::getTotal)).collect(Collectors.toList());
                     break;
-                case "archiveDesc":
+                case "archivedesc":
                     result = result.stream().sorted((t1, t2) -> t2.getArchive().compareTo(t1.getArchive())).collect(Collectors.toList());
                     break;
-                case "archiveAsc":
+                case "archiveasc":
                     result = result.stream().sorted(Comparator.comparing(KnowledgeCompanyVo::getArchive)).collect(Collectors.toList());
                     break;
-                case "wikiDesc":
+                case "wikidesc":
                     result = result.stream().sorted((t1, t2) -> t2.getWiki().compareTo(t1.getWiki())).collect(Collectors.toList());
                     break;
-                case "wikiAsc":
+                case "wikiasc":
                     result = result.stream().sorted(Comparator.comparing(KnowledgeCompanyVo::getWiki)).collect(Collectors.toList());
                     break;
             }