Browse Source

账户2.0——导入账户 bug修复

zhaoxian 3 năm trước cách đây
mục cha
commit
594d8c8cfa

+ 3 - 3
ruixuan-live/src/main/java/com/ruixuan/live/service/impl/KuaishouLiveUserAccountServiceImpl.java

@@ -241,14 +241,14 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
                     obj.put("accountId", account.getAccountId());
                     obj.put("accountName", account.getAccountName());
                     obj.put("createrId", account.getCreaterId());
-                    accountPartMapper.deleteByAccountId(account.getKsId(), account.getAccountId(),obj.getLong("userId"));
                 }
 
                 if (Check.isNotNull(collaborators)) {
+                    accountPartMapper.deleteByAccountId(account.getKsId(), account.getAccountId(),null);
                     accountPartMapper.replaceBatch(collaborators);
                 }
             } else {
-                accountPartMapper.deleteKuaishouLiveUserAccountPartById(account.getKsId());
+                accountPartMapper.deleteByAccountId(account.getKsId(), account.getAccountId(),null);
             }
             return ResultResponse.success();
         }
@@ -332,7 +332,7 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
     @Override
     public ResultResponse deleteAccountAllUser(Long ksId, Long accountId, String role, Long userId) {
         if ("collaborator".equals(role)) {
-            accountPartMapper.deleteByAccountId(ksId, accountId,userId);
+            accountPartMapper.deleteByAccountId(ksId, accountId, userId);
         } else {
             KuaishouLiveUserAccount account = new KuaishouLiveUserAccount();
             account.setAccountId(accountId);

+ 5 - 2
ruixuan-live/src/main/resources/mapper/live/KuaishouLiveUserAccountPartMapper.xml

@@ -66,8 +66,11 @@
         delete
         from kuaishou_live_user_account_part
         where ks_id = #{ksId}
-          AND account_id = #{accountId}
-          AND collaborator_id = #{userId}
+        AND account_id = #{accountId}
+        <if test="userId != null">
+            AND collaborator_id = #{userId}
+        </if>
+
     </delete>