编译通过,格式化代码。
This commit is contained in:
parent
6c31cd0c42
commit
48ca408ef3
|
|
@ -1,16 +1,20 @@
|
|||
package com.electromagnetic.industry.software.manage.pojo.models;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
||||
import com.electromagnetic.industry.software.common.util.IdWorker;
|
||||
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("ed_role") // 指定表名
|
||||
public class Role extends BaseModel{
|
||||
public class Role extends BaseModel {
|
||||
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@ import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
|||
import com.electromagnetic.industry.software.common.util.IdWorker;
|
||||
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("ed_role_permission")
|
||||
public class RolePermission extends BaseModel{
|
||||
public class RolePermission extends BaseModel {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public class RolePermissionServiceImpl extends ServiceImpl<RolePermissionMapper,
|
|||
// 查询包括已失效的记录
|
||||
RolePermission exist = this.getOne(new LambdaQueryWrapper<RolePermission>()
|
||||
.eq(RolePermission::getFileId, rp.getFileId())
|
||||
.eq(RolePermission::getRoleId,rp.getRoleId())
|
||||
.eq(RolePermission::getRoleId, rp.getRoleId())
|
||||
.eq(RolePermission::getPermissionCode, rp.getPermissionCode()));
|
||||
if (exist != null) {
|
||||
rp.setId(exist.getId()); // 赋值已有 ID,避免重复插入
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||
/**
|
||||
* 失效角色权限关系
|
||||
*/
|
||||
private void disableRolePermission (String roleId) {
|
||||
private void disableRolePermission(String roleId) {
|
||||
// 失效旧权限信息
|
||||
LambdaQueryWrapper<RolePermission> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(RolePermission::getRoleId, roleId);
|
||||
|
|
@ -410,7 +410,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||
/**
|
||||
* 失效角色用户关系
|
||||
*/
|
||||
private void disableUserRole (String roleId) {
|
||||
private void disableUserRole(String roleId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -345,9 +345,9 @@ public class UserServiceImpl implements UserService {
|
|||
if (roleNames != null) {
|
||||
for (String roleName : roleNames) {
|
||||
LambdaQueryWrapper<Role> roleQueryWrapper = new LambdaQueryWrapper<>();
|
||||
roleQueryWrapper.select(Role::getRoleId)
|
||||
roleQueryWrapper.select(Role::getId)
|
||||
.eq(Role::getRoleName, roleName);
|
||||
String roleId = roleMapper.selectOne(roleQueryWrapper).getRoleId();
|
||||
String roleId = roleMapper.selectOne(roleQueryWrapper).getId();
|
||||
|
||||
UserRole userRole = new UserRole();
|
||||
userRole.setUserId(userId);
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@
|
|||
<select id="selectUserRoles" parameterType="String" resultType="String">
|
||||
select r.role_name
|
||||
from ed_role r
|
||||
where r.role_id in (select ur.role_id
|
||||
where r.id in (select ur.role_id
|
||||
from ed_users u
|
||||
left join ed_user_role ur on u.user_id = ur.user_id
|
||||
where u.user_id = #{userId})
|
||||
|
|
|
|||
Loading…
Reference in New Issue