|
@@ -21,6 +21,7 @@ import org.springframework.web.util.HtmlUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -47,9 +48,20 @@ public class HceArticleServiceImpl extends AbstractCrudService<HceArticleMapper,
|
|
|
.orderByDesc(HceArticle::getIstop).orderByAsc(HceArticle::getSortindex, HceArticle::getId);
|
|
|
page = this.page(page,queryWrapper);
|
|
|
if(page.getRecords().size() > 0){
|
|
|
- LambdaQueryWrapper<HceCategory> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper1.eq(HceCategory::getStatus,1);
|
|
|
- List<HceCategory> list = hceCategoryMapper.selectList(queryWrapper1);
|
|
|
+
|
|
|
+ List<Integer> categoryIdList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
+ Integer categoryId = page.getRecords().get(i).getCategoryid();
|
|
|
+ if(!categoryIdList.contains(categoryId)){
|
|
|
+ categoryIdList.add(categoryId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<HceCategory> list = new ArrayList<>();
|
|
|
+ if(CollectionUtils.isNotEmpty(categoryIdList)){
|
|
|
+ list = hceCategoryMapper.getMenuNameList(categoryIdList);
|
|
|
+ }
|
|
|
+
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
for(int i=0;i<page.getRecords().size();i++){
|
|
|
// page.getRecords().get(i).setContent(HtmlUtils.htmlUnescape(page.getRecords().get(i).getContent()));
|