mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update [重大更新]全业务 增加 接口文档注解 格式化代码
This commit is contained in:
@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* 参数配置 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysConfigService extends IService<SysConfig> {
|
||||
|
||||
@ -22,7 +22,7 @@ public interface ISysConfigService extends IService<SysConfig> {
|
||||
* @param configId 参数配置ID
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
public SysConfig selectConfigById(Long configId);
|
||||
SysConfig selectConfigById(Long configId);
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
@ -30,14 +30,14 @@ public interface ISysConfigService extends IService<SysConfig> {
|
||||
* @param configKey 参数键名
|
||||
* @return 参数键值
|
||||
*/
|
||||
public String selectConfigByKey(String configKey);
|
||||
String selectConfigByKey(String configKey);
|
||||
|
||||
/**
|
||||
* 获取验证码开关
|
||||
*
|
||||
* @return true开启,false关闭
|
||||
*/
|
||||
public boolean selectCaptchaOnOff();
|
||||
boolean selectCaptchaOnOff();
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
@ -45,7 +45,7 @@ public interface ISysConfigService extends IService<SysConfig> {
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
public List<SysConfig> selectConfigList(SysConfig config);
|
||||
List<SysConfig> selectConfigList(SysConfig config);
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
@ -53,7 +53,7 @@ public interface ISysConfigService extends IService<SysConfig> {
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertConfig(SysConfig config);
|
||||
int insertConfig(SysConfig config);
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
@ -61,7 +61,7 @@ public interface ISysConfigService extends IService<SysConfig> {
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateConfig(SysConfig config);
|
||||
int updateConfig(SysConfig config);
|
||||
|
||||
/**
|
||||
* 批量删除参数信息
|
||||
@ -69,22 +69,22 @@ public interface ISysConfigService extends IService<SysConfig> {
|
||||
* @param configIds 需要删除的参数ID
|
||||
* @return 结果
|
||||
*/
|
||||
public void deleteConfigByIds(Long[] configIds);
|
||||
void deleteConfigByIds(Long[] configIds);
|
||||
|
||||
/**
|
||||
* 加载参数缓存数据
|
||||
*/
|
||||
public void loadingConfigCache();
|
||||
void loadingConfigCache();
|
||||
|
||||
/**
|
||||
* 清空参数缓存数据
|
||||
*/
|
||||
public void clearConfigCache();
|
||||
void clearConfigCache();
|
||||
|
||||
/**
|
||||
* 重置参数缓存数据
|
||||
*/
|
||||
public void resetConfigCache();
|
||||
void resetConfigCache();
|
||||
|
||||
/**
|
||||
* 校验参数键名是否唯一
|
||||
@ -92,5 +92,5 @@ public interface ISysConfigService extends IService<SysConfig> {
|
||||
* @param config 参数信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkConfigKeyUnique(SysConfig config);
|
||||
String checkConfigKeyUnique(SysConfig config);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* 部门管理 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysDeptService extends IService<SysDept> {
|
||||
/**
|
||||
@ -18,7 +18,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept);
|
||||
List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
@ -26,7 +26,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param depts 部门列表
|
||||
* @return 树结构列表
|
||||
*/
|
||||
public List<SysDept> buildDeptTree(List<SysDept> depts);
|
||||
List<SysDept> buildDeptTree(List<SysDept> depts);
|
||||
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
@ -34,7 +34,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param depts 部门列表
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
|
||||
List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
@ -42,7 +42,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param roleId 角色ID
|
||||
* @return 选中部门列表
|
||||
*/
|
||||
public List<Integer> selectDeptListByRoleId(Long roleId);
|
||||
List<Integer> selectDeptListByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询信息
|
||||
@ -50,7 +50,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param deptId 部门ID
|
||||
* @return 部门信息
|
||||
*/
|
||||
public SysDept selectDeptById(Long deptId);
|
||||
SysDept selectDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门(正常状态)
|
||||
@ -58,7 +58,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param deptId 部门ID
|
||||
* @return 子部门数
|
||||
*/
|
||||
public long selectNormalChildrenDeptById(Long deptId);
|
||||
long selectNormalChildrenDeptById(Long deptId);
|
||||
|
||||
/**
|
||||
* 是否存在部门子节点
|
||||
@ -66,7 +66,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean hasChildByDeptId(Long deptId);
|
||||
boolean hasChildByDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询部门是否存在用户
|
||||
@ -74,7 +74,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param deptId 部门ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
public boolean checkDeptExistUser(Long deptId);
|
||||
boolean checkDeptExistUser(Long deptId);
|
||||
|
||||
/**
|
||||
* 校验部门名称是否唯一
|
||||
@ -82,14 +82,14 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkDeptNameUnique(SysDept dept);
|
||||
String checkDeptNameUnique(SysDept dept);
|
||||
|
||||
/**
|
||||
* 校验部门是否有数据权限
|
||||
*
|
||||
* @param deptId 部门id
|
||||
*/
|
||||
public void checkDeptDataScope(Long deptId);
|
||||
void checkDeptDataScope(Long deptId);
|
||||
|
||||
/**
|
||||
* 新增保存部门信息
|
||||
@ -97,7 +97,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDept(SysDept dept);
|
||||
int insertDept(SysDept dept);
|
||||
|
||||
/**
|
||||
* 修改保存部门信息
|
||||
@ -105,7 +105,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDept(SysDept dept);
|
||||
int updateDept(SysDept dept);
|
||||
|
||||
/**
|
||||
* 删除部门管理信息
|
||||
@ -113,5 +113,5 @@ public interface ISysDeptService extends IService<SysDept> {
|
||||
* @param deptId 部门ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
int deleteDeptById(Long deptId);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* 字典 业务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysDictDataService extends IService<SysDictData> {
|
||||
|
||||
@ -22,7 +22,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
||||
* @param dictData 字典数据信息
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData);
|
||||
List<SysDictData> selectDictDataList(SysDictData dictData);
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
@ -31,7 +31,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
public String selectDictLabel(String dictType, String dictValue);
|
||||
String selectDictLabel(String dictType, String dictValue);
|
||||
|
||||
/**
|
||||
* 根据字典数据ID查询信息
|
||||
@ -39,7 +39,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
||||
* @param dictCode 字典数据ID
|
||||
* @return 字典数据
|
||||
*/
|
||||
public SysDictData selectDictDataById(Long dictCode);
|
||||
SysDictData selectDictDataById(Long dictCode);
|
||||
|
||||
/**
|
||||
* 批量删除字典数据信息
|
||||
@ -47,7 +47,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
||||
* @param dictCodes 需要删除的字典数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public void deleteDictDataByIds(Long[] dictCodes);
|
||||
void deleteDictDataByIds(Long[] dictCodes);
|
||||
|
||||
/**
|
||||
* 新增保存字典数据信息
|
||||
@ -55,7 +55,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
||||
* @param dictData 字典数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictData(SysDictData dictData);
|
||||
int insertDictData(SysDictData dictData);
|
||||
|
||||
/**
|
||||
* 修改保存字典数据信息
|
||||
@ -63,5 +63,5 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
||||
* @param dictData 字典数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictData(SysDictData dictData);
|
||||
int updateDictData(SysDictData dictData);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
/**
|
||||
* 字典 业务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
|
||||
@ -23,14 +23,14 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
* @param dictType 字典类型信息
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
public List<SysDictType> selectDictTypeList(SysDictType dictType);
|
||||
List<SysDictType> selectDictTypeList(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 根据所有字典类型
|
||||
*
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
public List<SysDictType> selectDictTypeAll();
|
||||
List<SysDictType> selectDictTypeAll();
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据
|
||||
@ -38,7 +38,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
* @param dictType 字典类型
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataByType(String dictType);
|
||||
List<SysDictData> selectDictDataByType(String dictType);
|
||||
|
||||
/**
|
||||
* 根据字典类型ID查询信息
|
||||
@ -46,7 +46,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
* @param dictId 字典类型ID
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeById(Long dictId);
|
||||
SysDictType selectDictTypeById(Long dictId);
|
||||
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
@ -54,7 +54,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeByType(String dictType);
|
||||
SysDictType selectDictTypeByType(String dictType);
|
||||
|
||||
/**
|
||||
* 批量删除字典信息
|
||||
@ -62,22 +62,22 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
* @param dictIds 需要删除的字典ID
|
||||
* @return 结果
|
||||
*/
|
||||
public void deleteDictTypeByIds(Long[] dictIds);
|
||||
void deleteDictTypeByIds(Long[] dictIds);
|
||||
|
||||
/**
|
||||
* 加载字典缓存数据
|
||||
*/
|
||||
public void loadingDictCache();
|
||||
void loadingDictCache();
|
||||
|
||||
/**
|
||||
* 清空字典缓存数据
|
||||
*/
|
||||
public void clearDictCache();
|
||||
void clearDictCache();
|
||||
|
||||
/**
|
||||
* 重置字典缓存数据
|
||||
*/
|
||||
public void resetDictCache();
|
||||
void resetDictCache();
|
||||
|
||||
/**
|
||||
* 新增保存字典类型信息
|
||||
@ -85,7 +85,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
* @param dictType 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictType(SysDictType dictType);
|
||||
int insertDictType(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 修改保存字典类型信息
|
||||
@ -93,7 +93,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
* @param dictType 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictType(SysDictType dictType);
|
||||
int updateDictType(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 校验字典类型称是否唯一
|
||||
@ -101,5 +101,5 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
* @param dictType 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkDictTypeUnique(SysDictType dictType);
|
||||
String checkDictTypeUnique(SysDictType dictType);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* 系统访问日志情况信息 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysLogininforService extends IService<SysLogininfor> {
|
||||
|
||||
@ -21,7 +21,7 @@ public interface ISysLogininforService extends IService<SysLogininfor> {
|
||||
*
|
||||
* @param logininfor 访问日志对象
|
||||
*/
|
||||
public void insertLogininfor(SysLogininfor logininfor);
|
||||
void insertLogininfor(SysLogininfor logininfor);
|
||||
|
||||
/**
|
||||
* 查询系统登录日志集合
|
||||
@ -29,7 +29,7 @@ public interface ISysLogininforService extends IService<SysLogininfor> {
|
||||
* @param logininfor 访问日志对象
|
||||
* @return 登录记录集合
|
||||
*/
|
||||
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor);
|
||||
List<SysLogininfor> selectLogininforList(SysLogininfor logininfor);
|
||||
|
||||
/**
|
||||
* 批量删除系统登录日志
|
||||
@ -37,10 +37,10 @@ public interface ISysLogininforService extends IService<SysLogininfor> {
|
||||
* @param infoIds 需要删除的登录日志ID
|
||||
* @return
|
||||
*/
|
||||
public int deleteLogininforByIds(Long[] infoIds);
|
||||
int deleteLogininforByIds(Long[] infoIds);
|
||||
|
||||
/**
|
||||
* 清空系统登录日志
|
||||
*/
|
||||
public void cleanLogininfor();
|
||||
void cleanLogininfor();
|
||||
}
|
||||
|
@ -11,16 +11,17 @@ import java.util.Set;
|
||||
/**
|
||||
* 菜单 业务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysMenuService extends IService<SysMenu> {
|
||||
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuList(Long userId);
|
||||
List<SysMenu> selectMenuList(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
@ -29,7 +30,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuList(SysMenu menu, Long userId);
|
||||
List<SysMenu> selectMenuList(SysMenu menu, Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询权限
|
||||
@ -37,7 +38,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param userId 用户ID
|
||||
* @return 权限列表
|
||||
*/
|
||||
public Set<String> selectMenuPermsByUserId(Long userId);
|
||||
Set<String> selectMenuPermsByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单树信息
|
||||
@ -45,7 +46,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||
List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询菜单树信息
|
||||
@ -53,7 +54,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param roleId 角色ID
|
||||
* @return 选中菜单列表
|
||||
*/
|
||||
public List<Integer> selectMenuListByRoleId(Long roleId);
|
||||
List<Integer> selectMenuListByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 构建前端路由所需要的菜单
|
||||
@ -61,7 +62,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menus 菜单列表
|
||||
* @return 路由列表
|
||||
*/
|
||||
public List<RouterVo> buildMenus(List<SysMenu> menus);
|
||||
List<RouterVo> buildMenus(List<SysMenu> menus);
|
||||
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
@ -69,7 +70,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menus 菜单列表
|
||||
* @return 树结构列表
|
||||
*/
|
||||
public List<SysMenu> buildMenuTree(List<SysMenu> menus);
|
||||
List<SysMenu> buildMenuTree(List<SysMenu> menus);
|
||||
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
@ -77,7 +78,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menus 菜单列表
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus);
|
||||
List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus);
|
||||
|
||||
/**
|
||||
* 根据菜单ID查询信息
|
||||
@ -85,7 +86,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menuId 菜单ID
|
||||
* @return 菜单信息
|
||||
*/
|
||||
public SysMenu selectMenuById(Long menuId);
|
||||
SysMenu selectMenuById(Long menuId);
|
||||
|
||||
/**
|
||||
* 是否存在菜单子节点
|
||||
@ -93,7 +94,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
public boolean hasChildByMenuId(Long menuId);
|
||||
boolean hasChildByMenuId(Long menuId);
|
||||
|
||||
/**
|
||||
* 查询菜单是否存在角色
|
||||
@ -101,7 +102,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
public boolean checkMenuExistRole(Long menuId);
|
||||
boolean checkMenuExistRole(Long menuId);
|
||||
|
||||
/**
|
||||
* 新增保存菜单信息
|
||||
@ -109,7 +110,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMenu(SysMenu menu);
|
||||
int insertMenu(SysMenu menu);
|
||||
|
||||
/**
|
||||
* 修改保存菜单信息
|
||||
@ -117,7 +118,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMenu(SysMenu menu);
|
||||
int updateMenu(SysMenu menu);
|
||||
|
||||
/**
|
||||
* 删除菜单管理信息
|
||||
@ -125,7 +126,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuById(Long menuId);
|
||||
int deleteMenuById(Long menuId);
|
||||
|
||||
/**
|
||||
* 校验菜单名称是否唯一
|
||||
@ -133,5 +134,5 @@ public interface ISysMenuService extends IService<SysMenu> {
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkMenuNameUnique(SysMenu menu);
|
||||
String checkMenuNameUnique(SysMenu menu);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* 公告 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysNoticeService extends IService<SysNotice> {
|
||||
|
||||
@ -22,7 +22,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
||||
* @param noticeId 公告ID
|
||||
* @return 公告信息
|
||||
*/
|
||||
public SysNotice selectNoticeById(Long noticeId);
|
||||
SysNotice selectNoticeById(Long noticeId);
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
@ -30,7 +30,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
||||
* @param notice 公告信息
|
||||
* @return 公告集合
|
||||
*/
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice);
|
||||
List<SysNotice> selectNoticeList(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 新增公告
|
||||
@ -38,7 +38,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNotice(SysNotice notice);
|
||||
int insertNotice(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 修改公告
|
||||
@ -46,7 +46,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNotice(SysNotice notice);
|
||||
int updateNotice(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 删除公告信息
|
||||
@ -54,7 +54,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
||||
* @param noticeId 公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeById(Long noticeId);
|
||||
int deleteNoticeById(Long noticeId);
|
||||
|
||||
/**
|
||||
* 批量删除公告信息
|
||||
@ -62,5 +62,5 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
||||
* @param noticeIds 需要删除的公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeByIds(Long[] noticeIds);
|
||||
int deleteNoticeByIds(Long[] noticeIds);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* 操作日志 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysOperLogService extends IService<SysOperLog> {
|
||||
|
||||
@ -20,7 +20,7 @@ public interface ISysOperLogService extends IService<SysOperLog> {
|
||||
*
|
||||
* @param operLog 操作日志对象
|
||||
*/
|
||||
public void insertOperlog(SysOperLog operLog);
|
||||
void insertOperlog(SysOperLog operLog);
|
||||
|
||||
/**
|
||||
* 查询系统操作日志集合
|
||||
@ -28,7 +28,7 @@ public interface ISysOperLogService extends IService<SysOperLog> {
|
||||
* @param operLog 操作日志对象
|
||||
* @return 操作日志集合
|
||||
*/
|
||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
||||
List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
||||
|
||||
/**
|
||||
* 批量删除系统操作日志
|
||||
@ -36,7 +36,7 @@ public interface ISysOperLogService extends IService<SysOperLog> {
|
||||
* @param operIds 需要删除的操作日志ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOperLogByIds(Long[] operIds);
|
||||
int deleteOperLogByIds(Long[] operIds);
|
||||
|
||||
/**
|
||||
* 查询操作日志详细
|
||||
@ -44,10 +44,10 @@ public interface ISysOperLogService extends IService<SysOperLog> {
|
||||
* @param operId 操作ID
|
||||
* @return 操作日志对象
|
||||
*/
|
||||
public SysOperLog selectOperLogById(Long operId);
|
||||
SysOperLog selectOperLogById(Long operId);
|
||||
|
||||
/**
|
||||
* 清空操作日志
|
||||
*/
|
||||
public void cleanOperLog();
|
||||
void cleanOperLog();
|
||||
}
|
||||
|
@ -17,42 +17,45 @@ import java.util.Collection;
|
||||
*/
|
||||
public interface ISysOssConfigService extends IServicePlus<SysOssConfig, SysOssConfigVo> {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*/
|
||||
SysOssConfigVo queryById(Integer ossConfigId);
|
||||
/**
|
||||
* 查询单个
|
||||
*/
|
||||
SysOssConfigVo queryById(Integer ossConfigId);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<SysOssConfigVo> queryPageList(SysOssConfigBo bo);
|
||||
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入对象存储配置
|
||||
* @param bo 对象存储配置新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(SysOssConfigBo bo);
|
||||
/**
|
||||
* 根据新增业务对象插入对象存储配置
|
||||
*
|
||||
* @param bo 对象存储配置新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(SysOssConfigBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改对象存储配置
|
||||
* @param bo 对象存储配置编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(SysOssConfigBo bo);
|
||||
/**
|
||||
* 根据编辑业务对象修改对象存储配置
|
||||
*
|
||||
* @param bo 对象存储配置编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(SysOssConfigBo bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
/**
|
||||
* 校验并删除数据
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 启用停用状态
|
||||
*/
|
||||
int updateOssConfigStatus(SysOssConfigBo bo);
|
||||
/**
|
||||
* 启用停用状态
|
||||
*/
|
||||
int updateOssConfigStatus(SysOssConfigBo bo);
|
||||
|
||||
}
|
||||
|
@ -16,9 +16,9 @@ import java.util.Collection;
|
||||
*/
|
||||
public interface ISysOssService extends IServicePlus<SysOss, SysOssVo> {
|
||||
|
||||
TableDataInfo<SysOssVo> queryPageList(SysOssBo sysOss);
|
||||
TableDataInfo<SysOssVo> queryPageList(SysOssBo sysOss);
|
||||
|
||||
SysOss upload(MultipartFile file);
|
||||
SysOss upload(MultipartFile file);
|
||||
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* 岗位信息 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysPostService extends IService<SysPost> {
|
||||
|
||||
@ -22,14 +22,14 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @param post 岗位信息
|
||||
* @return 岗位列表
|
||||
*/
|
||||
public List<SysPost> selectPostList(SysPost post);
|
||||
List<SysPost> selectPostList(SysPost post);
|
||||
|
||||
/**
|
||||
* 查询所有岗位
|
||||
*
|
||||
* @return 岗位列表
|
||||
*/
|
||||
public List<SysPost> selectPostAll();
|
||||
List<SysPost> selectPostAll();
|
||||
|
||||
/**
|
||||
* 通过岗位ID查询岗位信息
|
||||
@ -37,7 +37,7 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @param postId 岗位ID
|
||||
* @return 角色对象信息
|
||||
*/
|
||||
public SysPost selectPostById(Long postId);
|
||||
SysPost selectPostById(Long postId);
|
||||
|
||||
/**
|
||||
* 根据用户ID获取岗位选择框列表
|
||||
@ -45,7 +45,7 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @param userId 用户ID
|
||||
* @return 选中岗位ID列表
|
||||
*/
|
||||
public List<Integer> selectPostListByUserId(Long userId);
|
||||
List<Integer> selectPostListByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 校验岗位名称
|
||||
@ -53,7 +53,7 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @param post 岗位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkPostNameUnique(SysPost post);
|
||||
String checkPostNameUnique(SysPost post);
|
||||
|
||||
/**
|
||||
* 校验岗位编码
|
||||
@ -61,7 +61,7 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @param post 岗位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkPostCodeUnique(SysPost post);
|
||||
String checkPostCodeUnique(SysPost post);
|
||||
|
||||
/**
|
||||
* 通过岗位ID查询岗位使用数量
|
||||
@ -69,7 +69,7 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @param postId 岗位ID
|
||||
* @return 结果
|
||||
*/
|
||||
public long countUserPostById(Long postId);
|
||||
long countUserPostById(Long postId);
|
||||
|
||||
/**
|
||||
* 删除岗位信息
|
||||
@ -77,7 +77,7 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @param postId 岗位ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePostById(Long postId);
|
||||
int deletePostById(Long postId);
|
||||
|
||||
/**
|
||||
* 批量删除岗位信息
|
||||
@ -86,7 +86,7 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @return 结果
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
public int deletePostByIds(Long[] postIds);
|
||||
int deletePostByIds(Long[] postIds);
|
||||
|
||||
/**
|
||||
* 新增保存岗位信息
|
||||
@ -94,7 +94,7 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @param post 岗位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPost(SysPost post);
|
||||
int insertPost(SysPost post);
|
||||
|
||||
/**
|
||||
* 修改保存岗位信息
|
||||
@ -102,5 +102,5 @@ public interface ISysPostService extends IService<SysPost> {
|
||||
* @param post 岗位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePost(SysPost post);
|
||||
int updatePost(SysPost post);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import java.util.Set;
|
||||
/**
|
||||
* 角色业务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysRoleService extends IService<SysRole> {
|
||||
|
||||
@ -24,7 +24,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param role 角色信息
|
||||
* @return 角色数据集合信息
|
||||
*/
|
||||
public List<SysRole> selectRoleList(SysRole role);
|
||||
List<SysRole> selectRoleList(SysRole role);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询角色列表
|
||||
@ -32,7 +32,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param userId 用户ID
|
||||
* @return 角色列表
|
||||
*/
|
||||
public List<SysRole> selectRolesByUserId(Long userId);
|
||||
List<SysRole> selectRolesByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询角色权限
|
||||
@ -40,14 +40,14 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param userId 用户ID
|
||||
* @return 权限列表
|
||||
*/
|
||||
public Set<String> selectRolePermissionByUserId(Long userId);
|
||||
Set<String> selectRolePermissionByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 查询所有角色
|
||||
*
|
||||
* @return 角色列表
|
||||
*/
|
||||
public List<SysRole> selectRoleAll();
|
||||
List<SysRole> selectRoleAll();
|
||||
|
||||
/**
|
||||
* 根据用户ID获取角色选择框列表
|
||||
@ -55,7 +55,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param userId 用户ID
|
||||
* @return 选中角色ID列表
|
||||
*/
|
||||
public List<Integer> selectRoleListByUserId(Long userId);
|
||||
List<Integer> selectRoleListByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 通过角色ID查询角色
|
||||
@ -63,7 +63,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param roleId 角色ID
|
||||
* @return 角色对象信息
|
||||
*/
|
||||
public SysRole selectRoleById(Long roleId);
|
||||
SysRole selectRoleById(Long roleId);
|
||||
|
||||
/**
|
||||
* 校验角色名称是否唯一
|
||||
@ -71,7 +71,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param role 角色信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkRoleNameUnique(SysRole role);
|
||||
String checkRoleNameUnique(SysRole role);
|
||||
|
||||
/**
|
||||
* 校验角色权限是否唯一
|
||||
@ -79,21 +79,21 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param role 角色信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkRoleKeyUnique(SysRole role);
|
||||
String checkRoleKeyUnique(SysRole role);
|
||||
|
||||
/**
|
||||
* 校验角色是否允许操作
|
||||
*
|
||||
* @param role 角色信息
|
||||
*/
|
||||
public void checkRoleAllowed(SysRole role);
|
||||
void checkRoleAllowed(SysRole role);
|
||||
|
||||
/**
|
||||
* 校验角色是否有数据权限
|
||||
*
|
||||
* @param roleId 角色id
|
||||
*/
|
||||
public void checkRoleDataScope(Long roleId);
|
||||
void checkRoleDataScope(Long roleId);
|
||||
|
||||
/**
|
||||
* 通过角色ID查询角色使用数量
|
||||
@ -101,7 +101,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param roleId 角色ID
|
||||
* @return 结果
|
||||
*/
|
||||
public long countUserRoleByRoleId(Long roleId);
|
||||
long countUserRoleByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 新增保存角色信息
|
||||
@ -109,7 +109,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param role 角色信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRole(SysRole role);
|
||||
int insertRole(SysRole role);
|
||||
|
||||
/**
|
||||
* 修改保存角色信息
|
||||
@ -117,7 +117,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param role 角色信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRole(SysRole role);
|
||||
int updateRole(SysRole role);
|
||||
|
||||
/**
|
||||
* 修改角色状态
|
||||
@ -125,7 +125,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param role 角色信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRoleStatus(SysRole role);
|
||||
int updateRoleStatus(SysRole role);
|
||||
|
||||
/**
|
||||
* 修改数据权限信息
|
||||
@ -133,7 +133,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param role 角色信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int authDataScope(SysRole role);
|
||||
int authDataScope(SysRole role);
|
||||
|
||||
/**
|
||||
* 通过角色ID删除角色
|
||||
@ -141,7 +141,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param roleId 角色ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRoleById(Long roleId);
|
||||
int deleteRoleById(Long roleId);
|
||||
|
||||
/**
|
||||
* 批量删除角色信息
|
||||
@ -149,7 +149,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param roleIds 需要删除的角色ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRoleByIds(Long[] roleIds);
|
||||
int deleteRoleByIds(Long[] roleIds);
|
||||
|
||||
/**
|
||||
* 取消授权用户角色
|
||||
@ -157,23 +157,23 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @param userRole 用户和角色关联信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAuthUser(SysUserRole userRole);
|
||||
int deleteAuthUser(SysUserRole userRole);
|
||||
|
||||
/**
|
||||
* 批量取消授权用户角色
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 需要取消授权的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAuthUsers(Long roleId, Long[] userIds);
|
||||
int deleteAuthUsers(Long roleId, Long[] userIds);
|
||||
|
||||
/**
|
||||
* 批量选择授权用户角色
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 需要删除的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAuthUsers(Long roleId, Long[] userIds);
|
||||
int insertAuthUsers(Long roleId, Long[] userIds);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysUserOnline;
|
||||
/**
|
||||
* 在线用户 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysUserOnlineService {
|
||||
/**
|
||||
@ -16,7 +16,7 @@ public interface ISysUserOnlineService {
|
||||
* @param user 用户信息
|
||||
* @return 在线用户信息
|
||||
*/
|
||||
public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user);
|
||||
SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user);
|
||||
|
||||
/**
|
||||
* 通过用户名称查询信息
|
||||
@ -25,7 +25,7 @@ public interface ISysUserOnlineService {
|
||||
* @param user 用户信息
|
||||
* @return 在线用户信息
|
||||
*/
|
||||
public SysUserOnline selectOnlineByUserName(String userName, LoginUser user);
|
||||
SysUserOnline selectOnlineByUserName(String userName, LoginUser user);
|
||||
|
||||
/**
|
||||
* 通过登录地址/用户名称查询信息
|
||||
@ -35,7 +35,7 @@ public interface ISysUserOnlineService {
|
||||
* @param user 用户信息
|
||||
* @return 在线用户信息
|
||||
*/
|
||||
public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user);
|
||||
SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user);
|
||||
|
||||
/**
|
||||
* 设置在线用户信息
|
||||
@ -43,5 +43,5 @@ public interface ISysUserOnlineService {
|
||||
* @param user 用户信息
|
||||
* @return 在线用户
|
||||
*/
|
||||
public SysUserOnline loginUserToUserOnline(LoginUser user);
|
||||
SysUserOnline loginUserToUserOnline(LoginUser user);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* 用户 业务层
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysUserService extends IService<SysUser> {
|
||||
|
||||
@ -22,7 +22,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<SysUser> selectUserList(SysUser user);
|
||||
List<SysUser> selectUserList(SysUser user);
|
||||
|
||||
/**
|
||||
* 根据条件分页查询已分配用户角色列表
|
||||
@ -30,7 +30,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public TableDataInfo<SysUser> selectAllocatedList(SysUser user);
|
||||
TableDataInfo<SysUser> selectAllocatedList(SysUser user);
|
||||
|
||||
/**
|
||||
* 根据条件分页查询未分配用户角色列表
|
||||
@ -38,7 +38,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public TableDataInfo<SysUser> selectUnallocatedList(SysUser user);
|
||||
TableDataInfo<SysUser> selectUnallocatedList(SysUser user);
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户
|
||||
@ -46,7 +46,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param userName 用户名
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public SysUser selectUserByUserName(String userName);
|
||||
SysUser selectUserByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
@ -54,7 +54,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param userId 用户ID
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public SysUser selectUserById(Long userId);
|
||||
SysUser selectUserById(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询用户所属角色组
|
||||
@ -62,7 +62,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param userName 用户名
|
||||
* @return 结果
|
||||
*/
|
||||
public String selectUserRoleGroup(String userName);
|
||||
String selectUserRoleGroup(String userName);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询用户所属岗位组
|
||||
@ -70,7 +70,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param userName 用户名
|
||||
* @return 结果
|
||||
*/
|
||||
public String selectUserPostGroup(String userName);
|
||||
String selectUserPostGroup(String userName);
|
||||
|
||||
/**
|
||||
* 校验用户名称是否唯一
|
||||
@ -78,7 +78,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param userName 用户名称
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkUserNameUnique(String userName);
|
||||
String checkUserNameUnique(String userName);
|
||||
|
||||
/**
|
||||
* 校验手机号码是否唯一
|
||||
@ -86,7 +86,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkPhoneUnique(SysUser user);
|
||||
String checkPhoneUnique(SysUser user);
|
||||
|
||||
/**
|
||||
* 校验email是否唯一
|
||||
@ -94,21 +94,21 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkEmailUnique(SysUser user);
|
||||
String checkEmailUnique(SysUser user);
|
||||
|
||||
/**
|
||||
* 校验用户是否允许操作
|
||||
*
|
||||
* @param user 用户信息
|
||||
*/
|
||||
public void checkUserAllowed(SysUser user);
|
||||
void checkUserAllowed(SysUser user);
|
||||
|
||||
/**
|
||||
* 校验用户是否有数据权限
|
||||
*
|
||||
* @param userId 用户id
|
||||
*/
|
||||
public void checkUserDataScope(Long userId);
|
||||
void checkUserDataScope(Long userId);
|
||||
|
||||
/**
|
||||
* 新增用户信息
|
||||
@ -116,7 +116,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUser(SysUser user);
|
||||
int insertUser(SysUser user);
|
||||
|
||||
/**
|
||||
* 注册用户信息
|
||||
@ -124,7 +124,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean registerUser(SysUser user);
|
||||
boolean registerUser(SysUser user);
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
@ -132,15 +132,15 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUser(SysUser user);
|
||||
int updateUser(SysUser user);
|
||||
|
||||
/**
|
||||
* 用户授权角色
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param userId 用户ID
|
||||
* @param roleIds 角色组
|
||||
*/
|
||||
public void insertUserAuth(Long userId, Long[] roleIds);
|
||||
void insertUserAuth(Long userId, Long[] roleIds);
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
@ -148,7 +148,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserStatus(SysUser user);
|
||||
int updateUserStatus(SysUser user);
|
||||
|
||||
/**
|
||||
* 修改用户基本信息
|
||||
@ -156,16 +156,16 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserProfile(SysUser user);
|
||||
int updateUserProfile(SysUser user);
|
||||
|
||||
/**
|
||||
* 修改用户头像
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param avatar 头像地址
|
||||
* @param avatar 头像地址
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean updateUserAvatar(String userName, String avatar);
|
||||
boolean updateUserAvatar(String userName, String avatar);
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
@ -173,7 +173,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int resetPwd(SysUser user);
|
||||
int resetPwd(SysUser user);
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
@ -182,7 +182,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param password 密码
|
||||
* @return 结果
|
||||
*/
|
||||
public int resetUserPwd(String userName, String password);
|
||||
int resetUserPwd(String userName, String password);
|
||||
|
||||
/**
|
||||
* 通过用户ID删除用户
|
||||
@ -190,7 +190,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param userId 用户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserById(Long userId);
|
||||
int deleteUserById(Long userId);
|
||||
|
||||
/**
|
||||
* 批量删除用户信息
|
||||
@ -198,15 +198,15 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param userIds 需要删除的用户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserByIds(Long[] userIds);
|
||||
int deleteUserByIds(Long[] userIds);
|
||||
|
||||
/**
|
||||
* 导入用户数据
|
||||
*
|
||||
* @param userList 用户数据列表
|
||||
* @param userList 用户数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||
String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||
}
|
||||
|
@ -26,10 +26,11 @@ import javax.servlet.http.HttpServletRequest;
|
||||
/**
|
||||
* 登录校验方法
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysLoginService {
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 注册校验方法
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysRegisterService {
|
||||
|
@ -26,204 +26,204 @@ import java.util.Map;
|
||||
/**
|
||||
* 参数配置 服务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysConfigServiceImpl extends ServicePlusImpl<SysConfigMapper, SysConfig, SysConfig> implements ISysConfigService {
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化参数到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
loadingConfigCache();
|
||||
}
|
||||
/**
|
||||
* 项目启动时,初始化参数到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
loadingConfigCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysConfig> selectPageConfigList(SysConfig config) {
|
||||
Map<String, Object> params = config.getParams();
|
||||
LambdaQueryWrapper<SysConfig> lqw = new LambdaQueryWrapper<SysConfig>()
|
||||
.like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName())
|
||||
.eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType())
|
||||
.like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
||||
.apply(StringUtils.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
.apply(StringUtils.isNotEmpty(params.get("endTime")),
|
||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime"));
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<SysConfig> selectPageConfigList(SysConfig config) {
|
||||
Map<String, Object> params = config.getParams();
|
||||
LambdaQueryWrapper<SysConfig> lqw = new LambdaQueryWrapper<SysConfig>()
|
||||
.like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName())
|
||||
.eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType())
|
||||
.like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
||||
.apply(StringUtils.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
.apply(StringUtils.isNotEmpty(params.get("endTime")),
|
||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime"));
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
@Override
|
||||
@DataSource(DataSourceType.MASTER)
|
||||
public SysConfig selectConfigById(Long configId) {
|
||||
return baseMapper.selectById(configId);
|
||||
}
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
@Override
|
||||
@DataSource(DataSourceType.MASTER)
|
||||
public SysConfig selectConfigById(Long configId) {
|
||||
return baseMapper.selectById(configId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configKey 参数key
|
||||
* @return 参数键值
|
||||
*/
|
||||
@Override
|
||||
public String selectConfigByKey(String configKey) {
|
||||
String configValue = Convert.toStr(RedisUtils.getCacheObject(getCacheKey(configKey)));
|
||||
if (StringUtils.isNotEmpty(configValue)) {
|
||||
return configValue;
|
||||
}
|
||||
SysConfig retConfig = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>()
|
||||
.eq(SysConfig::getConfigKey, configKey));
|
||||
if (StringUtils.isNotNull(retConfig)) {
|
||||
RedisUtils.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
|
||||
return retConfig.getConfigValue();
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configKey 参数key
|
||||
* @return 参数键值
|
||||
*/
|
||||
@Override
|
||||
public String selectConfigByKey(String configKey) {
|
||||
String configValue = Convert.toStr(RedisUtils.getCacheObject(getCacheKey(configKey)));
|
||||
if (StringUtils.isNotEmpty(configValue)) {
|
||||
return configValue;
|
||||
}
|
||||
SysConfig retConfig = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>()
|
||||
.eq(SysConfig::getConfigKey, configKey));
|
||||
if (StringUtils.isNotNull(retConfig)) {
|
||||
RedisUtils.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
|
||||
return retConfig.getConfigValue();
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码开关
|
||||
*
|
||||
* @return true开启,false关闭
|
||||
*/
|
||||
@Override
|
||||
public boolean selectCaptchaOnOff() {
|
||||
String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff");
|
||||
if (StringUtils.isEmpty(captchaOnOff)) {
|
||||
return true;
|
||||
}
|
||||
return Convert.toBool(captchaOnOff);
|
||||
}
|
||||
/**
|
||||
* 获取验证码开关
|
||||
*
|
||||
* @return true开启,false关闭
|
||||
*/
|
||||
@Override
|
||||
public boolean selectCaptchaOnOff() {
|
||||
String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff");
|
||||
if (StringUtils.isEmpty(captchaOnOff)) {
|
||||
return true;
|
||||
}
|
||||
return Convert.toBool(captchaOnOff);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysConfig> selectConfigList(SysConfig config) {
|
||||
Map<String, Object> params = config.getParams();
|
||||
LambdaQueryWrapper<SysConfig> lqw = new LambdaQueryWrapper<SysConfig>()
|
||||
.like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName())
|
||||
.eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType())
|
||||
.like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
||||
.apply(StringUtils.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
.apply(StringUtils.isNotEmpty(params.get("endTime")),
|
||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime"));
|
||||
return baseMapper.selectList(lqw);
|
||||
}
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysConfig> selectConfigList(SysConfig config) {
|
||||
Map<String, Object> params = config.getParams();
|
||||
LambdaQueryWrapper<SysConfig> lqw = new LambdaQueryWrapper<SysConfig>()
|
||||
.like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName())
|
||||
.eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType())
|
||||
.like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
||||
.apply(StringUtils.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
.apply(StringUtils.isNotEmpty(params.get("endTime")),
|
||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime"));
|
||||
return baseMapper.selectList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertConfig(SysConfig config) {
|
||||
int row = baseMapper.insert(config);
|
||||
if (row > 0) {
|
||||
RedisUtils.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
return row;
|
||||
}
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertConfig(SysConfig config) {
|
||||
int row = baseMapper.insert(config);
|
||||
if (row > 0) {
|
||||
RedisUtils.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateConfig(SysConfig config) {
|
||||
int row = baseMapper.updateById(config);
|
||||
if (row > 0) {
|
||||
RedisUtils.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
return row;
|
||||
}
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateConfig(SysConfig config) {
|
||||
int row = baseMapper.updateById(config);
|
||||
if (row > 0) {
|
||||
RedisUtils.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除参数信息
|
||||
*
|
||||
* @param configIds 需要删除的参数ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void deleteConfigByIds(Long[] configIds) {
|
||||
for (Long configId : configIds) {
|
||||
SysConfig config = selectConfigById(configId);
|
||||
if (StringUtils.equals(UserConstants.YES, config.getConfigType())) {
|
||||
throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
|
||||
}
|
||||
RedisUtils.deleteObject(getCacheKey(config.getConfigKey()));
|
||||
}
|
||||
baseMapper.deleteBatchIds(Arrays.asList(configIds));
|
||||
}
|
||||
/**
|
||||
* 批量删除参数信息
|
||||
*
|
||||
* @param configIds 需要删除的参数ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void deleteConfigByIds(Long[] configIds) {
|
||||
for (Long configId : configIds) {
|
||||
SysConfig config = selectConfigById(configId);
|
||||
if (StringUtils.equals(UserConstants.YES, config.getConfigType())) {
|
||||
throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
|
||||
}
|
||||
RedisUtils.deleteObject(getCacheKey(config.getConfigKey()));
|
||||
}
|
||||
baseMapper.deleteBatchIds(Arrays.asList(configIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void loadingConfigCache() {
|
||||
List<SysConfig> configsList = selectConfigList(new SysConfig());
|
||||
for (SysConfig config : configsList) {
|
||||
RedisUtils.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 加载参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void loadingConfigCache() {
|
||||
List<SysConfig> configsList = selectConfigList(new SysConfig());
|
||||
for (SysConfig config : configsList) {
|
||||
RedisUtils.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void clearConfigCache() {
|
||||
Collection<String> keys = RedisUtils.keys(Constants.SYS_CONFIG_KEY + "*");
|
||||
RedisUtils.deleteObject(keys);
|
||||
}
|
||||
/**
|
||||
* 清空参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void clearConfigCache() {
|
||||
Collection<String> keys = RedisUtils.keys(Constants.SYS_CONFIG_KEY + "*");
|
||||
RedisUtils.deleteObject(keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void resetConfigCache() {
|
||||
clearConfigCache();
|
||||
loadingConfigCache();
|
||||
}
|
||||
/**
|
||||
* 重置参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void resetConfigCache() {
|
||||
clearConfigCache();
|
||||
loadingConfigCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数键名是否唯一
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String checkConfigKeyUnique(SysConfig config) {
|
||||
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
|
||||
SysConfig info = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getConfigKey, config.getConfigKey()));
|
||||
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
/**
|
||||
* 校验参数键名是否唯一
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String checkConfigKeyUnique(SysConfig config) {
|
||||
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
|
||||
SysConfig info = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getConfigKey, config.getConfigKey()));
|
||||
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
private String getCacheKey(String configKey) {
|
||||
return Constants.SYS_CONFIG_KEY + configKey;
|
||||
}
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
private String getCacheKey(String configKey) {
|
||||
return Constants.SYS_CONFIG_KEY + configKey;
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept, SysDept> implements ISysDeptService {
|
||||
@ -65,13 +65,13 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
for (SysDept dept : depts) {
|
||||
tempList.add(dept.getDeptId());
|
||||
}
|
||||
for (SysDept dept : depts) {
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(dept.getParentId())) {
|
||||
recursionFn(depts, dept);
|
||||
returnList.add(dept);
|
||||
}
|
||||
}
|
||||
for (SysDept dept : depts) {
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(dept.getParentId())) {
|
||||
recursionFn(depts, dept);
|
||||
returnList.add(dept);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty()) {
|
||||
returnList = depts;
|
||||
}
|
||||
@ -224,7 +224,7 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
}
|
||||
int result = baseMapper.updateById(dept);
|
||||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
|
||||
&& !StringUtils.equals("0", dept.getAncestors())) {
|
||||
&& !StringUtils.equals("0", dept.getAncestors())) {
|
||||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||
updateParentDeptStatusNormal(dept);
|
||||
}
|
||||
@ -237,8 +237,8 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
* @param dept 当前部门
|
||||
*/
|
||||
private void updateParentDeptStatusNormal(SysDept dept) {
|
||||
String ancestors = dept.getAncestors();
|
||||
Long[] deptIds = Convert.toLongArray(ancestors);
|
||||
String ancestors = dept.getAncestors();
|
||||
Long[] deptIds = Convert.toLongArray(ancestors);
|
||||
update(null, new LambdaUpdateWrapper<SysDept>()
|
||||
.set(SysDept::getStatus, "0")
|
||||
.in(SysDept::getDeptId, Arrays.asList(deptIds)));
|
||||
@ -247,13 +247,13 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
/**
|
||||
* 修改子元素关系
|
||||
*
|
||||
* @param deptId 被修改的部门ID
|
||||
* @param deptId 被修改的部门ID
|
||||
* @param newAncestors 新的父ID集合
|
||||
* @param oldAncestors 旧的父ID集合
|
||||
*/
|
||||
public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
|
||||
List<SysDept> children = list(new LambdaQueryWrapper<SysDept>()
|
||||
.apply("find_in_set({0},ancestors)",deptId));
|
||||
.apply("find_in_set({0},ancestors)", deptId));
|
||||
for (SysDept child : children) {
|
||||
child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
|
||||
}
|
||||
@ -292,11 +292,11 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
*/
|
||||
private List<SysDept> getChildList(List<SysDept> list, SysDept t) {
|
||||
List<SysDept> tlist = new ArrayList<SysDept>();
|
||||
for (SysDept n : list) {
|
||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
for (SysDept n : list) {
|
||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.DictUtils;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -16,108 +16,108 @@ import java.util.List;
|
||||
/**
|
||||
* 字典 业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, SysDictData, SysDictData> implements ISysDictDataService {
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysDictData> selectPageDictDataList(SysDictData dictData) {
|
||||
LambdaQueryWrapper<SysDictData> lqw = new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType())
|
||||
.like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel())
|
||||
.eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus())
|
||||
.orderByAsc(SysDictData::getDictSort);
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<SysDictData> selectPageDictDataList(SysDictData dictData) {
|
||||
LambdaQueryWrapper<SysDictData> lqw = new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType())
|
||||
.like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel())
|
||||
.eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus())
|
||||
.orderByAsc(SysDictData::getDictSort);
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
* @param dictData 字典数据信息
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData) {
|
||||
return list(new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType())
|
||||
.like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel())
|
||||
.eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus())
|
||||
.orderByAsc(SysDictData::getDictSort));
|
||||
}
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
* @param dictData 字典数据信息
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData) {
|
||||
return list(new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType())
|
||||
.like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel())
|
||||
.eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus())
|
||||
.orderByAsc(SysDictData::getDictSort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
@Override
|
||||
public String selectDictLabel(String dictType, String dictValue) {
|
||||
return getOne(new LambdaQueryWrapper<SysDictData>()
|
||||
.select(SysDictData::getDictLabel)
|
||||
.eq(SysDictData::getDictType, dictType)
|
||||
.eq(SysDictData::getDictValue, dictValue))
|
||||
.getDictLabel();
|
||||
}
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
@Override
|
||||
public String selectDictLabel(String dictType, String dictValue) {
|
||||
return getOne(new LambdaQueryWrapper<SysDictData>()
|
||||
.select(SysDictData::getDictLabel)
|
||||
.eq(SysDictData::getDictType, dictType)
|
||||
.eq(SysDictData::getDictValue, dictValue))
|
||||
.getDictLabel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典数据ID查询信息
|
||||
*
|
||||
* @param dictCode 字典数据ID
|
||||
* @return 字典数据
|
||||
*/
|
||||
@Override
|
||||
public SysDictData selectDictDataById(Long dictCode) {
|
||||
return getById(dictCode);
|
||||
}
|
||||
/**
|
||||
* 根据字典数据ID查询信息
|
||||
*
|
||||
* @param dictCode 字典数据ID
|
||||
* @return 字典数据
|
||||
*/
|
||||
@Override
|
||||
public SysDictData selectDictDataById(Long dictCode) {
|
||||
return getById(dictCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除字典数据信息
|
||||
*
|
||||
* @param dictCodes 需要删除的字典数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void deleteDictDataByIds(Long[] dictCodes) {
|
||||
for (Long dictCode : dictCodes) {
|
||||
SysDictData data = selectDictDataById(dictCode);
|
||||
/**
|
||||
* 批量删除字典数据信息
|
||||
*
|
||||
* @param dictCodes 需要删除的字典数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void deleteDictDataByIds(Long[] dictCodes) {
|
||||
for (Long dictCode : dictCodes) {
|
||||
SysDictData data = selectDictDataById(dictCode);
|
||||
removeById(dictCode);
|
||||
List<SysDictData> dictDatas = baseMapper.selectDictDataByType(data.getDictType());
|
||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
||||
}
|
||||
}
|
||||
List<SysDictData> dictDatas = baseMapper.selectDictDataByType(data.getDictType());
|
||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存字典数据信息
|
||||
*
|
||||
* @param data 字典数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDictData(SysDictData data) {
|
||||
int row = baseMapper.insert(data);
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = baseMapper.selectDictDataByType(data.getDictType());
|
||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
/**
|
||||
* 新增保存字典数据信息
|
||||
*
|
||||
* @param data 字典数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDictData(SysDictData data) {
|
||||
int row = baseMapper.insert(data);
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = baseMapper.selectDictDataByType(data.getDictType());
|
||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存字典数据信息
|
||||
*
|
||||
* @param data 字典数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDictData(SysDictData data) {
|
||||
int row = baseMapper.updateById(data);
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = baseMapper.selectDictDataByType(data.getDictType());
|
||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
/**
|
||||
* 修改保存字典数据信息
|
||||
*
|
||||
* @param data 字典数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDictData(SysDictData data) {
|
||||
int row = baseMapper.updateById(data);
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = baseMapper.selectDictDataByType(data.getDictType());
|
||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
@ -12,6 +11,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DictUtils;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||
import com.ruoyi.system.mapper.SysDictTypeMapper;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
@ -27,210 +27,210 @@ import java.util.Map;
|
||||
/**
|
||||
* 字典 业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, SysDictType, SysDictType> implements ISysDictTypeService {
|
||||
|
||||
@Autowired
|
||||
private SysDictDataMapper dictDataMapper;
|
||||
@Autowired
|
||||
private SysDictDataMapper dictDataMapper;
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化字典到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
loadingDictCache();
|
||||
}
|
||||
/**
|
||||
* 项目启动时,初始化字典到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
loadingDictCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysDictType> selectPageDictTypeList(SysDictType dictType) {
|
||||
Map<String, Object> params = dictType.getParams();
|
||||
LambdaQueryWrapper<SysDictType> lqw = new LambdaQueryWrapper<SysDictType>()
|
||||
.like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName())
|
||||
.eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
|
||||
.like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
||||
.apply(StringUtils.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
.apply(StringUtils.isNotEmpty(params.get("endTime")),
|
||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime"));
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<SysDictType> selectPageDictTypeList(SysDictType dictType) {
|
||||
Map<String, Object> params = dictType.getParams();
|
||||
LambdaQueryWrapper<SysDictType> lqw = new LambdaQueryWrapper<SysDictType>()
|
||||
.like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName())
|
||||
.eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
|
||||
.like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
||||
.apply(StringUtils.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
.apply(StringUtils.isNotEmpty(params.get("endTime")),
|
||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime"));
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件分页查询字典类型
|
||||
*
|
||||
* @param dictType 字典类型信息
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeList(SysDictType dictType) {
|
||||
Map<String, Object> params = dictType.getParams();
|
||||
return list(new LambdaQueryWrapper<SysDictType>()
|
||||
.like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName())
|
||||
.eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
|
||||
.like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
||||
.apply(StringUtils.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
.apply(StringUtils.isNotEmpty(params.get("endTime")),
|
||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime")));
|
||||
}
|
||||
/**
|
||||
* 根据条件分页查询字典类型
|
||||
*
|
||||
* @param dictType 字典类型信息
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeList(SysDictType dictType) {
|
||||
Map<String, Object> params = dictType.getParams();
|
||||
return list(new LambdaQueryWrapper<SysDictType>()
|
||||
.like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName())
|
||||
.eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
|
||||
.like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
||||
.apply(StringUtils.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
.apply(StringUtils.isNotEmpty(params.get("endTime")),
|
||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime")));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据所有字典类型
|
||||
*
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeAll() {
|
||||
return list();
|
||||
}
|
||||
/**
|
||||
* 根据所有字典类型
|
||||
*
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeAll() {
|
||||
return list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataByType(String dictType) {
|
||||
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
||||
if (CollUtil.isNotEmpty(dictDatas)) {
|
||||
return dictDatas;
|
||||
}
|
||||
dictDatas = dictDataMapper.selectDictDataByType(dictType);
|
||||
if (CollUtil.isNotEmpty(dictDatas)) {
|
||||
DictUtils.setDictCache(dictType, dictDatas);
|
||||
return dictDatas;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 根据字典类型查询字典数据
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataByType(String dictType) {
|
||||
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
||||
if (CollUtil.isNotEmpty(dictDatas)) {
|
||||
return dictDatas;
|
||||
}
|
||||
dictDatas = dictDataMapper.selectDictDataByType(dictType);
|
||||
if (CollUtil.isNotEmpty(dictDatas)) {
|
||||
DictUtils.setDictCache(dictType, dictDatas);
|
||||
return dictDatas;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型ID查询信息
|
||||
*
|
||||
* @param dictId 字典类型ID
|
||||
* @return 字典类型
|
||||
*/
|
||||
@Override
|
||||
public SysDictType selectDictTypeById(Long dictId) {
|
||||
return getById(dictId);
|
||||
}
|
||||
/**
|
||||
* 根据字典类型ID查询信息
|
||||
*
|
||||
* @param dictId 字典类型ID
|
||||
* @return 字典类型
|
||||
*/
|
||||
@Override
|
||||
public SysDictType selectDictTypeById(Long dictId) {
|
||||
return getById(dictId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
@Override
|
||||
public SysDictType selectDictTypeByType(String dictType) {
|
||||
return getOne(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
|
||||
}
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
@Override
|
||||
public SysDictType selectDictTypeByType(String dictType) {
|
||||
return getOne(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除字典类型信息
|
||||
*
|
||||
* @param dictIds 需要删除的字典ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void deleteDictTypeByIds(Long[] dictIds) {
|
||||
for (Long dictId : dictIds) {
|
||||
SysDictType dictType = selectDictTypeById(dictId);
|
||||
if (dictDataMapper.selectCount(new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(SysDictData::getDictType, dictType.getDictType())) > 0) {
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
|
||||
}
|
||||
DictUtils.removeDictCache(dictType.getDictType());
|
||||
}
|
||||
baseMapper.deleteBatchIds(Arrays.asList(dictIds));
|
||||
}
|
||||
/**
|
||||
* 批量删除字典类型信息
|
||||
*
|
||||
* @param dictIds 需要删除的字典ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void deleteDictTypeByIds(Long[] dictIds) {
|
||||
for (Long dictId : dictIds) {
|
||||
SysDictType dictType = selectDictTypeById(dictId);
|
||||
if (dictDataMapper.selectCount(new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(SysDictData::getDictType, dictType.getDictType())) > 0) {
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
|
||||
}
|
||||
DictUtils.removeDictCache(dictType.getDictType());
|
||||
}
|
||||
baseMapper.deleteBatchIds(Arrays.asList(dictIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void loadingDictCache() {
|
||||
List<SysDictType> dictTypeList = list();
|
||||
for (SysDictType dictType : dictTypeList) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
|
||||
DictUtils.setDictCache(dictType.getDictType(), dictDatas);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 加载字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void loadingDictCache() {
|
||||
List<SysDictType> dictTypeList = list();
|
||||
for (SysDictType dictType : dictTypeList) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
|
||||
DictUtils.setDictCache(dictType.getDictType(), dictDatas);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void clearDictCache() {
|
||||
DictUtils.clearDictCache();
|
||||
}
|
||||
/**
|
||||
* 清空字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void clearDictCache() {
|
||||
DictUtils.clearDictCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void resetDictCache() {
|
||||
clearDictCache();
|
||||
loadingDictCache();
|
||||
}
|
||||
/**
|
||||
* 重置字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void resetDictCache() {
|
||||
clearDictCache();
|
||||
loadingDictCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存字典类型信息
|
||||
*
|
||||
* @param dict 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDictType(SysDictType dict) {
|
||||
int row = baseMapper.insert(dict);
|
||||
if (row > 0) {
|
||||
DictUtils.setDictCache(dict.getDictType(), null);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
/**
|
||||
* 新增保存字典类型信息
|
||||
*
|
||||
* @param dict 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDictType(SysDictType dict) {
|
||||
int row = baseMapper.insert(dict);
|
||||
if (row > 0) {
|
||||
DictUtils.setDictCache(dict.getDictType(), null);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存字典类型信息
|
||||
*
|
||||
* @param dict 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateDictType(SysDictType dict) {
|
||||
SysDictType oldDict = getById(dict.getDictId());
|
||||
dictDataMapper.update(null, new LambdaUpdateWrapper<SysDictData>()
|
||||
.set(SysDictData::getDictType, dict.getDictType())
|
||||
.eq(SysDictData::getDictType, oldDict.getDictType()));
|
||||
int row = baseMapper.updateById(dict);
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
|
||||
DictUtils.setDictCache(dict.getDictType(), dictDatas);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
/**
|
||||
* 修改保存字典类型信息
|
||||
*
|
||||
* @param dict 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateDictType(SysDictType dict) {
|
||||
SysDictType oldDict = getById(dict.getDictId());
|
||||
dictDataMapper.update(null, new LambdaUpdateWrapper<SysDictData>()
|
||||
.set(SysDictData::getDictType, dict.getDictType())
|
||||
.eq(SysDictData::getDictType, oldDict.getDictType()));
|
||||
int row = baseMapper.updateById(dict);
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
|
||||
DictUtils.setDictCache(dict.getDictType(), dictDatas);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验字典类型称是否唯一
|
||||
*
|
||||
* @param dict 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String checkDictTypeUnique(SysDictType dict) {
|
||||
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
||||
SysDictType dictType = getOne(new LambdaQueryWrapper<SysDictType>()
|
||||
.eq(SysDictType::getDictType, dict.getDictType())
|
||||
.last("limit 1"));
|
||||
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
/**
|
||||
* 校验字典类型称是否唯一
|
||||
*
|
||||
* @param dict 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String checkDictTypeUnique(SysDictType dict) {
|
||||
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
||||
SysDictType dictType = getOne(new LambdaQueryWrapper<SysDictType>()
|
||||
.eq(SysDictType::getDictType, dict.getDictType())
|
||||
.last("limit 1"));
|
||||
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 系统访问日志情况信息 服务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
@ -26,11 +26,10 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 菜单 业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu, SysMenu> implements ISysMenuService {
|
||||
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
|
||||
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
@ -61,9 +60,9 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
// 管理员显示所有菜单信息
|
||||
if (SysUser.isAdmin(userId)) {
|
||||
menuList = list(new LambdaQueryWrapper<SysMenu>()
|
||||
.like(StringUtils.isNotBlank(menu.getMenuName()),SysMenu::getMenuName,menu.getMenuName())
|
||||
.eq(StringUtils.isNotBlank(menu.getVisible()),SysMenu::getVisible,menu.getVisible())
|
||||
.eq(StringUtils.isNotBlank(menu.getStatus()),SysMenu::getStatus,menu.getStatus())
|
||||
.like(StringUtils.isNotBlank(menu.getMenuName()), SysMenu::getMenuName, menu.getMenuName())
|
||||
.eq(StringUtils.isNotBlank(menu.getVisible()), SysMenu::getVisible, menu.getVisible())
|
||||
.eq(StringUtils.isNotBlank(menu.getStatus()), SysMenu::getStatus, menu.getStatus())
|
||||
.orderByAsc(SysMenu::getParentId)
|
||||
.orderByAsc(SysMenu::getOrderNum));
|
||||
} else {
|
||||
@ -137,7 +136,7 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
router.setComponent(getComponent(menu));
|
||||
router.setQuery(menu.getQuery());
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
|
||||
List<SysMenu> cMenus = menu.getChildren();
|
||||
List<SysMenu> cMenus = (List<SysMenu>) menu.getChildren();
|
||||
if (!cMenus.isEmpty() && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
|
||||
router.setAlwaysShow(true);
|
||||
router.setRedirect("noRedirect");
|
||||
@ -151,18 +150,18 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
children.setName(StringUtils.capitalize(menu.getPath()));
|
||||
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
|
||||
children.setQuery(menu.getQuery());
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
} else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) {
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
|
||||
router.setPath("/inner");
|
||||
List<RouterVo> childrenList = new ArrayList<RouterVo>();
|
||||
RouterVo children = new RouterVo();
|
||||
String routerPath = StringUtils.replaceEach(menu.getPath(), new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" });
|
||||
children.setPath(routerPath);
|
||||
children.setComponent(UserConstants.INNER_LINK);
|
||||
children.setName(StringUtils.capitalize(routerPath));
|
||||
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath()));
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
} else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) {
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
|
||||
router.setPath("/inner");
|
||||
List<RouterVo> childrenList = new ArrayList<RouterVo>();
|
||||
RouterVo children = new RouterVo();
|
||||
String routerPath = StringUtils.replaceEach(menu.getPath(), new String[]{Constants.HTTP, Constants.HTTPS}, new String[]{"", ""});
|
||||
children.setPath(routerPath);
|
||||
children.setComponent(UserConstants.INNER_LINK);
|
||||
children.setName(StringUtils.capitalize(routerPath));
|
||||
children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath()));
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
}
|
||||
@ -184,13 +183,13 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
for (SysMenu dept : menus) {
|
||||
tempList.add(dept.getMenuId());
|
||||
}
|
||||
for (SysMenu menu : menus) {
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(menu.getParentId())) {
|
||||
recursionFn(menus, menu);
|
||||
returnList.add(menu);
|
||||
}
|
||||
}
|
||||
for (SysMenu menu : menus) {
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(menu.getParentId())) {
|
||||
recursionFn(menus, menu);
|
||||
returnList.add(menu);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty()) {
|
||||
returnList = menus;
|
||||
}
|
||||
@ -228,7 +227,7 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
*/
|
||||
@Override
|
||||
public boolean hasChildByMenuId(Long menuId) {
|
||||
long result = count(new LambdaQueryWrapper<SysMenu>().eq(SysMenu::getParentId,menuId));
|
||||
long result = count(new LambdaQueryWrapper<SysMenu>().eq(SysMenu::getParentId, menuId));
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
@ -240,7 +239,7 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
*/
|
||||
@Override
|
||||
public boolean checkMenuExistRole(Long menuId) {
|
||||
long result = roleMenuMapper.selectCount(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getMenuId,menuId));
|
||||
long result = roleMenuMapper.selectCount(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getMenuId, menuId));
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
@ -287,8 +286,8 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
public String checkMenuNameUnique(SysMenu menu) {
|
||||
Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
|
||||
SysMenu info = getOne(new LambdaQueryWrapper<SysMenu>()
|
||||
.eq(SysMenu::getMenuName,menu.getMenuName())
|
||||
.eq(SysMenu::getParentId,menu.getParentId())
|
||||
.eq(SysMenu::getMenuName, menu.getMenuName())
|
||||
.eq(SysMenu::getParentId, menu.getParentId())
|
||||
.last("limit 1"));
|
||||
if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
@ -321,7 +320,7 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
String routerPath = menu.getPath();
|
||||
// 内链打开外网方式
|
||||
if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
|
||||
routerPath = StringUtils.replaceEach(routerPath, new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" });
|
||||
routerPath = StringUtils.replaceEach(routerPath, new String[]{Constants.HTTP, Constants.HTTPS}, new String[]{"", ""});
|
||||
}
|
||||
// 非外链并且是一级目录(类型为目录)
|
||||
if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
|
||||
@ -345,9 +344,9 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
String component = UserConstants.LAYOUT;
|
||||
if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) {
|
||||
component = menu.getComponent();
|
||||
} else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
|
||||
component = UserConstants.INNER_LINK;
|
||||
} else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) {
|
||||
} else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
|
||||
component = UserConstants.INNER_LINK;
|
||||
} else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) {
|
||||
component = UserConstants.PARENT_VIEW;
|
||||
}
|
||||
return component;
|
||||
@ -387,19 +386,19 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
/**
|
||||
* 根据父节点的ID获取所有子节点
|
||||
*
|
||||
* @param list 分类表
|
||||
* @param list 分类表
|
||||
* @param parentId 传入的父节点ID
|
||||
* @return String
|
||||
*/
|
||||
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
|
||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
||||
for (SysMenu t : list) {
|
||||
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
|
||||
if (t.getParentId() == parentId) {
|
||||
recursionFn(list, t);
|
||||
returnList.add(t);
|
||||
}
|
||||
}
|
||||
for (SysMenu t : list) {
|
||||
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
|
||||
if (t.getParentId() == parentId) {
|
||||
recursionFn(list, t);
|
||||
returnList.add(t);
|
||||
}
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
@ -425,11 +424,11 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
*/
|
||||
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
|
||||
List<SysMenu> tlist = new ArrayList<SysMenu>();
|
||||
for (SysMenu n : list) {
|
||||
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
for (SysMenu n : list) {
|
||||
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.mapper.SysNoticeMapper;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
@ -16,7 +16,7 @@ import java.util.List;
|
||||
/**
|
||||
* 公告 服务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysNoticeServiceImpl extends ServicePlusImpl<SysNoticeMapper, SysNotice, SysNotice> implements ISysNoticeService {
|
||||
@ -27,7 +27,7 @@ public class SysNoticeServiceImpl extends ServicePlusImpl<SysNoticeMapper, SysNo
|
||||
.like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle())
|
||||
.eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType())
|
||||
.like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy());
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(),lqw));
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -50,9 +50,9 @@ public class SysNoticeServiceImpl extends ServicePlusImpl<SysNoticeMapper, SysNo
|
||||
@Override
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice) {
|
||||
return list(new LambdaQueryWrapper<SysNotice>()
|
||||
.like(StringUtils.isNotBlank(notice.getNoticeTitle()),SysNotice::getNoticeTitle,notice.getNoticeTitle())
|
||||
.eq(StringUtils.isNotBlank(notice.getNoticeType()),SysNotice::getNoticeType,notice.getNoticeType())
|
||||
.like(StringUtils.isNotBlank(notice.getCreateBy()),SysNotice::getCreateBy,notice.getCreateBy()));
|
||||
.like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle())
|
||||
.eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType())
|
||||
.like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,10 +3,10 @@ package com.ruoyi.system.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.core.domain.dto.OperLogDTO;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.service.OperLogService;
|
||||
import com.ruoyi.common.core.domain.dto.OperLogDTO;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.ip.AddressUtils;
|
||||
@ -24,7 +24,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 操作日志 服务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, SysOperLog, SysOperLog> implements ISysOperLogService, OperLogService {
|
||||
@ -64,7 +64,7 @@ public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, Sys
|
||||
.apply(StringUtils.isNotEmpty(params.get("endTime")),
|
||||
"date_format(oper_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime"));
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage("oper_id","desc"), lqw));
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage("oper_id", "desc"), lqw));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,17 +88,17 @@ public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, Sys
|
||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog) {
|
||||
Map<String, Object> params = operLog.getParams();
|
||||
return list(new LambdaQueryWrapper<SysOperLog>()
|
||||
.like(StringUtils.isNotBlank(operLog.getTitle()),SysOperLog::getTitle,operLog.getTitle())
|
||||
.like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
|
||||
.eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0,
|
||||
SysOperLog::getBusinessType,operLog.getBusinessType())
|
||||
SysOperLog::getBusinessType, operLog.getBusinessType())
|
||||
.func(f -> {
|
||||
if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())){
|
||||
if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) {
|
||||
f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes()));
|
||||
}
|
||||
})
|
||||
.eq(operLog.getStatus() != null && operLog.getStatus() > 0,
|
||||
SysOperLog::getStatus,operLog.getStatus())
|
||||
.like(StringUtils.isNotBlank(operLog.getOperName()),SysOperLog::getOperName,operLog.getOperName())
|
||||
SysOperLog::getStatus, operLog.getStatus())
|
||||
.like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName())
|
||||
.apply(StringUtils.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(oper_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
|
@ -43,23 +43,23 @@ import java.util.List;
|
||||
@Service
|
||||
public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper, SysOssConfig, SysOssConfigVo> implements ISysOssConfigService {
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化参数到缓存,加载配置类
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
List<SysOssConfig> list = list();
|
||||
for (SysOssConfig config : list) {
|
||||
String configKey = config.getConfigKey();
|
||||
if ("0".equals(config.getStatus())) {
|
||||
RedisUtils.setCacheObject(CloudConstant.CACHE_CONFIG_KEY, configKey);
|
||||
}
|
||||
setConfigCache(true, config);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 项目启动时,初始化参数到缓存,加载配置类
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
List<SysOssConfig> list = list();
|
||||
for (SysOssConfig config : list) {
|
||||
String configKey = config.getConfigKey();
|
||||
if ("0".equals(config.getStatus())) {
|
||||
RedisUtils.setCacheObject(CloudConstant.CACHE_CONFIG_KEY, configKey);
|
||||
}
|
||||
setConfigCache(true, config);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysOssConfigVo queryById(Integer ossConfigId){
|
||||
public SysOssConfigVo queryById(Integer ossConfigId) {
|
||||
return getVoById(ossConfigId);
|
||||
}
|
||||
|
||||
@ -74,46 +74,46 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
LambdaQueryWrapper<SysOssConfig> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getConfigKey()), SysOssConfig::getConfigKey, bo.getConfigKey());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getBucketName()), SysOssConfig::getBucketName, bo.getBucketName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysOssConfig::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysOssConfig::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(SysOssConfigBo bo) {
|
||||
SysOssConfig config = BeanUtil.toBean(bo, SysOssConfig.class);
|
||||
validEntityBeforeSave(config);
|
||||
return setConfigCache(save(config), config);
|
||||
return setConfigCache(save(config), config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(SysOssConfigBo bo) {
|
||||
SysOssConfig config = BeanUtil.toBean(bo, SysOssConfig.class);
|
||||
validEntityBeforeSave(config);
|
||||
LambdaUpdateWrapper<SysOssConfig> luw = new LambdaUpdateWrapper<>();
|
||||
luw.set(StringUtils.isBlank(config.getPrefix()), SysOssConfig::getPrefix, "");
|
||||
luw.set(StringUtils.isBlank(config.getRegion()), SysOssConfig::getRegion, "");
|
||||
luw.set(StringUtils.isBlank(config.getExt1()), SysOssConfig::getExt1, "");
|
||||
luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId());
|
||||
return setConfigCache(update(config, luw), config);
|
||||
LambdaUpdateWrapper<SysOssConfig> luw = new LambdaUpdateWrapper<>();
|
||||
luw.set(StringUtils.isBlank(config.getPrefix()), SysOssConfig::getPrefix, "");
|
||||
luw.set(StringUtils.isBlank(config.getRegion()), SysOssConfig::getRegion, "");
|
||||
luw.set(StringUtils.isBlank(config.getExt1()), SysOssConfig::getExt1, "");
|
||||
luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId());
|
||||
return setConfigCache(update(config, luw), config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(SysOssConfig entity){
|
||||
if (StringUtils.isNotEmpty(entity.getConfigKey())
|
||||
&& UserConstants.NOT_UNIQUE.equals(checkConfigKeyUnique(entity))) {
|
||||
throw new ServiceException("操作配置'" + entity.getConfigKey() + "'失败, 配置key已存在!");
|
||||
}
|
||||
private void validEntityBeforeSave(SysOssConfig entity) {
|
||||
if (StringUtils.isNotEmpty(entity.getConfigKey())
|
||||
&& UserConstants.NOT_UNIQUE.equals(checkConfigKeyUnique(entity))) {
|
||||
throw new ServiceException("操作配置'" + entity.getConfigKey() + "'失败, 配置key已存在!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid) {
|
||||
if (CollUtil.containsAny(ids, CloudConstant.SYSTEM_DATA_IDS)) {
|
||||
throw new ServiceException("系统内置, 不可删除!");
|
||||
}
|
||||
}
|
||||
if (isValid) {
|
||||
if (CollUtil.containsAny(ids, CloudConstant.SYSTEM_DATA_IDS)) {
|
||||
throw new ServiceException("系统内置, 不可删除!");
|
||||
}
|
||||
}
|
||||
List<SysOssConfig> list = Lists.newArrayList();
|
||||
for (Long configId : ids) {
|
||||
SysOssConfig config = getById(configId);
|
||||
@ -128,61 +128,62 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断configKey是否唯一
|
||||
*/
|
||||
private String checkConfigKeyUnique(SysOssConfig sysOssConfig) {
|
||||
long ossConfigId = StringUtils.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.getOssConfigId();
|
||||
SysOssConfig info = getOne(new LambdaQueryWrapper<SysOssConfig>()
|
||||
.select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey)
|
||||
.eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey()));
|
||||
if (StringUtils.isNotNull(info) && info.getOssConfigId() != ossConfigId) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
/**
|
||||
* 判断configKey是否唯一
|
||||
*/
|
||||
private String checkConfigKeyUnique(SysOssConfig sysOssConfig) {
|
||||
long ossConfigId = StringUtils.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.getOssConfigId();
|
||||
SysOssConfig info = getOne(new LambdaQueryWrapper<SysOssConfig>()
|
||||
.select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey)
|
||||
.eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey()));
|
||||
if (StringUtils.isNotNull(info) && info.getOssConfigId() != ossConfigId) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用禁用状态
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateOssConfigStatus(SysOssConfigBo bo) {
|
||||
SysOssConfig sysOssConfig = BeanUtil.toBean(bo, SysOssConfig.class);
|
||||
int row = baseMapper.update(null, new LambdaUpdateWrapper<SysOssConfig>()
|
||||
.set(SysOssConfig::getStatus, "1"));
|
||||
row += baseMapper.updateById(sysOssConfig);
|
||||
if (row > 0) {
|
||||
RedisUtils.setCacheObject(CloudConstant.CACHE_CONFIG_KEY, sysOssConfig.getConfigKey());
|
||||
}
|
||||
return row;
|
||||
}
|
||||
/**
|
||||
* 启用禁用状态
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateOssConfigStatus(SysOssConfigBo bo) {
|
||||
SysOssConfig sysOssConfig = BeanUtil.toBean(bo, SysOssConfig.class);
|
||||
int row = baseMapper.update(null, new LambdaUpdateWrapper<SysOssConfig>()
|
||||
.set(SysOssConfig::getStatus, "1"));
|
||||
row += baseMapper.updateById(sysOssConfig);
|
||||
if (row > 0) {
|
||||
RedisUtils.setCacheObject(CloudConstant.CACHE_CONFIG_KEY, sysOssConfig.getConfigKey());
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
private String getCacheKey(String configKey) {
|
||||
return CloudConstant.SYS_OSS_KEY + configKey;
|
||||
}
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
private String getCacheKey(String configKey) {
|
||||
return CloudConstant.SYS_OSS_KEY + configKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果操作成功 则更新缓存
|
||||
* @param flag 操作状态
|
||||
* @param config 配置
|
||||
* @return 返回操作状态
|
||||
*/
|
||||
private boolean setConfigCache(boolean flag, SysOssConfig config) {
|
||||
if (flag) {
|
||||
RedisUtils.setCacheObject(
|
||||
getCacheKey(config.getConfigKey()),
|
||||
JsonUtils.toJsonString(config));
|
||||
RedisUtils.publish(CloudConstant.CACHE_CONFIG_KEY, config.getConfigKey(), msg -> {
|
||||
log.info("发布刷新OSS配置 => " + msg);
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
/**
|
||||
* 如果操作成功 则更新缓存
|
||||
*
|
||||
* @param flag 操作状态
|
||||
* @param config 配置
|
||||
* @return 返回操作状态
|
||||
*/
|
||||
private boolean setConfigCache(boolean flag, SysOssConfig config) {
|
||||
if (flag) {
|
||||
RedisUtils.setCacheObject(
|
||||
getCacheKey(config.getConfigKey()),
|
||||
JsonUtils.toJsonString(config));
|
||||
RedisUtils.publish(CloudConstant.CACHE_CONFIG_KEY, config.getConfigKey(), msg -> {
|
||||
log.info("发布刷新OSS配置 => " + msg);
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
@ -32,59 +32,59 @@ import java.util.Map;
|
||||
@Service
|
||||
public class SysOssServiceImpl extends ServicePlusImpl<SysOssMapper, SysOss, SysOssVo> implements ISysOssService {
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysOssVo> queryPageList(SysOssBo bo) {
|
||||
PagePlus<SysOss, SysOssVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<SysOssVo> queryPageList(SysOssBo bo) {
|
||||
PagePlus<SysOss, SysOssVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SysOss> buildQueryWrapper(SysOssBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SysOss> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFileName()), SysOss::getFileName, bo.getFileName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getOriginalName()), SysOss::getOriginalName, bo.getOriginalName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileSuffix()), SysOss::getFileSuffix, bo.getFileSuffix());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysOss::getUrl, bo.getUrl());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), SysOss::getCreateBy, bo.getCreateBy());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getService()), SysOss::getService, bo.getService());
|
||||
return lqw;
|
||||
}
|
||||
private LambdaQueryWrapper<SysOss> buildQueryWrapper(SysOssBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SysOss> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFileName()), SysOss::getFileName, bo.getFileName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getOriginalName()), SysOss::getOriginalName, bo.getOriginalName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileSuffix()), SysOss::getFileSuffix, bo.getFileSuffix());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysOss::getUrl, bo.getUrl());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), SysOss::getCreateBy, bo.getCreateBy());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getService()), SysOss::getService, bo.getService());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysOss upload(MultipartFile file) {
|
||||
String originalfileName = file.getOriginalFilename();
|
||||
String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length());
|
||||
ICloudStorageStrategy storage = OssFactory.instance();
|
||||
UploadResult uploadResult;
|
||||
try {
|
||||
uploadResult = storage.uploadSuffix(file.getBytes(), suffix, file.getContentType());
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
// 保存文件信息
|
||||
SysOss oss = new SysOss()
|
||||
.setUrl(uploadResult.getUrl())
|
||||
.setFileSuffix(suffix)
|
||||
.setFileName(uploadResult.getFilename())
|
||||
.setOriginalName(originalfileName)
|
||||
.setService(storage.getServiceType());
|
||||
save(oss);
|
||||
return oss;
|
||||
}
|
||||
@Override
|
||||
public SysOss upload(MultipartFile file) {
|
||||
String originalfileName = file.getOriginalFilename();
|
||||
String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length());
|
||||
ICloudStorageStrategy storage = OssFactory.instance();
|
||||
UploadResult uploadResult;
|
||||
try {
|
||||
uploadResult = storage.uploadSuffix(file.getBytes(), suffix, file.getContentType());
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
// 保存文件信息
|
||||
SysOss oss = new SysOss()
|
||||
.setUrl(uploadResult.getUrl())
|
||||
.setFileSuffix(suffix)
|
||||
.setFileName(uploadResult.getFilename())
|
||||
.setOriginalName(originalfileName)
|
||||
.setService(storage.getServiceType());
|
||||
save(oss);
|
||||
return oss;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
List<SysOss> list = listByIds(ids);
|
||||
for (SysOss sysOss : list) {
|
||||
ICloudStorageStrategy storage = OssFactory.instance(sysOss.getService());
|
||||
storage.delete(sysOss.getUrl());
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
List<SysOss> list = listByIds(ids);
|
||||
for (SysOss sysOss : list) {
|
||||
ICloudStorageStrategy storage = OssFactory.instance(sysOss.getService());
|
||||
storage.delete(sysOss.getUrl());
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
/**
|
||||
* 岗位信息 服务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost, SysPost> implements ISysPostService {
|
||||
@ -35,7 +35,7 @@ public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost,
|
||||
.like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode())
|
||||
.eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus())
|
||||
.like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName());
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(),lqw));
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -126,7 +126,7 @@ public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost,
|
||||
*/
|
||||
@Override
|
||||
public long countUserPostById(Long postId) {
|
||||
return userPostMapper.selectCount(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getPostId,postId));
|
||||
return userPostMapper.selectCount(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getPostId, postId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
@ -29,7 +29,7 @@ import java.util.*;
|
||||
/**
|
||||
* 角色 业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole, SysRole> implements ISysRoleService {
|
||||
@ -280,7 +280,7 @@ public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole,
|
||||
list.add(rm);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
rows = roleMenuMapper.insertAll(list);
|
||||
rows = roleMenuMapper.insertAll(list);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
@ -301,7 +301,7 @@ public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole,
|
||||
list.add(rd);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
rows = roleDeptMapper.insertAll(list);
|
||||
rows = roleDeptMapper.insertAll(list);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
@ -355,45 +355,45 @@ public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole,
|
||||
@Override
|
||||
public int deleteAuthUser(SysUserRole userRole) {
|
||||
return userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>()
|
||||
.eq(SysUserRole::getRoleId, userRole.getRoleId())
|
||||
.eq(SysUserRole::getUserId, userRole.getUserId()));
|
||||
.eq(SysUserRole::getRoleId, userRole.getRoleId())
|
||||
.eq(SysUserRole::getUserId, userRole.getUserId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量取消授权用户角色
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 需要取消授权的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAuthUsers(Long roleId, Long[] userIds) {
|
||||
return userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>()
|
||||
.eq(SysUserRole::getRoleId, roleId)
|
||||
.in(SysUserRole::getUserId, Arrays.asList(userIds)));
|
||||
return userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>()
|
||||
.eq(SysUserRole::getRoleId, roleId)
|
||||
.in(SysUserRole::getUserId, Arrays.asList(userIds)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量选择授权用户角色
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 需要删除的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAuthUsers(Long roleId, Long[] userIds) {
|
||||
// 新增用户与角色管理
|
||||
int rows = 1;
|
||||
List<SysUserRole> list = new ArrayList<SysUserRole>();
|
||||
int rows = 1;
|
||||
List<SysUserRole> list = new ArrayList<SysUserRole>();
|
||||
for (Long userId : userIds) {
|
||||
SysUserRole ur = new SysUserRole();
|
||||
ur.setUserId(userId);
|
||||
ur.setRoleId(roleId);
|
||||
list.add(ur);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
rows = userRoleMapper.insertAll(list);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
rows = userRoleMapper.insertAll(list);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
|
@ -9,10 +9,11 @@ import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 在线用户 服务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
|
||||
|
||||
/**
|
||||
* 通过登录地址查询信息
|
||||
*
|
||||
|
@ -31,7 +31,7 @@ import java.util.List;
|
||||
/**
|
||||
* 用户 业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@ -79,7 +79,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
@Override
|
||||
@DataScope(deptAlias = "d", userAlias = "u", isUser = true)
|
||||
public TableDataInfo<SysUser> selectAllocatedList(SysUser user) {
|
||||
return PageUtils.buildDataInfo(baseMapper.selectAllocatedList(PageUtils.buildPage(), user));
|
||||
return PageUtils.buildDataInfo(baseMapper.selectAllocatedList(PageUtils.buildPage(), user));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,7 +91,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
@Override
|
||||
@DataScope(deptAlias = "d", userAlias = "u", isUser = true)
|
||||
public TableDataInfo<SysUser> selectUnallocatedList(SysUser user) {
|
||||
return PageUtils.buildDataInfo(baseMapper.selectUnallocatedList(PageUtils.buildPage(), user));
|
||||
return PageUtils.buildDataInfo(baseMapper.selectUnallocatedList(PageUtils.buildPage(), user));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -258,7 +258,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Override
|
||||
public boolean registerUser(SysUser user) {
|
||||
return baseMapper.insert(user) > 0;
|
||||
}
|
||||
@ -274,11 +274,11 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
public int updateUser(SysUser user) {
|
||||
Long userId = user.getUserId();
|
||||
// 删除用户与角色关联
|
||||
userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId,userId));
|
||||
userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, userId));
|
||||
// 新增用户与角色管理
|
||||
insertUserRole(user);
|
||||
// 删除用户与岗位关联
|
||||
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getUserId,userId));
|
||||
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getUserId, userId));
|
||||
// 新增用户与岗位管理
|
||||
insertUserPost(user);
|
||||
return baseMapper.updateById(user);
|
||||
@ -287,15 +287,14 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
/**
|
||||
* 用户授权角色
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param userId 用户ID
|
||||
* @param roleIds 角色组
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void insertUserAuth(Long userId, Long[] roleIds)
|
||||
{
|
||||
public void insertUserAuth(Long userId, Long[] roleIds) {
|
||||
userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>()
|
||||
.eq(SysUserRole::getUserId, userId));
|
||||
.eq(SysUserRole::getUserId, userId));
|
||||
insertUserRole(userId, roleIds);
|
||||
}
|
||||
|
||||
@ -325,15 +324,15 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
* 修改用户头像
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param avatar 头像地址
|
||||
* @param avatar 头像地址
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean updateUserAvatar(String userName, String avatar) {
|
||||
return baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SysUser>()
|
||||
.set(SysUser::getAvatar,avatar)
|
||||
.eq(SysUser::getUserName,userName)) > 0;
|
||||
.set(SysUser::getAvatar, avatar)
|
||||
.eq(SysUser::getUserName, userName)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -358,8 +357,8 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
public int resetUserPwd(String userName, String password) {
|
||||
return baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SysUser>()
|
||||
.set(SysUser::getPassword,password)
|
||||
.eq(SysUser::getUserName,userName));
|
||||
.set(SysUser::getPassword, password)
|
||||
.eq(SysUser::getUserName, userName));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -379,7 +378,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
list.add(ur);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
userRoleMapper.insertAll(list);
|
||||
userRoleMapper.insertAll(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -401,7 +400,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
list.add(up);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
userPostMapper.insertAll(list);
|
||||
userPostMapper.insertAll(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -409,7 +408,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
/**
|
||||
* 新增用户角色信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param userId 用户ID
|
||||
* @param roleIds 角色组
|
||||
*/
|
||||
public void insertUserRole(Long userId, Long[] roleIds) {
|
||||
@ -438,9 +437,9 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
@Transactional
|
||||
public int deleteUserById(Long userId) {
|
||||
// 删除用户与角色关联
|
||||
userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId,userId));
|
||||
userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, userId));
|
||||
// 删除用户与岗位表
|
||||
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getUserId,userId));
|
||||
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getUserId, userId));
|
||||
return baseMapper.deleteById(userId);
|
||||
}
|
||||
|
||||
@ -458,18 +457,18 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
}
|
||||
List<Long> ids = Arrays.asList(userIds);
|
||||
// 删除用户与角色关联
|
||||
userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getUserId,ids));
|
||||
userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getUserId, ids));
|
||||
// 删除用户与岗位表
|
||||
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().in(SysUserPost::getUserId,ids));
|
||||
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().in(SysUserPost::getUserId, ids));
|
||||
return baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户数据
|
||||
*
|
||||
* @param userList 用户数据列表
|
||||
* @param userList 用户数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -49,16 +49,16 @@ public class TokenServiceImpl implements TokenService {
|
||||
// 获取请求携带的令牌
|
||||
String token = getToken(request);
|
||||
if (StringUtils.isNotEmpty(token)) {
|
||||
try {
|
||||
Claims claims = parseToken(token);
|
||||
// 解析对应的权限以及用户信息
|
||||
String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
|
||||
String userKey = getTokenKey(uuid);
|
||||
LoginUser user = RedisUtils.getCacheObject(userKey);
|
||||
return user;
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
Claims claims = parseToken(token);
|
||||
// 解析对应的权限以及用户信息
|
||||
String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
|
||||
String userKey = getTokenKey(uuid);
|
||||
LoginUser user = RedisUtils.getCacheObject(userKey);
|
||||
return user;
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user