diff --git a/cellsysOrg.js b/cellsysOrg.js index 52118db..92b56ec 100644 --- a/cellsysOrg.js +++ b/cellsysOrg.js @@ -296,9 +296,9 @@ class CellsysOrg { /** * 查询组织内的所有App */ - queryApps(pageInfo, order, filters) { + queryApps(pageInfo, order, filters,getUnion) { let query = new Query(); - query.addFilter('org_id', Operator.Equals, this.id); + // query.addFilter('org_id', Operator.Equals, this.id); if (pageInfo) { query.setCurrPage(pageInfo.currPage); query.setPageSize(pageInfo.pageSize); @@ -313,7 +313,14 @@ class CellsysOrg { query.addFilter(item['name'], item['operator'], item['value']); }); } - let queryTask = new QueryTask(QueryType.App, pageInfo ? true : false); + let queryType=QueryType.App + if (this.unionStatus === 1 && getUnion === true) { + //联合状态为父级组织,并且需要获取联合信息 + queryType = QueryType.UnionApp; + } else { + query.setOrder({ org_id: 'asc', id: 'desc' }); + } + let queryTask = new QueryTask(queryType, pageInfo ? true : false); return new Promise((resolve, reject) => { queryTask .execute(query) @@ -346,9 +353,9 @@ class CellsysOrg { * @param order * @returns {Promise} */ - queryAppListByPublish(pageInfo, filters, order) { + queryAppListByPublish(pageInfo, filters, order,getUnion) { let query = new Query(); - query.addFilter('org_id', Operator.Equals, this.id); + // query.addFilter('org_id', Operator.Equals, this.id); query.addFilter('is_publish', Operator.Equals, 1); if (pageInfo) { query.setCurrPage(pageInfo.currPage); @@ -364,7 +371,14 @@ class CellsysOrg { query.addFilter(item['name'], item['operator'], item['value']); }); } - let queryTask = new QueryTask(QueryType.App, pageInfo ? true : false); + let queryType=QueryType.App + if (this.unionStatus === 1 && getUnion === true) { + //联合状态为父级组织,并且需要获取联合信息 + queryType = QueryType.UnionApp; + } else { + query.setOrder({ org_id: 'asc', id: 'desc' }); + } + let queryTask = new QueryTask(queryType, pageInfo ? true : false); return new Promise((resolve, reject) => { queryTask .execute(query) diff --git a/cellsysUtil.js b/cellsysUtil.js index 3589942..682b72a 100644 --- a/cellsysUtil.js +++ b/cellsysUtil.js @@ -54,6 +54,8 @@ const QueryType = { UnionMemberTypeUser: '/rpc/view_org_union_member_type_user', // 门户中App的列表 App: '/rpc/view_org_app_basic', //查询应用基础列表2(含原始应用id)view_app_basic不含 + //查询组织联合的u应用列表 + UnionApp: '/rpc/view_org_union_app', // 应用模板 AppModel: '/rpc/view_app_model', AppModelType: '/rpc/view_app_model_type',