刘俊驰 1 éve
szülő
commit
fb80f5b66d

+ 9 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/TenantAlbumSheetController.java

@@ -13,6 +13,7 @@ import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.toolset.base.exception.BizException;
 import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.toolset.base.util.StringUtil;
 import com.yonge.toolset.mybatis.support.PageUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -72,6 +73,14 @@ public class TenantAlbumSheetController extends BaseController {
         }
         query.setUserId(user.getId());
         query.setClientType(ClientEnum.STUDENT);
+
+        Student student = studentService.getById(user.getId());
+        if (student == null) {
+            throw new BizException("学生信息不存在");
+        }
+        if (!StringUtil.isEmpty(student.getSubjectId())) {
+            query.setSubjectId(Long.parseLong(student.getSubjectId()));
+        }
         IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> page = tenantAlbumMusicService.selectPage(QueryInfo.getPage(query), query);
         return succeed((PageUtil.pageInfo(page)));
     }

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantAlbumMusicServiceImpl.java

@@ -266,6 +266,7 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
             List<MusicTag> tagList = musicTagService.listByIds(musicTagIds).parallelStream().collect(Collectors.toList());
             data.setTags(tagList);
         }
+        data.setSubjects(new ArrayList<>());
 
         return data;