|
@@ -7,7 +7,7 @@ namespace OASystem.API.Controllers
|
|
|
/// <summary>
|
|
|
/// 系统设置
|
|
|
/// </summary>
|
|
|
- [Authorize]
|
|
|
+
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
public class SystemController : ControllerBase
|
|
|
{
|
|
@@ -199,8 +199,8 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, "程序错误!"));
|
|
|
throw;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
#endregion
|
|
@@ -210,27 +210,27 @@ namespace OASystem.API.Controllers
|
|
|
/// <summary>
|
|
|
/// 查询部门数据
|
|
|
/// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
+ /// <param name = "dto" ></param>
|
|
|
/// <returns></returns>
|
|
|
- //[Authorize]
|
|
|
+ [Authorize]
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> QueryDepartmentList(DepartmentDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- if (dto.PortType==1)
|
|
|
+ if (dto.PortType == 1)
|
|
|
{
|
|
|
return Ok(JsonView(false, "暂无数据!"));
|
|
|
}
|
|
|
- else if (dto.PortType==2)
|
|
|
+ else if (dto.PortType == 2)
|
|
|
{
|
|
|
var result = _sysDepRep.QueryDto<Sys_Department, DepartmentIView>(s => s.CompanyId == dto.CompanyId).ToList();
|
|
|
if (result.Count == 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, "暂无数据!"));
|
|
|
}
|
|
|
- return Ok(JsonView(true,"查询成功!",result));
|
|
|
+ return Ok(JsonView(true, "查询成功!", result));
|
|
|
}
|
|
|
else if (dto.PortType == 3)
|
|
|
{
|
|
@@ -246,12 +246,12 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, "程序错误!"));
|
|
|
throw;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 部门添加
|
|
|
/// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
+ /// <param name = "dto" ></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
@@ -279,22 +279,22 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, "程序错误!"));
|
|
|
throw;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 部门修改
|
|
|
/// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
+ /// <param name = "dto" ></param>
|
|
|
+ /// <returns ></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> EditDepartment(EditDepartmentDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- if (dto.Id==0 || string.IsNullOrWhiteSpace(dto.DepName) || dto.CompanyId == 0 || string.IsNullOrWhiteSpace(dto.DepCode))
|
|
|
+ if (dto.Id == 0 || string.IsNullOrWhiteSpace(dto.DepName) || dto.CompanyId == 0 || string.IsNullOrWhiteSpace(dto.DepCode))
|
|
|
{
|
|
|
return Ok(JsonView(false, "请检查信息是否输入完整!"));
|
|
|
}
|
|
@@ -302,12 +302,12 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
bool res = await _sysDepRep.UpdateAsync<Sys_Department>(a => a.Id == dto.Id, a => new Sys_Department
|
|
|
{
|
|
|
- CompanyId=dto.CompanyId,
|
|
|
- DepCode=dto.DepCode,
|
|
|
- DepName=dto.DepName,
|
|
|
- ParentDepId=dto.ParentDepId,
|
|
|
- Remark=dto.Remark,
|
|
|
- });
|
|
|
+ CompanyId = dto.CompanyId,
|
|
|
+ DepCode = dto.DepCode,
|
|
|
+ DepName = dto.DepName,
|
|
|
+ ParentDepId = dto.ParentDepId,
|
|
|
+ Remark = dto.Remark,
|
|
|
+ });
|
|
|
if (!res)
|
|
|
{
|
|
|
return Ok(JsonView(false, "修改失败!"));
|
|
@@ -327,7 +327,7 @@ namespace OASystem.API.Controllers
|
|
|
/// <summary>
|
|
|
/// 部门删除
|
|
|
/// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
+ /// <param name = "dto" ></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
@@ -341,7 +341,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bool res =await _sysDepRep.SoftDeleteAsync<Sys_Department>(dto.Id.ToString());
|
|
|
+ bool res = await _sysDepRep.SoftDeleteAsync<Sys_Department>(dto.Id.ToString());
|
|
|
if (!res)
|
|
|
{
|
|
|
return Ok(JsonView(false, "删除失败!"));
|