|
|
|
@ -4,9 +4,10 @@ import java.io.IOException;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import com.mesnac.common.core.constant.CacheConstants;
|
|
|
|
|
import com.mesnac.common.core.text.Convert;
|
|
|
|
|
import com.mesnac.common.redis.service.RedisService;
|
|
|
|
|
import com.mesnac.system.domain.SysUserDatasource;
|
|
|
|
@ -179,7 +180,7 @@ public class SysUserController extends BaseController
|
|
|
|
|
// 园区集合
|
|
|
|
|
List<Map<String, String>> poolNameList = userService.getPoolNameList(user);
|
|
|
|
|
// 缓存用户园区
|
|
|
|
|
String poolName = redisService.getCacheObject("user_pool_name_current:"+ user.getUserName());
|
|
|
|
|
String poolName = redisService.getCacheObject(CacheConstants.USER_POOL_NAME_CURRENT + user.getUserName());
|
|
|
|
|
user.setPoolName(poolName);
|
|
|
|
|
|
|
|
|
|
AjaxResult ajax = AjaxResult.success();
|
|
|
|
@ -374,6 +375,15 @@ public class SysUserController extends BaseController
|
|
|
|
|
return success(deptService.selectDeptTreeList(dept));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping("/changePoolName")
|
|
|
|
|
public AjaxResult changePoolName(@RequestBody SysUser user) {
|
|
|
|
|
String username = SecurityUtils.getUsername();
|
|
|
|
|
// 缓存用户数据源
|
|
|
|
|
redisService.setCacheObject(CacheConstants.USER_POOL_NAME_CURRENT + username, user.getPoolName(),
|
|
|
|
|
CacheConstants.REFRESH_TIME, TimeUnit.MINUTES);
|
|
|
|
|
return success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据用户ID获取数据源ID
|
|
|
|
|
* @param sysUser
|
|
|
|
|