Browse Source

员工管理人事审核放外面

wangh 1 year ago
parent
commit
557795c6e9

+ 30 - 0
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -1087,7 +1087,37 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, "程序错误!"));
             }
         }
+        /// <summary>
+        /// 人事审核
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PersonnelAudit(PersonnelAuditDto dto)
+        {
+            try
+            {
+                if (dto == null)
+                {
+                    return Ok(JsonView(false, "参数不能为空!"));
+                }
+                bool res = await _userRep.UpdateAsync<Sys_Users>(a => a.Id == dto.Id, a => new Sys_Users
+                {
+                    HrAudit=dto.isAudit
+                });
+                if (!res)
+                {
+                    return Ok(JsonView(false, "操作失败!"));
+                }
+                return Ok(JsonView(true, "操作成功!"));
 
+            }
+            catch (Exception)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+            }
+        }
         #endregion
 
         #region 权限模块

+ 12 - 0
OASystem/OASystem.Domain/Dtos/System/UserDto.cs

@@ -217,4 +217,16 @@ namespace OASystem.Domain.Dtos.System
         /// </summary>
         public int OperateUserId { get; set; }
     }
+
+    public class PersonnelAuditDto
+    {
+        /// <summary>
+        /// 数据Id
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 审核是否通过 1:通过 2拒绝
+        /// </summary>
+        public int isAudit { get; set; }
+    }
 }

+ 5 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/TaskAssignmentRepository.cs

@@ -166,7 +166,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 {
                     sqlWhere += string.Format(@" And CTId ={0}", dto.CTId);
                 }
-                
+                else
+                {
+                    return result = new Result() { Code = -1, Msg = "暂无数据" };
+                }
+
 
                 sqlWhere += string.Format(@" And IsDel={0} ", 0);
                 if (!string.IsNullOrEmpty(sqlWhere.Trim()))