|  | @@ -921,7 +921,7 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
 | 
	
		
			
				|  |  |          Long tenantAlbumId = null;
 | 
	
		
			
				|  |  |          Date endTime = null;
 | 
	
		
			
				|  |  |          //忽略已删除的专辑
 | 
	
		
			
				|  |  | -        this.ignoreTenantAlbumIds(albumRecords);
 | 
	
		
			
				|  |  | +        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);
 | 
	
		
			
				|  |  | +            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) {
 | 
	
		
			
				|  |  | +    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());
 | 
	
	
		
			
				|  | @@ -972,14 +972,20 @@ public class UserTenantAlbumRecordServiceImpl extends ServiceImpl<UserTenantAlbu
 | 
	
		
			
				|  |  |              if (CollectionUtils.isNotEmpty(list)){
 | 
	
		
			
				|  |  |                  ignoreTenantAlbumIds = list.stream().map(TenantAlbum::getId).collect(Collectors.toList());
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            List<TenantGroupAlbum> groupAlbums = tenantGroupAlbumService.lambdaQuery().in(TenantGroupAlbum::getTenantAlbumId, tenantAlbumIds)
 | 
	
		
			
				|  |  | -                    .eq(TenantGroupAlbum::getDelFlag, true).or().eq(TenantGroupAlbum::getStatus, false).list();
 | 
	
		
			
				|  |  | -            if (CollectionUtils.isNotEmpty(groupAlbums)){
 | 
	
		
			
				|  |  | -                ignoreTenantAlbumIds.addAll(groupAlbums.stream().map(TenantGroupAlbum::getTenantAlbumId).collect(Collectors.toList()));
 | 
	
		
			
				|  |  | +            Student student = studentDao.selectById(userId);
 | 
	
		
			
				|  |  | +            if(student != null && student.getTenantGroupId() != null){
 | 
	
		
			
				|  |  | +                List<TenantGroupAlbum> groupAlbums = tenantGroupAlbumService.lambdaQuery().in(TenantGroupAlbum::getTenantAlbumId, tenantAlbumIds)
 | 
	
		
			
				|  |  | +                        .eq(TenantGroupAlbum::getTenantGroupId, student.getTenantGroupId())
 | 
	
		
			
				|  |  | +                        .eq(TenantGroupAlbum::getDelFlag, true).or().eq(TenantGroupAlbum::getStatus, false).list();
 | 
	
		
			
				|  |  | +                if (CollectionUtils.isNotEmpty(groupAlbums)){
 | 
	
		
			
				|  |  | +                    ignoreTenantAlbumIds.addAll(groupAlbums.stream().map(TenantGroupAlbum::getTenantAlbumId).distinct().collect(Collectors.toList()));
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              List<Long> finalIgnoreTenantAlbumIds = ignoreTenantAlbumIds;
 | 
	
		
			
				|  |  | -            albumRecords = albumRecords.stream().filter(x -> !finalIgnoreTenantAlbumIds.contains(x.getTenantAlbumId())).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +            //排除finalIgnoreTenantAlbumIds
 | 
	
		
			
				|  |  | +            return albumRecords.stream().filter(x -> !finalIgnoreTenantAlbumIds.contains(x.getTenantAlbumId())).collect(Collectors.toList());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        return albumRecords;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 |