Commit 7d93444f by lcx

全员绩效发放特殊科室调节系数、考核后绩效更改,二次绩效其他绩效人员科室与二次分配科室一致时带出其他绩效

parent 134f7930
......@@ -340,7 +340,7 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
MaterialsExtra = t.MaterialsExtra,
Extra = 0,
AssessLaterOtherFee = t.AssessLaterOtherFee,
AssessLaterPerforTotal = 0,
AssessLaterPerforTotal = Math.Round(((t.PerforTotal * t.ScoringAverage) ?? 0) + (t.MedicineExtra ?? 0) + (t.MaterialsExtra ?? 0) + (t.AssessLaterOtherFee ?? 0)),
AdjustFactor = t.Adjust,
AdjustLaterOtherFee = t.AdjustLaterOtherFee,
AssessLaterManagementFee = 0,
......@@ -387,11 +387,14 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
var aprAmounts = perapramountRepository.GetEntities(t => t.AllotId == allotId && t.Status == 3) ?? new List<per_apr_amount>();
var employees = perforPeremployeeRepository.GetEntities(t => t.AllotId == allotId) ?? new List<per_employee>();
var otherPerformances = aprAmounts.GroupJoin(employees, outer => new { outer.AccountingUnit, outer.PersonnelNumber }, inner => new { inner.AccountingUnit, inner.PersonnelNumber }, (outer, inner) => new
var otherPerformances = aprAmounts.Join(employees,
outer => new { outer.AccountingUnit, outer.PersonnelNumber },
inner => new { inner.AccountingUnit, inner.PersonnelNumber },
(outer, inner) => new
{
AccountingUnit = outer.AccountingUnit,
UnitType = inner?.FirstOrDefault(t => !string.IsNullOrEmpty(t.UnitType))?.UnitType,
PersonnelNumber = outer.PersonnelNumber,
UnitType = inner.UnitType,
PersonnelNumber = inner.PersonnelNumber,
PersonnelName = outer.DoctorName,
Amount = outer.Amount
})?.GroupBy(t => new { t.AccountingUnit, t.UnitType }).Select(t => new
......@@ -413,7 +416,7 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
MedicineExtra = t.Sum(group => group.MedicineExtra),
Extra = t.Sum(group => group.Extra),
AssessLaterOtherFee = t.Sum(group => group.AssessLaterOtherFee),
AdjustFactor = t.Sum(group => group.AdjustFactor),
AdjustFactor = t.Max(group => group.AdjustFactor),
AdjustLaterOtherFee = t.Sum(group => group.AdjustLaterOtherFee),
PerforTotal = t.Sum(group => group.PerforTotal),
AssessLaterPerforTotal = t.Sum(group => group.AssessLaterPerforTotal),
......@@ -621,7 +624,7 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i
comp.PerforSumFee = t.Avg;
}
// 行政工勤
if (types3.Contains(t.AccountType) && t.NeedSecondAllot.Trim() == "是")
if (types3.Contains(t.AccountType) && t.NeedSecondAllot?.Trim() == "是")
{
comp.PerforSumFee = t.GiveFee;
comp.AdjustLaterOtherFee = 0;
......
......@@ -811,34 +811,34 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
if (string.IsNullOrEmpty(item.WorkNumber))
{
var hasAmountData = perapramounts?.Where(w => w.AccountingUnit == item.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim() && w.DoctorName?.Trim() == item.Name?.Trim());
var hasAmountData = perapramounts?.Where(w => w.AccountingUnit == second.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim() && w.DoctorName?.Trim() == item.Name?.Trim());
if (hasAmountData == null || !hasAmountData.Any()) continue;
item.OtherPerformance = hasAmountData.Sum(w => w.Amount);
perapramounts.RemoveAll(w => w.AccountingUnit == item.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim() && w.DoctorName?.Trim() == item.Name?.Trim());
perapramounts.RemoveAll(w => w.AccountingUnit == second.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim() && w.DoctorName?.Trim() == item.Name?.Trim());
}
else
{
var hasAmountData = perapramounts?.Where(w => w.AccountingUnit == item.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim());
var hasAmountData = perapramounts?.Where(w => w.AccountingUnit == second.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim());
if (hasAmountData == null || !hasAmountData.Any()) continue;
item.OtherPerformance = hasAmountData.Sum(w => w.Amount);
perapramounts.RemoveAll(w => w.AccountingUnit == item.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim());
perapramounts.RemoveAll(w => w.AccountingUnit == second.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim());
}
}
else if (!string.IsNullOrEmpty(empl?.AccountingUnit))
{
if (string.IsNullOrEmpty(item.WorkNumber))
{
var hasAmountData = perapramounts?.Where(w => w.AccountingUnit == empl?.AccountingUnit && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim() && w.DoctorName?.Trim() == item.Name?.Trim());
var hasAmountData = perapramounts?.Where(w => w.AccountingUnit == second.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim() && w.DoctorName?.Trim() == item.Name?.Trim());
if (hasAmountData == null || !hasAmountData.Any()) continue;
item.OtherPerformance = hasAmountData.Sum(w => w.Amount);
perapramounts.RemoveAll(w => w.AccountingUnit == empl?.AccountingUnit && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim() && w.DoctorName?.Trim() == item.Name?.Trim());
perapramounts.RemoveAll(w => w.AccountingUnit == second.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim() && w.DoctorName?.Trim() == item.Name?.Trim());
}
else
{
var hasAmountData = perapramounts?.Where(w => w.AccountingUnit == empl?.AccountingUnit && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim());
var hasAmountData = perapramounts?.Where(w => w.AccountingUnit == second.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim());
if (hasAmountData == null || !hasAmountData.Any()) continue;
item.OtherPerformance = hasAmountData.Sum(w => w.Amount);
perapramounts.RemoveAll(w => w.AccountingUnit == empl?.AccountingUnit && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim());
perapramounts.RemoveAll(w => w.AccountingUnit == second.Department && w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim());
}
}
......
......@@ -1614,9 +1614,9 @@ private void SupplementSecondDetail(ag_secondallot second, List<per_employee> em
// return;
// 补充医院其他绩效 及 预留比例
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == second.AllotId && t.Status == 3);
Func<per_employee, decimal?> getAprAmount = (t) => second.Department == t.AccountingUnit ? perapramounts
?.Where(w => w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim())
?.Sum(w => w.Amount) : 0;
Func<per_employee, decimal?> getAprAmount = (t) => second.Department == t.AccountingUnit
? perapramounts?.Where(w => w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim())?.Sum(w => w.Amount)
: 0;
var distPerformance = rescomputeRepository.GetEntities(t => t.AllotID == second.AllotId && employees.Select(s => s.PersonnelNumber).Contains(t.JobNumber));
Func<per_employee, decimal?> getDistPerformance = (t) => 0;
......@@ -1708,7 +1708,8 @@ public void OtherSave(int secondId, SaveCollectData collectData)
{
var list = item.ToList();
Dictionary<string, object> dict = new Dictionary<string, object>();
parameters.ForEach(t => {
parameters.ForEach(t =>
{
dict.Add(t, list[parameters.IndexOf(t)]);
});
result.Add(dict);
......
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