|
@@ -5,10 +5,7 @@ import java.io.FileNotFoundException;
|
|
|
import java.io.IOException;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Paths;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
-import java.util.Scanner;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
@@ -17,6 +14,8 @@ import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.system.domain.SysTenantMenu;
|
|
|
import com.ruoyi.system.mapper.SysMenuMapper;
|
|
|
import com.ruoyi.system.mapper.SysTenantMenuMapper;
|
|
|
+import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
+import com.ruoyi.system.service.ISysUserService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.system.mapper.SysTenantMapper;
|
|
@@ -42,6 +41,12 @@ public class SysTenantServiceImpl implements ISysTenantService
|
|
|
@Autowired
|
|
|
private SysMenuMapper sysMenuMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService userService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysUserMapper sysUserMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询租户信息
|
|
|
*
|
|
@@ -98,8 +103,14 @@ public class SysTenantServiceImpl implements ISysTenantService
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public int deleteSysTenantByTenantIds(Long[] tenantIds)
|
|
|
{
|
|
|
+ //查询删除用户信息编号
|
|
|
+ Long[] userIds = sysUserMapper.selectUserIdByTenantIds(tenantIds);
|
|
|
+ //删除用户
|
|
|
+ userService.deleteUserByIds(userIds);
|
|
|
+ //删除租户
|
|
|
return sysTenantMapper.deleteSysTenantByTenantIds(tenantIds);
|
|
|
}
|
|
|
|