|
@@ -6,19 +6,13 @@ import com.dragoninfo.dcuc.app.dto.dataresource.ChildResourceClassify;
|
|
import com.dragoninfo.dcuc.app.dto.dataresource.ResourceClassify;
|
|
import com.dragoninfo.dcuc.app.dto.dataresource.ResourceClassify;
|
|
import com.dragoninfo.dcuc.app.dto.sub.DataClaAcceptDTO;
|
|
import com.dragoninfo.dcuc.app.dto.sub.DataClaAcceptDTO;
|
|
import com.dragoninfo.dcuc.app.dto.sub.FieldClaAcceptDTO;
|
|
import com.dragoninfo.dcuc.app.dto.sub.FieldClaAcceptDTO;
|
|
-import com.dragoninfo.dcuc.app.entity.DataColInfo;
|
|
|
|
-import com.dragoninfo.dcuc.app.entity.DataTabInfo;
|
|
|
|
-import com.dragoninfo.dcuc.app.entity.sub.DataCla;
|
|
|
|
-import com.dragoninfo.dcuc.app.entity.sub.DataLevel;
|
|
|
|
-import com.dragoninfo.dcuc.app.entity.sub.DataSec;
|
|
|
|
-import com.dragoninfo.dcuc.app.entity.sub.FieldCla;
|
|
|
|
|
|
+import com.dragoninfo.dcuc.app.entity.sub.*;
|
|
|
|
+import com.dragoninfo.dcuc.app.enumresources.AppDataTypeEnum;
|
|
import com.dragoninfo.dcuc.app.enumresources.DataAttrTypeEnum;
|
|
import com.dragoninfo.dcuc.app.enumresources.DataAttrTypeEnum;
|
|
import com.dragoninfo.dcuc.app.enumresources.DataResourceEnum;
|
|
import com.dragoninfo.dcuc.app.enumresources.DataResourceEnum;
|
|
import com.dragoninfo.dcuc.app.enumresources.sub.DataClaTypeEnum;
|
|
import com.dragoninfo.dcuc.app.enumresources.sub.DataClaTypeEnum;
|
|
import com.dragoninfo.dcuc.app.enumresources.sub.FieldClaTypeEnum;
|
|
import com.dragoninfo.dcuc.app.enumresources.sub.FieldClaTypeEnum;
|
|
-import com.dragoninfo.dcuc.app.service.IDataColInfoService;
|
|
|
|
import com.dragoninfo.dcuc.app.service.IDataResourceService;
|
|
import com.dragoninfo.dcuc.app.service.IDataResourceService;
|
|
-import com.dragoninfo.dcuc.app.service.IDataTabInfoService;
|
|
|
|
import com.dragoninfo.dcuc.app.service.sub.*;
|
|
import com.dragoninfo.dcuc.app.service.sub.*;
|
|
import com.dragoninfo.dcuc.app.vo.*;
|
|
import com.dragoninfo.dcuc.app.vo.*;
|
|
import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
@@ -61,10 +55,10 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
private IFieldClaService fieldClaService;
|
|
private IFieldClaService fieldClaService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private IDataTabInfoService tabInfoService;
|
|
|
|
|
|
+ private IAppDataResourceInfoService tabInfoService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private IDataColInfoService colInfoService;
|
|
|
|
|
|
+ private IAppDataItemInfoService colInfoService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IDataCatalogBusiness dataCatalogBusiness;
|
|
private IDataCatalogBusiness dataCatalogBusiness;
|
|
@@ -80,21 +74,21 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
//表:数据分级 数据资源分类
|
|
//表:数据分级 数据资源分类
|
|
if (DataAttrTypeEnum.DATA_ATTR_TABLE.getValue().equals(attrType)) {
|
|
if (DataAttrTypeEnum.DATA_ATTR_TABLE.getValue().equals(attrType)) {
|
|
// 查询所有的表和列
|
|
// 查询所有的表和列
|
|
- List<DataTabInfo> tabInfos = tabInfoService.getAllTabInfos();
|
|
|
|
- List<DataColInfo> colInfos = colInfoService.getAllColInfos();
|
|
|
|
|
|
+ List<AppDataResourceInfo> tabInfos = tabInfoService.getHasClassifyTables();
|
|
result.add(getDataLevelTree());
|
|
result.add(getDataLevelTree());
|
|
- result.add(getDataClassifyTree(tabInfos, colInfos));
|
|
|
|
|
|
+ result.add(getDataClassifyTree(tabInfos));
|
|
} else if (DataAttrTypeEnum.DATA_ATTR_COLUMN.getValue().equals(attrType)) {
|
|
} else if (DataAttrTypeEnum.DATA_ATTR_COLUMN.getValue().equals(attrType)) {
|
|
- List<DataColInfo> colInfos = colInfoService.getAllColInfos();
|
|
|
|
|
|
+ List<AppDataResourceInfo> tabInfos = tabInfoService.getAllTabInfos();
|
|
|
|
+ List<AppDataItemInfo> colInfos = colInfoService.getHasClassifyColInfos();
|
|
result.add(getSecurityLevelTree());
|
|
result.add(getSecurityLevelTree());
|
|
- result.add(getFieldClassifyTree(colInfos));
|
|
|
|
|
|
+ result.add(getFieldClassifyTree(tabInfos, colInfos));
|
|
} else {
|
|
} else {
|
|
- List<DataTabInfo> tabInfos = tabInfoService.getAllTabInfos();
|
|
|
|
- List<DataColInfo> colInfos = colInfoService.getAllColInfos();
|
|
|
|
|
|
+ List<AppDataResourceInfo> tabInfos = tabInfoService.getAllTabInfos();
|
|
|
|
+ List<AppDataItemInfo> colInfos = colInfoService.getHasClassifyColInfos();
|
|
result.add(getDataLevelTree());
|
|
result.add(getDataLevelTree());
|
|
- result.add(getDataClassifyTree(tabInfos, colInfos));
|
|
|
|
|
|
+ result.add(getDataClassifyTree(tabInfos));
|
|
result.add(getSecurityLevelTree());
|
|
result.add(getSecurityLevelTree());
|
|
- result.add(getFieldClassifyTree(colInfos));
|
|
|
|
|
|
+ result.add(getFieldClassifyTree(tabInfos, colInfos));
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -103,23 +97,23 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
public DataResourceClassifyVo getDataResourceTree(String typeCode) {
|
|
public DataResourceClassifyVo getDataResourceTree(String typeCode) {
|
|
DataResourceClassifyVo result = null;
|
|
DataResourceClassifyVo result = null;
|
|
DataResourceEnum dataResourceEnum = Enum.valueOf(DataResourceEnum.class, typeCode);
|
|
DataResourceEnum dataResourceEnum = Enum.valueOf(DataResourceEnum.class, typeCode);
|
|
- List<DataColInfo> colInfos = null;
|
|
|
|
- List<DataTabInfo> tabInfos = null;
|
|
|
|
|
|
+ List<AppDataItemInfo> colInfos = null;
|
|
|
|
+ List<AppDataResourceInfo> tabInfos = null;
|
|
switch (dataResourceEnum) {
|
|
switch (dataResourceEnum) {
|
|
case DATA_CLASSIFY:
|
|
case DATA_CLASSIFY:
|
|
result = getDataLevelTree();
|
|
result = getDataLevelTree();
|
|
break;
|
|
break;
|
|
case COLUMN_CLASSIFY:
|
|
case COLUMN_CLASSIFY:
|
|
- colInfos = colInfoService.getAllColInfos();
|
|
|
|
- result = getFieldClassifyTree(colInfos);
|
|
|
|
|
|
+ tabInfos = tabInfoService.getAllTabInfos();
|
|
|
|
+ colInfos = colInfoService.getHasClassifyColInfos();
|
|
|
|
+ result = getFieldClassifyTree(tabInfos, colInfos);
|
|
break;
|
|
break;
|
|
case DATA_SECURITY_LEVEL:
|
|
case DATA_SECURITY_LEVEL:
|
|
result = getSecurityLevelTree();
|
|
result = getSecurityLevelTree();
|
|
break;
|
|
break;
|
|
case DATA_RESOURCE_CLASSIFY:
|
|
case DATA_RESOURCE_CLASSIFY:
|
|
- tabInfos = tabInfoService.getAllTabInfos();
|
|
|
|
- colInfos = colInfoService.getAllColInfos();
|
|
|
|
- result = getDataClassifyTree(tabInfos, colInfos);
|
|
|
|
|
|
+ tabInfos = tabInfoService.getHasClassifyTables();
|
|
|
|
+ result = getDataClassifyTree(tabInfos);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
@@ -202,10 +196,9 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
return dataResourceClassifyVo;
|
|
return dataResourceClassifyVo;
|
|
}
|
|
}
|
|
|
|
|
|
- private DataResourceClassifyVo getDataClassifyTree(List<DataTabInfo> tabInfos, List<DataColInfo> colInfos) {
|
|
|
|
|
|
+ private DataResourceClassifyVo getDataClassifyTree(List<AppDataResourceInfo> tabInfos) {
|
|
// 将表分类映射到表
|
|
// 将表分类映射到表
|
|
- Map<String, List<DataTabInfo>> tabLabMap = getTabLabGroupMap(tabInfos);
|
|
|
|
- Map<String, List<DataColInfo>> colTaMap = colInfos.stream().collect(Collectors.groupingBy(DataColInfo::getTaCode));
|
|
|
|
|
|
+ Map<String, List<AppDataResourceInfo>> tabLabMap = getTabLabGroupMap(tabInfos);
|
|
|
|
|
|
DataResourceEnum dataResourceEnum = DataResourceEnum.DATA_RESOURCE_CLASSIFY;
|
|
DataResourceEnum dataResourceEnum = DataResourceEnum.DATA_RESOURCE_CLASSIFY;
|
|
|
|
|
|
@@ -238,7 +231,7 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
resourceVo.setTotal(0);
|
|
resourceVo.setTotal(0);
|
|
} else {
|
|
} else {
|
|
// 拼接表、列、pid
|
|
// 拼接表、列、pid
|
|
- boolean b = combinePidAndTabCol(topTreeVo, tabLabMap, colTaMap);
|
|
|
|
|
|
+ boolean b = combinePidAndTableInfo(topTreeVo, tabLabMap);
|
|
if (b) {
|
|
if (b) {
|
|
resourceVo.setNodes(new ArrayList<>());
|
|
resourceVo.setNodes(new ArrayList<>());
|
|
resourceVo.setTotal(0);
|
|
resourceVo.setTotal(0);
|
|
@@ -252,42 +245,42 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
return resourceVo;
|
|
return resourceVo;
|
|
}
|
|
}
|
|
|
|
|
|
- private Map<String, List<DataTabInfo>> getTabLabGroupMap(List<DataTabInfo> tabInfos) {
|
|
|
|
- Map<String, List<DataTabInfo>> group = new HashMap<>();
|
|
|
|
|
|
+ private Map<String, List<AppDataResourceInfo>> getTabLabGroupMap(List<AppDataResourceInfo> tabInfos) {
|
|
|
|
+ Map<String, List<AppDataResourceInfo>> group = new HashMap<>();
|
|
tabInfos.forEach(e -> {
|
|
tabInfos.forEach(e -> {
|
|
// 一级分类
|
|
// 一级分类
|
|
- String claFir = e.getDataClaFir();
|
|
|
|
|
|
+ String claFir = e.getDataClassifyOneCode();
|
|
if (StringUtils.isBlank(claFir)) {
|
|
if (StringUtils.isBlank(claFir)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
// 二级分类
|
|
// 二级分类
|
|
- String claSec = e.getLabSec();
|
|
|
|
|
|
+ String claSec = e.getDataClassifyTwoCode();
|
|
if (StringUtils.isBlank(claSec)) {
|
|
if (StringUtils.isBlank(claSec)) {
|
|
putInMap(group, e, claFir);
|
|
putInMap(group, e, claFir);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
// 标签1
|
|
// 标签1
|
|
- String labFir = e.getLabFir();
|
|
|
|
|
|
+ String labFir = e.getDataLabelOneCode();
|
|
if (StringUtils.isNotBlank(labFir)) {
|
|
if (StringUtils.isNotBlank(labFir)) {
|
|
labFir = CommonCons.LAB_CLA_FIR + CommonCons.ID_SEPARATOR + labFir;
|
|
labFir = CommonCons.LAB_CLA_FIR + CommonCons.ID_SEPARATOR + labFir;
|
|
}
|
|
}
|
|
// 标签2
|
|
// 标签2
|
|
- String labSec = e.getLabSec();
|
|
|
|
|
|
+ String labSec = e.getDataLabelTwoCode();
|
|
if (StringUtils.isNotBlank(labSec)) {
|
|
if (StringUtils.isNotBlank(labSec)) {
|
|
labSec = CommonCons.LAB_CLA_SEC + CommonCons.ID_SEPARATOR + labSec;
|
|
labSec = CommonCons.LAB_CLA_SEC + CommonCons.ID_SEPARATOR + labSec;
|
|
}
|
|
}
|
|
// 标签3
|
|
// 标签3
|
|
- String labThr = e.getLabThr();
|
|
|
|
|
|
+ String labThr = e.getDataLabelThreeCode();
|
|
if (StringUtils.isNotBlank(labThr)) {
|
|
if (StringUtils.isNotBlank(labThr)) {
|
|
labThr = CommonCons.LAB_CLA_THI + CommonCons.ID_SEPARATOR + labThr;
|
|
labThr = CommonCons.LAB_CLA_THI + CommonCons.ID_SEPARATOR + labThr;
|
|
}
|
|
}
|
|
// 标签4
|
|
// 标签4
|
|
- String labFour = e.getLabFour();
|
|
|
|
|
|
+ String labFour = e.getDataLabelFourCode();
|
|
if (StringUtils.isNotBlank(labFour)) {
|
|
if (StringUtils.isNotBlank(labFour)) {
|
|
labFour = CommonCons.LAB_CLA_FOUR + CommonCons.ID_SEPARATOR + labFour;
|
|
labFour = CommonCons.LAB_CLA_FOUR + CommonCons.ID_SEPARATOR + labFour;
|
|
}
|
|
}
|
|
// 标签5
|
|
// 标签5
|
|
- String labFiv = e.getLabFiv();
|
|
|
|
|
|
+ String labFiv = e.getDataLabelFiveCode();
|
|
if (StringUtils.isNotBlank(labFiv)) {
|
|
if (StringUtils.isNotBlank(labFiv)) {
|
|
labFiv = CommonCons.LAB_CLA_FIV + CommonCons.ID_SEPARATOR + labFiv;
|
|
labFiv = CommonCons.LAB_CLA_FIV + CommonCons.ID_SEPARATOR + labFiv;
|
|
}
|
|
}
|
|
@@ -305,8 +298,8 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
return group;
|
|
return group;
|
|
}
|
|
}
|
|
|
|
|
|
- private void putInMap(Map<String, List<DataTabInfo>> group, DataTabInfo e, String claFir) {
|
|
|
|
- List<DataTabInfo> list = group.get(claFir);
|
|
|
|
|
|
+ private void putInMap(Map<String, List<AppDataResourceInfo>> group, AppDataResourceInfo e, String claFir) {
|
|
|
|
+ List<AppDataResourceInfo> list = group.get(claFir);
|
|
if (null == list) {
|
|
if (null == list) {
|
|
list = new ArrayList<>();
|
|
list = new ArrayList<>();
|
|
}
|
|
}
|
|
@@ -325,9 +318,11 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private DataResourceClassifyVo getFieldClassifyTree(List<DataColInfo> colInfos) {
|
|
|
|
-
|
|
|
|
- Map<String, List<DataColInfo>> colInfosMap = getColumnClaGroupMap(colInfos);
|
|
|
|
|
|
+ private DataResourceClassifyVo getFieldClassifyTree(List<AppDataResourceInfo> tabInfos, List<AppDataItemInfo> colInfos) {
|
|
|
|
+ Map<String, AppDataResourceInfo> tableMap = tabInfos
|
|
|
|
+ .stream()
|
|
|
|
+ .collect(Collectors.toMap(AppDataResourceInfo::getDataObjectId, e -> e));
|
|
|
|
+ Map<String, List<AppDataItemInfo>> colInfosMap = getColumnClaGroupMap(colInfos);
|
|
|
|
|
|
DataResourceEnum dataResourceEnum = DataResourceEnum.COLUMN_CLASSIFY;
|
|
DataResourceEnum dataResourceEnum = DataResourceEnum.COLUMN_CLASSIFY;
|
|
|
|
|
|
@@ -348,7 +343,7 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
resourceVo.setNodes(new ArrayList<>());
|
|
resourceVo.setNodes(new ArrayList<>());
|
|
resourceVo.setTotal(0);
|
|
resourceVo.setTotal(0);
|
|
} else {
|
|
} else {
|
|
- boolean b = combinePidCol(topTreeVo, colInfosMap);
|
|
|
|
|
|
+ boolean b = combinePidTabAndCol(topTreeVo, tableMap, colInfosMap);
|
|
if (b) {
|
|
if (b) {
|
|
resourceVo.setNodes(new ArrayList<>());
|
|
resourceVo.setNodes(new ArrayList<>());
|
|
resourceVo.setTotal(0);
|
|
resourceVo.setTotal(0);
|
|
@@ -361,11 +356,11 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
return resourceVo;
|
|
return resourceVo;
|
|
}
|
|
}
|
|
|
|
|
|
- private Map<String, List<DataColInfo>> getColumnClaGroupMap(List<DataColInfo> colInfos) {
|
|
|
|
- return colInfos.stream().collect(Collectors.groupingBy(DataColInfo::getColClaSec));
|
|
|
|
|
|
+ private Map<String, List<AppDataItemInfo>> getColumnClaGroupMap(List<AppDataItemInfo> colInfos) {
|
|
|
|
+ return colInfos.stream().collect(Collectors.groupingBy(AppDataItemInfo::getColumnClassify));
|
|
}
|
|
}
|
|
|
|
|
|
- private boolean combinePidCol(DataResourceTreeVo treeVo, Map<String, List<DataColInfo>> colInfosMap) {
|
|
|
|
|
|
+ private boolean combinePidTabAndCol(DataResourceTreeVo treeVo, Map<String, AppDataResourceInfo> tableMap, Map<String, List<AppDataItemInfo>> colInfosMap) {
|
|
List<DataResourceTreeVo> child = treeVo.getChild();
|
|
List<DataResourceTreeVo> child = treeVo.getChild();
|
|
Iterator<DataResourceTreeVo> iterator = child.iterator();
|
|
Iterator<DataResourceTreeVo> iterator = child.iterator();
|
|
while (iterator.hasNext()) {
|
|
while (iterator.hasNext()) {
|
|
@@ -375,19 +370,24 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
List<DataResourceTreeVo> cc = childVo.getChild();
|
|
List<DataResourceTreeVo> cc = childVo.getChild();
|
|
if (CollectionUtils.isNotEmpty(cc)) {
|
|
if (CollectionUtils.isNotEmpty(cc)) {
|
|
childVo.setTreeNode(true);
|
|
childVo.setTreeNode(true);
|
|
- boolean emptyChild = combinePidCol(childVo, colInfosMap);
|
|
|
|
|
|
+ boolean emptyChild = combinePidTabAndCol(childVo, tableMap, colInfosMap);
|
|
if (emptyChild) {
|
|
if (emptyChild) {
|
|
iterator.remove();
|
|
iterator.remove();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// 如果为叶子节点,查找对应的表和列
|
|
// 如果为叶子节点,查找对应的表和列
|
|
// 如果查找不到表和列则移除
|
|
// 如果查找不到表和列则移除
|
|
- String id = childVo.getId();
|
|
|
|
- List<DataColInfo> dataColInfo = colInfosMap.get(childVo.getCode());
|
|
|
|
|
|
+ List<AppDataItemInfo> dataColInfo = colInfosMap.get(childVo.getCode());
|
|
if (dataColInfo == null) {
|
|
if (dataColInfo == null) {
|
|
iterator.remove();
|
|
iterator.remove();
|
|
} else {
|
|
} else {
|
|
- List<DataResourceTreeVo> tableVos = convertColumnToTreeVo(childVo.getId(), dataColInfo);
|
|
|
|
|
|
+ Map<String, List<AppDataItemInfo>> tableGroup = dataColInfo.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(AppDataItemInfo::getResourceTableId));
|
|
|
|
+ List<DataResourceTreeVo> tableVos = tableGroup.entrySet().stream().map(e -> {
|
|
|
|
+ String tableId = e.getKey();
|
|
|
|
+ AppDataResourceInfo table = tableMap.get(tableId);
|
|
|
|
+ return convertTableToTreeVo(childVo.getId(), Collections.singletonList(table), tableGroup);
|
|
|
|
+ }).flatMap(List::stream).collect(Collectors.toList());
|
|
childVo.setTreeNode(true);
|
|
childVo.setTreeNode(true);
|
|
childVo.setChild(tableVos);
|
|
childVo.setChild(tableVos);
|
|
}
|
|
}
|
|
@@ -425,7 +425,7 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<DataLevelVo> getSecurityLevelList() {
|
|
public List<DataLevelVo> getSecurityLevelList() {
|
|
- List<DataSec> all = dataSecService.getAll();
|
|
|
|
|
|
+ List<FieldSec> all = dataSecService.getAll();
|
|
return all.stream()
|
|
return all.stream()
|
|
.map(item -> new DataLevelVo(item.getId(), item.getSecCode(), item.getSecName(), item.getDataType()))
|
|
.map(item -> new DataLevelVo(item.getId(), item.getSecCode(), item.getSecName(), item.getDataType()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -636,7 +636,7 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
} else if (DataResourceEnum.DATA_SECURITY_LEVEL.equals(anEnum)) {
|
|
} else if (DataResourceEnum.DATA_SECURITY_LEVEL.equals(anEnum)) {
|
|
- List<DataSec> list = dataSecService.getByIds(ids);
|
|
|
|
|
|
+ List<FieldSec> list = dataSecService.getByIds(ids);
|
|
list.stream().map(item -> {
|
|
list.stream().map(item -> {
|
|
DataLevelVo vo = new DataLevelVo();
|
|
DataLevelVo vo = new DataLevelVo();
|
|
vo.setTypeCode(item.getDataType());
|
|
vo.setTypeCode(item.getDataType());
|
|
@@ -677,7 +677,7 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
vo.setLevelName(dataCla.getName());
|
|
vo.setLevelName(dataCla.getName());
|
|
vo.setTypeCode(dataCla.getCode());
|
|
vo.setTypeCode(dataCla.getCode());
|
|
} else if (DataResourceEnum.DATA_SECURITY_LEVEL.equals(anEnum)) {
|
|
} else if (DataResourceEnum.DATA_SECURITY_LEVEL.equals(anEnum)) {
|
|
- DataSec dataSec = dataSecService.getById(id);
|
|
|
|
|
|
+ FieldSec dataSec = dataSecService.getById(id);
|
|
vo.setId(dataSec.getId());
|
|
vo.setId(dataSec.getId());
|
|
vo.setLevelCode(dataSec.getSecCode());
|
|
vo.setLevelCode(dataSec.getSecCode());
|
|
vo.setLevelName(dataSec.getSecName());
|
|
vo.setLevelName(dataSec.getSecName());
|
|
@@ -794,10 +794,9 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
*
|
|
*
|
|
* @param treeVo
|
|
* @param treeVo
|
|
* @param tabInfosMap
|
|
* @param tabInfosMap
|
|
- * @param colInfosMap
|
|
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- private boolean combinePidAndTabCol(DataResourceTreeVo treeVo, Map<String, List<DataTabInfo>> tabInfosMap, Map<String, List<DataColInfo>> colInfosMap) {
|
|
|
|
|
|
+ private boolean combinePidAndTableInfo(DataResourceTreeVo treeVo, Map<String, List<AppDataResourceInfo>> tabInfosMap) {
|
|
List<DataResourceTreeVo> child = treeVo.getChild();
|
|
List<DataResourceTreeVo> child = treeVo.getChild();
|
|
Iterator<DataResourceTreeVo> iterator = child.iterator();
|
|
Iterator<DataResourceTreeVo> iterator = child.iterator();
|
|
while (iterator.hasNext()) {
|
|
while (iterator.hasNext()) {
|
|
@@ -807,7 +806,7 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
List<DataResourceTreeVo> cc = childVo.getChild();
|
|
List<DataResourceTreeVo> cc = childVo.getChild();
|
|
if (CollectionUtils.isNotEmpty(cc)) {
|
|
if (CollectionUtils.isNotEmpty(cc)) {
|
|
childVo.setTreeNode(true);
|
|
childVo.setTreeNode(true);
|
|
- boolean emptyChild = combinePidAndTabCol(childVo, tabInfosMap, colInfosMap);
|
|
|
|
|
|
+ boolean emptyChild = combinePidAndTableInfo(childVo, tabInfosMap);
|
|
if (emptyChild) {
|
|
if (emptyChild) {
|
|
iterator.remove();
|
|
iterator.remove();
|
|
}
|
|
}
|
|
@@ -818,11 +817,11 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
String classifyCode = DataResourceEnum.DATA_RESOURCE_CLASSIFY.getCode();
|
|
String classifyCode = DataResourceEnum.DATA_RESOURCE_CLASSIFY.getCode();
|
|
if (id.startsWith(classifyCode)) {
|
|
if (id.startsWith(classifyCode)) {
|
|
String replace = id.replace(classifyCode + CommonCons.ID_SEPARATOR, "");
|
|
String replace = id.replace(classifyCode + CommonCons.ID_SEPARATOR, "");
|
|
- List<DataTabInfo> dataTabInfo = tabInfosMap.get(replace);
|
|
|
|
|
|
+ List<AppDataResourceInfo> dataTabInfo = tabInfosMap.get(replace);
|
|
if (dataTabInfo == null) {
|
|
if (dataTabInfo == null) {
|
|
iterator.remove();
|
|
iterator.remove();
|
|
} else {
|
|
} else {
|
|
- List<DataResourceTreeVo> tableVos = convertTableToTreeVo(childVo, dataTabInfo, colInfosMap);
|
|
|
|
|
|
+ List<DataResourceTreeVo> tableVos = convertTableToTreeVo(childVo.getId(), dataTabInfo, null);
|
|
childVo.setTreeNode(true);
|
|
childVo.setTreeNode(true);
|
|
childVo.setChild(tableVos);
|
|
childVo.setChild(tableVos);
|
|
}
|
|
}
|
|
@@ -833,33 +832,35 @@ public class DataResourceFacade implements IDataResourceFacade {
|
|
return CollectionUtils.isEmpty(child);
|
|
return CollectionUtils.isEmpty(child);
|
|
}
|
|
}
|
|
|
|
|
|
- private List<DataResourceTreeVo> convertTableToTreeVo(DataResourceTreeVo childVo, List<DataTabInfo> dataTabInfo, Map<String, List<DataColInfo>> colInfosMap) {
|
|
|
|
|
|
+ private List<DataResourceTreeVo> convertTableToTreeVo(String pid, List<AppDataResourceInfo> dataTabInfo, Map<String, List<AppDataItemInfo>> colInfosMap) {
|
|
return dataTabInfo.stream().map(e -> {
|
|
return dataTabInfo.stream().map(e -> {
|
|
DataResourceTreeVo vo = new DataResourceTreeVo();
|
|
DataResourceTreeVo vo = new DataResourceTreeVo();
|
|
vo.setId(e.getId());
|
|
vo.setId(e.getId());
|
|
- vo.setPId(childVo.getId());
|
|
|
|
- vo.setLabel(e.getName());
|
|
|
|
- vo.setDataType(DataResourceEnum.TAB.getCode());
|
|
|
|
- List<DataColInfo> colInfoList = colInfosMap.get(e.getCode());
|
|
|
|
- if (CollectionUtils.isNotEmpty(colInfoList)) {
|
|
|
|
- List<DataResourceTreeVo> colVos = convertColumnToTreeVo(e.getId(), colInfoList);
|
|
|
|
- vo.setChild(colVos);
|
|
|
|
- vo.setTreeNode(true);
|
|
|
|
- } else {
|
|
|
|
- vo.setChild(Collections.emptyList());
|
|
|
|
- vo.setTreeNode(false);
|
|
|
|
|
|
+ vo.setPId(pid);
|
|
|
|
+ vo.setLabel(e.getTableName());
|
|
|
|
+ vo.setDataType(AppDataTypeEnum.TAB.getValue());
|
|
|
|
+ if (null != colInfosMap) {
|
|
|
|
+ List<AppDataItemInfo> colInfoList = colInfosMap.get(e.getDataObjectId());
|
|
|
|
+ if (CollectionUtils.isNotEmpty(colInfoList)) {
|
|
|
|
+ List<DataResourceTreeVo> colVos = convertColumnToTreeVo(e.getId(), colInfoList);
|
|
|
|
+ vo.setChild(colVos);
|
|
|
|
+ vo.setTreeNode(true);
|
|
|
|
+ } else {
|
|
|
|
+ vo.setChild(Collections.emptyList());
|
|
|
|
+ vo.setTreeNode(false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return vo;
|
|
return vo;
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
|
|
- private List<DataResourceTreeVo> convertColumnToTreeVo(String pid, List<DataColInfo> colInfoList) {
|
|
|
|
|
|
+ private List<DataResourceTreeVo> convertColumnToTreeVo(String pid, List<AppDataItemInfo> colInfoList) {
|
|
return colInfoList.stream().map(e -> {
|
|
return colInfoList.stream().map(e -> {
|
|
DataResourceTreeVo vo = new DataResourceTreeVo();
|
|
DataResourceTreeVo vo = new DataResourceTreeVo();
|
|
vo.setId(e.getId());
|
|
vo.setId(e.getId());
|
|
vo.setPId(pid);
|
|
vo.setPId(pid);
|
|
- vo.setLabel(e.getName());
|
|
|
|
- vo.setDataType(DataResourceEnum.COL.getCode());
|
|
|
|
|
|
+ vo.setLabel(e.getColumnName());
|
|
|
|
+ vo.setDataType(AppDataTypeEnum.COL.getValue());
|
|
return vo;
|
|
return vo;
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
}
|
|
}
|