|
|
@ -106,27 +106,29 @@ public class CategoryController { |
|
|
|
|
|
|
|
|
|
|
|
if (type == 0) { |
|
|
|
if (type == 0) { |
|
|
|
// 类型
|
|
|
|
// 类型
|
|
|
|
List<Category> categoriesList = service.lookUpTheTypeOfReferenceBySite(siteId); |
|
|
|
List<Category> categoriesList = service.lookUpTheTypeOfReferenceBySite(siteId, type); |
|
|
|
|
|
|
|
|
|
|
|
// 将List转换为Set
|
|
|
|
// 将List转换为Set
|
|
|
|
categories.addAll(categoriesList); |
|
|
|
categories.addAll(categoriesList); |
|
|
|
|
|
|
|
return R.success(categories); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 分类、标签
|
|
|
|
// 分类、标签
|
|
|
|
String tagIds = service.queryLabelsReferencedWithinSite(siteId); |
|
|
|
String tagIds = service.queryLabelsReferencedWithinSite(siteId, type); |
|
|
|
if (!StringUtils.isEmpty(tagIds)) { |
|
|
|
if (!StringUtils.isEmpty(tagIds)) { |
|
|
|
// 逗号循环分隔设置到集合中
|
|
|
|
// 逗号循环分隔设置到集合中
|
|
|
|
String[] tagArray = tagIds.split(","); |
|
|
|
String[] tagArray = tagIds.split(","); |
|
|
|
for (String tagId : tagArray) { |
|
|
|
for (String tagId : tagArray) { |
|
|
|
Category category = service.getById(tagId); |
|
|
|
Category category = service.getById(tagId); |
|
|
|
if (!ObjectUtils.isEmpty(category)) { |
|
|
|
if (!ObjectUtils.isEmpty(category) && category.getType() == 1) { |
|
|
|
categories.add(category); |
|
|
|
categories.add(category); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return R.success(categories); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return R.success(categories); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|