Ver código fonte

机构树bug修改

jingyuanchao 2 anos atrás
pai
commit
5a398ab36e

+ 2 - 2
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/vo/SysOrgVO.java

@@ -29,7 +29,7 @@ public class SysOrgVO {
     private Integer type;
     private String shortName;
     private String treeShowPath;
-    private Integer sort;
+    private Integer sort=0;
     @JsonSerialize(using = ToStringSerializer.class)
     private Long treeShowParentId;
     private List<SysOrgVO> children = new ArrayList<SysOrgVO>();
@@ -37,7 +37,7 @@ public class SysOrgVO {
 
     public List<SysOrgVO> getChildren() {
         if(children.size() > 0) {
-            children.stream().sorted(Comparator.comparing(SysOrgVO::getSort).reversed()).collect(Collectors.toList());
+            children.sort(Comparator.comparing(SysOrgVO::getSort).reversed());
         }
         return children;
     }

+ 1 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -629,7 +629,7 @@
                type,
                tree_show_parent_id,
                tree_show_path,
-               sort
+               sort as sort
         FROM sys_org
         WHERE deleted = 0
         ORDER BY isnull(sort),sort, path