Преглед изворни кода

Merge branch 'feature/0721-tenant' into develop

haonan пре 1 година
родитељ
комит
dfee67e792

+ 6 - 2
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantAlbumController.java

@@ -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);

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantActivationCodeServiceImpl.java

@@ -329,15 +329,15 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
 
         String errTemplate = "第%s行%s";
         // 校验数据格式是否错误
+        int rowIndex = 0;
         for (ExcelDataReaderProperty<TenantActivationCodeWrapper.ImportTemplate> next : dataList) {
-            Integer rowIndex = next.getRowIndex();
+            rowIndex++;
             TenantActivationCodeWrapper.ImportTemplate code = next.getClazz();
 
             String acCode = code.getCode();
             if (StringUtils.isEmpty(acCode)) {
                 continue;
             }
-
             int msgRowNo = rowIndex + 1;
             code.checkIsIllegal().forEach(err -> errMsg.add(String.format(errTemplate, msgRowNo, err)));
             if (codeRowMap.containsKey(code.getCode())) {