|
@@ -1,16 +1,12 @@
|
|
|
package com.persagy.proxy.adm.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
|
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.define.entity.ObjectInfoCollect;
|
|
|
-import com.persagy.dmp.define.entity.ObjectInfoDefine;
|
|
|
import com.persagy.proxy.adm.constant.AdmDictConstant;
|
|
|
import com.persagy.proxy.adm.constant.enums.AdmDictCategoryEnum;
|
|
|
import com.persagy.proxy.adm.model.*;
|
|
@@ -21,10 +17,12 @@ import com.persagy.proxy.adm.service.IAdmDictService;
|
|
|
import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
-import org.springframework.context.annotation.Primary;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Iterator;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -48,7 +46,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@Override
|
|
|
- public AdmResponse queryCategory(InstanceUrlParam context , AdmDict request, Class<T> clazz) throws Exception {
|
|
|
+ public AdmResponse queryCategory(InstanceUrlParam context , AdmDict request, Class<T> clazz) {
|
|
|
String type = request.getType();
|
|
|
QueryCriteria criteria = new QueryCriteria();
|
|
|
ObjectNode node = JsonNodeFactory.instance.objectNode();
|
|
@@ -99,11 +97,11 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
|
|
|
AdmResponse admResponse = doQueryObjectType(context, new QueryCriteria(), clazz);
|
|
|
List<AdmObjectType> objectTypes = (List<AdmObjectType>) admResponse.getContent();
|
|
|
Map<String, List<AdmObjectType>> objectTypeMap = objectTypes.stream().filter(k-> StringUtils.isNotEmpty(k.getObjType()))
|
|
|
- .collect(Collectors.groupingBy(AdmObjectType::getObjType));
|
|
|
+ .collect(Collectors.groupingBy(AdmObjectType::getObjType));
|
|
|
//获取专业-设备类关系
|
|
|
List<AdmObjectType> equipments = objectTypeMap.get(AdmDictCategoryEnum.EQUIPMENT.getValue());
|
|
|
Map<String,List<AdmObjectType>> majorEquipMap = equipments.stream().filter(k->StringUtils.isNotEmpty(k.getMajorCode()))
|
|
|
- .collect(Collectors.groupingBy(item -> item.getMajorCode()));
|
|
|
+ .collect(Collectors.groupingBy(item -> item.getMajorCode()));
|
|
|
|
|
|
//获取专业-系统类关系
|
|
|
List<AdmObjectType> systems = objectTypeMap.get(AdmDictCategoryEnum.SYSTEM.getValue());
|
|
@@ -157,7 +155,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
|
|
|
}
|
|
|
//构建专业-系统-设备类树形结构
|
|
|
for (AdmObjectType major : allMajor) {
|
|
|
- //设置专业
|
|
|
+ //设置专业
|
|
|
if(CollUtil.isNotEmpty(majorSystemMap)){
|
|
|
//专业下的系统
|
|
|
List<AdmObjectType> systemCodes = majorSystemMap.get(major.getCode());
|
|
@@ -302,8 +300,8 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
|
|
|
String name = null;
|
|
|
//项目
|
|
|
if(AdmDictCategoryEnum.PROJECT.getValue().equals(type)){
|
|
|
- name = AdmDictCategoryEnum.PROJECT.getDesc();
|
|
|
- classCodes.add(AdmDictCategoryEnum.PROJECT.getValue());
|
|
|
+ name = AdmDictCategoryEnum.PROJECT.getDesc();
|
|
|
+ classCodes.add(AdmDictCategoryEnum.PROJECT.getValue());
|
|
|
}
|
|
|
//建筑
|
|
|
if(AdmDictCategoryEnum.BUILDING.getValue().equals(type)){
|
|
@@ -369,6 +367,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
|
|
|
Map<String, Boolean> projectObjectInfoCollectMap = projectObjectInfoCollect.stream().filter(item -> StrUtil.isNotEmpty(item.getDefineInfoId())).collect(Collectors.toMap(ObjectInfoCollect::getDefineInfoId,ObjectInfoCollect::getVisiable));
|
|
|
|
|
|
String dictType = request.getDictType();
|
|
|
+
|
|
|
//采集值配置查询
|
|
|
if(StringUtils.isNotEmpty(dictType)){
|
|
|
//查询平台级、项目级信息点采集信息
|
|
@@ -381,6 +380,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
|
|
|
admResponse.setContent(admObjectInfos);
|
|
|
return admResponse;
|
|
|
}
|
|
|
+
|
|
|
//只查看采集值 todo
|
|
|
if(CollUtil.isNotEmpty(projectObjectInfoCollectMap)){
|
|
|
setOnlyQueryObjectInfoVisiable(admObjectInfos,projectObjectInfoCollectMap,dictType);
|