|
|
|
@ -17,6 +17,7 @@ import cn.estsh.i3plus.pojo.platform.repository.SysPositionRepository;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -50,6 +51,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
private SysMenuRepository menuRDao;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取岗位树",notes = "根据父节点获取岗位树集合")
|
|
|
|
|
public List<SysPosition> findSysPositionTreeByParentId(long parentId) {
|
|
|
|
|
List<SysPosition> result = positionRDao.findByProperty("parentId", parentId);
|
|
|
|
|
|
|
|
|
@ -64,6 +66,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取岗位树",notes = "根据父节点获取岗位树")
|
|
|
|
|
public SysPosition getSysPositionTreeById(long id) {
|
|
|
|
|
// 查找数据
|
|
|
|
|
SysPosition position = positionRDao.getById(id);
|
|
|
|
@ -76,6 +79,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "封装岗位树",notes = "封装当前岗位树")
|
|
|
|
|
public void findSysPositionChildrenTreePack(SysPosition parent, int step) {
|
|
|
|
|
++step;
|
|
|
|
|
List<SysPosition> childList = positionRDao.findByProperty("parentId", parent.getId());
|
|
|
|
@ -92,12 +96,14 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "父节点检查",notes = "检查岗位的父节点是否是当前节点的子节点")
|
|
|
|
|
public void doValidatorSysPositionParentId(SysPosition position) {
|
|
|
|
|
findSysPositionChildrenTreePack(position,0);
|
|
|
|
|
validatorSysPositionParentId(position.getChildList(),position.getParentId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取部门树",notes = "根据父节点获取部门树集合")
|
|
|
|
|
public List<SysDepartment> findSysDepartmentTreeByParentId(long parentId) {
|
|
|
|
|
List<SysDepartment> result = departmentRDao.findByProperty("parentId", parentId);
|
|
|
|
|
|
|
|
|
@ -112,6 +118,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取部门树",notes = "根据父节点获取部门树")
|
|
|
|
|
public SysDepartment getSysDepartmentTreeById(long id) {
|
|
|
|
|
// 查找数据
|
|
|
|
|
SysDepartment department = departmentRDao.getById(id);
|
|
|
|
@ -124,6 +131,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "封装部门树",notes = "封装当前部门树")
|
|
|
|
|
public void findSysDepartmentChildrenTreePack(SysDepartment parent, int step) {
|
|
|
|
|
++step;
|
|
|
|
|
List<SysDepartment> childList = departmentRDao.findByProperty("parentId", parent.getId());
|
|
|
|
@ -140,12 +148,14 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "父节点检查",notes = "检查部门的父节点是否是当前节点的子节点")
|
|
|
|
|
public void doValidatorSysDepartmentParentId(SysDepartment department) {
|
|
|
|
|
findSysDepartmentChildrenTreePack(department,0);
|
|
|
|
|
validatorSysDepartmentParentId(department.getChildList(),department.getParentId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取组织树",notes = "根据父节点获取组织树集合")
|
|
|
|
|
public List<SysOrganize> findSysOrganizeTreeByParentId(long parentId) {
|
|
|
|
|
StringBuffer orgHQL = new StringBuffer();
|
|
|
|
|
HqlPack.getNumEqualPack(parentId,"parentId",orgHQL);
|
|
|
|
@ -163,6 +173,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取组织树",notes = "根据父节点获取组织树")
|
|
|
|
|
public SysOrganize getSysOrganizeTreeById(long id) {
|
|
|
|
|
// 查找数据
|
|
|
|
|
SysOrganize organize = organizeRDao.getById(id);
|
|
|
|
@ -175,6 +186,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "封装组织树",notes = "封装当前组织树")
|
|
|
|
|
public void findSysOrganizeChildrenTreePack(SysOrganize parent, int step) {
|
|
|
|
|
++step;
|
|
|
|
|
|
|
|
|
@ -194,12 +206,14 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "父节点检查",notes = "检查组织的父节点是否是当前节点的子节点")
|
|
|
|
|
public void doValidatorSysOrganizeParentId(SysOrganize organize) {
|
|
|
|
|
findSysOrganizeChildrenTreePack(organize,0);
|
|
|
|
|
validatorSysOrganizeParentId(organize.getChildList(),organize.getParentId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取菜单树",notes = "根据父节点获取菜单树集合")
|
|
|
|
|
public List<SysMenu> findSysMenuTreeByParentId(long parentId) {
|
|
|
|
|
List<SysMenu> result = menuRDao.findByProperty("parentId", parentId);
|
|
|
|
|
|
|
|
|
@ -214,6 +228,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取菜单树",notes = "根据父节点获取菜单树")
|
|
|
|
|
public SysMenu getSysMenuTreeById(long id) {
|
|
|
|
|
// 查找数据
|
|
|
|
|
SysMenu menu = menuRDao.getById(id);
|
|
|
|
@ -226,6 +241,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "封装菜单树",notes = "封装当前菜单树")
|
|
|
|
|
public void findSysMenuChildrenTreePack(SysMenu parent, int step) {
|
|
|
|
|
++step;
|
|
|
|
|
List<SysMenu> childList = menuRDao.findByProperty("parentId", parent.getId());
|
|
|
|
@ -241,6 +257,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "父节点检查",notes = "检查菜单的父节点是否是当前节点的子节点")
|
|
|
|
|
public void doValidatorSysMenuParentId(SysMenu menu) {
|
|
|
|
|
findSysMenuChildrenTreePack(menu,0);
|
|
|
|
|
validatorSysMenuParentId(menu.getChildList(),menu.getParentId());
|
|
|
|
@ -319,6 +336,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取组织部门树",notes = "根据父节点获取组织部门树集合")
|
|
|
|
|
public List<CommonTreeModel> findOrganizeDepartment(long parentId) {
|
|
|
|
|
List<CommonTreeModel> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
@ -345,6 +363,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "获取组织部门树",notes = "根据父节点获取组织部门树")
|
|
|
|
|
public CommonTreeModel getOrganizeById(long id) {
|
|
|
|
|
// 查找数据
|
|
|
|
|
SysOrganize organize = organizeRDao.getById(id);
|
|
|
|
@ -361,6 +380,7 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "封装菜单树",notes = "封装当前组织部门树")
|
|
|
|
|
public void findOrganizeTreePack(CommonTreeModel parent, int step) {
|
|
|
|
|
if(null != parent){
|
|
|
|
|
BaseBean bean = parent.getBean();
|
|
|
|
|