|
@@ -218,12 +218,16 @@ public class TenantAlbumController {
|
|
|
@ApiOperation(value = "修改专辑", notes = "修改专辑")
|
|
|
@PreAuthorize("@pcs.hasPermissions('tenantAlbum/update')")
|
|
|
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)){
|
|
|
- throw new BizException("当前机构已有专辑");
|
|
|
+ list.stream().forEach(i->{
|
|
|
+ if (!i.getTenantAlbumId().equals(album.getId())){
|
|
|
+ throw new BizException("当前机构已有专辑");
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
TenantAlbum tenantAlbum = JSON.parseObject(album.jsonString(), TenantAlbum.class);
|