update 用户管理swagger
This commit is contained in:
+4
-3
@@ -30,6 +30,7 @@ import com.jero.modules.system.service.ISysDepartService;
|
||||
import com.jero.modules.system.service.ISysUserDepartService;
|
||||
import com.jero.modules.system.service.ISysUserRoleService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.vo.SetRoleBody;
|
||||
import com.jero.modules.system.vo.SysDepartUsersVO;
|
||||
import com.jero.modules.system.vo.SysUserRoleVO;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -1461,10 +1462,10 @@ public class SysUserController {
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation(value="角色配置", notes="角色配置")
|
||||
@PostMapping(value = "/setRole")
|
||||
public Result<SysUser> setRole(@RequestBody JSONObject jsonObject) {
|
||||
public Result<SysUser> setRole(@RequestBody SetRoleBody body) {
|
||||
try {
|
||||
String ids = jsonObject.getString("ids");
|
||||
String roles = jsonObject.getString(SELECTED_ROLES);
|
||||
String ids = body.getIds();
|
||||
String roles = body.getSelectedroles();
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for (String id : idList) {
|
||||
SysUser sysUser = sysUserService.getById(id);
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -34,24 +36,28 @@ public class SysUser implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty(value = "id")
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 工号(也是登录账号)
|
||||
*/
|
||||
@ApiModelProperty(value = ")")
|
||||
@Excel(name = "账号", width = 15)
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "真实姓名")
|
||||
@Excel(name = "用户姓名", width = 15)
|
||||
private String realname;
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位")
|
||||
@Excel(name = "岗位", width = 15)
|
||||
private String post;
|
||||
|
||||
@@ -70,11 +76,13 @@ public class SysUser implements Serializable {
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@ApiModelProperty(value = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@ApiModelProperty(value = "生日")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
@@ -82,31 +90,41 @@ public class SysUser implements Serializable {
|
||||
/**
|
||||
* 性别(1:男 2:女),字典值和IAM相同
|
||||
*/
|
||||
@Excel(name = "性别", width = 15,dicCode="sex")
|
||||
@ApiModelProperty(value = "性别")
|
||||
@Excel(name = "性别", width = 15, dicCode = "sex")
|
||||
@Dict(dicCode = "sex")
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 电子邮件
|
||||
*/
|
||||
@ApiModelProperty(value = "电子邮件")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@ApiModelProperty(value = "电话")
|
||||
@Excel(name = "手机号码", width = 15)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 部门code(当前选择登录部门)
|
||||
*/
|
||||
@ApiModelProperty(value = "部门code")
|
||||
private String orgCode;
|
||||
|
||||
/**部门名称*/
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
@Excel(name = "组织机构", width = 15)
|
||||
private transient String orgCodeTxt;
|
||||
|
||||
/**角色名称*/
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
@Excel(name = "角色", width = 15)
|
||||
private transient String roleTxt;
|
||||
|
||||
@@ -116,7 +134,8 @@ public class SysUser implements Serializable {
|
||||
* 所有IAM的poststatus = 1的数据,则此字段为1
|
||||
* 所有IAM的poststatus = 0的数据,则此字段为2
|
||||
*/
|
||||
@Excel(name = "状态", width = 15,dicCode="user_status")
|
||||
@ApiModelProperty(value = "状态")
|
||||
@Excel(name = "状态", width = 15, dicCode = "user_status")
|
||||
@Dict(dicCode = "user_status")
|
||||
private Integer status;
|
||||
|
||||
@@ -124,57 +143,72 @@ public class SysUser implements Serializable {
|
||||
* 删除状态(0,正常,1已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
@ApiModelProperty(value = "删除状态")
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 座机号
|
||||
*/
|
||||
@ApiModelProperty(value = "座机号")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 同步工作流引擎1同步0不同步
|
||||
*/
|
||||
@ApiModelProperty(value = "同步工作流引擎1同步0不同步")
|
||||
private Integer activitiSync;
|
||||
|
||||
/**
|
||||
* 身份(0 普通成员 1 上级)
|
||||
*/
|
||||
@ApiModelProperty(accessMode = ApiModelProperty.AccessMode.READ_ONLY)
|
||||
private Integer userIdentity;
|
||||
|
||||
/**
|
||||
* 负责部门
|
||||
*/
|
||||
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||
@ApiModelProperty(value = "负责部门")
|
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
|
||||
private String departIds;
|
||||
|
||||
/**
|
||||
* 多租户id配置,编辑用户的时候设置
|
||||
*/
|
||||
@ApiModelProperty(value = "编辑用户的时候设置")
|
||||
private String relTenantIds;
|
||||
|
||||
/**设备id uniapp推送用*/
|
||||
/**
|
||||
* 设备id uniapp推送用
|
||||
*/
|
||||
@ApiModelProperty(value = "设备id uniapp推送用")
|
||||
private String clientId;
|
||||
|
||||
@ApiModelProperty(value = "用户域账号")
|
||||
private String thirdId;//用户域账号
|
||||
@ApiModelProperty(value = "用户数据来源")
|
||||
private String thirdType;//用户数据来源
|
||||
|
||||
@TableField(exist = false)
|
||||
@@ -186,22 +220,26 @@ public class SysUser implements Serializable {
|
||||
* 人员类型
|
||||
* 000正式员工、002外部用户、001劳务工等
|
||||
*/
|
||||
@ApiModelProperty(value = "人员类型")
|
||||
private String typeId;
|
||||
|
||||
|
||||
/**
|
||||
* 职务级别
|
||||
*/
|
||||
@ApiModelProperty(value = "职务级别")
|
||||
private String dutyLevelId;
|
||||
|
||||
/**
|
||||
* 直接上级
|
||||
*/
|
||||
@ApiModelProperty(value = "直接上级")
|
||||
private String directLeadership;
|
||||
|
||||
/**
|
||||
* 岗位状态
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位状态")
|
||||
private String postStatus;
|
||||
|
||||
@TableField(exist = false)
|
||||
@@ -212,7 +250,7 @@ public class SysUser implements Serializable {
|
||||
* 不能用get开头,否则会造成初始化queryWrapper的bug
|
||||
* @return
|
||||
*/
|
||||
public String calcNameWorkNo(){
|
||||
public String calcNameWorkNo() {
|
||||
return this.realname + "(" + this.username + ")";
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.jero.modules.system.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2023-11-17 15:27
|
||||
*/
|
||||
@Data
|
||||
public class IdMapBody {
|
||||
/**id*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.jero.modules.system.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2023-11-17 15:27
|
||||
*/
|
||||
@Data
|
||||
public class IdsMapBody {
|
||||
/**ids*/
|
||||
@ApiModelProperty(value = "ids")
|
||||
private String ids;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jero.modules.system.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2023-11-17 15:27
|
||||
*/
|
||||
@Data
|
||||
public class SetRoleBody {
|
||||
/**用户ids*/
|
||||
@ApiModelProperty(value = "用户ids")
|
||||
private String ids;
|
||||
/**选择的角色Ids*/
|
||||
@ApiModelProperty(value = "选择的角色Ids")
|
||||
private String selectedroles;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.system.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -10,8 +11,10 @@ public class SysUserRoleVO implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**角色id*/
|
||||
@ApiModelProperty(value = "角色id")
|
||||
private String roleId;
|
||||
/**对应的用户id集合*/
|
||||
@ApiModelProperty(value = "对应的用户id集合")
|
||||
private List<String> userIdList;
|
||||
|
||||
public SysUserRoleVO() {
|
||||
|
||||
Reference in New Issue
Block a user