二次绩效BUG修复

parent 3421cb68
...@@ -907,6 +907,11 @@ ...@@ -907,6 +907,11 @@
职务分类 职务分类
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.FitPeopleValue">
<summary>
实际人均绩效
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.Basics"> <member name="P:Performance.DtoModels.PerDataClinicEmployee.Basics">
<summary> <summary>
基础绩效系数 基础绩效系数
...@@ -2358,7 +2363,17 @@ ...@@ -2358,7 +2363,17 @@
</member> </member>
<member name="P:Performance.DtoModels.ComputeResponse.PerforSumFee"> <member name="P:Performance.DtoModels.ComputeResponse.PerforSumFee">
<summary> <summary>
绩效合计 业绩绩效
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.PerforManagementFee">
<summary>
管理绩效
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.ShouldGiveFee">
<summary>
应发小计
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ComputeResponse.OthePerfor"> <member name="P:Performance.DtoModels.ComputeResponse.OthePerfor">
...@@ -2368,7 +2383,7 @@ ...@@ -2368,7 +2383,7 @@
</member> </member>
<member name="P:Performance.DtoModels.ComputeResponse.NightWorkPerfor"> <member name="P:Performance.DtoModels.ComputeResponse.NightWorkPerfor">
<summary> <summary>
实发绩效工资金额 夜班费
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ComputeResponse.RealGiveFee"> <member name="P:Performance.DtoModels.ComputeResponse.RealGiveFee">
......
...@@ -362,6 +362,11 @@ ...@@ -362,6 +362,11 @@
人员名称 人员名称
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_compute.PerforSumFee">
<summary>
可分配绩效
</summary>
</member>
<member name="P:Performance.EntityModels.ag_compute.OthePerfor"> <member name="P:Performance.EntityModels.ag_compute.OthePerfor">
<summary> <summary>
医院其他绩效 医院其他绩效
......
...@@ -37,6 +37,11 @@ public class PerDataClinicEmployee : IPerData ...@@ -37,6 +37,11 @@ public class PerDataClinicEmployee : IPerData
public string JobTitle { get; set; } public string JobTitle { get; set; }
/// <summary> /// <summary>
/// 实际人均绩效
/// </summary>
public Nullable<decimal> FitPeopleValue { get; set; }
/// <summary>
/// 基础绩效系数 /// 基础绩效系数
/// </summary> /// </summary>
public Nullable<decimal> Basics { get; set; } public Nullable<decimal> Basics { get; set; }
......
...@@ -8,15 +8,13 @@ public class ComputeResponse ...@@ -8,15 +8,13 @@ public class ComputeResponse
{ {
public ComputeResponse() { } public ComputeResponse() { }
public ComputeResponse(string source, string accountingUnit, string employeeName, public ComputeResponse(string source, string accountingUnit, string employeeName, string jobNumber, string jobTitle)
string jobNumber, string jobTitle, decimal? perforSumFee)
{ {
Source = source; Source = source;
AccountingUnit = accountingUnit; AccountingUnit = accountingUnit;
EmployeeName = employeeName; EmployeeName = employeeName;
JobNumber = jobNumber; JobNumber = jobNumber;
JobTitle = jobTitle; JobTitle = jobTitle;
PerforSumFee = perforSumFee;
} }
/// <summary> /// <summary>
...@@ -47,17 +45,27 @@ public class ComputeResponse ...@@ -47,17 +45,27 @@ public class ComputeResponse
public string JobTitle { get; set; } public string JobTitle { get; set; }
/// <summary> /// <summary>
/// 绩效合计 /// 业绩绩效
/// </summary> /// </summary>
public Nullable<decimal> PerforSumFee { get; set; } public Nullable<decimal> PerforSumFee { get; set; }
/// <summary> /// <summary>
/// 管理绩效
/// </summary>
public Nullable<decimal> PerforManagementFee { get; set; }
/// <summary>
/// 应发小计
/// </summary>
public Nullable<decimal> ShouldGiveFee { get; set; }
/// <summary>
/// 医院其他绩效 /// 医院其他绩效
/// </summary> /// </summary>
public Nullable<decimal> OthePerfor { get; set; } public Nullable<decimal> OthePerfor { get; set; }
/// <summary> /// <summary>
/// 实发绩效工资金额 /// 夜班费
/// </summary> /// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; } public Nullable<decimal> NightWorkPerfor { get; set; }
......
...@@ -52,6 +52,11 @@ public class ag_compute ...@@ -52,6 +52,11 @@ public class ag_compute
public string PersonName { get; set; } public string PersonName { get; set; }
/// <summary> /// <summary>
/// 可分配绩效
/// </summary>
public Nullable<decimal> PerforSumFee { get; set; }
/// <summary>
/// 医院其他绩效 /// 医院其他绩效
/// </summary> /// </summary>
public Nullable<decimal> OthePerfor { get; set; } public Nullable<decimal> OthePerfor { get; set; }
......
...@@ -422,22 +422,13 @@ public DeptDetailResponse GetDepartmentDetail(int allotId, int accountId, int ty ...@@ -422,22 +422,13 @@ public DeptDetailResponse GetDepartmentDetail(int allotId, int accountId, int ty
/// <returns></returns> /// <returns></returns>
public List<ComputeResponse> AllCompute(int allotId, int isShowManage) public List<ComputeResponse> AllCompute(int allotId, int isShowManage)
{ {
var list = new List<ComputeResponse>(); // 获取一次次绩效结果
var list = GetAllotPerformance(allotId, isShowManage);
var mTypes = new[] { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString(), AccountUnitType.行政中层.ToString(), AccountUnitType.行政高层.ToString() };
var types = new List<string> { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString() };
// 一次绩效 获取特定人员绩效结果
var allot = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && mTypes.Contains(t.AccountType))?.OrderByDescending(t => t.AccountingUnit);
list = allot?.Select(t =>
{
// 仅显示管理绩效
var fee = isShowManage == 1 && types.Contains(t.AccountType) ? t.ShouldGiveFee : t.RealGiveFee;
return new ComputeResponse("一次绩效", t.AccountingUnit, t.EmployeeName, t.JobNumber, t.JobTitle, fee);
}).ToList();
// 获取二次绩效结果 // 获取二次绩效结果
var seconds = GetSecondPerformance(allotId); var seconds = GetSecondPerformance(allotId);
if (seconds != null) if (seconds != null)
list?.AddRange(seconds); list?.AddRange(seconds);
// 补充医院其他绩效 // 补充医院其他绩效
var result = AddAprAmount(allotId, list); var result = AddAprAmount(allotId, list);
...@@ -447,10 +438,12 @@ public List<ComputeResponse> AllCompute(int allotId, int isShowManage) ...@@ -447,10 +438,12 @@ public List<ComputeResponse> AllCompute(int allotId, int isShowManage)
var empDic = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId); var empDic = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId);
foreach (var item in result) foreach (var item in result)
{ {
var temp = item.PerforSumFee ?? 0; var temp = item.PerforSumFee ?? 0 + item.PerforManagementFee ?? 0;
item.ShouldGiveFee = item.PerforSumFee ?? 0 + item.PerforManagementFee ?? 0 + item.OthePerfor ?? 0 + item.NightWorkPerfor ?? 0;
item.ReservedRatio = empDic?.FirstOrDefault(w => w.DoctorName == item.EmployeeName && w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0; item.ReservedRatio = empDic?.FirstOrDefault(w => w.DoctorName == item.EmployeeName && w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0;
item.ReservedRatioFee = temp * item.ReservedRatio; item.ReservedRatioFee = temp * item.ReservedRatio;
item.RealGiveFee = temp * (1 - item.ReservedRatio) + (item.OthePerfor ?? 0) + (item.NightWorkPerfor ?? 0); item.RealGiveFee = item.ShouldGiveFee - (item.ReservedRatioFee ?? 0);
} }
} }
...@@ -458,6 +451,36 @@ public List<ComputeResponse> AllCompute(int allotId, int isShowManage) ...@@ -458,6 +451,36 @@ public List<ComputeResponse> AllCompute(int allotId, int isShowManage)
} }
/// <summary> /// <summary>
/// 获取一次次绩效结果
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
private List<ComputeResponse> GetAllotPerformance(int allotId, int isShowManage)
{
var mTypes = new[] { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString(), AccountUnitType.行政中层.ToString(), AccountUnitType.行政高层.ToString() };
var types = new List<string> { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString() };
// 一次绩效 获取特定人员绩效结果
var allot = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && mTypes.Contains(t.AccountType))?.OrderByDescending(t => t.AccountingUnit);
return allot?.Select(t =>
{
var comp = new ComputeResponse("一次绩效", t.AccountingUnit, t.EmployeeName, t.JobNumber, t.JobTitle);
// 仅显示管理绩效
if (isShowManage == 1 && types.Contains(t.AccountType))
{
comp.PerforManagementFee = (t.ShouldGiveFee ?? 0) + (t.OtherPerfor ?? 0) + (t.Punishment ?? 0);
comp.PerforSumFee = 0;
}
else
{
comp.PerforManagementFee = t.RealGiveFee;
comp.PerforSumFee = t.Avg;
}
return comp;
}).ToList();
}
/// <summary>
/// 获取二次绩效结果 /// 获取二次绩效结果
/// </summary> /// </summary>
/// <param name="allotId"></param> /// <param name="allotId"></param>
...@@ -471,7 +494,8 @@ private List<ComputeResponse> GetSecondPerformance(int allotId) ...@@ -471,7 +494,8 @@ private List<ComputeResponse> GetSecondPerformance(int allotId)
.GroupBy(t => new { t.Department, t.WorkPost, t.JobNumber, t.PersonName }) .GroupBy(t => new { t.Department, t.WorkPost, t.JobNumber, t.PersonName })
.Select(t => .Select(t =>
{ {
var comp = new ComputeResponse("二次绩效", t.Key.Department, t.Key.PersonName, t.Key.JobNumber, t.Key.WorkPost, t.Sum(g => g.RealGiveFee)); var comp = new ComputeResponse("二次绩效", t.Key.Department, t.Key.PersonName, t.Key.JobNumber, t.Key.WorkPost);
comp.PerforSumFee = t.Sum(g => g.PerforSumFee);
comp.NightWorkPerfor = t.Sum(g => g.NightWorkPerfor); comp.NightWorkPerfor = t.Sum(g => g.NightWorkPerfor);
return comp; return comp;
}); });
......
...@@ -358,7 +358,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS ...@@ -358,7 +358,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS
var basicRule = basicRuleList.FirstOrDefault(t => t.UnitType == (UnitType)resAccount.UnitType); var basicRule = basicRuleList.FirstOrDefault(t => t.UnitType == (UnitType)resAccount.UnitType);
if (basicRule == null) continue; if (basicRule == null) continue;
var avg = (resAccount.ManagerNumber + resAccount.Number) == 0 ? 0 : resAccount.PerforTotal / (resAccount.ManagerNumber + resAccount.Number); // 优先取 实际人均绩效
var avg = (empolyee.FitPeopleValue.HasValue && empolyee.FitPeopleValue > 0)
? empolyee.FitPeopleValue
: (resAccount.ManagerNumber + resAccount.Number) == 0 ? 0 : resAccount.PerforTotal / (resAccount.ManagerNumber + resAccount.Number);
var effAvg = empolyee.PermanentStaff == 0 ? 0 : resAccount.PerforTotal / empolyee.PermanentStaff; var effAvg = empolyee.PermanentStaff == 0 ? 0 : resAccount.PerforTotal / empolyee.PermanentStaff;
//var efficiency = avg * (empolyee.Efficiency ?? 1); //var efficiency = avg * (empolyee.Efficiency ?? 1);
......
...@@ -34,6 +34,7 @@ public class ExcelReadConfig ...@@ -34,6 +34,7 @@ public class ExcelReadConfig
new ColumnInfo(nameof(PerDataClinicEmployee.DoctorName), "医生姓名"), new ColumnInfo(nameof(PerDataClinicEmployee.DoctorName), "医生姓名"),
new ColumnInfo(nameof(PerDataClinicEmployee.JobTitle), "职务分类"), new ColumnInfo(nameof(PerDataClinicEmployee.JobTitle), "职务分类"),
new ColumnInfo(nameof(PerDataClinicEmployee.Basics), "基础绩效系数", true), new ColumnInfo(nameof(PerDataClinicEmployee.Basics), "基础绩效系数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.FitPeopleValue), "实际人均绩效", true),
new ColumnInfo(nameof(PerDataClinicEmployee.PermanentStaff), "效率绩效人数", true), new ColumnInfo(nameof(PerDataClinicEmployee.PermanentStaff), "效率绩效人数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.Efficiency), "效率绩效系数", true), new ColumnInfo(nameof(PerDataClinicEmployee.Efficiency), "效率绩效系数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.Scale), "规模绩效系数", true), new ColumnInfo(nameof(PerDataClinicEmployee.Scale), "规模绩效系数", true),
......
...@@ -376,13 +376,13 @@ private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> head ...@@ -376,13 +376,13 @@ private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> head
if (employees == null || !employees.Any()) return list; if (employees == null || !employees.Any()) return list;
if (!string.IsNullOrEmpty(empName)) if (!string.IsNullOrEmpty(empName))
employees = employees?.Where(w => w.DoctorName == empName).ToList(); employees = employees?.Where(w => w.DoctorName.Trim() == empName.Trim()).ToList();
if (!string.IsNullOrEmpty(jobNumber)) if (!string.IsNullOrEmpty(jobNumber))
employees = employees?.Where(w => w.PersonnelNumber == jobNumber).ToList(); employees = employees?.Where(w => w.PersonnelNumber.Trim() == jobNumber.Trim()).ToList();
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == allotId); var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == allotId);
Func<per_employee, decimal?> getAprAmount = (t) => perapramounts Func<per_employee, decimal?> getAprAmount = (t) => perapramounts
?.Where(w => w.DoctorName == t.DoctorName && w.PersonnelNumber == t.PersonnelNumber) ?.Where(w => w.DoctorName.Trim() == t.DoctorName.Trim() && w.PersonnelNumber.Trim() == t.PersonnelNumber.Trim())
?.Sum(w => w.Amount); ?.Sum(w => w.Amount);
Dictionary<(string, string), Func<per_employee, object>> dict = new Dictionary<(string, string), Func<per_employee, object>> Dictionary<(string, string), Func<per_employee, object>> dict = new Dictionary<(string, string), Func<per_employee, object>>
...@@ -1231,6 +1231,7 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request) ...@@ -1231,6 +1231,7 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
JobNumber = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "人员工号")?.ItemValue, JobNumber = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "人员工号")?.ItemValue,
WorkPost = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "岗位")?.ItemValue, WorkPost = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "岗位")?.ItemValue,
PersonName = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "姓名")?.ItemValue, PersonName = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "姓名")?.ItemValue,
PerforSumFee = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "可分配绩效")?.ItemValue, 0),
OthePerfor = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "医院其他绩效")?.ItemValue, 0), OthePerfor = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "医院其他绩效")?.ItemValue, 0),
NightWorkPerfor = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "夜班工作量绩效")?.ItemValue, 0), NightWorkPerfor = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "夜班工作量绩效")?.ItemValue, 0),
RealGiveFee = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "实发绩效工资金额")?.ItemValue, 0), RealGiveFee = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "实发绩效工资金额")?.ItemValue, 0),
...@@ -1254,6 +1255,9 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request) ...@@ -1254,6 +1255,9 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
WorkPost = item.WorkPost, WorkPost = item.WorkPost,
JobNumber = item.WorkNumber, JobNumber = item.WorkNumber,
PersonName = item.Name, PersonName = item.Name,
PerforSumFee = item.DistPerformance,
OthePerfor = item.OtherPerformance,
NightWorkPerfor = item.NightWorkPerformance,
RealGiveFee = item.RealAmount, RealGiveFee = item.RealAmount,
}); });
} }
......
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