|
@@ -67,7 +67,7 @@ public class RelationReportService implements IRelationReportService {
|
|
|
private String defaultCode;
|
|
|
|
|
|
@Override
|
|
|
- public List<ObjectTypeDefine> queryClassList(String groupCode, String projectId, String classCode, String objType, String ascOrder) {
|
|
|
+ public List<ObjectTypeDefine> queryClassList(String groupCode, String projectId, String classCode, Set<String> objTypes, String ascOrder) {
|
|
|
groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
|
|
|
ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
@@ -76,15 +76,19 @@ public class RelationReportService implements IRelationReportService {
|
|
|
if (StrUtil.isNotBlank(classCode)) {
|
|
|
condition.put("code", classCode);
|
|
|
}
|
|
|
- if (StrUtil.isNotBlank(objType)) {
|
|
|
- condition.put("objType", objType);
|
|
|
+ if (CollectionUtil.isNotEmpty(objTypes)) {
|
|
|
+ JSONObject arrays = new JSONObject();
|
|
|
+ arrays.put("$in", objTypes);
|
|
|
+ condition.putPOJO("objType", objTypes);
|
|
|
}
|
|
|
classCriteria.setCriteria(condition);
|
|
|
if (StrUtil.isNotBlank(ascOrder)) {
|
|
|
classCriteria.setOrders(Collections.singletonList(OrderItem.asc(ascOrder)));
|
|
|
}
|
|
|
- List<ObjectTypeDefine> objectNodes = DigitalDefineFacade.queryObjectType(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, classCriteria);
|
|
|
- return CollectionUtil.isEmpty(objectNodes) ? Lists.newArrayList() : objectNodes;
|
|
|
+ classCriteria.setSize(500L);
|
|
|
+ List<ObjectTypeDefine> all = new ArrayList<ObjectTypeDefine>();
|
|
|
+ this.queryPageClass(all, classCriteria, groupCode, projectId, 1L);
|
|
|
+ return all;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -307,8 +311,11 @@ public class RelationReportService implements IRelationReportService {
|
|
|
criteria.put(key, value);
|
|
|
criteria.put("objType", objType);
|
|
|
queryCriteria.setCriteria(criteria);
|
|
|
- List<ObjectNode> objectNodes = DigitalObjectFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
|
|
|
- return objectNodes;
|
|
|
+ queryCriteria.setSize(500L);
|
|
|
+
|
|
|
+ List<ObjectNode> all = new ArrayList<ObjectNode>();
|
|
|
+ this.queryPageObjects(all, queryCriteria, groupCode, projectId, 1L);
|
|
|
+ return all;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -352,12 +359,14 @@ public class RelationReportService implements IRelationReportService {
|
|
|
if (StrUtil.isNotBlank(objType)) {
|
|
|
object.put("objType", objType);
|
|
|
}
|
|
|
+ objectCriteria.setSize(500L);
|
|
|
objectCriteria.setCriteria(object);
|
|
|
if (StrUtil.isNotBlank(ascOrder)) {
|
|
|
objectCriteria.setOrders(Collections.singletonList(OrderItem.asc(ascOrder)));
|
|
|
}
|
|
|
- List<ObjectNode> objectNodes = DigitalObjectFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, objectCriteria);
|
|
|
- return CollectionUtil.isEmpty(objectNodes) ? Lists.newArrayList() : objectNodes;
|
|
|
+ List<ObjectNode> all = new ArrayList<ObjectNode>();
|
|
|
+ this.queryPageObjects(all, objectCriteria, groupCode, projectId, 1L);
|
|
|
+ return all;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -399,8 +408,10 @@ public class RelationReportService implements IRelationReportService {
|
|
|
condition.putPOJO("classCode", arrays);
|
|
|
}
|
|
|
queryCriteria.setCriteria(condition);
|
|
|
- List<ObjectInfoDefine> infos = DigitalObjectInfoFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
|
|
|
- return CollectionUtil.isEmpty(infos) ? Lists.newArrayList() : infos;
|
|
|
+ queryCriteria.setSize(500L);
|
|
|
+ List<ObjectInfoDefine> all = new ArrayList<ObjectInfoDefine>();
|
|
|
+ this.queryPageFunids(all, queryCriteria, groupCode, projectId, 1L);
|
|
|
+ return all;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -717,4 +728,64 @@ public class RelationReportService implements IRelationReportService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /***************************************************** 所有接口的额外分页查询 **********************************************/
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询类定义数据
|
|
|
+ *
|
|
|
+ * @param all
|
|
|
+ * @param classCriteria
|
|
|
+ * @param groupCode
|
|
|
+ * @param projectId
|
|
|
+ * @param page
|
|
|
+ */
|
|
|
+ private void queryPageClass(List<ObjectTypeDefine> all, QueryCriteria classCriteria, String groupCode, String projectId, long page) {
|
|
|
+ classCriteria.setPage(page);
|
|
|
+ List<ObjectTypeDefine> objectNodes = DigitalDefineFacade.queryObjectType(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, classCriteria);
|
|
|
+ if (CollectionUtil.isEmpty(objectNodes)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ all.addAll(objectNodes);
|
|
|
+ this.queryPageClass(all, classCriteria, groupCode, projectId, ++page);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询对象数据
|
|
|
+ *
|
|
|
+ * @param all
|
|
|
+ * @param objectCriteria
|
|
|
+ * @param groupCode
|
|
|
+ * @param projectId
|
|
|
+ * @param page
|
|
|
+ */
|
|
|
+ private void queryPageObjects(List<ObjectNode> all, QueryCriteria objectCriteria, String groupCode, String projectId, long page) {
|
|
|
+ objectCriteria.setPage(page);
|
|
|
+ List<ObjectNode> objectNodes = DigitalObjectFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, objectCriteria);
|
|
|
+ if (CollectionUtil.isEmpty(objectNodes)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ all.addAll(objectNodes);
|
|
|
+ this.queryPageObjects(all, objectCriteria, groupCode, projectId, ++page);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询信息点定义数据
|
|
|
+ *
|
|
|
+ * @param all
|
|
|
+ * @param classCriteria
|
|
|
+ * @param groupCode
|
|
|
+ * @param projectId
|
|
|
+ * @param page
|
|
|
+ */
|
|
|
+ private void queryPageFunids(List<ObjectInfoDefine> all, QueryCriteria queryCriteria, String groupCode, String projectId, long page) {
|
|
|
+ queryCriteria.setPage(page);
|
|
|
+ List<ObjectInfoDefine> infos = DigitalObjectInfoFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
|
|
|
+ if (CollectionUtil.isEmpty(infos)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ all.addAll(infos);
|
|
|
+ this.queryPageFunids(all, queryCriteria, groupCode, projectId, ++page);
|
|
|
+ }
|
|
|
+
|
|
|
}
|