Sfoglia il codice sorgente

Merge branch 'zx_online_tenantAlbum_0331' of http://git.dayaedu.com/yonge/cooleshow into develop-new

zouxuan 2 mesi fa
parent
commit
1854e9b583

+ 5 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserTenantAlbumRecordServiceImpl.java

@@ -921,7 +921,7 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
         Long tenantAlbumId = null;
         Date endTime = null;
         //忽略已删除的专辑
-        this.ignoreTenantAlbumIds(albumRecords,userId);
+        albumRecords = this.ignoreTenantAlbumIds(albumRecords,userId);
         if (CollectionUtils.isNotEmpty(albumRecords)) {
             //按专辑编号分组,然后找出截止时间最大的记录
             Map<Long, UserTenantAlbumRecord> recordMap = albumRecords.stream()
@@ -943,7 +943,7 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
                     .orderByDesc(UserTenantAlbumRecord::getEndTime)
                     .orderByAsc(UserTenantAlbumRecord::getId).list();
             //忽略已删除的专辑
-            this.ignoreTenantAlbumIds(tenantAlbumRecords,userId);
+            tenantAlbumRecords = this.ignoreTenantAlbumIds(tenantAlbumRecords,userId);
             if (CollectionUtils.isNotEmpty(tenantAlbumRecords)) {
                 UserTenantAlbumRecord record = tenantAlbumRecords.get(0);
                 tenantAlbumId = record.getTenantAlbumId();
@@ -962,7 +962,7 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
     }
 
     //忽略已删除的专辑
-    private void ignoreTenantAlbumIds(List<UserTenantAlbumRecord> albumRecords,Long userId) {
+    private List<UserTenantAlbumRecord> ignoreTenantAlbumIds(List<UserTenantAlbumRecord> albumRecords,Long userId) {
         if(CollectionUtils.isNotEmpty(albumRecords)){
             //获取所有专辑列表
             List<Long> tenantAlbumIds = albumRecords.stream().map(UserTenantAlbumRecord::getTenantAlbumId).distinct().collect(Collectors.toList());
@@ -983,8 +983,9 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
             }
             List<Long> finalIgnoreTenantAlbumIds = ignoreTenantAlbumIds;
             //排除finalIgnoreTenantAlbumIds
-            albumRecords = albumRecords.stream().filter(x -> !finalIgnoreTenantAlbumIds.contains(x.getTenantAlbumId())).collect(Collectors.toList());
+            return albumRecords.stream().filter(x -> !finalIgnoreTenantAlbumIds.contains(x.getTenantAlbumId())).collect(Collectors.toList());
         }
+        return albumRecords;
     }