From d1ea385a7848e4172d82870a06dbc5ebeab95c5b Mon Sep 17 00:00:00 2001 From: Flow <958079825@qq.com> Date: Fri, 23 May 2025 10:02:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=BA=E6=9E=84=E7=9B=B8=E5=85=B3=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/dept/DeptController.java | 6 +---- .../admin/dept/vo/dept/DeptRespVO.java | 5 ++++ .../admin/dept/vo/dept/DeptSaveReqVO.java | 7 ++++++ .../system/dal/dataobject/dept/DeptDO.java | 24 ++++++++++++++++++- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java index 86cdeed1d8..9192e2d8ff 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java @@ -33,7 +33,6 @@ public class DeptController { @PostMapping("create") @Operation(summary = "创建部门") - @PreAuthorize("@ss.hasPermission('system:dept:create')") public CommonResult 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 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 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> getDeptList(DeptListReqVO reqVO) { List 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 getDept(@RequestParam("id") Long id) { DeptDO dept = deptService.getDept(id); return success(BeanUtils.toBean(dept, DeptRespVO.class)); } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java index 83e6ed085f..5aff2fa22c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java @@ -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; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java index 0d6276fe58..6aa89db597 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSaveReqVO.java @@ -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; + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java index a59fa8b6e6..12387c12fe 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java @@ -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; }