|
@@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.persagy.dmp.basic.model.QueryCriteria;
|
|
|
import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
|
|
|
+import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
|
|
|
import com.persagy.proxy.adm.constant.AdmDictConstant;
|
|
|
import com.persagy.proxy.adm.constant.AdmDictCategoryEnum;
|
|
|
import com.persagy.proxy.adm.request.AdmCreateRequest;
|
|
@@ -50,13 +51,14 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
|
|
|
@Override
|
|
|
public AdmResponse queryCategory(InstanceUrlParam context , AdmDict request, Class<T> clazz) {
|
|
|
String type = request.getType();
|
|
|
+ AdmResponse admResponse = new AdmResponse();
|
|
|
QueryCriteria criteria = new QueryCriteria();
|
|
|
ObjectNode node = JsonNodeFactory.instance.objectNode();
|
|
|
if(AdmDictCategoryEnum.MAJOR.getValue().equals(type)){
|
|
|
//查询专业分类
|
|
|
node.put("type",AdmDictCategoryEnum.MAJOR.getValue());
|
|
|
criteria.setCriteria(node);
|
|
|
- return doQueryDictData(context, criteria, clazz);
|
|
|
+ admResponse = doQueryDictData(context, criteria, clazz);
|
|
|
}
|
|
|
|
|
|
List<String> baseCategory = getDictBaseCategory();
|
|
@@ -64,7 +66,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
|
|
|
//查询设备类型:equipment,部件类型:component,输入系统类型:system,输入专业类型:major,业务空间类型 space ,资产 property
|
|
|
node.put("objType",type);
|
|
|
criteria.setCriteria(node);
|
|
|
- return doQueryObjectType(context, criteria, clazz);
|
|
|
+ admResponse = doQueryObjectType(context, criteria, clazz);
|
|
|
}
|
|
|
|
|
|
if(AdmDictCategoryEnum.EQUIPMENT_AND_COMPONENT.getValue().equals(type)){
|
|
@@ -73,15 +75,25 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
|
|
|
arrayNode.add(AdmDictCategoryEnum.COMPONENT.getValue());
|
|
|
arrayNode.add(AdmDictCategoryEnum.EQUIPMENT.getValue());
|
|
|
criteria.setCriteria(node);
|
|
|
- return doQueryObjectType(context, criteria, clazz);
|
|
|
+ admResponse = doQueryObjectType(context, criteria, clazz);
|
|
|
}
|
|
|
List<String> dictTreeCategory = getDictTreeCategory();
|
|
|
if(dictTreeCategory.contains(type)){
|
|
|
//查询树形结构:专业和系统:majorSystem(树),设备类型要以及对应的部件equipmentComponent(树),专业下的设备类型 majorEquipment(树),
|
|
|
//专业下的系统,系统下的设备majorSystemEquip (树),systemEquip 系统下的设备类(树)
|
|
|
- return queryDictObjectTypeTree(context ,type,clazz);
|
|
|
+ admResponse = queryDictObjectTypeTree(context ,type,clazz);
|
|
|
}
|
|
|
- return null;
|
|
|
+
|
|
|
+ QueryCriteria criteriaCollect = new QueryCriteria();
|
|
|
+ ObjectNode nodeCol = JsonNodeFactory.instance.objectNode();
|
|
|
+ nodeCol.put("projectId", context.getProjectId());
|
|
|
+ criteriaCollect.setCriteria(nodeCol);
|
|
|
+
|
|
|
+ AdmResponse colType = doQueryObjectTypeCollect(context, criteriaCollect);
|
|
|
+ List<AdmObjectType> admObjectTypes = (List<AdmObjectType>) admResponse.getContent();
|
|
|
+ List<ObjectTypeCollect> collectList = (List<ObjectTypeCollect>) colType.getContent();
|
|
|
+ admResponse.setContent(doSetObjectTypeCollect(admObjectTypes, collectList));
|
|
|
+ return admResponse;
|
|
|
}
|
|
|
|
|
|
|