全院发放人均绩效

parent c38d1132
......@@ -201,6 +201,45 @@ public ApiResponse AllCompute([FromBody] ComputerRequest request)
}
/// <summary>
/// 获取全院绩效平均
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("allavg")]
[HttpPost]
public ApiResponse AllComputeAvg([FromBody] ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var isShowManage = _computeService.IsShowManage(request.AllotId);
var list = _computeService.AllCompute(request.AllotId, isShowManage);
List<res_baiscnorm> avgs = new List<res_baiscnorm>();
var gc = list.Where(w => w.UnitType != UnitType.行政高层.ToString());
avgs.Add(new res_baiscnorm
{
PositionName = "不含行政高层人均绩效",
TotelNumber = gc.Count(),
TotelValue = Math.Round(gc.Sum(s => s.RealGiveFee) ?? 0),
AvgValue = gc.Count() == 0 ? 0 : Math.Round(gc.Sum(s => s.RealGiveFee) / gc.Count() ?? 0)
});
avgs.AddRange(
list.GroupBy(w => w.UnitType).Select(w => new res_baiscnorm
{
PositionName = $"{w.Key}人均绩效",
TotelNumber = w.Count(),
TotelValue = Math.Round(w.Sum(s => s.RealGiveFee) ?? 0),
AvgValue = w.Count() == 0 ? 0 : Math.Round(w.Sum(s => s.RealGiveFee) / w.Count() ?? 0)
}));
return new ApiResponse(ResponseType.OK, "ok", avgs.Select(w => new { w.PositionName, w.TotelNumber, w.TotelValue, w.AvgValue }));
}
/// <summary>
/// 获取全院管理绩效列表
/// </summary>
/// <param name="request"></param>
......
......@@ -339,6 +339,13 @@
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ComputeController.AllComputeAvg(Performance.DtoModels.ComputerRequest)">
<summary>
获取全院绩效平均
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ComputeController.AllManageCompute(Performance.DtoModels.ComputerRequest)">
<summary>
获取全院管理绩效列表
......
......@@ -713,6 +713,9 @@
<member name="F:Performance.DtoModels.SheetType.PersonAdjustLaterOtherFee">
<summary> 业务中层行政中高层调节后其他绩效 </summary>
</member>
<member name="F:Performance.DtoModels.SheetType.OtherWorkload">
<summary> 其他工作量(不参与核算) </summary>
</member>
<member name="T:Performance.DtoModels.AccountUnitType">
<summary>
核算单元类型
......
......@@ -30,6 +30,7 @@ public class ag_compute
/// 二次绩效ID
/// </summary>
public Nullable<int> SecondId { get; set; }
public string UnitType { get; set; }
/// <summary>
/// 科室
......
......@@ -479,23 +479,21 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int isShowManage)
return allot?.Select(t =>
{
var comp = new ComputeResponse("一次绩效", t.AccountingUnit, t.EmployeeName, t.JobNumber, t.JobTitle);
comp.UnitType = t.AccountType;
if (types1.Contains(t.AccountType))
comp.PerforManagementFee = (t.ShouldGiveFee ?? 0) + (t.OtherPerfor ?? 0) + (t.Punishment ?? 0);
else
comp.PerforManagementFee = t.RealGiveFee;
// 行政中层 行政高层 补充 夜班费
if (types2.Contains(t.AccountType))
{
comp.NightWorkPerfor = t.NightWorkPerfor;
}
// 仅显示管理绩效
if (isShowManage == 1)
comp.PerforSumFee = 0;
else
comp.PerforSumFee = t.Avg;
return comp;
}).ToList();
}
......@@ -511,10 +509,11 @@ private List<ComputeResponse> GetSecondPerformance(int allotId)
if (again != null && again.Any())
{
var group = again
.GroupBy(t => new { t.Department, t.WorkPost, t.JobNumber, t.PersonName })
.GroupBy(t => new { t.UnitType, t.Department, t.WorkPost, t.JobNumber, t.PersonName })
.Select(t =>
{
var comp = new ComputeResponse("二次绩效", t.Key.Department, t.Key.PersonName, t.Key.JobNumber, t.Key.WorkPost);
comp.UnitType = t.Key.UnitType;
comp.PerforSumFee = t.Sum(g => g.PerforSumFee);
comp.NightWorkPerfor = t.Sum(g => g.NightWorkPerfor);
return comp;
......
......@@ -1354,6 +1354,7 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
{
AllotId = second.AllotId,
SecondId = second.Id,
UnitType = second.UnitType,
Department = second.Department,
JobNumber = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "人员工号")?.ItemValue,
WorkPost = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "岗位")?.ItemValue,
......@@ -1378,6 +1379,7 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
{
AllotId = second.AllotId,
SecondId = second.Id,
UnitType = second.UnitType,
Department = second.Department,
WorkPost = item.WorkPost,
JobNumber = item.WorkNumber,
......@@ -1390,7 +1392,6 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
}
}
}
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