Browse Source

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

zhaoxian 3 years ago
parent
commit
62a9e447dc

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/live/controller/KuaishouLiveUserAccountController.java

@@ -82,7 +82,7 @@ public class KuaishouLiveUserAccountController extends BaseController {
             @ApiParam("快手ID") @RequestParam(value = "ksId", required = true) Long ksId,
             @ApiParam("账户ID") @RequestParam(value = "accountId", required = true) Long accountId,
             @ApiParam("角色code") @RequestParam(value = "role", required = true) String role,
-            @ApiParam("用户ID") @RequestParam(value = "userId", required = true) String userId) {
+            @ApiParam("用户ID") @RequestParam(value = "userId", required = true) Long userId) {
         try {
             return kuaishouLiveUserAccountService.deleteAccountAllUser(ksId, accountId, role, userId);
         } catch (Exception e) {

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

@@ -35,7 +35,7 @@ public interface KuaishouLiveUserAccountPartMapper {
      * @param id 快手账户协作人群主键
      * @return 结果
      */
-    public int deleteByAccountId(@Param("ksId") Long ksId, @Param("accountId") Long accountId);
+    public int deleteByAccountId(@Param("ksId") Long ksId, @Param("accountId") Long accountId,@Param("userId") Long userId);
 
 
     void replaceBatch(@Param(value = "collaborators") List<JSONObject> collaborators);

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/live/service/IKuaishouLiveUserAccountService.java

@@ -74,5 +74,5 @@ public interface IKuaishouLiveUserAccountService {
 
     ResultResponse queryAccountAllUsers(Long ksId, Long accountId );
 
-    ResultResponse deleteAccountAllUser(Long ksId, Long accountId, String role, String userId);
+    ResultResponse deleteAccountAllUser(Long ksId, Long accountId, String role, Long userId);
 }

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

@@ -241,7 +241,7 @@ 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.deleteByAccountId(account.getKsId(), account.getAccountId(),obj.getLong("userId"));
                 }
 
                 if (Check.isNotNull(collaborators)) {
@@ -330,9 +330,9 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
     }
 
     @Override
-    public ResultResponse deleteAccountAllUser(Long ksId, Long accountId, String role, String userId) {
+    public ResultResponse deleteAccountAllUser(Long ksId, Long accountId, String role, Long userId) {
         if ("collaborator".equals(role)) {
-            accountPartMapper.deleteByAccountId(ksId, accountId);
+            accountPartMapper.deleteByAccountId(ksId, accountId,userId);
         } else {
             KuaishouLiveUserAccount account = new KuaishouLiveUserAccount();
             account.setAccountId(accountId);

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

@@ -67,6 +67,7 @@
         from kuaishou_live_user_account_part
         where ks_id = #{ksId}
           AND account_id = #{accountId}
+          AND collaborator_id = #{userId}
     </delete>