共用核算单元调整

parent 0abed487
......@@ -2367,6 +2367,11 @@
变更日志
</summary>
</member>
<member name="P:Performance.EntityModels.res_compute.Remark">
<summary>
</summary>
</member>
<member name="T:Performance.EntityModels.res_specialunit">
<summary>
......
......@@ -126,6 +126,7 @@ public class ComputeResult
public decimal? Adjust { get; set; }
public string UnitType { get; set; }
public string Remark { get; set; }
///// <summary>
///// 工作量绩效
......
......@@ -160,5 +160,10 @@ public class res_compute
/// 变更日志
/// </summary>
public string ChangeLog { get; set; }
/// <summary>
///
/// </summary>
public string Remark { get; set; }
}
}
......@@ -293,30 +293,45 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_
dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number);
}
var multi = atDataList.GroupBy(t => new { t.UnitType, t.AccountingUnit })
.Select(t => new
{
UnitType = t.Key.UnitType,
AccountingUnit = t.Key.AccountingUnit,
Count = t.Count(),
RealGiveFee = t.Sum(p => p.RealGiveFee),
PerforTotal = t.Sum(p => p.PerforTotal),
Avg = t.Sum(p => p.ManagerNumber + p.Number) == 0 ? 0 : t.Sum(p => p.RealGiveFee) / t.Sum(p => p.ManagerNumber + p.Number)
})
.Where(t => t.Count > 1).ToArray();
.Select(t => new { t.Key.UnitType, t.Key.AccountingUnit, Count = t.Count(), })
.Where(t => t.Count > 1);
if (multi != null && multi.Any())
{
foreach (var item in atDataList)
{
if (multi.Any(group => group.UnitType == item.UnitType && group.AccountingUnit == item.AccountingUnit))
{
item.Avg = multi.FirstOrDefault(group => group.AccountingUnit == item.AccountingUnit).Avg;
item.RealGiveFee = multi.FirstOrDefault(group => group.AccountingUnit == item.AccountingUnit).RealGiveFee;
item.PerforTotal = multi.FirstOrDefault(group => group.AccountingUnit == item.AccountingUnit).PerforTotal;
item.Remark = "特殊科室,共用核算单元";
}
}
}
//共用核算单元算法调整20190920新都调整
//var multi = atDataList.GroupBy(t => new { t.UnitType, t.AccountingUnit })
// .Select(t => new
// {
// UnitType = t.Key.UnitType,
// AccountingUnit = t.Key.AccountingUnit,
// Count = t.Count(),
// RealGiveFee = t.Sum(p => p.RealGiveFee),
// PerforTotal = t.Sum(p => p.PerforTotal),
// Avg = t.Sum(p => p.ManagerNumber + p.Number) == 0 ? 0 : t.Sum(p => p.RealGiveFee) / t.Sum(p => p.ManagerNumber + p.Number)
// })
// .Where(t => t.Count > 1).ToArray();
//if (multi != null && multi.Any())
//{
// foreach (var item in atDataList)
// {
// if (multi.Any(group => group.UnitType == item.UnitType && group.AccountingUnit == item.AccountingUnit))
// {
// item.Avg = multi.FirstOrDefault(group => group.AccountingUnit == item.AccountingUnit).Avg;
// item.RealGiveFee = multi.FirstOrDefault(group => group.AccountingUnit == item.AccountingUnit).RealGiveFee;
// item.PerforTotal = multi.FirstOrDefault(group => group.AccountingUnit == item.AccountingUnit).PerforTotal;
// item.Remark = "特殊科室,共用核算单元";
// }
// }
//}
sheet.PerData.AddRange(atDataList);
}
......
......@@ -151,6 +151,9 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
{
dataList.AddRange(AutoMapper.Mapper.Map<List<res_account>>(account.PerData.Select(t => (PerDataAccountBaisc)t)));
}
var multi = accountbasicList.GroupBy(t => new { t.UnitType, t.DoctorAccountingUnit })
.Select(t => new { t.Key.UnitType, t.Key.DoctorAccountingUnit, Count = t.Count(), })
.Where(t => t.Count > 1);
List<ComputeResult> computeList = new List<ComputeResult>();
foreach (var accountbasic in accountbasicList)
{
......@@ -158,11 +161,18 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
// continue;
if (!accountbasic.DoctorDirectorNumber.HasValue || accountbasic.DoctorDirectorNumber.Value == 0)
continue;
//原不存在科主任则跳过科主任绩效计算20190920新都
//是否共用核算单元
var isShare = multi.Any(group => group.UnitType == accountbasic.UnitType && group.DoctorAccountingUnit == accountbasic.DoctorAccountingUnit);
if (isShare
&& accountbasic.DoctorDirectorNumber.HasValue && accountbasic.DoctorDirectorNumber.Value < 1
&& accountbasic.Department != accountbasic.DoctorAccountingUnit)
continue;
//分别取出对应的 计算 人员 平均值等信息
var resAccount = dataList.Where(t => t.UnitType == accountbasic.UnitType && t.AccountingUnit == accountbasic.DoctorAccountingUnit);
var number = resAccount.OrderByDescending(t => t.ManagerNumber).Sum(t => t.ManagerNumber + t.Number);
var perforTotal = resAccount.Max(t => t.PerforTotal);
var avg = resAccount.Max(t => t.Avg);
var perforTotal = resAccount.Sum(t => t.PerforTotal);
var avg = resAccount.Average(t => t.Avg);
var basicRule = basicRuleList.FirstOrDefault(t => t.UnitType == (UnitType)accountbasic.UnitType);
if (basicRule == null) continue;
......@@ -201,6 +211,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
Efficiency = avg * (accountbasic.DoctorEffic ?? 1),
Scale = perforTotal * (accountbasic.DoctorScale ?? 1),
Adjust = empolyee.Adjust,
Remark = isShare ? "特殊科室主任,共用核算单元" : ""
};
//应发管理绩效
compute.ShouldGiveFee = (compute.Efficiency + compute.Scale) * accountbasic.DoctorGrant;
......
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