二次绩效BUG修复

parent 3421cb68
......@@ -907,6 +907,11 @@
职务分类
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.FitPeopleValue">
<summary>
实际人均绩效
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.Basics">
<summary>
基础绩效系数
......@@ -2358,7 +2363,17 @@
</member>
<member name="P:Performance.DtoModels.ComputeResponse.PerforSumFee">
<summary>
绩效合计
业绩绩效
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.PerforManagementFee">
<summary>
管理绩效
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.ShouldGiveFee">
<summary>
应发小计
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.OthePerfor">
......@@ -2368,7 +2383,7 @@
</member>
<member name="P:Performance.DtoModels.ComputeResponse.NightWorkPerfor">
<summary>
实发绩效工资金额
夜班费
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.RealGiveFee">
......
......@@ -362,6 +362,11 @@
人员名称
</summary>
</member>
<member name="P:Performance.EntityModels.ag_compute.PerforSumFee">
<summary>
可分配绩效
</summary>
</member>
<member name="P:Performance.EntityModels.ag_compute.OthePerfor">
<summary>
医院其他绩效
......
......@@ -37,6 +37,11 @@ public class PerDataClinicEmployee : IPerData
public string JobTitle { get; set; }
/// <summary>
/// 实际人均绩效
/// </summary>
public Nullable<decimal> FitPeopleValue { get; set; }
/// <summary>
/// 基础绩效系数
/// </summary>
public Nullable<decimal> Basics { get; set; }
......
......@@ -8,15 +8,13 @@ public class ComputeResponse
{
public ComputeResponse() { }
public ComputeResponse(string source, string accountingUnit, string employeeName,
string jobNumber, string jobTitle, decimal? perforSumFee)
public ComputeResponse(string source, string accountingUnit, string employeeName, string jobNumber, string jobTitle)
{
Source = source;
AccountingUnit = accountingUnit;
EmployeeName = employeeName;
JobNumber = jobNumber;
JobTitle = jobTitle;
PerforSumFee = perforSumFee;
}
/// <summary>
......@@ -47,17 +45,27 @@ public class ComputeResponse
public string JobTitle { get; set; }
/// <summary>
/// 绩效合计
/// 业绩绩效
/// </summary>
public Nullable<decimal> PerforSumFee { get; set; }
/// <summary>
/// 管理绩效
/// </summary>
public Nullable<decimal> PerforManagementFee { get; set; }
/// <summary>
/// 应发小计
/// </summary>
public Nullable<decimal> ShouldGiveFee { get; set; }
/// <summary>
/// 医院其他绩效
/// </summary>
public Nullable<decimal> OthePerfor { get; set; }
/// <summary>
/// 实发绩效工资金额
/// 夜班费
/// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; }
......
......@@ -52,6 +52,11 @@ public class ag_compute
public string PersonName { get; set; }
/// <summary>
/// 可分配绩效
/// </summary>
public Nullable<decimal> PerforSumFee { get; set; }
/// <summary>
/// 医院其他绩效
/// </summary>
public Nullable<decimal> OthePerfor { get; set; }
......
......@@ -422,22 +422,13 @@ public DeptDetailResponse GetDepartmentDetail(int allotId, int accountId, int ty
/// <returns></returns>
public List<ComputeResponse> AllCompute(int allotId, int isShowManage)
{
var list = new List<ComputeResponse>();
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 list = GetAllotPerformance(allotId, isShowManage);
// 获取二次绩效结果
var seconds = GetSecondPerformance(allotId);
if (seconds != null)
list?.AddRange(seconds);
// 补充医院其他绩效
var result = AddAprAmount(allotId, list);
......@@ -447,10 +438,12 @@ public List<ComputeResponse> AllCompute(int allotId, int isShowManage)
var empDic = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId);
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.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)
}
/// <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>
/// <param name="allotId"></param>
......@@ -471,7 +494,8 @@ private List<ComputeResponse> GetSecondPerformance(int allotId)
.GroupBy(t => new { 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, 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);
return comp;
});
......
......@@ -358,7 +358,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS
var basicRule = basicRuleList.FirstOrDefault(t => t.UnitType == (UnitType)resAccount.UnitType);
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 efficiency = avg * (empolyee.Efficiency ?? 1);
......
......@@ -34,6 +34,7 @@ public class ExcelReadConfig
new ColumnInfo(nameof(PerDataClinicEmployee.DoctorName), "医生姓名"),
new ColumnInfo(nameof(PerDataClinicEmployee.JobTitle), "职务分类"),
new ColumnInfo(nameof(PerDataClinicEmployee.Basics), "基础绩效系数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.FitPeopleValue), "实际人均绩效", true),
new ColumnInfo(nameof(PerDataClinicEmployee.PermanentStaff), "效率绩效人数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.Efficiency), "效率绩效系数", true),
new ColumnInfo(nameof(PerDataClinicEmployee.Scale), "规模绩效系数", true),
......
......@@ -376,13 +376,13 @@ private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> head
if (employees == null || !employees.Any()) return list;
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))
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);
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);
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)
JobNumber = 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,
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),
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),
......@@ -1254,6 +1255,9 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
WorkPost = item.WorkPost,
JobNumber = item.WorkNumber,
PersonName = item.Name,
PerforSumFee = item.DistPerformance,
OthePerfor = item.OtherPerformance,
NightWorkPerfor = item.NightWorkPerformance,
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