测算表4.1是不是只算一边,考核后绩效、药占比、医院奖罚、考核前其他绩效/删除医院奖罚

parent 0fb16ca5
...@@ -2673,6 +2673,26 @@ ...@@ -2673,6 +2673,26 @@
预留比例金额 预留比例金额
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ComputeResponse.Punishment">
<summary>
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.GiveFee">
<summary>
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.Adjust">
<summary>
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.AdjustLaterOtherFee">
<summary>
</summary>
</member>
<member name="P:Performance.DtoModels.DeptDataDetails`1.Pandect"> <member name="P:Performance.DtoModels.DeptDataDetails`1.Pandect">
<summary> 概览</summary> <summary> 概览</summary>
</member> </member>
......
...@@ -81,12 +81,12 @@ public class PerDataAccountBaisc : IPerData ...@@ -81,12 +81,12 @@ public class PerDataAccountBaisc : IPerData
/// <summary> /// <summary>
/// 药占比奖罚 /// 药占比奖罚
/// </summary> /// </summary>
public decimal MedicineExtra { get; set; } public decimal? MedicineExtra { get; set; }
/// <summary> /// <summary>
/// 材料占比奖罚 /// 材料占比奖罚
/// </summary> /// </summary>
public decimal MaterialsExtra { get; set; } public decimal? MaterialsExtra { get; set; }
/// <summary> /// <summary>
/// 医院奖罚 /// 医院奖罚
......
...@@ -259,8 +259,7 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -259,8 +259,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
/// <param name="excel"></param> /// <param name="excel"></param>
/// <param name="perSheet"></param> /// <param name="perSheet"></param>
/// <returns></returns> /// <returns></returns>
public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, IEnumerable<AccountUnitTotal> extras, public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet)
IEnumerable<AccountUnitTotal> drugExtras, IEnumerable<AccountUnitTotal> materialsExtras)
{ {
var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t); var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t);
var economicData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeEconomic)?.PerData?.Select(t => (PerData)t); var economicData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeEconomic)?.PerData?.Select(t => (PerData)t);
...@@ -284,9 +283,9 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -284,9 +283,9 @@ public void Save(List<PerSheet> perSheets, int allotId)
foreach (var dept in atDataList) foreach (var dept in atDataList)
{ {
//科室奖罚汇总结果 //科室奖罚汇总结果
var extra = extras?.FirstOrDefault(w => w.UnitType == unitType.ToString() && w.AccountingUnit == dept.AccountingUnit)?.TotelValue; //var extra = extras?.FirstOrDefault(w => w.UnitType == unitType.ToString() && w.AccountingUnit == dept.AccountingUnit)?.TotelValue;
var drugExtra = drugExtras?.FirstOrDefault(w => w.UnitType == unitType.ToString() && w.AccountingUnit == dept.AccountingUnit)?.TotelValue; //var drugExtra = drugExtras?.FirstOrDefault(w => w.UnitType == unitType.ToString() && w.AccountingUnit == dept.AccountingUnit)?.TotelValue;
var materialsExtra = materialsExtras?.FirstOrDefault(w => w.UnitType == unitType.ToString() && w.AccountingUnit == dept.AccountingUnit)?.TotelValue; //var materialsExtra = materialsExtras?.FirstOrDefault(w => w.UnitType == unitType.ToString() && w.AccountingUnit == dept.AccountingUnit)?.TotelValue;
//var scoreAverage = accountScoreAverages?.FirstOrDefault(w => w.UnitType == unitType.ToString() && w.AccountingUnit == dept.AccountingUnit)?.TotelValue; //var scoreAverage = accountScoreAverages?.FirstOrDefault(w => w.UnitType == unitType.ToString() && w.AccountingUnit == dept.AccountingUnit)?.TotelValue;
var econDoctor = economicData.FirstOrDefault(t => t.UnitType == unitType.ToString() && t.AccountingUnit == dept.AccountingUnit); var econDoctor = economicData.FirstOrDefault(t => t.UnitType == unitType.ToString() && t.AccountingUnit == dept.AccountingUnit);
...@@ -308,9 +307,13 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -308,9 +307,13 @@ public void Save(List<PerSheet> perSheets, int allotId)
dept.AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0; dept.AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0;
dept.AssessLaterOtherFee = dept?.AssessLaterOtherFee ?? 0; dept.AssessLaterOtherFee = dept?.AssessLaterOtherFee ?? 0;
dept.AdjustLaterOtherFee = dept?.AdjustLaterOtherFee ?? 0; dept.AdjustLaterOtherFee = dept?.AdjustLaterOtherFee ?? 0;
dept.Extra = (extra ?? 0); //dept.Extra = (extra ?? 0);
dept.MedicineExtra = (drugExtra ?? 0); //dept.MedicineExtra = (drugExtra ?? 0);
dept.MaterialsExtra = (materialsExtra ?? 0); //dept.MaterialsExtra = (materialsExtra ?? 0);
dept.Extra = 0;
dept.MedicineExtra = dept.MedicineExtra ?? 0;
dept.MaterialsExtra = dept.MaterialsExtra ?? 0;
dept.PerforFee = dept.Income * dept.BasicFactor; dept.PerforFee = dept.Income * dept.BasicFactor;
//dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.OtherPerfor1 + dept.AssessBeforeOtherFee) ?? 0); //dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.OtherPerfor1 + dept.AssessBeforeOtherFee) ?? 0);
dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.AssessBeforeOtherFee) ?? 0); dept.PerforTotal = Math.Round((dept.PerforFee + dept.WorkloadFee + dept.AssessBeforeOtherFee) ?? 0);
...@@ -333,7 +336,7 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -333,7 +336,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
/// <param name="allot"></param> /// <param name="allot"></param>
/// <param name="excel"></param> /// <param name="excel"></param>
/// <param name="extras"></param> /// <param name="extras"></param>
public void ComputeOffice(per_allot allot, PerExcel excel, IEnumerable<AccountUnitTotal> extras) public void ComputeOffice(per_allot allot, PerExcel excel)
{ {
//取出科室 //取出科室
var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t); var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t);
...@@ -357,7 +360,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel, IEnumerable<AccountUn ...@@ -357,7 +360,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel, IEnumerable<AccountUn
if (!empolyees.Any()) continue; if (!empolyees.Any()) continue;
//科室奖罚汇总结果 //科室奖罚汇总结果
var extra = extras?.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == account.AccountingUnit)?.TotelValue; //var extra = extras?.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == account.AccountingUnit)?.TotelValue;
//var drugExtra = drugExtras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue; //var drugExtra = drugExtras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue;
//var materialsExtra = materialsExtras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue; //var materialsExtra = materialsExtras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue;
...@@ -369,9 +372,17 @@ public void ComputeOffice(per_allot allot, PerExcel excel, IEnumerable<AccountUn ...@@ -369,9 +372,17 @@ public void ComputeOffice(per_allot allot, PerExcel excel, IEnumerable<AccountUn
dept.ScoringAverage = resAccount?.ScoringAverage == null ? 0 : resAccount.ScoringAverage; dept.ScoringAverage = resAccount?.ScoringAverage == null ? 0 : resAccount.ScoringAverage;
dept.AdjustFactor = resAccount?.AdjustFactor == null ? 0 : resAccount.AdjustFactor; dept.AdjustFactor = resAccount?.AdjustFactor == null ? 0 : resAccount.AdjustFactor;
dept.Income = empolyees.Sum(w => w.PerforTotal ?? 0); dept.Income = empolyees.Sum(w => w.PerforTotal ?? 0);
dept.Extra = (extra ?? 0); //dept.Extra = (extra ?? 0);
dept.MedicineExtra = 0;// (drugExtra ?? 0); //dept.MedicineExtra = 0;// (drugExtra ?? 0);
dept.MaterialsExtra = 0;//(materialsExtra ?? 0); //dept.MaterialsExtra = 0;//(materialsExtra ?? 0);
dept.Extra = 0;
dept.MedicineExtra = resAccount?.MedicineExtra ?? 0;// (drugExtra ?? 0);
dept.MaterialsExtra = resAccount?.MaterialsExtra ?? 0;//(materialsExtra ?? 0);
dept.AssessBeforeOtherFee = resAccount?.AssessBeforeOtherFee ?? 0;
dept.AssessLaterOtherFee = resAccount?.AssessLaterOtherFee ?? 0;
dept.AdjustLaterOtherFee = resAccount?.AdjustLaterOtherFee ?? 0;
dept.PerforFee = empolyees.Sum(w => w.PerforTotal ?? 0); dept.PerforFee = empolyees.Sum(w => w.PerforTotal ?? 0);
dept.PerforTotal = Math.Round(empolyees.Sum(w => w.GiveFee ?? 0)); dept.PerforTotal = Math.Round(empolyees.Sum(w => w.GiveFee ?? 0));
dept.RealGiveFee = Math.Round(((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra) * dept.AdjustFactor) ?? 0); dept.RealGiveFee = Math.Round(((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra) * dept.AdjustFactor) ?? 0);
......
...@@ -73,8 +73,7 @@ public class ResultComputeService : IAutoInjection ...@@ -73,8 +73,7 @@ public class ResultComputeService : IAutoInjection
/// 计算最终数据 /// 计算最终数据
/// </summary> /// </summary>
/// <param name="excel"></param> /// <param name="excel"></param>
public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, List<PerSheet> accountSheet, public List<res_baiscnorm> Compute(per_allot allot, List<PerSheet> accountSheet)
IEnumerable<EmpolyeeTotal> employeeExtra)
{ {
//取出人员信息 //取出人员信息
var empolyeeList = perforImemployeeclinicRepository.GetEntities(t => t.AllotID == allot.ID); var empolyeeList = perforImemployeeclinicRepository.GetEntities(t => t.AllotID == allot.ID);
...@@ -83,7 +82,7 @@ public class ResultComputeService : IAutoInjection ...@@ -83,7 +82,7 @@ public class ResultComputeService : IAutoInjection
List<ComputeEmployee> computeEmployees = Mapper.Map<List<ComputeEmployee>>(empolyeeList); List<ComputeEmployee> computeEmployees = Mapper.Map<List<ComputeEmployee>>(empolyeeList);
logManageService.WriteMsg("正在生成绩效", "科室主任、护士长 最终绩效数据计算", 1, allot.ID, "ReceiveMessage"); logManageService.WriteMsg("正在生成绩效", "科室主任、护士长 最终绩效数据计算", 1, allot.ID, "ReceiveMessage");
var computResult = computeDirector.Compute(computeEmployees, accountSheet, allot, employeeExtra); var computResult = computeDirector.Compute(computeEmployees, accountSheet, allot);
//计算 绩效标准 基数(科主任、副主任、护士长 =>> 平均值) //计算 绩效标准 基数(科主任、副主任、护士长 =>> 平均值)
List<res_baiscnorm> baiscnormList = new List<res_baiscnorm>(); List<res_baiscnorm> baiscnormList = new List<res_baiscnorm>();
baiscNormService.ComputeAvg(baiscnormList, computeEmployees, computResult); baiscNormService.ComputeAvg(baiscnormList, computeEmployees, computResult);
...@@ -92,12 +91,12 @@ public class ResultComputeService : IAutoInjection ...@@ -92,12 +91,12 @@ public class ResultComputeService : IAutoInjection
var empolyeeList2 = perforImEmployeeRepository.GetEntities(t => t.AllotID == allot.ID); var empolyeeList2 = perforImEmployeeRepository.GetEntities(t => t.AllotID == allot.ID);
var computeEmployees2 = Mapper.Map<List<ComputeEmployee>>(empolyeeList2); var computeEmployees2 = Mapper.Map<List<ComputeEmployee>>(empolyeeList2);
logManageService.WriteMsg("正在生成绩效", "行政中高层 最终绩效数据计算", 1, allot.ID, "ReceiveMessage"); logManageService.WriteMsg("正在生成绩效", "行政中高层 最终绩效数据计算", 1, allot.ID, "ReceiveMessage");
var computResult2 = computeDirector.Compute(computeEmployees2, allot, baiscnormList, employeeExtra); var computResult2 = computeDirector.Compute(computeEmployees2, allot, baiscnormList);
var empolyeeList3 = perforImemployeelogisticsRepository.GetEntities(t => t.AllotID == allot.ID); var empolyeeList3 = perforImemployeelogisticsRepository.GetEntities(t => t.AllotID == allot.ID);
var computeEmployees3 = Mapper.Map<List<ComputeEmployee>>(empolyeeList3); var computeEmployees3 = Mapper.Map<List<ComputeEmployee>>(empolyeeList3);
logManageService.WriteMsg("正在生成绩效", "行政后勤 最终绩效数据计算", 1, allot.ID, "ReceiveMessage"); logManageService.WriteMsg("正在生成绩效", "行政后勤 最终绩效数据计算", 1, allot.ID, "ReceiveMessage");
var computResult3 = computeDirector.Compute(computeEmployees3, allot, baiscnormList, employeeExtra); var computResult3 = computeDirector.Compute(computeEmployees3, allot, baiscnormList);
//计算 行政中高层 平均值 //计算 行政中高层 平均值
baiscNormService.ComputeOtherAvg(baiscnormList, computResult2, empolyeeList2); baiscNormService.ComputeOtherAvg(baiscnormList, computResult2, empolyeeList2);
...@@ -122,9 +121,7 @@ public class ResultComputeService : IAutoInjection ...@@ -122,9 +121,7 @@ public class ResultComputeService : IAutoInjection
/// </summary> /// </summary>
/// <param name="excel"></param> /// <param name="excel"></param>
/// <param name="allot"></param> /// <param name="allot"></param>
public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscnorm> baiscnormList, public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscnorm> baiscnormList)
IEnumerable<AccountUnitTotal> accountExtras, IEnumerable<AccountUnitTotal> drugExtras, IEnumerable<AccountUnitTotal> materialsExtras,
IEnumerable<EmpolyeeTotal> employeeExtra)
{ {
var isBudget = budgetService.GetAdjustAndGrant(allot, out decimal adjust, out decimal grant); var isBudget = budgetService.GetAdjustAndGrant(allot, out decimal adjust, out decimal grant);
var typeList = EnumHelper.GetItems<PerforType>(); var typeList = EnumHelper.GetItems<PerforType>();
...@@ -170,9 +167,9 @@ public class ResultComputeService : IAutoInjection ...@@ -170,9 +167,9 @@ public class ResultComputeService : IAutoInjection
foreach (var item in accountDataList) foreach (var item in accountDataList)
{ {
//科室奖罚汇总结果 //科室奖罚汇总结果
var extra = accountExtras?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue; //var extra = accountExtras?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue;
var drugExtra = drugExtras?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue; //var drugExtra = drugExtras?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue;
var materialsExtra = materialsExtras?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue; //var materialsExtra = materialsExtras?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue;
//var scoreAverage = accountScoreAverages?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue; //var scoreAverage = accountScoreAverages?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue;
decimal? headcount = null; decimal? headcount = null;
...@@ -197,9 +194,13 @@ public class ResultComputeService : IAutoInjection ...@@ -197,9 +194,13 @@ public class ResultComputeService : IAutoInjection
//ScoringAverage = scoreAverage.HasValue ? scoreAverage : dept?.ScoringAverage, //ScoringAverage = scoreAverage.HasValue ? scoreAverage : dept?.ScoringAverage,
ScoringAverage = dept?.ScoringAverage ?? 1, ScoringAverage = dept?.ScoringAverage ?? 1,
//OtherPerfor = dept?.OtherPerfor1, //OtherPerfor = dept?.OtherPerfor1,
Punishment = (extra ?? 0), //Punishment = (extra ?? 0),
MedicineExtra = (drugExtra ?? 0), //MedicineExtra = (drugExtra ?? 0),
MaterialsExtra = (materialsExtra ?? 0), //MaterialsExtra = (materialsExtra ?? 0),
Punishment = 0,
MedicineExtra = dept?.MedicineExtra ?? 0,
MaterialsExtra = dept?.MaterialsExtra ?? 0,
Adjust = isBudget ? adjust : (dept?.AdjustFactor ?? 1), Adjust = isBudget ? adjust : (dept?.AdjustFactor ?? 1),
AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0, AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0,
...@@ -222,10 +223,10 @@ public class ResultComputeService : IAutoInjection ...@@ -222,10 +223,10 @@ public class ResultComputeService : IAutoInjection
foreach (var empolyee in empolyees) foreach (var empolyee in empolyees)
{ {
var extra = employeeExtra?.Where(w => !string.IsNullOrEmpty(w.AccountingUnit) && !string.IsNullOrEmpty(w.UnitType) //var extra = employeeExtra?.Where(w => !string.IsNullOrEmpty(w.AccountingUnit) && !string.IsNullOrEmpty(w.UnitType)
&& (!string.IsNullOrEmpty(w.EmployeeName) || !string.IsNullOrEmpty(w.JobNumber))) // && (!string.IsNullOrEmpty(w.EmployeeName) || !string.IsNullOrEmpty(w.JobNumber)))
.FirstOrDefault(w => w.AccountingUnit == empolyee.AccountingUnit && w.UnitType == empolyee.UnitType // .FirstOrDefault(w => w.AccountingUnit == empolyee.AccountingUnit && w.UnitType == empolyee.UnitType
&& w.JobNumber == empolyee.JobNumber && w.EmployeeName == empolyee.DoctorName)?.TotelValue; // && w.JobNumber == empolyee.JobNumber && w.EmployeeName == empolyee.DoctorName)?.TotelValue;
var avg = (group.Number == 0 ? 0 : (sumValue / group.Number)); var avg = (group.Number == 0 ? 0 : (sumValue / group.Number));
var empolyeeAdjust = isBudget ? adjust : empolyee.Adjust; var empolyeeAdjust = isBudget ? adjust : empolyee.Adjust;
var compute = new ComputeResult var compute = new ComputeResult
...@@ -239,7 +240,7 @@ public class ResultComputeService : IAutoInjection ...@@ -239,7 +240,7 @@ public class ResultComputeService : IAutoInjection
JobTitle = empolyee.JobTitle, JobTitle = empolyee.JobTitle,
ScoreAverageRate = empolyee.ScoreAverageRate, ScoreAverageRate = empolyee.ScoreAverageRate,
Punishment = extra ?? 0, Punishment = 0,
//OtherPerfor = empolyee.OtherPerfor, //OtherPerfor = empolyee.OtherPerfor,
OtherManagePerfor = empolyee.OtherManagePerfor, OtherManagePerfor = empolyee.OtherManagePerfor,
Number = group.Number, Number = group.Number,
......
...@@ -324,6 +324,7 @@ public void Generate(per_allot allot, string mail) ...@@ -324,6 +324,7 @@ public void Generate(per_allot allot, string mail)
var (list, mergeSheets) = processComputService.MergeCompute(excel, allot.ID); var (list, mergeSheets) = processComputService.MergeCompute(excel, allot.ID);
processComputService.Save(list, allot.ID); processComputService.Save(list, allot.ID);
#region 注释
////计算保底绩效参考标准(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效) ////计算保底绩效参考标准(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)
//logManageService.WriteMsg("计算保底绩效参考标准值", "正在保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("计算保底绩效参考标准值", "正在保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效", 1, allot.ID, "ReceiveMessage", true);
//var minimumBaiscnorm = processComputService.ComputeMinimum(excel, mergeSheets, allot.ID); //var minimumBaiscnorm = processComputService.ComputeMinimum(excel, mergeSheets, allot.ID);
...@@ -350,18 +351,18 @@ public void Generate(per_allot allot, string mail) ...@@ -350,18 +351,18 @@ public void Generate(per_allot allot, string mail)
//logManageService.WriteMsg("计算保底绩效参考标准值", "保存保底绩效参考标准", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("计算保底绩效参考标准值", "保存保底绩效参考标准", 1, allot.ID, "ReceiveMessage", true);
//perforResbaiscnormRepository.AddRange(minimumBaiscnorm.ToArray()); //perforResbaiscnormRepository.AddRange(minimumBaiscnorm.ToArray());
// 科室奖罚汇总 //// 科室奖罚汇总
logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true);
var accountExtras = processComputService.GetAccountExtra(excel, SheetType.AccountExtra, true); //var accountExtras = processComputService.GetAccountExtra(excel, SheetType.AccountExtra, true);
// 科室药占比考核 //// 科室药占比考核
logManageService.WriteMsg("正在生成绩效", "科室药占比考核", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "科室药占比考核", 1, allot.ID, "ReceiveMessage", true);
var drugExtras = processComputService.GetAccountExtra(excel, SheetType.AccountDrugAssess, true); //var drugExtras = processComputService.GetAccountExtra(excel, SheetType.AccountDrugAssess, true);
// 科室材料占比考核 //// 科室材料占比考核
logManageService.WriteMsg("正在生成绩效", "科室材料占比考核", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "科室材料占比考核", 1, allot.ID, "ReceiveMessage", true);
var materialsExtras = processComputService.GetAccountExtra(excel, SheetType.AccountMaterialsAssess, true); //var materialsExtras = processComputService.GetAccountExtra(excel, SheetType.AccountMaterialsAssess, true);
// 科室考核得分率 //// 科室考核得分率
logManageService.WriteMsg("正在生成绩效", "科室考核得分率", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "科室考核得分率", 1, allot.ID, "ReceiveMessage", true);
var accountScoreAverages = processComputService.GetAccountScoreAverage(excel, SheetType.AccountScoreAverage, true); //var accountScoreAverages = processComputService.GetAccountScoreAverage(excel, SheetType.AccountScoreAverage, true);
////科室药占比考核 ////科室药占比考核
//logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true);
...@@ -369,30 +370,31 @@ public void Generate(per_allot allot, string mail) ...@@ -369,30 +370,31 @@ public void Generate(per_allot allot, string mail)
////科室材料考核 ////科室材料考核
//logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true);
//var accountExtras = processComputService.GetAccountExtra(excel); //var accountExtras = processComputService.GetAccountExtra(excel);
#endregion
//重新计算科室业绩(含所有提供保底金额) //重新计算科室业绩(含所有提供保底金额)
logManageService.WriteMsg("正在生成绩效", "计算科室业绩分", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "计算科室业绩分", 1, allot.ID, "ReceiveMessage", true);
var sheetLast = processComputService.Compute(excel, mergeSheets, accountExtras, drugExtras, materialsExtras); var sheetLast = processComputService.Compute(excel, mergeSheets);
//保存计算过程数据 //保存计算过程数据
logManageService.WriteMsg("正在生成绩效", "保存科室业绩结果及计算过程中产生的数据", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "保存科室业绩结果及计算过程中产生的数据", 1, allot.ID, "ReceiveMessage", true);
processComputService.Save(sheetLast, allot.ID); processComputService.Save(sheetLast, allot.ID);
//业务中层行政中高层医院奖罚 ////业务中层行政中高层医院奖罚
logManageService.WriteMsg("正在生成绩效", "业务中层行政中高层医院奖罚", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "业务中层行政中高层医院奖罚", 1, allot.ID, "ReceiveMessage", true);
var employeeExtra = processComputService.GetEmployeeExtra(excel); //var employeeExtra = processComputService.GetEmployeeExtra(excel);
// 计算最总数据 // 计算最总数据
logManageService.WriteMsg("正在生成绩效", "计算最终绩效数据", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "计算最终绩效数据", 1, allot.ID, "ReceiveMessage", true);
var baiscnormList = resultComputeService.Compute(allot, excel, sheetLast, employeeExtra); var baiscnormList = resultComputeService.Compute(allot, sheetLast);
// 计算行政科室绩效 // 计算行政科室绩效
processComputService.ComputeOffice(allot, excel, accountExtras); processComputService.ComputeOffice(allot, excel);
// 计算特殊科室 // 计算特殊科室
logManageService.WriteMsg("正在生成绩效", "计算最终特殊科室绩效数据", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "计算最终特殊科室绩效数据", 1, allot.ID, "ReceiveMessage", true);
resultComputeService.SpecialUnitCompute(excel, allot, baiscnormList, accountExtras, drugExtras, materialsExtras, employeeExtra); resultComputeService.SpecialUnitCompute(excel, allot, baiscnormList);
logManageService.WriteMsg("正在生成绩效", "保存最终特殊科室绩效数据", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "保存最终特殊科室绩效数据", 1, allot.ID, "ReceiveMessage", true);
//保存 绩效人均参考标准 //保存 绩效人均参考标准
......
...@@ -748,23 +748,15 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -748,23 +748,15 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
groupbasis += 1; groupbasis += 1;
single = sheet.SheetName.Substring(0, 3); single = sheet.SheetName.Substring(0, 3);
Dictionary<SheetType, decimal?> pairs = new Dictionary<SheetType, decimal?>
{
{ SheetType.AccountExtra, account.Extra },
{ SheetType.AccountDrugAssess, account.MedicineExtra },
{ SheetType.AccountMaterialsAssess, account.MaterialsExtra },
};
var sheetName = new Regex("[0-9]*").Replace(sheet.SheetName, "", 5).Replace(".", "").Replace(" ", ""); var sheetName = new Regex("[0-9]*").Replace(sheet.SheetName, "", 5).Replace(".", "").Replace(" ", "");
var (sheettype, amount) = ClinicDepartmentDetail(persheet, account, basicData, sheet, type, sheetName); var (sheettype, amount) = ClinicDepartmentDetail(persheet, account, basicData, sheet, type, sheetName);
(sheettype, amount) = CommonDepartmentDetail(basicData, sheet, type, pairs, sheettype, amount); (sheettype, amount) = CommonDepartmentDetail(basicData, sheet, type, sheettype, amount);
var items = CommonDetailItems(basicData, headers, sheet, type); var items = CommonDetailItems(basicData, headers, sheet, type);
if (sheet.SheetType == (int)SheetType.Workload) if (sheet.SheetType == (int)SheetType.Workload)
{ {
if ((sheetName.Contains("医生") && account.UnitType == (int)UnitType.护理组) || (sheetName.Contains("护理") && account.UnitType != (int)UnitType.护理组)) continue; if ((sheetName.Contains("医生") && account.UnitType == (int)UnitType.护理组) || (sheetName.Contains("护理") && account.UnitType != (int)UnitType.护理组))
continue;
var workitems = cofworkitemRepository.GetEntities(t => t.AllotID == account.AllotID); var workitems = cofworkitemRepository.GetEntities(t => t.AllotID == account.AllotID);
var allotCmi = cofcmiRepository.GetEntity(t => t.AllotId == account.AllotID && t.UnitType == account.UnitType && t.AccountingUnit == account.AccountingUnit); var allotCmi = cofcmiRepository.GetEntity(t => t.AllotId == account.AllotID && t.UnitType == account.UnitType && t.AccountingUnit == account.AccountingUnit);
...@@ -829,26 +821,35 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -829,26 +821,35 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
return (sheettype, amount); return (sheettype, amount);
} }
private (int sheettype, decimal amount) CommonDepartmentDetail(List<im_data> basicData, per_sheet sheet, UnitType type, Dictionary<SheetType, decimal?> pairs, int sheettype = 1, decimal amount = 0) private (int sheettype, decimal amount) CommonDepartmentDetail(List<im_data> basicData, per_sheet sheet, UnitType type, int sheettype = 1, decimal amount = 0)
{ {
//var sheettype = 1; var amount = 0m; //var sheettype = 1; var amount = 0m;
if (pairs.ContainsKey((SheetType)sheet.SheetType)) //if (pairs.ContainsKey((SheetType)sheet.SheetType))
{ //{
sheettype = 5; // sheettype = 5;
amount = pairs[(SheetType)sheet.SheetType] ?? 0; // amount = pairs[(SheetType)sheet.SheetType] ?? 0;
} //}
else if (sheet.SheetType == (int)SheetType.AccountScoreAverage) //else if (sheet.SheetType == (int)SheetType.AccountScoreAverage)
//{
// sheettype = 8;
// amount = Math.Round(basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == (int)type && t.IsTotal == 1)?.FirstOrDefault()?.CellValue ?? 0, 4);
//}
//else if (sheet.SheetType == (int)SheetType.AccountAdjustLaterOtherFee)
//{
// sheettype = 9;
// amount = Math.Round(basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == (int)type && t.IsTotal == 1)?.FirstOrDefault()?.CellValue ?? 0, 0);
//}
SheetType[] pairs = new SheetType[]
{ {
sheettype = 8; SheetType.AccountDrugAssess, SheetType.AccountMaterialsAssess, SheetType.AccountScoreAverage, SheetType.AccountAdjustLaterOtherFee
amount = Math.Round(basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == (int)type && t.IsTotal == 1)?.FirstOrDefault()?.CellValue ?? 0, 4); };
} if (pairs.Contains((SheetType)sheet.SheetType))
else if (sheet.SheetType == (int)SheetType.AccountAdjustLaterOtherFee)
{ {
sheettype = 9; sheettype = 5;
amount = Math.Round(basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == (int)type && t.IsTotal == 1)?.FirstOrDefault()?.CellValue ?? 0, 0); amount = Math.Round(basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == (int)type && t.IsTotal == 1)?.FirstOrDefault()?.CellValue ?? 0, 0);
} }
return (sheettype, amount); return (sheettype, amount);
} }
...@@ -1035,13 +1036,7 @@ public DeptDataDetails DeptOfficeDetail(int accountId) ...@@ -1035,13 +1036,7 @@ public DeptDataDetails DeptOfficeDetail(int accountId)
foreach (var sheet in persheet.Where(t => t.SheetType == stype)) foreach (var sheet in persheet.Where(t => t.SheetType == stype))
{ {
groupBasis++; groupBasis++;
Dictionary<SheetType, decimal?> pairs = new Dictionary<SheetType, decimal?> var (sheettype, amount) = CommonDepartmentDetail(basicData, sheet, UnitType.行政后勤);
{
{ SheetType.AccountExtra, account.Extra },
{ SheetType.AccountDrugAssess, account.MedicineExtra },
{ SheetType.AccountMaterialsAssess, account.MaterialsExtra },
};
var (sheettype, amount) = CommonDepartmentDetail(basicData, sheet, UnitType.行政后勤, pairs);
var items = CommonDetailItems(basicData, headers, sheet, UnitType.行政后勤); var items = CommonDetailItems(basicData, headers, sheet, UnitType.行政后勤);
var sheetName = new Regex("[0-9]*").Replace(sheet.SheetName, "", 5).Replace(".", "").Replace(" ", ""); var sheetName = new Regex("[0-9]*").Replace(sheet.SheetName, "", 5).Replace(".", "").Replace(" ", "");
...@@ -1124,13 +1119,7 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second) ...@@ -1124,13 +1119,7 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
foreach (var sheet in persheet.Where(t => t.SheetType == stype)) foreach (var sheet in persheet.Where(t => t.SheetType == stype))
{ {
groupBasis++; groupBasis++;
Dictionary<SheetType, decimal?> pairs = new Dictionary<SheetType, decimal?> var (sheettype, amount) = CommonDepartmentDetail(basicData, sheet, UnitType.特殊核算组);
{
{ SheetType.AccountExtra, special.FirstOrDefault()?.Punishment },
{ SheetType.AccountDrugAssess, special.FirstOrDefault()?.MedicineExtra },
{ SheetType.AccountMaterialsAssess, special.FirstOrDefault()?.MaterialsExtra },
};
var (sheettype, amount) = CommonDepartmentDetail(basicData, sheet, UnitType.特殊核算组, pairs);
var items = CommonDetailItems(basicData, headers, sheet, UnitType.特殊核算组); var items = CommonDetailItems(basicData, headers, sheet, UnitType.特殊核算组);
var sheetName = new Regex("[0-9]*").Replace(sheet.SheetName, "", 5).Replace(".", "").Replace(" ", ""); var sheetName = new Regex("[0-9]*").Replace(sheet.SheetName, "", 5).Replace(".", "").Replace(" ", "");
......
...@@ -282,7 +282,7 @@ public class ComputeDirector : IAutoInjection ...@@ -282,7 +282,7 @@ public class ComputeDirector : IAutoInjection
/// <param name="nurseList"></param> /// <param name="nurseList"></param>
/// <param name="directorList"></param> /// <param name="directorList"></param>
/// <returns></returns> /// <returns></returns>
public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerSheet> accountSheet, per_allot allot, IEnumerable<EmpolyeeTotal> employeeExtra) public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerSheet> accountSheet, per_allot allot)
{ {
var basicRuleList = new[] var basicRuleList = new[]
{ {
...@@ -398,13 +398,13 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS ...@@ -398,13 +398,13 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS
Attendance = empolyee.Attendance ?? 0, Attendance = empolyee.Attendance ?? 0,
}; };
var extra = employeeExtra?.Where(w => !string.IsNullOrEmpty(w.AccountingUnit) && !string.IsNullOrEmpty(w.UnitType) //var extra = employeeExtra?.Where(w => !string.IsNullOrEmpty(w.AccountingUnit) && !string.IsNullOrEmpty(w.UnitType)
&& (!string.IsNullOrEmpty(w.EmployeeName) || !string.IsNullOrEmpty(w.JobNumber))) // && (!string.IsNullOrEmpty(w.EmployeeName) || !string.IsNullOrEmpty(w.JobNumber)))
.FirstOrDefault(w => w.AccountingUnit == empolyee.AccountingUnit && w.UnitType == empolyee.UnitType // .FirstOrDefault(w => w.AccountingUnit == empolyee.AccountingUnit && w.UnitType == empolyee.UnitType
&& w.JobNumber == empolyee.JobNumber && w.EmployeeName == empolyee.DoctorName)?.TotelValue; // && w.JobNumber == empolyee.JobNumber && w.EmployeeName == empolyee.DoctorName)?.TotelValue;
compute.Avg = avg * (empolyee.Basics ?? 0) * compute.Attendance; compute.Avg = avg * (empolyee.Basics ?? 0) * compute.Attendance;
compute.Punishment = extra ?? 0; compute.Punishment = 0;
// 考核前管理绩效 // 考核前管理绩效
compute.ShouldGiveFee = Math.Round((compute.Efficiency + compute.Scale) * compute.Grant + compute.OtherManagePerfor ?? 0); compute.ShouldGiveFee = Math.Round((compute.Efficiency + compute.Scale) * compute.Grant + compute.OtherManagePerfor ?? 0);
// 考核后管理绩效 // 考核后管理绩效
...@@ -441,7 +441,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS ...@@ -441,7 +441,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS
/// <param name="empolyeeList"></param> /// <param name="empolyeeList"></param>
/// <param name="baiscnormList"></param> /// <param name="baiscnormList"></param>
/// <returns></returns> /// <returns></returns>
public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot allot, List<res_baiscnorm> baiscnormList, IEnumerable<EmpolyeeTotal> employeeExtra) public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot allot, List<res_baiscnorm> baiscnormList)
{ {
////年资系数 ////年资系数
//var workyearList = perforCofworkyearRepository.GetEntities(t => t.AllotID == allot.ID); //var workyearList = perforCofworkyearRepository.GetEntities(t => t.AllotID == allot.ID);
...@@ -464,10 +464,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -464,10 +464,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
var perforTypeArray = EnumHelper.GetItems<PerforType>(); var perforTypeArray = EnumHelper.GetItems<PerforType>();
foreach (var item in needCompute) foreach (var item in needCompute)
{ {
// 奖罚汇总 //// 奖罚汇总
var extra = employeeExtra?.Where(w => !string.IsNullOrEmpty(w.AccountingUnit) && !string.IsNullOrEmpty(w.UnitType) && (!string.IsNullOrEmpty(w.EmployeeName) || !string.IsNullOrEmpty(w.JobNumber))) //var extra = employeeExtra?.Where(w => !string.IsNullOrEmpty(w.AccountingUnit) && !string.IsNullOrEmpty(w.UnitType) && (!string.IsNullOrEmpty(w.EmployeeName) || !string.IsNullOrEmpty(w.JobNumber)))
.FirstOrDefault(w => w.AccountingUnit == item.AccountingUnit && w.UnitType == item.AccountType && w.JobNumber == item.JobNumber && w.EmployeeName == item.DoctorName) // .FirstOrDefault(w => w.AccountingUnit == item.AccountingUnit && w.UnitType == item.AccountType && w.JobNumber == item.JobNumber && w.EmployeeName == item.DoctorName)
?.TotelValue; // ?.TotelValue;
var compute = new ComputeResult var compute = new ComputeResult
{ {
...@@ -482,7 +482,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -482,7 +482,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
PostCoefficient = item.PostCoefficient ?? 0, PostCoefficient = item.PostCoefficient ?? 0,
Attendance = item.Attendance ?? 0, Attendance = item.Attendance ?? 0,
ScoreAverageRate = item.ScoreAverageRate ?? 1, ScoreAverageRate = item.ScoreAverageRate ?? 1,
Punishment = extra ?? 0, Punishment = 0,
OtherPerfor = item.OtherPerfor ?? 0, OtherPerfor = item.OtherPerfor ?? 0,
JobTitle = item.JobTitle, JobTitle = item.JobTitle,
JobNumber = item.JobNumber, JobNumber = item.JobNumber,
...@@ -523,9 +523,9 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -523,9 +523,9 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
{ {
//考核前绩效 //考核前绩效
compute.PerforTotal = Math.Round(compute.BaiscNormValue * compute.PostCoefficient * compute.Attendance + compute.OtherPerfor ?? 0); compute.PerforTotal = Math.Round(compute.BaiscNormValue * compute.PostCoefficient * compute.Attendance + compute.OtherPerfor ?? 0);
//考核后绩效 没什么用也不显示 //考核后绩效 更加开关来控制显示
compute.GiveFee = compute.PerforTotal * compute.ScoreAverageRate; compute.GiveFee = compute.PerforTotal * compute.ScoreAverageRate;
//实发绩效 没什么用也不显示 //实发绩效 更加开关来控制显示
compute.RealGiveFee = Math.Round(compute.GiveFee * compute.Adjust ?? 0); compute.RealGiveFee = Math.Round(compute.GiveFee * compute.Adjust ?? 0);
} }
computeList.Add(compute); computeList.Add(compute);
......
...@@ -80,6 +80,8 @@ public class ExcelReadConfig ...@@ -80,6 +80,8 @@ public class ExcelReadConfig
new ColumnInfo(nameof(PerDataAccountBaisc.BasicFactor), "预算比例", true), new ColumnInfo(nameof(PerDataAccountBaisc.BasicFactor), "预算比例", true),
//new ColumnInfo(nameof(PerDataAccountBaisc.OtherPerfor1), "其他绩效1", true), //new ColumnInfo(nameof(PerDataAccountBaisc.OtherPerfor1), "其他绩效1", true),
new ColumnInfo(nameof(PerDataAccountBaisc.AssessBeforeOtherFee), "考核前其他绩效", true), new ColumnInfo(nameof(PerDataAccountBaisc.AssessBeforeOtherFee), "考核前其他绩效", true),
new ColumnInfo(nameof(PerDataAccountBaisc.MedicineExtra), "药占比奖罚", true),
new ColumnInfo(nameof(PerDataAccountBaisc.MaterialsExtra), "材料占比奖罚", true),
new ColumnInfo(nameof(PerDataAccountBaisc.ScoringAverage), "考核得分率", true), new ColumnInfo(nameof(PerDataAccountBaisc.ScoringAverage), "考核得分率", true),
new ColumnInfo(nameof(PerDataAccountBaisc.AssessLaterOtherFee), "考核后其他绩效", true), new ColumnInfo(nameof(PerDataAccountBaisc.AssessLaterOtherFee), "考核后其他绩效", true),
new ColumnInfo(nameof(PerDataAccountBaisc.AdjustFactor), "调节系数", true), new ColumnInfo(nameof(PerDataAccountBaisc.AdjustFactor), "调节系数", true),
......
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