调解系统修改
This commit is contained in:
@@ -2,9 +2,13 @@ package com.ruoyi;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@@ -45,6 +49,23 @@ public class RuoYiApplication
|
||||
if(CollectionUtil.isNotEmpty(sysUsers)){
|
||||
for (SysUser sysUser : sysUsers) {
|
||||
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
|
||||
redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY+sysUser.getEmail(),sysUser);
|
||||
}
|
||||
}
|
||||
// 初始化角色redis
|
||||
SysRoleMapper roleMapper = SpringUtils.getBean(SysRoleMapper.class);
|
||||
List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
|
||||
if(CollectionUtil.isNotEmpty(roles)){
|
||||
for (SysRole role : roles) {
|
||||
redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
|
||||
}
|
||||
}
|
||||
// 初始化部门redis
|
||||
SysDeptMapper deptMapper = SpringUtils.getBean(SysDeptMapper.class);
|
||||
List<SysDept> depts = deptMapper.selectDeptList(new SysDept());
|
||||
if(CollectionUtil.isNotEmpty(depts)){
|
||||
for (SysDept dept : depts) {
|
||||
redisCache.setCacheObject(CacheConstants.DEPT_KEY+dept.getDeptName(),dept.getDeptId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user