This commit is contained in:
lijiaqi 2024-01-10 11:01:13 +08:00
parent 8304c356bb
commit 9834372956
5 changed files with 30 additions and 0 deletions

View File

@ -15,4 +15,7 @@ public class UserDto extends User {
@ApiModelProperty(value = "岗位名称")
private String jobName;
@ApiModelProperty(value = "权限名称")
private String permissionsName;
}

View File

@ -79,4 +79,7 @@ public class User extends BaseEntity{
@ApiModelProperty(value = "电子签名")
private String electronicSignature;
@ApiModelProperty(value = "权限 my:自己dept:本部门all:所有")
private String permissions;
}

View File

@ -47,4 +47,8 @@ public class UserRequest {
@ApiModelProperty(value = "电子签名")
private String electronicSignature;
@ApiModelProperty(value = "权限 my:自己dept:本部门all:所有")
@NotBlank(message = "权限不能为空")
private String permissions;
}

View File

@ -450,6 +450,11 @@ public class UserServiceImpl extends BaseService<UserMapper, User> implements IU
if (ObjectUtil.isNotNull(user)) return "登录账号不能重复";
LoginNameUtil.valid(userRequest.getLoginName());
List<String> permissionsList = new ArrayList<>();
permissionsList.add("my");
permissionsList.add("dept");
permissionsList.add("all");
if (!permissionsList.contains(userRequest.getPermissions())) return "权限不正确";
return null;
}
}

View File

@ -52,5 +52,20 @@ public interface UserWrapper extends BaseWrapper<User, UserDto> {
.last("limit 1")
);
if (ObjectUtil.isNotNull(job)) dto.setJobName(job.getName());
switch (obj.getPermissions())
{
case "my":
dto.setPermissionsName("自己");
break;
case "dept":
dto.setPermissionsName("本部门");
break;
case "all":
dto.setPermissionsName("所有");
break;
default:
dto.setPermissionsName("未知");
break;
}
}
}