调解系统修改

This commit is contained in:
18792927508
2024-04-02 15:56:40 +08:00
parent 08f4aca27c
commit 72026ee6f4
51 changed files with 3102 additions and 3242 deletions
@@ -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());
}
}
}