fix(system-api、boot): 给用户管理功能相关的各种需要company字段的类,新增company字段。

This commit is contained in:
dk
2026-04-16 20:29:36 +08:00
parent 67040aaf5d
commit 0c91f5deaa
14 changed files with 56 additions and 0 deletions

View File

@@ -14,6 +14,9 @@ public class AdminUserRespDTO implements VO {
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小王")
private String nickname;
@Schema(description = "所属公司", example = "灿能")
private String company;
@Schema(description = "帐号状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status; // 参见 CommonStatusEnum 枚举

View File

@@ -41,6 +41,9 @@ public class AuthPermissionInfoRespVO {
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "灿能源码")
private String nickname;
@Schema(description = "所属公司", example = "灿能")
private String company;
@Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/xx.jpg")
private String avatar;

View File

@@ -24,6 +24,10 @@ public class AuthRegisterReqVO extends CaptchaVerificationReqVO {
@Size(max = 30, message = "用户昵称长度不能超过 30 个字符")
private String nickname;
@Schema(description = "所属公司", example = "灿能")
@Size(max = 100, message = "所属公司长度不能超过 100 个字符")
private String company;
@Schema(description = "所属部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "所属部门不能为空")
private Long deptId;

View File

@@ -21,6 +21,9 @@ public class AuthUserInfoRespVO {
@Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "admin")
private String userName;
@Schema(description = "所属公司", example = "灿能")
private String company;
@Schema(description = "角色编码列表", example = "[\"SUPER_ADMIN\"]")
private List<String> roles;

View File

@@ -12,7 +12,9 @@ import com.njcn.rdms.module.system.controller.admin.dict.vo.data.DictDataRespVO;
import com.njcn.rdms.module.system.controller.admin.dict.vo.data.DictDataSaveReqVO;
import com.njcn.rdms.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO;
import com.njcn.rdms.module.system.dal.dataobject.dict.DictDataDO;
import com.njcn.rdms.module.system.dal.dataobject.dict.DictTypeDO;
import com.njcn.rdms.module.system.service.dict.DictDataService;
import com.njcn.rdms.module.system.service.dict.DictTypeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -38,6 +40,9 @@ public class DictDataController {
@Resource
private DictDataService dictDataService;
@Resource
private DictTypeService dictTypeService;
@PostMapping("/create")
@Operation(summary = "新增字典数据")
@PreAuthorize("@ss.hasPermission('system:dict:create')")
@@ -98,6 +103,16 @@ public class DictDataController {
return success(BeanUtils.toBean(dictData, DictDataRespVO.class));
}
@GetMapping(value = "/code")
@Operation(summary = "/通过字典编码去查询字典数据详细")
@Parameter(name = "code", description = "编号", required = true, example = "system_user_company")
@PreAuthorize("@ss.hasPermission('system:dict:query')")
public CommonResult<List<DictDataRespVO>> getDictData(@RequestParam("code") String code) {
DictTypeDO dictType = dictTypeService.getDictType(code);
List<DictDataDO> dictDataList = dictDataService.getDictDataList(0, dictType.getType());
return success(BeanUtils.toBean(dictDataList, DictDataRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出字典数据")
@PreAuthorize("@ss.hasPermission('system:dict:export')")

View File

@@ -20,6 +20,9 @@ public class OAuth2UserInfoRespVO {
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "灿能")
private String nickname;
@Schema(description = "所属公司", example = "灿能")
private String company;
@Schema(description = "用户邮箱", example = "rdms@iocoder.cn")
private String email;

View File

@@ -22,6 +22,9 @@ public class UserProfileRespVO {
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "awen")
private String nickname;
@Schema(description = "所属公司", example = "灿能")
private String company;
@Schema(description = "用户邮箱", example = "rdms@iocoder.cn")
private String email;

View File

@@ -24,6 +24,9 @@ public class UserImportExcelVO {
@ExcelProperty("用户名称")
private String nickname;
@ExcelProperty("所属公司")
private String company;
@ExcelProperty("部门编号")
private Long deptId;

View File

@@ -25,6 +25,9 @@ public class UserPageReqVO extends PageParam {
@Schema(description = "手机号码,模糊匹配", example = "rdms")
private String mobile;
@Schema(description = "所属公司,模糊匹配", example = "灿能")
private String company;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
private Integer status;

View File

@@ -30,6 +30,10 @@ public class UserRespVO {
@Schema(description = "备注", example = "我是一个用户")
private String remark;
@Schema(description = "所属公司", example = "灿能")
@ExcelProperty("所属公司")
private String company;
@Schema(description = "部门编号", example = "1")
private Long deptId;

View File

@@ -42,6 +42,11 @@ public class UserSaveReqVO {
@DiffLogField(name = "备注")
private String remark;
@Schema(description = "所属公司", example = "灿能")
@Size(max = 100, message = "所属公司长度不能超过 100 个字符")
@DiffLogField(name = "所属公司")
private String company;
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "部门不能为空")
@DiffLogField(name = "部门", function = DeptParseFunction.NAME)

View File

@@ -57,6 +57,7 @@ public interface AuthConvert {
return AuthUserInfoRespVO.builder()
.userId(String.valueOf(user.getId()))
.userName(user.getUsername())
.company(user.getCompany())
.roles(sortDistinctStrings(convertList(roleList, RoleDO::getCode)))
.buttons(sortDistinctStrings(convertList(menuList, MenuDO::getPermission,
menu -> StrUtil.isNotBlank(menu.getPermission()))))

View File

@@ -57,6 +57,11 @@ public class AdminUserDO extends BaseDO {
*/
private String remark;
/**
* 所属公司
*/
private String company;
/**
* 部门 ID
*/

View File

@@ -29,6 +29,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
return selectPage(reqVO, new LambdaQueryWrapperX<AdminUserDO>()
.likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername())
.likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile())
.likeIfPresent(AdminUserDO::getCompany, reqVO.getCompany())
.eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus())
.betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime())
.inIfPresent(AdminUserDO::getDeptId, deptIds)