|
@@ -199,9 +199,10 @@ public class TenantAlbumController {
|
|
|
@PreAuthorize("@pcs.hasPermissions('tenantAlbum/save')")
|
|
|
public HttpResponseResult<Boolean> save(@Validated @RequestBody TenantAlbumVo.TenantAlbum album) {
|
|
|
//判断当前机构是否已经绑定机构专辑
|
|
|
- Long tenantId = album.getTenantId();
|
|
|
- List<TenantAlbumMusic> list = tenantAlbumMusicService.lambdaQuery().eq(TenantAlbumMusic::getTenantId, tenantId).list();
|
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
+ List<TenantAlbumRef> list = tenantAlbumRefService.lambdaQuery()
|
|
|
+ .eq(TenantAlbumRef::getTenantId, album.getTenantId())
|
|
|
+ .list();
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
throw new BizException("当前机构已有专辑");
|
|
|
}
|
|
|
|
|
@@ -227,11 +228,11 @@ public class TenantAlbumController {
|
|
|
tenantAlbumSheet.setLevel(m.getLevel());
|
|
|
tenantAlbumSheet.setType(m.getType());
|
|
|
tenantAlbumSheet.setId(m.getId().toString());
|
|
|
- return tenantAlbumSheet;
|
|
|
+ return tenantAlbumSheet;
|
|
|
}).collect(Collectors.toList()));
|
|
|
sheetData.setSubjectType(next.getSubjectType());
|
|
|
return sheetData;
|
|
|
- }
|
|
|
+ }
|
|
|
).collect(Collectors.toList());
|
|
|
tenantAlbumService.insertTenantAlbum(album.getTenantId(), tenantAlbum, musicSheetDataList);
|
|
|
return HttpResponseResult.succeed();
|
|
@@ -243,14 +244,12 @@ public class TenantAlbumController {
|
|
|
public HttpResponseResult<Boolean> update( @RequestBody TenantAlbumVo.TenantAlbum album) {
|
|
|
|
|
|
//判断当前机构是否已经绑定机构专辑
|
|
|
- Long tenantId = album.getTenantId();
|
|
|
- List<TenantAlbumMusic> list = tenantAlbumMusicService.lambdaQuery().eq(TenantAlbumMusic::getTenantId, tenantId).list();
|
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
- list.stream().forEach(i->{
|
|
|
- if (!i.getTenantAlbumId().equals(album.getId())){
|
|
|
- throw new BizException("当前机构已有专辑");
|
|
|
- }
|
|
|
- });
|
|
|
+ List<TenantAlbumRef> list = tenantAlbumRefService.lambdaQuery()
|
|
|
+ .eq(TenantAlbumRef::getTenantId, album.getTenantId())
|
|
|
+ .ne(TenantAlbumRef::getTenantAlbumId, album.getId())
|
|
|
+ .list();
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ throw new BizException("当前机构已有专辑");
|
|
|
}
|
|
|
|
|
|
// 检查曲目重复
|