Commit 662961d7 by liuyu

Merge branch 'feature' into 'release'

2023年06/12 模板搜索 分页bug修复

See merge request !78
parents 5001581e e2038c0a
......@@ -54,10 +54,9 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
List<Map<String, Object>> res = new ArrayList<>();
Map<String, Object> resultMap = new HashMap<>();
// 分页起始节点大于总模板数
if (limit > templateTitleVoMap.size()) {
return resultMap;
}
int i = 0;
// if (limit > templateTitleVoMap.size()) {
// return resultMap;
// }
for (String key : templateTitleVoMap.keySet()) {
TemplateTitleVo templateTitleVo = templateTitleVoMap.get(key);
long createTime = templateTitleVo.getCreateTime().getTime();
......@@ -75,11 +74,6 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
if (!StringUtils.isEmpty(searchInfo) && !key.contains(searchInfo)) {
continue;
}
i++;
// // 分页过滤
// if (limit >= i) {
// continue;
// }
Map<String, Object> map = new HashMap<>();
map.put("templateTitle", key);
map.put("project", project);
......@@ -95,6 +89,8 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
}
Tools.sortByField(res, orderField, isAsc);
resultMap.put("count", templateTitleVoMap.size());
// 分页判断
limit = limit > res.size() ? 0 : limit;
resultMap.put("list", res.subList(limit, Math.min((limit + size), res.size())));
return resultMap;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment