Commit 84c9441d by lcx

添加审核驳回接口

parent 0d6c172a
...@@ -169,5 +169,20 @@ public ApiResponse DepartmentList(int allotId, [FromQuery] int userId) ...@@ -169,5 +169,20 @@ public ApiResponse DepartmentList(int allotId, [FromQuery] int userId)
var data = collectService.DepartmentList(allotId, userId); var data = collectService.DepartmentList(allotId, userId);
return new ApiResponse(ResponseType.OK, data); return new ApiResponse(ResponseType.OK, data);
} }
/// <summary>
/// 提交数据审核
/// </summary>
[HttpPost]
[Route("collectdataaudit")]
public ApiResponse CollectDataAudit([FromBody] CollectAuditRequest request)
{
if (request == null || request.AllotId <= 0 || request.UserId <= 0 || new int[] { 3, 4 }.Contains(request.Status))
return new ApiResponse(ResponseType.ParameterError, "参数无效");
var result = collectService.CollectDataAudit(request.AllotId, request.Status, request.Status);
string remark = request.Status == 3 ? "审核通过" : "驳回成功";
return result ? new ApiResponse(ResponseType.OK, remark) : new ApiResponse(ResponseType.Fail, "操作失败");
}
} }
} }
namespace Performance.DtoModels
{
public class CollectAuditRequest
{
public int AllotId { get; set; }
public int UserId { get; set; }
/// <summary>
/// 3 审核通过 4 驳回
/// </summary>
public int Status { get; set; }
}
}
...@@ -955,6 +955,25 @@ public HandsonTableBase DepartmentList(int allotId, int userId) ...@@ -955,6 +955,25 @@ public HandsonTableBase DepartmentList(int allotId, int userId)
return table; return table;
} }
/// <summary>
/// 提交数据审核
/// </summary>
/// <param name="allotId"></param>
/// <param name="userId"></param>
/// <param name="status"></param>
public bool CollectDataAudit(int allotId, int userId, int status)
{
var data = perforcollectdataRepository.GetEntities(t => t.AllotID == allotId && t.SubmitUser == userId);
if (data == null || !data.Any())
return true;
data.ForEach(t =>
{
t.Status = status;
});
return perforcollectdataRepository.UpdateRange(data.ToArray());
}
} }
public class CollectDataConfig public class CollectDataConfig
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment