Commit 732bf39b by 陈健智

全网搜发布时间排序修复

parent 60731e78
...@@ -177,13 +177,13 @@ public class SearchFilterDTO { ...@@ -177,13 +177,13 @@ public class SearchFilterDTO {
map.put("source", sourceKeyword); map.put("source", sourceKeyword);
map.put("url", hostKeyword); map.put("url", hostKeyword);
if (null == sorter || sorter.isEmpty()) { if (null == sorter || sorter.isEmpty()) {
map.put("sort", "DESC"); map.put("sort", "desc");
} else { } else {
for (Map.Entry<String, Object> entry : sorter.entrySet()) { for (Map.Entry<String, Object> entry : sorter.entrySet()) {
if (entry.getValue().toString().contains("desc")) { if (entry.getValue().toString().contains("desc")) {
map.put("sort", "DESC"); map.put("sort", "desc");
} else { } else {
map.put("sort", "ASC"); map.put("sort", "asc");
} }
} }
} }
......
...@@ -2941,7 +2941,10 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -2941,7 +2941,10 @@ public class MarkDataServiceImpl implements MarkDataService {
return null; return null;
} }
// 最高点的时间为开始时间 // 最高点的时间为开始时间
LineVO startLine = lines.stream().max(Comparator.comparingLong(LineVO::getCount)).get(); LineVO startLine = lines.stream().max(Comparator.comparingLong(LineVO::getCount)).orElse(null);
if (Objects.isNull(startLine)){
return null;
}
Long startTime = startLine.getDate(); Long startTime = startLine.getDate();
int startIndex = lines.indexOf(startLine); int startIndex = lines.indexOf(startLine);
// 最高点后一个点的时间为结束时间 // 最高点后一个点的时间为结束时间
......
...@@ -826,7 +826,10 @@ public class SearchWholeServiceImpl implements SearchWholeService { ...@@ -826,7 +826,10 @@ public class SearchWholeServiceImpl implements SearchWholeService {
*/ */
private BaseMap getFirstArticle(SearchFilterDTO dto, List<LineVO> totalSpreadTendency) throws IOException { private BaseMap getFirstArticle(SearchFilterDTO dto, List<LineVO> totalSpreadTendency) throws IOException {
// 最高点的时间为开始时间 // 最高点的时间为开始时间
LineVO startLine = totalSpreadTendency.stream().max(Comparator.comparingLong(LineVO::getCount)).get(); LineVO startLine = totalSpreadTendency.stream().max(Comparator.comparingLong(LineVO::getCount)).orElse(null);
if (Objects.isNull(startLine)){
return null;
}
Long startTime = startLine.getDate(); Long startTime = startLine.getDate();
int startIndex = totalSpreadTendency.indexOf(startLine); int startIndex = totalSpreadTendency.indexOf(startLine);
// 最高点后一个点的时间为结束时间 // 最高点后一个点的时间为结束时间
......
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