|
|
@ -1,7 +1,9 @@
|
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@ -54,6 +56,32 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|
|
|
return ztrees;
|
|
|
|
return ztrees;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 查询部门管理树(排除下级)
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param deptId 部门ID
|
|
|
|
|
|
|
|
* @return 所有部门信息
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@DataScope(deptAlias = "d")
|
|
|
|
|
|
|
|
public List<Ztree> selectDeptTreeExcludeChild(SysDept dept)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Long deptId = dept.getDeptId();
|
|
|
|
|
|
|
|
List<SysDept> deptList = deptMapper.selectDeptList(dept);
|
|
|
|
|
|
|
|
Iterator<SysDept> it = deptList.iterator();
|
|
|
|
|
|
|
|
while (it.hasNext())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SysDept d = (SysDept) it.next();
|
|
|
|
|
|
|
|
if (d.getDeptId().intValue() == deptId
|
|
|
|
|
|
|
|
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
it.remove();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Ztree> ztrees = initZtree(deptList);
|
|
|
|
|
|
|
|
return ztrees;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据角色ID查询部门(数据权限)
|
|
|
|
* 根据角色ID查询部门(数据权限)
|
|
|
|
*
|
|
|
|
*
|
|
|
|