Browse Source

账户2.0——导入账户初版

zhaoxian 3 years ago
parent
commit
cdf64ba15e

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

@@ -233,7 +233,7 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
         int i = kuaishouLiveUserAccountMapper.updateKuaishouLiveUserAccount(account);
         if (i > 0) {
             String collaboratorList = account.getCollaboratorList();
-            if (Check.isNotNull(collaboratorList)) {
+            if (Check.isNotNull(collaboratorList) && "[]".equals(collaboratorList)) {
                 List<JSONObject> collaborators = JSONArray.parseArray(collaboratorList, JSONObject.class);
                 for (JSONObject obj : collaborators) {
                     obj.put("ksId", account.getKsId());
@@ -243,9 +243,12 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
                     obj.put("createrId", account.getCreaterId());
                     accountPartMapper.deleteByAccountId(account.getKsId(), account.getAccountId());
                 }
+
                 if (Check.isNotNull(collaborators)) {
                     accountPartMapper.replaceBatch(collaborators);
                 }
+            } else {
+                accountPartMapper.deleteKuaishouLiveUserAccountPartById(account.getKsId());
             }
             return ResultResponse.success();
         }