|
|
@@ -31,7 +31,7 @@ public class ModelCatalogTreeHandler extends AbstractTreeHandler<DefaultEntity> |
|
|
|
private long prj_id;//所属项目 |
|
|
|
private int type;//查询类型:0-目录;1-表定义;2-页面定义 |
|
|
|
private boolean exc_empty;//排除空目录,type非目录时有效 |
|
|
|
|
|
|
|
private boolean exc_depend;//排除依赖项目的目录 |
|
|
|
private ModelCatalogTreeHelper mcTreeHelper = null; |
|
|
|
|
|
|
|
//模块子页面,暂存 |
|
|
@@ -43,6 +43,7 @@ public class ModelCatalogTreeHandler extends AbstractTreeHandler<DefaultEntity> |
|
|
|
type = params.readInt("type"); |
|
|
|
prj_id = params.readLong("prj_id"); |
|
|
|
exc_empty = params.readBool("exc_empty"); |
|
|
|
exc_depend = params.readBool("exc_depend"); |
|
|
|
mcTreeHelper = (ModelCatalogTreeHelper) TreeHelper.getTreeHelper(ModelCatalog.ENTITY_NAME, ModelCatalogTreeHelper.class); |
|
|
|
} |
|
|
|
|
|
|
@@ -56,7 +57,7 @@ public class ModelCatalogTreeHandler extends AbstractTreeHandler<DefaultEntity> |
|
|
|
|
|
|
|
@Override |
|
|
|
protected List<DefaultEntity> filterData() { |
|
|
|
Set<Long> setId = ModelProjectCache.getInstance().getDependsPrjIds(prj_id); |
|
|
|
Set<Long> setId =exc_depend ? new HashSet<>(Arrays.asList(prj_id)) : ModelProjectCache.getInstance().getDependsPrjIds(prj_id); |
|
|
|
if (setId.isEmpty()) return new ArrayList<>(); |
|
|
|
String sqlPrjId = CommUtil.getSqlInIds(setId); |
|
|
|
|
|
|
@@ -93,7 +94,7 @@ public class ModelCatalogTreeHandler extends AbstractTreeHandler<DefaultEntity> |
|
|
|
|
|
|
|
@Override |
|
|
|
protected List<DefaultEntity> getChildren(long id) { |
|
|
|
List<ModelCatalog> list = mcTreeHelper.getChildren(id, prj_id, (o1, o2) -> CommUtil.chineseCompare(o1.getName(), o2.getName())); |
|
|
|
List<ModelCatalog> list = mcTreeHelper.getChildren(id, prj_id,exc_depend, (o1, o2) -> CommUtil.chineseCompare(o1.getName(), o2.getName())); |
|
|
|
List<DefaultEntity> listRet; |
|
|
|
if (type != TYPE_CATALOG && exc_empty) {//排除空目录 |
|
|
|
listRet = cleanEmpty(list); |
|
|
@@ -141,7 +142,7 @@ public class ModelCatalogTreeHandler extends AbstractTreeHandler<DefaultEntity> |
|
|
|
addPageChildren(listRet, mc.getId(), type); |
|
|
|
} |
|
|
|
if (!listRet.isEmpty()) return true; |
|
|
|
List<ModelCatalog> list = mcTreeHelper.getChildren(mc.getId(), prj_id, null); |
|
|
|
List<ModelCatalog> list = mcTreeHelper.getChildren(mc.getId(), prj_id,exc_depend,null); |
|
|
|
if (list == null || list.isEmpty()) return false; |
|
|
|
for (ModelCatalog c : list) { |
|
|
|
if (hasChildren(c)) return true; |
|
|
@@ -223,6 +224,8 @@ public class ModelCatalogTreeHandler extends AbstractTreeHandler<DefaultEntity> |
|
|
|
} else if (bean instanceof ModelForm) { |
|
|
|
final ModelForm form = (ModelForm) bean; |
|
|
|
node.put("type", form.getType() + 2); |
|
|
|
// 返回页面名称 |
|
|
|
bean.put("pageName",ModelProjectCache.getInstance().getModule(((ModelForm) bean).getPrjId())+"."+((ModelForm) bean).getName()); |
|
|
|
//是模块,需要加子页面 |
|
|
|
if (form.getType() == SwEnum.FormType.MODULE.value) { |
|
|
|
List<DefaultEntity> lf = mapFormChild.get(form.getEntityId()); |
|
|
|