Browse Source

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

zhaoxian 3 years ago
parent
commit
4bf53f2b27

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/live/mapper/KuaishouLiveUserAccountPartMapper.java

@@ -40,7 +40,7 @@ public interface KuaishouLiveUserAccountPartMapper {
 
     void replaceBatch(@Param(value = "collaborators") List<JSONObject> collaborators);
 
-    List<JSONObject> queryCollaboratorsById(Long ksId);
+    List<JSONObject> queryCollaboratorsById(@Param("ksId") Long ksId, @Param("accountId") Long accountId);
 
     List<JSONObject> queryAccountCollaborators(@Param("ksId") Long ksId, @Param("accountId") Long accountId);
 }

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

@@ -60,7 +60,7 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
         KuaishouLiveUserAccount account = kuaishouLiveUserAccountMapper.selectKuaishouLiveUserAccountById(id);
         JSONObject object = JSONObject.parseObject(JSON.toJSONString(account));
         if (object != null) {
-            List<JSONObject> parts = accountPartMapper.queryCollaboratorsById(account.getKsId());
+            List<JSONObject> parts = accountPartMapper.queryCollaboratorsById(account.getKsId(), account.getAccountId());
             object.put("collaborators", parts);
         }
         return object;
@@ -241,8 +241,8 @@ 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());
                 }
-                accountPartMapper.deleteKuaishouLiveUserAccountPartById(account.getKsId());
                 if (Check.isNotNull(collaborators)) {
                     accountPartMapper.replaceBatch(collaborators);
                 }

+ 1 - 0
ruixuan-live/src/main/resources/mapper/live/KuaishouLiveUserAccountPartMapper.xml

@@ -35,6 +35,7 @@
         from kuaishou_live_user_account_part
         where ks_id = #{ksId}
           and collaborator_id is not null
+          and account_id = #{accountId}
         group by collaborator_id
     </select>