|
@@ -1,6 +1,6 @@
|
|
|
package com.dragoninfo.dcuc.app.service.impl;
|
|
|
|
|
|
-import com.dragoninfo.dcuc.app.business.IResourceBusiness;
|
|
|
+import com.dragoninfo.dcuc.app.business.IDataCatalogBusiness;
|
|
|
import com.dragoninfo.dcuc.app.dto.dataresource.ResourceClassify;
|
|
|
import com.dragoninfo.dcuc.app.dto.dataresource.ResourceType;
|
|
|
import com.dragoninfo.dcuc.app.service.IDataResourceService;
|
|
@@ -18,34 +18,34 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
- * Created by lidr on 2021/4/14
|
|
|
+ * @author lidr
|
|
|
+ * @date 2021/4/14
|
|
|
*/
|
|
|
-@Transactional(rollbackFor = Exception.class)
|
|
|
@Service
|
|
|
public class DataResourceServiceImpl implements IDataResourceService {
|
|
|
|
|
|
Logger logger = LoggerFactory.getLogger(DataResourceServiceImpl.class);
|
|
|
|
|
|
@Autowired
|
|
|
- private IResourceBusiness resourceBusiness;
|
|
|
+ private IDataCatalogBusiness dataCatalogBusiness;
|
|
|
|
|
|
@Override
|
|
|
public List<ResourceClassify> getDataLevelList() {
|
|
|
- Map param = getParamMap(ResourceType.builder().typeCode("DATA_LEVEL").build());
|
|
|
- return resourceBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
+ Map<String, Object> param = getParamMap(ResourceType.builder().typeCode("DATA_LEVEL").build());
|
|
|
+ return dataCatalogBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
}.getType());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ResourceClassify> getSecurityLevelList() {
|
|
|
- Map param = getParamMap(ResourceType.builder().typeCode("DATA_SECURITY_LEVEL").build());
|
|
|
- return resourceBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
+ Map<String, Object> param = getParamMap(ResourceType.builder().typeCode("DATA_SECURITY_LEVEL").build());
|
|
|
+ return dataCatalogBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
}.getType());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ResourceClassify> getDataClassifyList() {
|
|
|
- Map param = getParamMap(true,
|
|
|
+ Map<String, Object> param = getParamMap(true,
|
|
|
ResourceType.builder().typeCode("RESOURCE_SJZZYJFL").build(),
|
|
|
ResourceType.builder().typeCode("RESOURCE_SJZZEJFL").build(),
|
|
|
ResourceType.builder().typeCode("RESOURCE_SJZYBQ1").build(),
|
|
@@ -54,30 +54,37 @@ public class DataResourceServiceImpl implements IDataResourceService {
|
|
|
ResourceType.builder().typeCode("RESOURCE_SJZYBQ4").build(),
|
|
|
ResourceType.builder().typeCode("RESOURCE_SJZYBQ5").build()
|
|
|
);
|
|
|
- return resourceBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
+ return dataCatalogBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
}.getType());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ResourceClassify> getFieldClassifyList() {
|
|
|
- Map param = getParamMap(true,
|
|
|
+ Map<String, Object> param = getParamMap(true,
|
|
|
ResourceType.builder().typeCode("LEVEL_1_COLUMN_CLASSIFY").build(),
|
|
|
ResourceType.builder().typeCode("LEVEL_2_COLUMN_CLASSIFY").build()
|
|
|
);
|
|
|
- return resourceBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
+ return dataCatalogBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
}.getType());
|
|
|
}
|
|
|
|
|
|
- private Map getParamMap(ResourceType... typeCodes) {
|
|
|
+ @Override
|
|
|
+ public List<ResourceClassify> getColumnRelationCatalog() {
|
|
|
+ Map<String, Object> param = getParamMap(ResourceType.builder().typeCode("COLUMN_RELATION_CATALOG").build());
|
|
|
+ return dataCatalogBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
+ }.getType());
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, Object> getParamMap(ResourceType... typeCodes) {
|
|
|
return getParamMap(false, typeCodes);
|
|
|
}
|
|
|
|
|
|
- private Map getParamMap(boolean isBuildTree, ResourceType... typeCodes) {
|
|
|
- Map paramMap = new HashMap();
|
|
|
- List<Map> mapList = new ArrayList<>();
|
|
|
+ private Map<String, Object> getParamMap(boolean isBuildTree, ResourceType... typeCodes) {
|
|
|
+ Map<String, Object> paramMap = new HashMap<>();
|
|
|
+ List<Map<String, String>> mapList = new ArrayList<>();
|
|
|
|
|
|
for (ResourceType typeCode : typeCodes) {
|
|
|
- Map typeMap = new HashMap();
|
|
|
+ Map<String, String> typeMap = new HashMap<>();
|
|
|
|
|
|
typeMap.put("typeCode", typeCode.getTypeCode());
|
|
|
if (Strings.isNullOrEmpty(typeCode.getParentCode())) {
|