|
@@ -5,7 +5,6 @@ import com.dragoninfo.dcuc.app.dto.dataresource.ResourceClassify;
|
|
|
import com.dragoninfo.dcuc.app.dto.dataresource.ResourceType;
|
|
|
import com.dragoninfo.dcuc.app.service.IDataResourceService;
|
|
|
import com.google.common.base.Strings;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
import com.google.common.reflect.TypeToken;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -32,34 +31,28 @@ public class DataResourceServiceImpl implements IDataResourceService {
|
|
|
|
|
|
@Override
|
|
|
public List<ResourceClassify> getDataLevelList() {
|
|
|
- Map param = getParamMap(Lists.newArrayList(
|
|
|
- ResourceType.builder().typeCode("DATA_LEVEL").build()
|
|
|
- ));
|
|
|
+ Map param = getParamMap(ResourceType.builder().typeCode("DATA_LEVEL").build());
|
|
|
return resourceBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
}.getType());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ResourceClassify> getSecurityLevelList() {
|
|
|
- Map param = getParamMap(
|
|
|
- Lists.newArrayList(ResourceType.builder().typeCode("DATA_SECURITY_LEVEL").build())
|
|
|
- );
|
|
|
+ Map param = getParamMap(ResourceType.builder().typeCode("DATA_SECURITY_LEVEL").build());
|
|
|
return resourceBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
}.getType());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ResourceClassify> getDataClassifyList() {
|
|
|
- Map param = getParamMap(
|
|
|
- Lists.newArrayList(
|
|
|
- ResourceType.builder().typeCode("RESOURCE_SJZZYJFL").build(),
|
|
|
- ResourceType.builder().typeCode("RESOURCE_SJZZEJFL").build(),
|
|
|
- ResourceType.builder().typeCode("RESOURCE_SJZYBQ1").build(),
|
|
|
- ResourceType.builder().typeCode("RESOURCE_SJZYBQ2").build(),
|
|
|
- ResourceType.builder().typeCode("RESOURCE_SJZYBQ3").build(),
|
|
|
- ResourceType.builder().typeCode("RESOURCE_SJZYBQ4").build(),
|
|
|
- ResourceType.builder().typeCode("RESOURCE_SJZYBQ5").build()
|
|
|
- ), true
|
|
|
+ Map param = getParamMap(true,
|
|
|
+ ResourceType.builder().typeCode("RESOURCE_SJZZYJFL").build(),
|
|
|
+ ResourceType.builder().typeCode("RESOURCE_SJZZEJFL").build(),
|
|
|
+ ResourceType.builder().typeCode("RESOURCE_SJZYBQ1").build(),
|
|
|
+ ResourceType.builder().typeCode("RESOURCE_SJZYBQ2").build(),
|
|
|
+ ResourceType.builder().typeCode("RESOURCE_SJZYBQ3").build(),
|
|
|
+ ResourceType.builder().typeCode("RESOURCE_SJZYBQ4").build(),
|
|
|
+ ResourceType.builder().typeCode("RESOURCE_SJZYBQ5").build()
|
|
|
);
|
|
|
return resourceBusiness.getDataResource(param, new TypeToken<List<ResourceClassify>>() {
|
|
|
}.getType());
|
|
@@ -67,21 +60,19 @@ public class DataResourceServiceImpl implements IDataResourceService {
|
|
|
|
|
|
@Override
|
|
|
public List<ResourceClassify> getFieldClassifyList() {
|
|
|
- Map param = getParamMap(
|
|
|
- Lists.newArrayList(
|
|
|
- ResourceType.builder().typeCode("LEVEL_1_COLUMN_CLASSIFY").build(),
|
|
|
- ResourceType.builder().typeCode("LEVEL_2_COLUMN_CLASSIFY").build()
|
|
|
- ), true
|
|
|
+ Map 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>>() {
|
|
|
}.getType());
|
|
|
}
|
|
|
|
|
|
- private Map getParamMap(List<ResourceType> typeCodes) {
|
|
|
- return getParamMap(typeCodes, false);
|
|
|
+ private Map getParamMap(ResourceType... typeCodes) {
|
|
|
+ return getParamMap(false, typeCodes);
|
|
|
}
|
|
|
|
|
|
- private Map getParamMap(List<ResourceType> typeCodes, boolean isBuildTree) {
|
|
|
+ private Map getParamMap(boolean isBuildTree, ResourceType... typeCodes) {
|
|
|
Map paramMap = new HashMap();
|
|
|
List<Map> mapList = new ArrayList<>();
|
|
|
|