|
|
|
@ -4,6 +4,7 @@ import cn.estsh.i3plus.core.api.iservice.busi.ICoreTreeService;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ModelEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.platform.CommonTreeModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysDepartment;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
|
|
|
|
@ -313,7 +314,11 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
@Override
|
|
|
|
|
public List<CommonTreeModel> findOrganizeDepartment(long parentId) {
|
|
|
|
|
List<CommonTreeModel> result = new ArrayList<>();
|
|
|
|
|
List<SysOrganize> list = organizeRDao.findByProperty("parentId", parentId);
|
|
|
|
|
|
|
|
|
|
StringBuffer hql = new StringBuffer();
|
|
|
|
|
HqlPack.getNumEqualPack(parentId,"parentId",hql);
|
|
|
|
|
HqlPack.getOrderByPack(new Object[]{2}, new String[]{"organizeSort"}, hql);
|
|
|
|
|
List<SysOrganize> list = organizeRDao.findByHqlWhere(hql.toString());
|
|
|
|
|
|
|
|
|
|
// 循环设置子集
|
|
|
|
|
if(list != null && list.size() > 0){
|
|
|
|
@ -357,7 +362,11 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
if(bean instanceof SysOrganize){
|
|
|
|
|
SysOrganize organize = (SysOrganize) bean;
|
|
|
|
|
|
|
|
|
|
List<SysOrganize> organizeList = organizeRDao.findByProperty("parentId", organize.getId());
|
|
|
|
|
StringBuffer hql = new StringBuffer();
|
|
|
|
|
HqlPack.getNumEqualPack(organize.getId(),"parentId",hql);
|
|
|
|
|
HqlPack.getOrderByPack(new Object[]{2}, new String[]{"organizeSort"}, hql);
|
|
|
|
|
List<SysOrganize> organizeList = organizeRDao.findByHqlWhere(hql.toString());
|
|
|
|
|
|
|
|
|
|
if(organizeList != null && organizeList.size() > 0){
|
|
|
|
|
for (SysOrganize org : organizeList) {
|
|
|
|
|
treeModel = new CommonTreeModel();
|
|
|
|
@ -370,7 +379,11 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<SysDepartment> departmentList = departmentRDao.findByProperty("organizeId", organize.getId());
|
|
|
|
|
StringBuffer depHQL = new StringBuffer();
|
|
|
|
|
HqlPack.getNumEqualPack(organize.getId(),"organizeId",depHQL);
|
|
|
|
|
HqlPack.getOrderByPack(new Object[]{2}, new String[]{"departmentSort"}, depHQL);
|
|
|
|
|
List<SysDepartment> departmentList = departmentRDao.findByHqlWhere(depHQL.toString());
|
|
|
|
|
|
|
|
|
|
if(departmentList != null && departmentList.size() > 0){
|
|
|
|
|
for (SysDepartment department : departmentList) {
|
|
|
|
|
if(department.getParentId() != null && department.getParentId() < 0){
|
|
|
|
@ -387,7 +400,12 @@ public class CoreTreeService implements ICoreTreeService {
|
|
|
|
|
LOGGER.info("【{}】包含子集:{},步长:{}", parent.getBean().getClass().getName(), parent.getChildList().size(), step);
|
|
|
|
|
}else if(bean instanceof SysDepartment){
|
|
|
|
|
SysDepartment department = (SysDepartment) bean;
|
|
|
|
|
List<SysDepartment> departmentList = departmentRDao.findByProperty("parentId", department.getId());
|
|
|
|
|
|
|
|
|
|
StringBuffer depHQL = new StringBuffer();
|
|
|
|
|
HqlPack.getNumEqualPack(department.getId(),"parentId",depHQL);
|
|
|
|
|
HqlPack.getOrderByPack(new Object[]{2}, new String[]{"departmentSort"}, depHQL);
|
|
|
|
|
List<SysDepartment> departmentList = departmentRDao.findByHqlWhere(depHQL.toString());
|
|
|
|
|
|
|
|
|
|
if(departmentList != null && departmentList.size() > 0){
|
|
|
|
|
for (SysDepartment dep : departmentList) {
|
|
|
|
|
treeModel = new CommonTreeModel();
|
|
|
|
|