瀏覽代碼

更新留言分页- 处理多一层数组问题

wuweihao 3 年之前
父節點
當前提交
7456055245
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      gis_cms/src/main/java/com/gis/cms/service/impl/CommentServiceImpl.java

+ 7 - 3
gis_cms/src/main/java/com/gis/cms/service/impl/CommentServiceImpl.java

@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
 
 
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Collections;
 import java.util.List;
 import java.util.List;
 import java.util.Set;
 import java.util.Set;
@@ -134,17 +135,20 @@ public class CommentServiceImpl extends ServiceImpl<CommentMapper, CommentEntity
 
 
         Page<CommentVo> voPage = baseMapper.pageSearch(param, display, iBaseService.initPage(param));
         Page<CommentVo> voPage = baseMapper.pageSearch(param, display, iBaseService.initPage(param));
         List<CommentVo> records = voPage.getRecords();
         List<CommentVo> records = voPage.getRecords();
-                Set<Object> filterKey = sensitiveService.getFilterKey();
+
+        Set<Object> filterKey = sensitiveService.getFilterKey();
         CommentTreeUtil commentTreeUtil = new CommentTreeUtil(records, filterKey);
         CommentTreeUtil commentTreeUtil = new CommentTreeUtil(records, filterKey);
         List<CommentTree> commentTrees = commentTreeUtil.buildTree();
         List<CommentTree> commentTrees = commentTreeUtil.buildTree();
 
 
         // 转换分页
         // 转换分页
         Page<Object> resPage = new Page<>();
         Page<Object> resPage = new Page<>();
         BeanUtils.copyProperties(voPage, resPage);
         BeanUtils.copyProperties(voPage, resPage);
-        resPage.setRecords(Collections.singletonList(commentTrees));
+        ArrayList<Object> list = new ArrayList<>(commentTrees);
+        resPage.setRecords(list);
+
 
 
+//        resPage.setRecords(Collections.singletonList(commentTrees));
 
 
-        // todo 2022-08-12
         return Result.success(resPage);
         return Result.success(resPage);
     }
     }