|
|
|
@ -242,7 +242,6 @@ public class ArticleSerivceImpl implements ArticleSerive {
|
|
|
|
|
Category secondCategory = categoryMapper.selectByPrimaryKey(secondCategoryId);
|
|
|
|
|
ArticleVo articleVo = new ArticleVo();
|
|
|
|
|
articleVo.setTitle(article.getTitle());
|
|
|
|
|
// articleVo.setFirstCategory(firstCategoryId);
|
|
|
|
|
articleVo.setSecondCategory(secondCategoryId);
|
|
|
|
|
articleVo.setContent(article.getContent());
|
|
|
|
|
articleVo.setFileType(article.getFileType());
|
|
|
|
@ -255,7 +254,9 @@ public class ArticleSerivceImpl implements ArticleSerive {
|
|
|
|
|
if (null != firstCategoryList && firstCategoryList.size()>0 ){
|
|
|
|
|
List<String> firstCategoryNameList = new ArrayList<>();
|
|
|
|
|
List<String> firstSortNumList = new ArrayList<>();
|
|
|
|
|
List<String> firstCategoryIdList = new ArrayList<>();
|
|
|
|
|
for (ArticleCategory articleCategory:firstCategoryList){
|
|
|
|
|
firstCategoryIdList.add(String.valueOf(articleCategory.getCategoryId()));
|
|
|
|
|
Category category = categoryMapper.selectByPrimaryKey(articleCategory.getCategoryId());
|
|
|
|
|
firstCategoryNameList.add(category.getName());
|
|
|
|
|
if (category.getSortNum()!=null){
|
|
|
|
@ -266,8 +267,10 @@ public class ArticleSerivceImpl implements ArticleSerive {
|
|
|
|
|
}
|
|
|
|
|
String firstCategoryName = String.join(",", firstCategoryNameList);
|
|
|
|
|
String firstSortNum = String.join(",", firstSortNumList);
|
|
|
|
|
String firstCategoryId = String.join(",", firstCategoryIdList);
|
|
|
|
|
articleVo.setFirstCategoryName(firstCategoryName);
|
|
|
|
|
articleVo.setFirstSortNum(firstSortNum);
|
|
|
|
|
articleVo.setFirstCategoryId(firstCategoryId);
|
|
|
|
|
}
|
|
|
|
|
if (null != secondCategory ){
|
|
|
|
|
articleVo.setSecondCategoryName(secondCategory.getName());
|
|
|
|
|