Commit e4f4af82 by zry

二次绩效审核及其他来源详情

parent afbd0054
...@@ -115,6 +115,18 @@ public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBo ...@@ -115,6 +115,18 @@ public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBo
var result = secondAllotService.GetSecondDetail(request); var result = secondAllotService.GetSecondDetail(request);
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK, result);
} }
/// <summary>
/// 二次绩效录入页面配置信息
/// </summary>
/// <returns></returns>
[Route("api/second/otherdetail/{secondid}")]
[HttpPost]
public ApiResponse SecondOtherDetail(int secondid)
{
var result = secondAllotService.GetSecondDetail(secondid);
return new ApiResponse(ResponseType.OK, result);
}
#endregion #endregion
#region 模板使用 #region 模板使用
...@@ -209,20 +221,20 @@ public ApiResponse WorkloadDelete([CustomizeValidator(RuleSet = "Delete"), FromB ...@@ -209,20 +221,20 @@ public ApiResponse WorkloadDelete([CustomizeValidator(RuleSet = "Delete"), FromB
/// <summary> /// <summary>
/// 提交审核 /// 提交审核
/// </summary> /// </summary>
/// <param name="secondid">二次绩效Id</param> /// <param name="request">二次绩效Id</param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Route("/api/second/audit/submit/{secondid}")] [Route("/api/second/audit/submit")]
public ApiResponse SubmitAudit(int secondid) public ApiResponse SubmitAudit(SubmitAuditRequest request)
{ {
var second = secondAllotService.GetSecondallot(secondid); var second = secondAllotService.GetSecondallot(request.SecondId);
if (second == null) if (second == null)
return new ApiResponse(ResponseType.ParameterError, "二次绩效Id无效"); return new ApiResponse(ResponseType.ParameterError, "二次绩效Id无效");
if (second.Status == 3) if (second.Status == 3)
return new ApiResponse(ResponseType.Fail, "该绩效已\"审核通过\",无需再次提交"); return new ApiResponse(ResponseType.Fail, "该绩效已\"审核通过\",无需再次提交");
var userid = claimService.GetUserId(); var userid = claimService.GetUserId();
var result = secondAllotService.AuditSubmit(second); var result = secondAllotService.AuditSubmit(second, request.Type);
return result ? new ApiResponse(ResponseType.OK, "提交成功") : new ApiResponse(ResponseType.Fail, "提交失败"); return result ? new ApiResponse(ResponseType.OK, "提交成功") : new ApiResponse(ResponseType.Fail, "提交失败");
} }
......
...@@ -797,6 +797,12 @@ ...@@ -797,6 +797,12 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.SecondAllotController.SecondOtherDetail(System.Int32)">
<summary>
二次绩效录入页面配置信息
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.SecondAllotController.Temp(Performance.DtoModels.AllotDeptRequest)"> <member name="M:Performance.Api.Controllers.SecondAllotController.Temp(Performance.DtoModels.AllotDeptRequest)">
<summary> <summary>
选择二次绩效模板 选择二次绩效模板
...@@ -839,11 +845,11 @@ ...@@ -839,11 +845,11 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.SecondAllotController.SubmitAudit(System.Int32)"> <member name="M:Performance.Api.Controllers.SecondAllotController.SubmitAudit(Performance.DtoModels.SubmitAuditRequest)">
<summary> <summary>
提交审核 提交审核
</summary> </summary>
<param name="secondid">二次绩效Id</param> <param name="request">二次绩效Id</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.SecondAllotController.AuditList(Performance.DtoModels.AllotDeptRequest)"> <member name="M:Performance.Api.Controllers.SecondAllotController.AuditList(Performance.DtoModels.AllotDeptRequest)">
......
...@@ -1634,6 +1634,11 @@ ...@@ -1634,6 +1634,11 @@
短信验证类型 1 手机号登录 2 其他 短信验证类型 1 手机号登录 2 其他
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.SubmitAuditRequest.Type">
<summary>
提交类型 1 模板提交 2 其他提交
</summary>
</member>
<member name="P:Performance.DtoModels.UserRequest.RealName"> <member name="P:Performance.DtoModels.UserRequest.RealName">
<summary> <summary>
真实名称 真实名称
......
...@@ -708,6 +708,11 @@ ...@@ -708,6 +708,11 @@
状态 1 未提交 2 等待审核 3 审核通过 4 驳回 状态 1 未提交 2 等待审核 3 审核通过 4 驳回
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_secondallot.SubmitType">
<summary>
提交类型 1使用模板 2 其他类型数据
</summary>
</member>
<member name="P:Performance.EntityModels.ag_secondallot.SubmitTime"> <member name="P:Performance.EntityModels.ag_secondallot.SubmitTime">
<summary> <summary>
提交时间 提交时间
......
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class SubmitAuditRequest
{
public int SecondId { get; set; }
/// <summary>
/// 提交类型 1 模板提交 2 其他提交
/// </summary>
public int Type { get; set; }
}
public class SubmitAuditRequestValidator : AbstractValidator<SubmitAuditRequest>
{
public SubmitAuditRequestValidator()
{
RuleFor(x => x.Type).InclusiveBetween(1, 2);
RuleFor(x => x.SecondId).GreaterThan(0);
}
}
}
...@@ -55,6 +55,11 @@ public class ag_secondallot ...@@ -55,6 +55,11 @@ public class ag_secondallot
/// 状态 1 未提交 2 等待审核 3 审核通过 4 驳回 /// 状态 1 未提交 2 等待审核 3 审核通过 4 驳回
/// </summary> /// </summary>
public Nullable<int> Status { get; set; } public Nullable<int> Status { get; set; }
/// <summary>
/// 提交类型 1使用模板 2 其他类型数据
/// </summary>
public Nullable<int> SubmitType { get; set; }
/// <summary> /// <summary>
/// 提交时间 /// 提交时间
......
...@@ -224,6 +224,15 @@ public SecondResponse GetSecondDetail(UseTempRequest request) ...@@ -224,6 +224,15 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
} }
/// <summary> /// <summary>
/// 二次绩效详情
/// </summary>
/// <returns></returns>
public List<ag_othersource> GetSecondDetail(int secondid)
{
var others = perforAgothersourceRepository.GetEntities(t => t.SecondId == secondid);
return others;
}
/// <summary>
/// 二次绩效项录入保存 /// 二次绩效项录入保存
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
...@@ -576,9 +585,10 @@ public List<ag_secondallot> AuditList(int userId, int allotId) ...@@ -576,9 +585,10 @@ public List<ag_secondallot> AuditList(int userId, int allotId)
/// <param name="userId">用户ID</param> /// <param name="userId">用户ID</param>
/// <param name="secondId">二次绩效ID</param> /// <param name="secondId">二次绩效ID</param>
/// <returns></returns> /// <returns></returns>
public bool AuditSubmit(ag_secondallot second) public bool AuditSubmit(ag_secondallot second, int submittype)
{ {
second.Status = 2; second.Status = 2;
second.SubmitType = submittype;
second.SubmitTime = DateTime.Now; second.SubmitTime = DateTime.Now;
second.Remark = "已提交审核,等待审核中"; second.Remark = "已提交审核,等待审核中";
return perforAgsecondallotRepository.Update(second); return perforAgsecondallotRepository.Update(second);
...@@ -612,42 +622,49 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request) ...@@ -612,42 +622,49 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
if (result && request.IsPass == 1) if (result && request.IsPass == 1)
{ {
var computes = new List<ag_compute>(); var computes = new List<ag_compute>();
var items = perforAgfixatitemRepository.GetEntities(t => t.SecondId == request.SecondId); if (second.SubmitType == 1)
if (items != null && items.Any())
{ {
var rowNumbers = items.Select(t => t.RowNumber).Where(t => t > 0)?.Distinct(); var items = perforAgfixatitemRepository.GetEntities(t => t.SecondId == request.SecondId);
if (rowNumbers != null && rowNumbers.Any()) if (items != null && items.Any())
{ {
foreach (var item in rowNumbers) var rowNumbers = items.Select(t => t.RowNumber).Where(t => t > 0)?.Distinct();
if (rowNumbers != null && rowNumbers.Any())
{ {
computes.Add(new ag_compute foreach (var item in rowNumbers)
{ {
AllotId = second.AllotId, computes.Add(new ag_compute
SecondId = second.Id, {
Department = second.Department, AllotId = second.AllotId,
WorkPost = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "岗位")?.ItemValue, SecondId = second.Id,
PersonName = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "姓名")?.ItemValue, Department = second.Department,
RealGiveFee = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "实发绩效工资金额")?.ItemValue, 0), WorkPost = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "岗位")?.ItemValue,
}); PersonName = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "姓名")?.ItemValue,
RealGiveFee = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "实发绩效工资金额")?.ItemValue, 0),
});
}
} }
} }
} }
var others = perforAgothersourceRepository.GetEntities(t => t.SecondId == request.SecondId); else if (second.SubmitType == 2)
if (others != null && others.Any())
{ {
foreach (var item in others) var others = perforAgothersourceRepository.GetEntities(t => t.SecondId == request.SecondId);
if (others != null && others.Any())
{ {
computes.Add(new ag_compute foreach (var item in others)
{ {
AllotId = second.AllotId, computes.Add(new ag_compute
SecondId = second.Id, {
Department = item.Department, AllotId = second.AllotId,
WorkPost = item.WorkPost, SecondId = second.Id,
PersonName = item.Name, Department = item.Department,
RealGiveFee = item.Amount, WorkPost = item.WorkPost,
}); PersonName = item.Name,
RealGiveFee = item.Amount,
});
}
} }
} }
perforAgcomputeRepository.AddRange(computes.ToArray()); perforAgcomputeRepository.AddRange(computes.ToArray());
} }
......
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