删除权限
This commit is contained in:
parent
7cef8f5008
commit
c6901f4893
@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.controller.admin.org;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
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.tags.Tag;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@ -40,14 +39,12 @@ public class OrgController {
|
|||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建机构")
|
@Operation(summary = "创建机构")
|
||||||
@PreAuthorize("@ss.hasPermission('system:org:create')")
|
|
||||||
public CommonResult<Integer> createOrg(@Valid @RequestBody OrgSaveReqVO createReqVO) {
|
public CommonResult<Integer> createOrg(@Valid @RequestBody OrgSaveReqVO createReqVO) {
|
||||||
return success(orgService.createOrg(createReqVO));
|
return success(orgService.createOrg(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新机构")
|
@Operation(summary = "更新机构")
|
||||||
@PreAuthorize("@ss.hasPermission('system:org:update')")
|
|
||||||
public CommonResult<Boolean> updateOrg(@Valid @RequestBody OrgSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateOrg(@Valid @RequestBody OrgSaveReqVO updateReqVO) {
|
||||||
orgService.updateOrg(updateReqVO);
|
orgService.updateOrg(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -56,7 +53,6 @@ public class OrgController {
|
|||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除机构")
|
@Operation(summary = "删除机构")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('system:org:delete')")
|
|
||||||
public CommonResult<Boolean> deleteOrg(@RequestParam("id") Integer id) {
|
public CommonResult<Boolean> deleteOrg(@RequestParam("id") Integer id) {
|
||||||
orgService.deleteOrg(id);
|
orgService.deleteOrg(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -65,7 +61,6 @@ public class OrgController {
|
|||||||
@DeleteMapping("/delete-list")
|
@DeleteMapping("/delete-list")
|
||||||
@Parameter(name = "ids", description = "编号", required = true)
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
@Operation(summary = "批量删除机构")
|
@Operation(summary = "批量删除机构")
|
||||||
@PreAuthorize("@ss.hasPermission('system:org:delete')")
|
|
||||||
public CommonResult<Boolean> deleteOrgList(@RequestParam("ids") List<Integer> ids) {
|
public CommonResult<Boolean> deleteOrgList(@RequestParam("ids") List<Integer> ids) {
|
||||||
orgService.deleteOrgListByIds(ids);
|
orgService.deleteOrgListByIds(ids);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -74,7 +69,6 @@ public class OrgController {
|
|||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得机构")
|
@Operation(summary = "获得机构")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('system:org:query')")
|
|
||||||
public CommonResult<OrgRespVO> getOrg(@RequestParam("id") Integer id) {
|
public CommonResult<OrgRespVO> getOrg(@RequestParam("id") Integer id) {
|
||||||
OrgDO org = orgService.getOrg(id);
|
OrgDO org = orgService.getOrg(id);
|
||||||
return success(BeanUtils.toBean(org, OrgRespVO.class));
|
return success(BeanUtils.toBean(org, OrgRespVO.class));
|
||||||
@ -82,7 +76,6 @@ public class OrgController {
|
|||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得机构分页")
|
@Operation(summary = "获得机构分页")
|
||||||
@PreAuthorize("@ss.hasPermission('system:org:query')")
|
|
||||||
public CommonResult<PageResult<OrgRespVO>> getOrgPage(@Valid OrgPageReqVO pageReqVO) {
|
public CommonResult<PageResult<OrgRespVO>> getOrgPage(@Valid OrgPageReqVO pageReqVO) {
|
||||||
PageResult<OrgDO> pageResult = orgService.getOrgPage(pageReqVO);
|
PageResult<OrgDO> pageResult = orgService.getOrgPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, OrgRespVO.class));
|
return success(BeanUtils.toBean(pageResult, OrgRespVO.class));
|
||||||
@ -90,7 +83,6 @@ public class OrgController {
|
|||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出机构 Excel")
|
@Operation(summary = "导出机构 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('system:org:export')")
|
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
public void exportOrgExcel(@Valid OrgPageReqVO pageReqVO,
|
public void exportOrgExcel(@Valid OrgPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
|
|||||||
@ -15,12 +15,11 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
|||||||
@TableName("tb_org")
|
@TableName("tb_org")
|
||||||
@KeySequence("tb_org_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
@KeySequence("tb_org_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class OrgDO extends BaseDO {
|
public class OrgDO{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键ID,自增
|
* 主键ID,自增
|
||||||
@ -30,34 +29,42 @@ public class OrgDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 机构ID
|
* 机构ID
|
||||||
*/
|
*/
|
||||||
|
@TableField("orgId")
|
||||||
private Integer orgId;
|
private Integer orgId;
|
||||||
/**
|
/**
|
||||||
* 机构名称
|
* 机构名称
|
||||||
*/
|
*/
|
||||||
|
@TableField("orgName")
|
||||||
private String orgName;
|
private String orgName;
|
||||||
/**
|
/**
|
||||||
* 机构地址
|
* 机构地址
|
||||||
*/
|
*/
|
||||||
|
@TableField("orgAddress")
|
||||||
private String orgAddress;
|
private String orgAddress;
|
||||||
/**
|
/**
|
||||||
* 负责人
|
* 负责人
|
||||||
*/
|
*/
|
||||||
|
@TableField("manager")
|
||||||
private String manager;
|
private String manager;
|
||||||
/**
|
/**
|
||||||
* 电话
|
* 电话
|
||||||
*/
|
*/
|
||||||
|
@TableField("phone")
|
||||||
private String phone;
|
private String phone;
|
||||||
/**
|
/**
|
||||||
* 上级机构ID
|
* 上级机构ID
|
||||||
*/
|
*/
|
||||||
|
@TableField("parentOrgId")
|
||||||
private Integer parentOrgId;
|
private Integer parentOrgId;
|
||||||
/**
|
/**
|
||||||
* 上级机构名称
|
* 上级机构名称
|
||||||
*/
|
*/
|
||||||
|
@TableField("parentOrgName")
|
||||||
private String parentOrgName;
|
private String parentOrgName;
|
||||||
/**
|
/**
|
||||||
* 是否为上级机构(0否1是)
|
* 是否为上级机构(0否1是)
|
||||||
*/
|
*/
|
||||||
|
@TableField("isParent")
|
||||||
private Integer isParent;
|
private Integer isParent;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user