⚡ 修改部门表status、delFlag数据类型
This commit is contained in:
@@ -7,6 +7,7 @@ using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Common;
|
||||
using ZR.Model.System;
|
||||
using ZR.Model.System.Dto;
|
||||
using ZR.Service.System.IService;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.System
|
||||
@@ -33,7 +34,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
/// <returns></returns>
|
||||
[ActionPermissionFilter(Permission = "system:dept:list")]
|
||||
[HttpGet("list")]
|
||||
public IActionResult List([FromQuery] SysDept dept)
|
||||
public IActionResult List([FromQuery] SysDeptQueryDto dept)
|
||||
{
|
||||
return SUCCESS(DeptService.GetSysDepts(dept), TIME_FORMAT_FULL);
|
||||
}
|
||||
@@ -46,7 +47,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
[HttpGet("list/exclude/{deptId}")]
|
||||
public IActionResult ExcludeChild(long deptId)
|
||||
{
|
||||
var depts = DeptService.GetSysDepts(new SysDept());
|
||||
var depts = DeptService.GetSysDepts(new SysDeptQueryDto());
|
||||
|
||||
for (int i = 0; i < depts.Count; i++)
|
||||
{
|
||||
@@ -66,7 +67,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
/// <param name="dept"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("treeselect")]
|
||||
public IActionResult TreeSelect(SysDept dept)
|
||||
public IActionResult TreeSelect(SysDeptQueryDto dept)
|
||||
{
|
||||
var depts = DeptService.GetSysDepts(dept);
|
||||
|
||||
@@ -82,7 +83,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
[HttpGet("roleDeptTreeselect/{roleId}")]
|
||||
public IActionResult RoleMenuTreeselect(int roleId)
|
||||
{
|
||||
var depts = DeptService.GetSysDepts(new SysDept());
|
||||
var depts = DeptService.GetSysDepts(new SysDeptQueryDto());
|
||||
var checkedKeys = DeptService.SelectRoleDepts(roleId);
|
||||
return SUCCESS(new
|
||||
{
|
||||
@@ -152,7 +153,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
[Log(Title = "部门管理", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult Remove(long deptId)
|
||||
{
|
||||
if (DeptService.Queryable().Count(it => it.ParentId == deptId && it.DelFlag == "0") > 0)
|
||||
if (DeptService.Queryable().Count(it => it.ParentId == deptId && it.DelFlag == 0) > 0)
|
||||
{
|
||||
return ToResponse(ResultCode.CUSTOM_ERROR, $"存在下级部门,不允许删除");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user