机构相关字段

This commit is contained in:
Flow 2025-05-23 10:02:10 +08:00
parent 9209ddf599
commit d1ea385a78
4 changed files with 36 additions and 6 deletions

View File

@ -33,7 +33,6 @@ public class DeptController {
@PostMapping("create")
@Operation(summary = "创建部门")
@PreAuthorize("@ss.hasPermission('system:dept:create')")
public CommonResult<Long> createDept(@Valid @RequestBody DeptSaveReqVO createReqVO) {
Long deptId = deptService.createDept(createReqVO);
return success(deptId);
@ -41,7 +40,6 @@ public class DeptController {
@PutMapping("update")
@Operation(summary = "更新部门")
@PreAuthorize("@ss.hasPermission('system:dept:update')")
public CommonResult<Boolean> updateDept(@Valid @RequestBody DeptSaveReqVO updateReqVO) {
deptService.updateDept(updateReqVO);
return success(true);
@ -50,7 +48,6 @@ public class DeptController {
@DeleteMapping("delete")
@Operation(summary = "删除部门")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:dept:delete')")
public CommonResult<Boolean> deleteDept(@RequestParam("id") Long id) {
deptService.deleteDept(id);
return success(true);
@ -58,7 +55,6 @@ public class DeptController {
@GetMapping("/list")
@Operation(summary = "获取部门列表")
@PreAuthorize("@ss.hasPermission('system:dept:query')")
public CommonResult<List<DeptRespVO>> getDeptList(DeptListReqVO reqVO) {
List<DeptDO> list = deptService.getDeptList(reqVO);
return success(BeanUtils.toBean(list, DeptRespVO.class));
@ -75,10 +71,10 @@ public class DeptController {
@GetMapping("/get")
@Operation(summary = "获得部门信息")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:dept:query')")
public CommonResult<DeptRespVO> getDept(@RequestParam("id") Long id) {
DeptDO dept = deptService.getDept(id);
return success(BeanUtils.toBean(dept, DeptRespVO.class));
}
}

View File

@ -36,4 +36,9 @@ public class DeptRespVO {
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式")
private LocalDateTime createTime;
@Schema(description = "机构ID")
private int orgid;
@Schema(description = "机构地址")
private String orgaddress;
}

View File

@ -46,4 +46,11 @@ public class DeptSaveReqVO {
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
private Integer status;
@Schema(description = "机构ID")
@NotNull(message = "机构ID不能为空")
private int orgid;
@Schema(description = "机构地址")
private String orgaddress;
}

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@ -29,38 +30,59 @@ public class DeptDO extends TenantBaseDO {
@TableId
private Long id;
/**
* 部门名称
* 部门名称(机构名称)
*/
@TableField("name")
private String name;
/**
* 父部门ID
*
* 关联 {@link #id}
*/
@TableField("parentId")
private Long parentId;
/**
* 显示顺序
*/
@TableField("sort")
private Integer sort;
/**
* 负责人
*
* 关联 {@link AdminUserDO#getId()}
*/
@TableField("leader_user_id")
private Long leaderUserId;
/**
* 联系电话
*/
@TableField("phone")
private String phone;
/**
* 邮箱
*/
@TableField("email")
private String email;
/**
* 部门状态
*
* 枚举 {@link CommonStatusEnum}
*/
@TableField("status")
private Integer status;
/**
* 机构ID
*
*/
@TableField("orgid")
private int orgid;
/*
*
* 机构地址
*
*/
@TableField("orgaddress")
private String orgaddress;
}