mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
[重磅更新] 重写项目整体结构 数据处理下沉至 Mapper 符合 MVC 规范 减少循环依赖
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
|
||||
/**
|
||||
@ -8,6 +8,6 @@ import com.ruoyi.system.domain.SysConfig;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysConfigMapper extends BaseMapperPlus<SysConfig> {
|
||||
public interface SysConfigMapper extends BaseMapperPlus<SysConfigMapper, SysConfig, SysConfig> {
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package com.ruoyi.system.mapper;
|
||||
import com.ruoyi.common.annotation.DataColumn;
|
||||
import com.ruoyi.common.annotation.DataPermission;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -13,7 +13,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysDeptMapper extends BaseMapperPlus<SysDept> {
|
||||
public interface SysDeptMapper extends BaseMapperPlus<SysDeptMapper, SysDept, SysDept> {
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
|
@ -2,7 +2,7 @@ package com.ruoyi.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -11,7 +11,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysDictDataMapper extends BaseMapperPlus<SysDictData> {
|
||||
public interface SysDictDataMapper extends BaseMapperPlus<SysDictDataMapper, SysDictData, SysDictData> {
|
||||
|
||||
default List<SysDictData> selectDictDataByType(String dictType) {
|
||||
return selectList(
|
||||
|
@ -1,13 +1,13 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysDictType;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 字典表 数据层
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysDictTypeMapper extends BaseMapperPlus<SysDictType> {
|
||||
public interface SysDictTypeMapper extends BaseMapperPlus<SysDictTypeMapper, SysDictType, SysDictType> {
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
|
||||
/**
|
||||
@ -8,6 +8,6 @@ import com.ruoyi.system.domain.SysLogininfor;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysLogininforMapper extends BaseMapperPlus<SysLogininfor> {
|
||||
public interface SysLogininforMapper extends BaseMapperPlus<SysLogininforMapper, SysLogininfor, SysLogininfor> {
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -11,7 +11,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysMenuMapper extends BaseMapperPlus<SysMenu> {
|
||||
public interface SysMenuMapper extends BaseMapperPlus<SysMenuMapper, SysMenu, SysMenu> {
|
||||
|
||||
/**
|
||||
* 根据用户所有权限
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
|
||||
/**
|
||||
@ -8,6 +8,6 @@ import com.ruoyi.system.domain.SysNotice;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysNoticeMapper extends BaseMapperPlus<SysNotice> {
|
||||
public interface SysNoticeMapper extends BaseMapperPlus<SysNoticeMapper, SysNotice, SysNotice> {
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysOperLog;
|
||||
|
||||
/**
|
||||
@ -8,6 +8,6 @@ import com.ruoyi.system.domain.SysOperLog;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysOperLogMapper extends BaseMapperPlus<SysOperLog> {
|
||||
public interface SysOperLogMapper extends BaseMapperPlus<SysOperLogMapper, SysOperLog, SysOperLog> {
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysOssConfig;
|
||||
import com.ruoyi.system.domain.vo.SysOssConfigVo;
|
||||
|
||||
/**
|
||||
* 对象存储配置Mapper接口
|
||||
@ -10,6 +11,6 @@ import com.ruoyi.system.domain.SysOssConfig;
|
||||
* @author 孤舟烟雨
|
||||
* @date 2021-08-13
|
||||
*/
|
||||
public interface SysOssConfigMapper extends BaseMapperPlus<SysOssConfig> {
|
||||
public interface SysOssConfigMapper extends BaseMapperPlus<SysOssConfigMapper, SysOssConfig, SysOssConfigVo> {
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,13 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysOss;
|
||||
import com.ruoyi.system.domain.vo.SysOssVo;
|
||||
|
||||
/**
|
||||
* 文件上传 数据层
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysOssMapper extends BaseMapperPlus<SysOss> {
|
||||
public interface SysOssMapper extends BaseMapperPlus<SysOssMapper, SysOss, SysOssVo> {
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
|
||||
import java.util.List;
|
||||
@ -10,7 +10,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysPostMapper extends BaseMapperPlus<SysPost> {
|
||||
public interface SysPostMapper extends BaseMapperPlus<SysPostMapper, SysPost, SysPost> {
|
||||
|
||||
/**
|
||||
* 根据用户ID获取岗位选择框列表
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysRoleDept;
|
||||
|
||||
/**
|
||||
@ -8,6 +8,6 @@ import com.ruoyi.system.domain.SysRoleDept;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysRoleDeptMapper extends BaseMapperPlus<SysRoleDept> {
|
||||
public interface SysRoleDeptMapper extends BaseMapperPlus<SysRoleDeptMapper, SysRoleDept, SysRoleDept> {
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.DataColumn;
|
||||
import com.ruoyi.common.annotation.DataPermission;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -14,7 +14,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysRoleMapper extends BaseMapperPlus<SysRole> {
|
||||
public interface SysRoleMapper extends BaseMapperPlus<SysRoleMapper, SysRole, SysRole> {
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "d.dept_id")
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysRoleMenu;
|
||||
|
||||
/**
|
||||
@ -8,6 +8,6 @@ import com.ruoyi.system.domain.SysRoleMenu;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysRoleMenuMapper extends BaseMapperPlus<SysRoleMenu> {
|
||||
public interface SysRoleMenuMapper extends BaseMapperPlus<SysRoleMenuMapper, SysRoleMenu, SysRoleMenu> {
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.DataColumn;
|
||||
import com.ruoyi.common.annotation.DataPermission;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -14,7 +14,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysUserMapper extends BaseMapperPlus<SysUser> {
|
||||
public interface SysUserMapper extends BaseMapperPlus<SysUserMapper, SysUser, SysUser> {
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "d.dept_id"),
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysUserPost;
|
||||
|
||||
/**
|
||||
@ -8,6 +8,6 @@ import com.ruoyi.system.domain.SysUserPost;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysUserPostMapper extends BaseMapperPlus<SysUserPost> {
|
||||
public interface SysUserPostMapper extends BaseMapperPlus<SysUserPostMapper, SysUserPost, SysUserPost> {
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
|
||||
/**
|
||||
@ -8,6 +8,6 @@ import com.ruoyi.system.domain.SysUserRole;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRole> {
|
||||
public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRoleMapper, SysUserRole, SysUserRole> {
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
@ -12,7 +11,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysConfigService extends IService<SysConfig> {
|
||||
public interface ISysConfigService {
|
||||
|
||||
|
||||
TableDataInfo<SysConfig> selectPageConfigList(SysConfig config, PageQuery pageQuery);
|
||||
@ -94,4 +93,7 @@ public interface ISysConfigService extends IService<SysConfig> {
|
||||
* @return 结果
|
||||
*/
|
||||
String checkConfigKeyUnique(SysConfig config);
|
||||
|
||||
SysConfig getOne(SysConfig config);
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
|
||||
import java.util.List;
|
||||
@ -11,7 +10,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysDeptService extends IService<SysDept> {
|
||||
public interface ISysDeptService {
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -12,7 +11,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysDictDataService extends IService<SysDictData> {
|
||||
public interface ISysDictDataService {
|
||||
|
||||
|
||||
TableDataInfo<SysDictData> selectPageDictDataList(SysDictData dictData, PageQuery pageQuery);
|
||||
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysDictTypeService extends IService<SysDictType> {
|
||||
public interface ISysDictTypeService {
|
||||
|
||||
|
||||
TableDataInfo<SysDictType> selectPageDictTypeList(SysDictType dictType, PageQuery pageQuery);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
@ -12,7 +11,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysLogininforService extends IService<SysLogininfor> {
|
||||
public interface ISysLogininforService {
|
||||
|
||||
|
||||
TableDataInfo<SysLogininfor> selectPageLogininforList(SysLogininfor logininfor, PageQuery pageQuery);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.system.domain.vo.RouterVo;
|
||||
|
||||
@ -13,7 +12,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysMenuService extends IService<SysMenu> {
|
||||
public interface ISysMenuService {
|
||||
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
@ -12,7 +11,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysNoticeService extends IService<SysNotice> {
|
||||
public interface ISysNoticeService {
|
||||
|
||||
|
||||
TableDataInfo<SysNotice> selectPageNoticeList(SysNotice notice, PageQuery pageQuery);
|
||||
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysOperLogService extends IService<SysOperLog> {
|
||||
public interface ISysOperLogService {
|
||||
|
||||
TableDataInfo<SysOperLog> selectPageOperLogList(SysOperLog operLog, PageQuery pageQuery);
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysOssConfig;
|
||||
import com.ruoyi.system.domain.bo.SysOssConfigBo;
|
||||
import com.ruoyi.system.domain.vo.SysOssConfigVo;
|
||||
|
||||
@ -16,7 +14,7 @@ import java.util.Collection;
|
||||
* @author 孤舟烟雨
|
||||
* @date 2021-08-13
|
||||
*/
|
||||
public interface ISysOssConfigService extends IServicePlus<SysOssConfig, SysOssConfigVo> {
|
||||
public interface ISysOssConfigService {
|
||||
|
||||
/**
|
||||
* 初始化OSS配置
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.system.domain.SysOss;
|
||||
import com.ruoyi.system.domain.bo.SysOssBo;
|
||||
@ -15,11 +14,14 @@ import java.util.Collection;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysOssService extends IServicePlus<SysOss, SysOssVo> {
|
||||
public interface ISysOssService {
|
||||
|
||||
TableDataInfo<SysOssVo> queryPageList(SysOssBo sysOss, PageQuery pageQuery);
|
||||
|
||||
SysOss getById(Long ossId);
|
||||
|
||||
SysOss upload(MultipartFile file);
|
||||
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysPostService extends IService<SysPost> {
|
||||
public interface ISysPostService {
|
||||
|
||||
|
||||
TableDataInfo<SysPost> selectPagePostList(SysPost post, PageQuery pageQuery);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -14,7 +13,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysRoleService extends IService<SysRole> {
|
||||
public interface ISysRoleService {
|
||||
|
||||
|
||||
TableDataInfo<SysRole> selectPageRoleList(SysRole role, PageQuery pageQuery);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -13,7 +12,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface ISysUserService extends IService<SysUser>, UserService {
|
||||
public interface ISysUserService extends UserService {
|
||||
|
||||
|
||||
TableDataInfo<SysUser> selectPageUserList(SysUser user, PageQuery pageQuery);
|
||||
|
@ -12,16 +12,15 @@ import com.ruoyi.common.exception.user.CaptchaExpireException;
|
||||
import com.ruoyi.common.exception.user.UserException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@ -30,23 +29,15 @@ import java.util.concurrent.TimeUnit;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysLoginService {
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Resource
|
||||
private AuthenticationManager authenticationManager;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private LogininforService asyncService;
|
||||
private final TokenService tokenService;
|
||||
private final AuthenticationManager authenticationManager;
|
||||
private final ISysUserService userService;
|
||||
private final ISysConfigService configService;
|
||||
private final LogininforService asyncService;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashSet;
|
||||
@ -12,14 +12,12 @@ import java.util.Set;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysPermissionService {
|
||||
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
private final ISysRoleService roleService;
|
||||
private final ISysMenuService menuService;
|
||||
|
||||
/**
|
||||
* 获取角色数据权限
|
||||
|
@ -7,9 +7,12 @@ import com.ruoyi.common.core.domain.model.RegisterBody;
|
||||
import com.ruoyi.common.core.service.LogininforService;
|
||||
import com.ruoyi.common.exception.user.CaptchaException;
|
||||
import com.ruoyi.common.exception.user.CaptchaExpireException;
|
||||
import com.ruoyi.common.utils.*;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@ -17,17 +20,13 @@ import org.springframework.stereotype.Service;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysRegisterService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private LogininforService asyncService;
|
||||
private final ISysUserService userService;
|
||||
private final ISysConfigService configService;
|
||||
private final LogininforService asyncService;
|
||||
|
||||
/**
|
||||
* 注册
|
||||
|
@ -7,15 +7,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.service.ConfigService;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.mapper.SysConfigMapper;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -28,8 +28,11 @@ import java.util.Map;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysConfigServiceImpl extends ServicePlusImpl<SysConfigMapper, SysConfig, SysConfig> implements ISysConfigService, ConfigService {
|
||||
public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
|
||||
|
||||
private final SysConfigMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysConfig> selectPageConfigList(SysConfig config, PageQuery pageQuery) {
|
||||
@ -40,7 +43,7 @@ public class SysConfigServiceImpl extends ServicePlusImpl<SysConfigMapper, SysCo
|
||||
.like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
||||
SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||
Page<SysConfig> page = page(pageQuery.build(), lqw);
|
||||
Page<SysConfig> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@ -202,6 +205,11 @@ public class SysConfigServiceImpl extends ServicePlusImpl<SysConfigMapper, SysCo
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysConfig getOne(SysConfig config) {
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<>(config));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数 key 获取参数值
|
||||
*
|
||||
|
@ -8,19 +8,18 @@ import com.ruoyi.system.domain.SysRoleDept;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleDeptMapper;
|
||||
import com.ruoyi.system.service.SysDataScopeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Service("sdss")
|
||||
public class SysDataScopeServiceImpl implements SysDataScopeService {
|
||||
|
||||
@Autowired
|
||||
private SysRoleDeptMapper roleDeptMapper;
|
||||
@Autowired
|
||||
private SysDeptMapper deptMapper;
|
||||
private final SysRoleDeptMapper roleDeptMapper;
|
||||
private final SysDeptMapper deptMapper;
|
||||
|
||||
@Override
|
||||
public String getRoleCustom(Long roleId) {
|
||||
|
@ -9,7 +9,6 @@ import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@ -19,7 +18,7 @@ import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -30,14 +29,13 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept, SysDept> implements ISysDeptService {
|
||||
public class SysDeptServiceImpl implements ISysDeptService {
|
||||
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper userMapper;
|
||||
private final SysDeptMapper baseMapper;
|
||||
private final SysRoleMapper roleMapper;
|
||||
private final SysUserMapper userMapper;
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
@ -47,8 +45,6 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
*/
|
||||
@Override
|
||||
public List<SysDept> selectDeptList(SysDept dept) {
|
||||
// return baseMapper.selectList();
|
||||
// return baseMapper.selectList(new LambdaQueryWrapper<>());
|
||||
return baseMapper.selectDeptList(dept);
|
||||
}
|
||||
|
||||
@ -91,7 +87,7 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
*/
|
||||
@Override
|
||||
public SysDept selectDeptById(Long deptId) {
|
||||
return getById(deptId);
|
||||
return baseMapper.selectById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,7 +98,7 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
*/
|
||||
@Override
|
||||
public long selectNormalChildrenDeptById(Long deptId) {
|
||||
return count(new LambdaQueryWrapper<SysDept>()
|
||||
return baseMapper.selectCount(new LambdaQueryWrapper<SysDept>()
|
||||
.eq(SysDept::getStatus, 0)
|
||||
.apply("find_in_set({0}, ancestors)", deptId));
|
||||
}
|
||||
@ -115,9 +111,8 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
*/
|
||||
@Override
|
||||
public boolean hasChildByDeptId(Long deptId) {
|
||||
long result = count(new LambdaQueryWrapper<SysDept>()
|
||||
return baseMapper.exists(new LambdaQueryWrapper<SysDept>()
|
||||
.eq(SysDept::getParentId, deptId));
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,9 +123,8 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
*/
|
||||
@Override
|
||||
public boolean checkDeptExistUser(Long deptId) {
|
||||
long result = userMapper.selectCount(new LambdaQueryWrapper<SysUser>()
|
||||
return userMapper.exists(new LambdaQueryWrapper<SysUser>()
|
||||
.eq(SysUser::getDeptId, deptId));
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,11 +136,11 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
@Override
|
||||
public String checkDeptNameUnique(SysDept dept) {
|
||||
Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
|
||||
long count = count(new LambdaQueryWrapper<SysDept>()
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysDept>()
|
||||
.eq(SysDept::getDeptName, dept.getDeptName())
|
||||
.eq(SysDept::getParentId, dept.getParentId())
|
||||
.ne(SysDept::getDeptId, deptId));
|
||||
if (count > 0) {
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -177,7 +171,7 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
*/
|
||||
@Override
|
||||
public int insertDept(SysDept dept) {
|
||||
SysDept info = getById(dept.getParentId());
|
||||
SysDept info = baseMapper.selectById(dept.getParentId());
|
||||
// 如果父节点不为正常状态,则不允许新增子节点
|
||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
||||
throw new ServiceException("部门停用,不允许新增");
|
||||
@ -194,8 +188,8 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
*/
|
||||
@Override
|
||||
public int updateDept(SysDept dept) {
|
||||
SysDept newParentDept = getById(dept.getParentId());
|
||||
SysDept oldDept = getById(dept.getDeptId());
|
||||
SysDept newParentDept = baseMapper.selectById(dept.getParentId());
|
||||
SysDept oldDept = baseMapper.selectById(dept.getDeptId());
|
||||
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
|
||||
String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
|
||||
String oldAncestors = oldDept.getAncestors();
|
||||
@ -219,7 +213,7 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
private void updateParentDeptStatusNormal(SysDept dept) {
|
||||
String ancestors = dept.getAncestors();
|
||||
Long[] deptIds = Convert.toLongArray(ancestors);
|
||||
update(null, new LambdaUpdateWrapper<SysDept>()
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<SysDept>()
|
||||
.set(SysDept::getStatus, "0")
|
||||
.in(SysDept::getDeptId, Arrays.asList(deptIds)));
|
||||
}
|
||||
@ -232,7 +226,7 @@ public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept,
|
||||
* @param oldAncestors 旧的父ID集合
|
||||
*/
|
||||
public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
|
||||
List<SysDept> children = list(new LambdaQueryWrapper<SysDept>()
|
||||
List<SysDept> children = baseMapper.selectList(new LambdaQueryWrapper<SysDept>()
|
||||
.apply("find_in_set({0},ancestors)", deptId));
|
||||
for (SysDept child : children) {
|
||||
child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
|
||||
|
@ -5,12 +5,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
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.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,8 +20,11 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, SysDictData, SysDictData> implements ISysDictDataService {
|
||||
public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
|
||||
private final SysDictDataMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysDictData> selectPageDictDataList(SysDictData dictData, PageQuery pageQuery) {
|
||||
@ -30,7 +33,7 @@ public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, S
|
||||
.like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel())
|
||||
.eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus())
|
||||
.orderByAsc(SysDictData::getDictSort);
|
||||
Page<SysDictData> page = page(pageQuery.build(), lqw);
|
||||
Page<SysDictData> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@ -42,7 +45,7 @@ public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, S
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData) {
|
||||
return list(new LambdaQueryWrapper<SysDictData>()
|
||||
return baseMapper.selectList(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())
|
||||
@ -58,7 +61,7 @@ public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, S
|
||||
*/
|
||||
@Override
|
||||
public String selectDictLabel(String dictType, String dictValue) {
|
||||
return getOne(new LambdaQueryWrapper<SysDictData>()
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<SysDictData>()
|
||||
.select(SysDictData::getDictLabel)
|
||||
.eq(SysDictData::getDictType, dictType)
|
||||
.eq(SysDictData::getDictValue, dictValue))
|
||||
@ -73,7 +76,7 @@ public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, S
|
||||
*/
|
||||
@Override
|
||||
public SysDictData selectDictDataById(Long dictCode) {
|
||||
return getById(dictCode);
|
||||
return baseMapper.selectById(dictCode);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,7 +89,7 @@ public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, S
|
||||
public void deleteDictDataByIds(Long[] dictCodes) {
|
||||
for (Long dictCode : dictCodes) {
|
||||
SysDictData data = selectDictDataById(dictCode);
|
||||
removeById(dictCode);
|
||||
baseMapper.deleteById(dictCode);
|
||||
List<SysDictData> dictDatas = baseMapper.selectDictDataByType(data.getDictType());
|
||||
RedisUtils.setCacheObject(getCacheKey(data.getDictType()), dictDatas);
|
||||
}
|
||||
|
@ -9,16 +9,15 @@ import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictType;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.service.DictService;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||
import com.ruoyi.system.mapper.SysDictTypeMapper;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -32,11 +31,12 @@ import java.util.Map;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, SysDictType, SysDictType> implements ISysDictTypeService, DictService {
|
||||
public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService {
|
||||
|
||||
@Autowired
|
||||
private SysDictDataMapper dictDataMapper;
|
||||
private final SysDictTypeMapper baseMapper;
|
||||
private final SysDictDataMapper dictDataMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysDictType> selectPageDictTypeList(SysDictType dictType, PageQuery pageQuery) {
|
||||
@ -47,7 +47,7 @@ public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, S
|
||||
.like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
||||
SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||
Page<SysDictType> page = page(pageQuery.build(), lqw);
|
||||
Page<SysDictType> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, S
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeList(SysDictType dictType) {
|
||||
Map<String, Object> params = dictType.getParams();
|
||||
return list(new LambdaQueryWrapper<SysDictType>()
|
||||
return baseMapper.selectList(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())
|
||||
@ -75,7 +75,7 @@ public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, S
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeAll() {
|
||||
return list();
|
||||
return baseMapper.selectList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,7 +106,7 @@ public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, S
|
||||
*/
|
||||
@Override
|
||||
public SysDictType selectDictTypeById(Long dictId) {
|
||||
return getById(dictId);
|
||||
return baseMapper.selectById(dictId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -117,7 +117,7 @@ public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, S
|
||||
*/
|
||||
@Override
|
||||
public SysDictType selectDictTypeByType(String dictType) {
|
||||
return getOne(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
|
||||
return baseMapper.selectById(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +144,7 @@ public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, S
|
||||
*/
|
||||
@Override
|
||||
public void loadingDictCache() {
|
||||
List<SysDictType> dictTypeList = list();
|
||||
List<SysDictType> dictTypeList = baseMapper.selectList();
|
||||
for (SysDictType dictType : dictTypeList) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
|
||||
RedisUtils.setCacheObject(getCacheKey(dictType.getDictType()), dictDatas);
|
||||
@ -193,7 +193,7 @@ public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, S
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateDictType(SysDictType dict) {
|
||||
SysDictType oldDict = getById(dict.getDictId());
|
||||
SysDictType oldDict = baseMapper.selectById(dict.getDictId());
|
||||
dictDataMapper.update(null, new LambdaUpdateWrapper<SysDictData>()
|
||||
.set(SysDictData::getDictType, dict.getDictType())
|
||||
.eq(SysDictData::getDictType, oldDict.getDictType()));
|
||||
@ -214,7 +214,7 @@ public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, S
|
||||
@Override
|
||||
public String checkDictTypeUnique(SysDictType dict) {
|
||||
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
||||
long count = count(new LambdaQueryWrapper<SysDictType>()
|
||||
long count = baseMapper.selectCount(new LambdaQueryWrapper<SysDictType>()
|
||||
.eq(SysDictType::getDictType, dict.getDictType())
|
||||
.ne(SysDictType::getDictId, dictId));
|
||||
if (count > 0) {
|
||||
|
@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.service.LogininforService;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
@ -15,6 +14,7 @@ import com.ruoyi.common.utils.ip.AddressUtils;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
import com.ruoyi.system.mapper.SysLogininforMapper;
|
||||
import com.ruoyi.system.service.ISysLogininforService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -30,9 +30,12 @@ import java.util.Map;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SysLogininforServiceImpl extends ServicePlusImpl<SysLogininforMapper, SysLogininfor, SysLogininfor> implements ISysLogininforService, LogininforService {
|
||||
public class SysLogininforServiceImpl implements ISysLogininforService, LogininforService {
|
||||
|
||||
private final SysLogininforMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 记录登录信息
|
||||
@ -99,7 +102,7 @@ public class SysLogininforServiceImpl extends ServicePlusImpl<SysLogininforMappe
|
||||
if(StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
||||
pageQuery.setOrderByColumn("info_id").setIsAsc("desc");
|
||||
}
|
||||
Page<SysLogininfor> page = page(pageQuery.build(), lqw);
|
||||
Page<SysLogininfor> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@ -111,7 +114,7 @@ public class SysLogininforServiceImpl extends ServicePlusImpl<SysLogininforMappe
|
||||
@Override
|
||||
public void insertLogininfor(SysLogininfor logininfor) {
|
||||
logininfor.setLoginTime(new Date());
|
||||
save(logininfor);
|
||||
baseMapper.insert(logininfor);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -123,7 +126,7 @@ public class SysLogininforServiceImpl extends ServicePlusImpl<SysLogininforMappe
|
||||
@Override
|
||||
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) {
|
||||
Map<String, Object> params = logininfor.getParams();
|
||||
return list(new LambdaQueryWrapper<SysLogininfor>()
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SysLogininfor>()
|
||||
.like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr())
|
||||
.eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus())
|
||||
.like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName())
|
||||
@ -148,6 +151,6 @@ public class SysLogininforServiceImpl extends ServicePlusImpl<SysLogininforMappe
|
||||
*/
|
||||
@Override
|
||||
public void cleanLogininfor() {
|
||||
remove(new LambdaQueryWrapper<>());
|
||||
baseMapper.delete(new LambdaQueryWrapper<>());
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
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.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.TreeBuildUtils;
|
||||
@ -19,7 +18,7 @@ import com.ruoyi.system.mapper.SysMenuMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMenuMapper;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
@ -29,14 +28,13 @@ import java.util.*;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu, SysMenu> implements ISysMenuService {
|
||||
public class SysMenuServiceImpl implements ISysMenuService {
|
||||
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
@Autowired
|
||||
private SysRoleMenuMapper roleMenuMapper;
|
||||
private final SysMenuMapper baseMapper;
|
||||
private final SysRoleMapper roleMapper;
|
||||
private final SysRoleMenuMapper roleMenuMapper;
|
||||
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
@ -60,7 +58,7 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
List<SysMenu> menuList = null;
|
||||
// 管理员显示所有菜单信息
|
||||
if (SysUser.isAdmin(userId)) {
|
||||
menuList = list(new LambdaQueryWrapper<SysMenu>()
|
||||
menuList = baseMapper.selectList(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())
|
||||
@ -198,7 +196,7 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
*/
|
||||
@Override
|
||||
public SysMenu selectMenuById(Long menuId) {
|
||||
return getById(menuId);
|
||||
return baseMapper.selectById(menuId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -209,8 +207,7 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
*/
|
||||
@Override
|
||||
public boolean hasChildByMenuId(Long menuId) {
|
||||
long result = count(new LambdaQueryWrapper<SysMenu>().eq(SysMenu::getParentId, menuId));
|
||||
return result > 0;
|
||||
return baseMapper.exists(new LambdaQueryWrapper<SysMenu>().eq(SysMenu::getParentId, menuId));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -221,8 +218,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));
|
||||
return result > 0;
|
||||
return roleMenuMapper.exists(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getMenuId, menuId));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -267,11 +263,11 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
||||
@Override
|
||||
public String checkMenuNameUnique(SysMenu menu) {
|
||||
Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
|
||||
long count = count(new LambdaQueryWrapper<SysMenu>()
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysMenu>()
|
||||
.eq(SysMenu::getMenuName, menu.getMenuName())
|
||||
.eq(SysMenu::getParentId, menu.getParentId())
|
||||
.ne(SysMenu::getMenuId, menuId));
|
||||
if (count > 0) {
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
@ -3,12 +3,12 @@ package com.ruoyi.system.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.mapper.SysNoticeMapper;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -19,8 +19,11 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysNoticeServiceImpl extends ServicePlusImpl<SysNoticeMapper, SysNotice, SysNotice> implements ISysNoticeService {
|
||||
public class SysNoticeServiceImpl implements ISysNoticeService {
|
||||
|
||||
private final SysNoticeMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysNotice> selectPageNoticeList(SysNotice notice, PageQuery pageQuery) {
|
||||
@ -28,7 +31,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());
|
||||
Page<SysNotice> page = page(pageQuery.build(), lqw);
|
||||
Page<SysNotice> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@ -40,7 +43,7 @@ public class SysNoticeServiceImpl extends ServicePlusImpl<SysNoticeMapper, SysNo
|
||||
*/
|
||||
@Override
|
||||
public SysNotice selectNoticeById(Long noticeId) {
|
||||
return getById(noticeId);
|
||||
return baseMapper.selectById(noticeId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +54,7 @@ public class SysNoticeServiceImpl extends ServicePlusImpl<SysNoticeMapper, SysNo
|
||||
*/
|
||||
@Override
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice) {
|
||||
return list(new LambdaQueryWrapper<SysNotice>()
|
||||
return baseMapper.selectList(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()));
|
||||
|
@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
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.utils.StringUtils;
|
||||
@ -14,6 +13,7 @@ import com.ruoyi.common.utils.ip.AddressUtils;
|
||||
import com.ruoyi.system.domain.SysOperLog;
|
||||
import com.ruoyi.system.mapper.SysOperLogMapper;
|
||||
import com.ruoyi.system.service.ISysOperLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -27,8 +27,11 @@ import java.util.Map;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, SysOperLog, SysOperLog> implements ISysOperLogService, OperLogService {
|
||||
public class SysOperLogServiceImpl implements ISysOperLogService, OperLogService {
|
||||
|
||||
private final SysOperLogMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 操作日志记录
|
||||
@ -64,7 +67,7 @@ public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, Sys
|
||||
if(StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
||||
pageQuery.setOrderByColumn("oper_id").setIsAsc("desc");
|
||||
}
|
||||
Page<SysOperLog> page = page(pageQuery.build(), lqw);
|
||||
Page<SysOperLog> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@ -76,7 +79,7 @@ public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, Sys
|
||||
@Override
|
||||
public void insertOperlog(SysOperLog operLog) {
|
||||
operLog.setOperTime(new Date());
|
||||
save(operLog);
|
||||
baseMapper.insert(operLog);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,7 +91,7 @@ public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, Sys
|
||||
@Override
|
||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog) {
|
||||
Map<String, Object> params = operLog.getParams();
|
||||
return list(new LambdaQueryWrapper<SysOperLog>()
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SysOperLog>()
|
||||
.like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
|
||||
.eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0,
|
||||
SysOperLog::getBusinessType, operLog.getBusinessType())
|
||||
@ -124,7 +127,7 @@ public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, Sys
|
||||
*/
|
||||
@Override
|
||||
public SysOperLog selectOperLogById(Long operId) {
|
||||
return getById(operId);
|
||||
return baseMapper.selectById(operId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,6 +135,6 @@ public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, Sys
|
||||
*/
|
||||
@Override
|
||||
public void cleanOperLog() {
|
||||
remove(new LambdaQueryWrapper<>());
|
||||
baseMapper.delete(new LambdaQueryWrapper<>());
|
||||
}
|
||||
}
|
||||
|
@ -9,12 +9,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.JsonUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.oss.constant.OssConstant;
|
||||
import com.ruoyi.oss.factory.OssFactory;
|
||||
import com.ruoyi.system.domain.SysOssConfig;
|
||||
@ -24,7 +23,6 @@ import com.ruoyi.system.mapper.SysOssConfigMapper;
|
||||
import com.ruoyi.system.service.ISysOssConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -39,16 +37,18 @@ import java.util.List;
|
||||
* @date 2021-08-13
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper, SysOssConfig, SysOssConfigVo> implements ISysOssConfigService {
|
||||
public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
|
||||
private final SysOssConfigMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化参数到缓存,加载配置类
|
||||
*/
|
||||
@Override
|
||||
public void init() {
|
||||
List<SysOssConfig> list = list();
|
||||
List<SysOssConfig> list = baseMapper.selectList();
|
||||
// 加载OSS初始化配置
|
||||
for (SysOssConfig config : list) {
|
||||
String configKey = config.getConfigKey();
|
||||
@ -63,13 +63,13 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
|
||||
@Override
|
||||
public SysOssConfigVo queryById(Integer ossConfigId) {
|
||||
return getVoById(ossConfigId);
|
||||
return baseMapper.selectVoById(ossConfigId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysOssConfigVo> queryPageList(SysOssConfigBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysOssConfig> lqw = buildQueryWrapper(bo);
|
||||
Page<SysOssConfigVo> result = pageVo(pageQuery.build(), lqw);
|
||||
Page<SysOssConfigVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
public Boolean insertByBo(SysOssConfigBo bo) {
|
||||
SysOssConfig config = BeanUtil.toBean(bo, SysOssConfig.class);
|
||||
validEntityBeforeSave(config);
|
||||
return setConfigCache(save(config), config);
|
||||
return setConfigCache(baseMapper.insert(config) > 0, config);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -98,7 +98,7 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
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);
|
||||
return setConfigCache(baseMapper.update(config, luw) > 0, config);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,10 +120,10 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
}
|
||||
List<SysOssConfig> list = Lists.newArrayList();
|
||||
for (Long configId : ids) {
|
||||
SysOssConfig config = getById(configId);
|
||||
SysOssConfig config = baseMapper.selectById(configId);
|
||||
list.add(config);
|
||||
}
|
||||
boolean flag = removeByIds(ids);
|
||||
boolean flag = baseMapper.deleteBatchIds(ids) > 0;
|
||||
if (flag) {
|
||||
list.stream().forEach(sysOssConfig -> {
|
||||
RedisUtils.deleteObject(getCacheKey(sysOssConfig.getConfigKey()));
|
||||
@ -137,7 +137,7 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
*/
|
||||
private String checkConfigKeyUnique(SysOssConfig sysOssConfig) {
|
||||
long ossConfigId = StringUtils.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.getOssConfigId();
|
||||
SysOssConfig info = getOne(new LambdaQueryWrapper<SysOssConfig>()
|
||||
SysOssConfig info = baseMapper.selectOne(new LambdaQueryWrapper<SysOssConfig>()
|
||||
.select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey)
|
||||
.eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey()));
|
||||
if (StringUtils.isNotNull(info) && info.getOssConfigId() != ossConfigId) {
|
||||
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@ -16,6 +15,7 @@ import com.ruoyi.system.domain.bo.SysOssBo;
|
||||
import com.ruoyi.system.domain.vo.SysOssVo;
|
||||
import com.ruoyi.system.mapper.SysOssMapper;
|
||||
import com.ruoyi.system.service.ISysOssService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -29,13 +29,16 @@ import java.util.Map;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysOssServiceImpl extends ServicePlusImpl<SysOssMapper, SysOss, SysOssVo> implements ISysOssService {
|
||||
public class SysOssServiceImpl implements ISysOssService {
|
||||
|
||||
private final SysOssMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysOssVo> queryPageList(SysOssBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysOss> lqw = buildQueryWrapper(bo);
|
||||
Page<SysOssVo> result = pageVo(pageQuery.build(), lqw);
|
||||
Page<SysOssVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@ -53,6 +56,11 @@ public class SysOssServiceImpl extends ServicePlusImpl<SysOssMapper, SysOss, Sys
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysOss getById(Long ossId) {
|
||||
return baseMapper.selectById(ossId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysOss upload(MultipartFile file) {
|
||||
String originalfileName = file.getOriginalFilename();
|
||||
@ -71,7 +79,7 @@ public class SysOssServiceImpl extends ServicePlusImpl<SysOssMapper, SysOss, Sys
|
||||
.setFileName(uploadResult.getFilename())
|
||||
.setOriginalName(originalfileName)
|
||||
.setService(storage.getServiceType());
|
||||
save(oss);
|
||||
baseMapper.insert(oss);
|
||||
return oss;
|
||||
}
|
||||
|
||||
@ -80,12 +88,12 @@ public class SysOssServiceImpl extends ServicePlusImpl<SysOssMapper, SysOss, Sys
|
||||
if (isValid) {
|
||||
// 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
List<SysOss> list = listByIds(ids);
|
||||
List<SysOss> list = baseMapper.selectBatchIds(ids);
|
||||
for (SysOss sysOss : list) {
|
||||
IOssStrategy storage = OssFactory.instance(sysOss.getService());
|
||||
storage.delete(sysOss.getUrl());
|
||||
}
|
||||
return removeByIds(ids);
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@ -13,7 +12,7 @@ import com.ruoyi.system.domain.SysUserPost;
|
||||
import com.ruoyi.system.mapper.SysPostMapper;
|
||||
import com.ruoyi.system.mapper.SysUserPostMapper;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -24,11 +23,12 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost, SysPost> implements ISysPostService {
|
||||
public class SysPostServiceImpl implements ISysPostService {
|
||||
|
||||
@Autowired
|
||||
private SysUserPostMapper userPostMapper;
|
||||
private final SysPostMapper baseMapper;
|
||||
private final SysUserPostMapper userPostMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysPost> selectPagePostList(SysPost post, PageQuery pageQuery) {
|
||||
@ -36,7 +36,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());
|
||||
Page<SysPost> page = page(pageQuery.build(), lqw);
|
||||
Page<SysPost> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost,
|
||||
*/
|
||||
@Override
|
||||
public List<SysPost> selectPostList(SysPost post) {
|
||||
return list(new LambdaQueryWrapper<SysPost>()
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<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()));
|
||||
@ -61,7 +61,7 @@ public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost,
|
||||
*/
|
||||
@Override
|
||||
public List<SysPost> selectPostAll() {
|
||||
return list();
|
||||
return baseMapper.selectList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,7 +72,7 @@ public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost,
|
||||
*/
|
||||
@Override
|
||||
public SysPost selectPostById(Long postId) {
|
||||
return getById(postId);
|
||||
return baseMapper.selectById(postId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,10 +95,10 @@ public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost,
|
||||
@Override
|
||||
public String checkPostNameUnique(SysPost post) {
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
long count = count(new LambdaQueryWrapper<SysPost>()
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysPost>()
|
||||
.eq(SysPost::getPostName, post.getPostName())
|
||||
.ne(SysPost::getPostId, postId));
|
||||
if (count > 0) {
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -113,10 +113,10 @@ public class SysPostServiceImpl extends ServicePlusImpl<SysPostMapper, SysPost,
|
||||
@Override
|
||||
public String checkPostCodeUnique(SysPost post) {
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
long count = count(new LambdaQueryWrapper<SysPost>()
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysPost>()
|
||||
.eq(SysPost::getPostCode, post.getPostCode())
|
||||
.ne(SysPost::getPostId, postId));
|
||||
if (count > 0) {
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
@ -6,7 +6,6 @@ import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
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.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
@ -20,7 +19,7 @@ import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMenuMapper;
|
||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -31,17 +30,14 @@ import java.util.*;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole, SysRole> implements ISysRoleService {
|
||||
public class SysRoleServiceImpl implements ISysRoleService {
|
||||
|
||||
@Autowired
|
||||
private SysRoleMenuMapper roleMenuMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserRoleMapper userRoleMapper;
|
||||
|
||||
@Autowired
|
||||
private SysRoleDeptMapper roleDeptMapper;
|
||||
private final SysRoleMapper baseMapper;
|
||||
private final SysRoleMenuMapper roleMenuMapper;
|
||||
private final SysUserRoleMapper userRoleMapper;
|
||||
private final SysRoleDeptMapper roleDeptMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysRole> selectPageRoleList(SysRole role, PageQuery pageQuery) {
|
||||
@ -128,7 +124,7 @@ public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole,
|
||||
*/
|
||||
@Override
|
||||
public SysRole selectRoleById(Long roleId) {
|
||||
return getById(roleId);
|
||||
return baseMapper.selectById(roleId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -140,10 +136,10 @@ public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole,
|
||||
@Override
|
||||
public String checkRoleNameUnique(SysRole role) {
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
long count = count(new LambdaQueryWrapper<SysRole>()
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysRole>()
|
||||
.eq(SysRole::getRoleName, role.getRoleName())
|
||||
.ne(SysRole::getRoleId, roleId));
|
||||
if (count > 0) {
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -158,10 +154,10 @@ public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole,
|
||||
@Override
|
||||
public String checkRoleKeyUnique(SysRole role) {
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
long count = count(new LambdaQueryWrapper<SysRole>()
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysRole>()
|
||||
.eq(SysRole::getRoleKey, role.getRoleKey())
|
||||
.ne(SysRole::getRoleId, roleId));
|
||||
if (count > 0) {
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -281,7 +277,7 @@ public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole,
|
||||
list.add(rm);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
rows = roleMenuMapper.insertAll(list);
|
||||
rows = roleMenuMapper.insertBatch(list) ? list.size() : 0;
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
@ -302,7 +298,7 @@ public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole,
|
||||
list.add(rd);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
rows = roleDeptMapper.insertAll(list);
|
||||
rows = roleDeptMapper.insertBatch(list) ? list.size() : 0;
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
@ -393,7 +389,7 @@ public class SysRoleServiceImpl extends ServicePlusImpl<SysRoleMapper, SysRole,
|
||||
list.add(ur);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
rows = userRoleMapper.insertAll(list);
|
||||
rows = userRoleMapper.insertBatch(list) ? list.size() : 0;
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
@ -4,9 +4,9 @@ import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysUserOnline;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.service.ISysUserOnlineService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@ -14,11 +14,11 @@ import org.springframework.stereotype.Service;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
private final SysUserMapper userMapper;
|
||||
|
||||
/**
|
||||
* 通过登录地址查询信息
|
||||
@ -77,7 +77,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
|
||||
if (StringUtils.isNull(user)) {
|
||||
return null;
|
||||
}
|
||||
SysUser sysUser = userService.selectUserById(user.getUserId());
|
||||
SysUser sysUser = userMapper.selectUserById(user.getUserId());
|
||||
SysUserOnline sysUserOnline = new SysUserOnline();
|
||||
sysUserOnline.setTokenId(user.getToken());
|
||||
sysUserOnline.setUserName(user.getUsername());
|
||||
|
@ -8,7 +8,6 @@ import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
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.service.UserService;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
@ -20,8 +19,8 @@ import com.ruoyi.system.domain.SysUserPost;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
import com.ruoyi.system.mapper.*;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -36,20 +35,15 @@ import java.util.stream.Collectors;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser, SysUser> implements ISysUserService, UserService {
|
||||
public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
@Autowired
|
||||
private SysPostMapper postMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserRoleMapper userRoleMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserPostMapper userPostMapper;
|
||||
private final SysUserMapper baseMapper;
|
||||
private final SysRoleMapper roleMapper;
|
||||
private final SysPostMapper postMapper;
|
||||
private final SysUserRoleMapper userRoleMapper;
|
||||
private final SysUserPostMapper userPostMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysUser> selectPageUserList(SysUser user, PageQuery pageQuery) {
|
||||
@ -152,7 +146,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
*/
|
||||
@Override
|
||||
public String checkUserNameUnique(String userName) {
|
||||
long count = count(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, userName));
|
||||
long count = baseMapper.selectCount(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, userName));
|
||||
if (count > 0) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -168,10 +162,10 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
@Override
|
||||
public String checkPhoneUnique(SysUser user) {
|
||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||
long count = count(new LambdaQueryWrapper<SysUser>()
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysUser>()
|
||||
.eq(SysUser::getPhonenumber, user.getPhonenumber())
|
||||
.ne(SysUser::getUserId, userId));
|
||||
if (count > 0) {
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -186,10 +180,10 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
@Override
|
||||
public String checkEmailUnique(SysUser user) {
|
||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||
long count = count(new LambdaQueryWrapper<SysUser>()
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysUser>()
|
||||
.eq(SysUser::getEmail, user.getEmail())
|
||||
.ne(SysUser::getUserId, userId));
|
||||
if (count > 0) {
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -368,7 +362,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
list.add(ur);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
userRoleMapper.insertAll(list);
|
||||
userRoleMapper.insertBatch(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -390,7 +384,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
list.add(up);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
userPostMapper.insertAll(list);
|
||||
userPostMapper.insertBatch(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -412,7 +406,7 @@ public class SysUserServiceImpl extends ServicePlusImpl<SysUserMapper, SysUser,
|
||||
list.add(ur);
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
userRoleMapper.insertAll(list);
|
||||
userRoleMapper.insertBatch(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,11 +11,11 @@ import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.service.TokenService;
|
||||
import com.ruoyi.common.properties.TokenProperties;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.ip.AddressUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -28,6 +28,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class TokenServiceImpl implements TokenService {
|
||||
|
||||
@ -37,8 +38,7 @@ public class TokenServiceImpl implements TokenService {
|
||||
|
||||
private static final Long MILLIS_MINUTE_TEN = 20 * 60 * 1000L;
|
||||
|
||||
@Autowired
|
||||
private TokenProperties tokenProperties;
|
||||
private final TokenProperties tokenProperties;
|
||||
|
||||
/**
|
||||
* 获取用户身份信息
|
||||
|
@ -7,8 +7,8 @@ import com.ruoyi.common.exception.user.UserException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.system.service.SysPermissionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
@ -20,14 +20,12 @@ import org.springframework.stereotype.Service;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class UserDetailsServiceImpl implements UserDetailsService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private SysPermissionService permissionService;
|
||||
private final ISysUserService userService;
|
||||
private final SysPermissionService permissionService;
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
|
Reference in New Issue
Block a user