【8.3.3】【org】更新树排序,改为sorted排序

pull/62/head
stylefeng 2025-01-26 19:03:09 +08:00
parent 445a246de1
commit 179f0930f7
2 changed files with 8 additions and 4 deletions

View File

@ -2,7 +2,7 @@ package cn.stylefeng.roses.kernel.sys.modular.org.entity;
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseExpandFieldEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.tree.factory.base.AbstractTreeNode;
import cn.stylefeng.roses.kernel.rule.tree.factory.base.AbstractSortedTreeNode;
import cn.stylefeng.roses.kernel.sys.api.entity.OrganizationLevel;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@ -20,7 +20,7 @@ import java.util.List;
@TableName(value = "sys_hr_organization", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class HrOrganization extends BaseExpandFieldEntity implements AbstractTreeNode<HrOrganization> {
public class HrOrganization extends BaseExpandFieldEntity implements AbstractSortedTreeNode<HrOrganization> {
/**
*
@ -196,4 +196,8 @@ public class HrOrganization extends BaseExpandFieldEntity implements AbstractTre
this.children = childrenNodes;
}
@Override
public BigDecimal getSort() {
return this.orgSort;
}
}

View File

@ -26,7 +26,7 @@ import cn.stylefeng.roses.kernel.rule.enums.StatusEnum;
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
import cn.stylefeng.roses.kernel.rule.pidset.ParentIdParseUtil;
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
import cn.stylefeng.roses.kernel.rule.tree.factory.DefaultTreeBuildFactory;
import cn.stylefeng.roses.kernel.rule.tree.factory.SortedTreeBuildFactory;
import cn.stylefeng.roses.kernel.sys.api.callback.RemoveOrgCallbackApi;
import cn.stylefeng.roses.kernel.sys.api.constants.SysConstants;
import cn.stylefeng.roses.kernel.sys.api.entity.OrganizationLevel;
@ -307,7 +307,7 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
// 构建树形结构
if (ObjectUtil.isNotEmpty(commonOrgTreeRequest.getSearchText()) || ObjectUtil.isNotEmpty(
commonOrgTreeRequest.getIndexOrgIdList())) {
newNotRepeatList = new DefaultTreeBuildFactory<HrOrganization>().doTreeBuild(newNotRepeatList);
newNotRepeatList = new SortedTreeBuildFactory<HrOrganization>().doTreeBuild(newNotRepeatList);
}
// 遍历所有节点查询这些节点有没有子级填充haveSubOrgFlag