浏览代码

增加排序

wangyunpeng 7 月之前
父节点
当前提交
761ce794b7

+ 3 - 5
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleAuditService.java

@@ -31,10 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -167,7 +164,8 @@ public class ArticleAuditService {
             String groupPushMsgId = pushIdMap.get(pushId);
             String publishAccountId = pushAccountMap.get(pushId);
             String ghId = publishAccountMap.get(publishAccountId);
-            List<PublishGzhPushContentRelDTO> relList = groupPushRelMap.get(pushId);
+            List<PublishGzhPushContentRelDTO> relList = groupPushRelMap.get(pushId).stream()
+                    .sorted(Comparator.comparing(PublishGzhPushContentRelDTO::getId)).collect(Collectors.toList());
             int index = 1;
             for (int i = 0; i < relList.size(); i++) {
                 if (relList.get(i).getPublishContentId().equals(publishContentId)) {