Commit 7d93444f by lcx

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

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