删除权限

This commit is contained in:
Flow 2025-07-14 09:51:47 +08:00
parent 7cef8f5008
commit c6901f4893
2 changed files with 9 additions and 10 deletions

View File

@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.controller.admin.org;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
@ -40,14 +39,12 @@ public class OrgController {
@PostMapping("/create")
@Operation(summary = "创建机构")
@PreAuthorize("@ss.hasPermission('system:org:create')")
public CommonResult<Integer> createOrg(@Valid @RequestBody OrgSaveReqVO createReqVO) {
return success(orgService.createOrg(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新机构")
@PreAuthorize("@ss.hasPermission('system:org:update')")
public CommonResult<Boolean> updateOrg(@Valid @RequestBody OrgSaveReqVO updateReqVO) {
orgService.updateOrg(updateReqVO);
return success(true);
@ -56,7 +53,6 @@ public class OrgController {
@DeleteMapping("/delete")
@Operation(summary = "删除机构")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('system:org:delete')")
public CommonResult<Boolean> deleteOrg(@RequestParam("id") Integer id) {
orgService.deleteOrg(id);
return success(true);
@ -65,7 +61,6 @@ public class OrgController {
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除机构")
@PreAuthorize("@ss.hasPermission('system:org:delete')")
public CommonResult<Boolean> deleteOrgList(@RequestParam("ids") List<Integer> ids) {
orgService.deleteOrgListByIds(ids);
return success(true);
@ -74,7 +69,6 @@ public class OrgController {
@GetMapping("/get")
@Operation(summary = "获得机构")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:org:query')")
public CommonResult<OrgRespVO> getOrg(@RequestParam("id") Integer id) {
OrgDO org = orgService.getOrg(id);
return success(BeanUtils.toBean(org, OrgRespVO.class));
@ -82,7 +76,6 @@ public class OrgController {
@GetMapping("/page")
@Operation(summary = "获得机构分页")
@PreAuthorize("@ss.hasPermission('system:org:query')")
public CommonResult<PageResult<OrgRespVO>> getOrgPage(@Valid OrgPageReqVO pageReqVO) {
PageResult<OrgDO> pageResult = orgService.getOrgPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, OrgRespVO.class));
@ -90,7 +83,6 @@ public class OrgController {
@GetMapping("/export-excel")
@Operation(summary = "导出机构 Excel")
@PreAuthorize("@ss.hasPermission('system:org:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportOrgExcel(@Valid OrgPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {

View File

@ -15,12 +15,11 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
@TableName("tb_org")
@KeySequence("tb_org_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OrgDO extends BaseDO {
public class OrgDO{
/**
* 主键ID自增
@ -30,34 +29,42 @@ public class OrgDO extends BaseDO {
/**
* 机构ID
*/
@TableField("orgId")
private Integer orgId;
/**
* 机构名称
*/
@TableField("orgName")
private String orgName;
/**
* 机构地址
*/
@TableField("orgAddress")
private String orgAddress;
/**
* 负责人
*/
@TableField("manager")
private String manager;
/**
* 电话
*/
@TableField("phone")
private String phone;
/**
* 上级机构ID
*/
@TableField("parentOrgId")
private Integer parentOrgId;
/**
* 上级机构名称
*/
@TableField("parentOrgName")
private String parentOrgName;
/**
* 是否为上级机构0否1是
*/
@TableField("isParent")
private Integer isParent;