Commit 3c20253c by lcx

自动匹配根据员工工号、核算单元、核算单元类型进行匹配

parent e72ad6a3
......@@ -413,7 +413,6 @@ private void SupplementFixedData(ag_secondallot secondAllot, List<BodyItem> body
{
{ "发放月份", $"{secondAllot.Year}{secondAllot.Month.ToString().PadLeft(2, '0')}月" },
{ "可分配绩效", secondAllot.RealGiveFee.ToString() },
{ "满勤天数", DateTime.DaysInMonth(secondAllot.Year.Value, secondAllot.Month.Value).ToString() },
};
var pairs = new Dictionary<string, string>
......@@ -468,6 +467,10 @@ private void SupplementFixedData(ag_secondallot secondAllot, List<BodyItem> body
if (field != null && !string.IsNullOrEmpty(item.Value))
field.Value = item.Value;
}
var days = bodyItems.FirstOrDefault(w => w.RowNumber == -1 && w.FiledName == "满勤天数");
if (days != null && string.IsNullOrEmpty(days.Value))
days.Value = DateTime.DaysInMonth(secondAllot.Year.Value, secondAllot.Month.Value).ToString();
}
/// <summary>
......
......@@ -196,7 +196,7 @@ private void SupplementOtherPerfor(ag_secondallot secondAllot, List<ag_bodysourc
var hasAmountData = perapramounts?.Where(w => w.PersonnelNumber?.Trim() == rowitem.WorkNumber?.Trim());
if (hasAmountData == null || !hasAmountData.Any()) continue;
rowitem.OtherPerformance = secondAllot.Department == employee.AccountingUnit ? hasAmountData.Sum(w => w.Amount) : 0;
rowitem.OtherPerformance = secondAllot.Department == employee.AccountingUnit && secondAllot.UnitType == employee.UnitType ? hasAmountData.Sum(w => w.Amount) : 0;
perapramounts.RemoveAll(w => w.PersonnelNumber?.Trim() == rowitem.WorkNumber?.Trim());
}
......@@ -367,8 +367,8 @@ public JArray AutoComplete(int secodId, string workNumber)
if (usetemp == null)
throw new PerformanceException("当前科室暂未配置绩效模板");
var employees = peremployeeRepository.GetEntities(t => t.AllotId == allot.ID && t.UnitType == second.UnitType && !string.IsNullOrEmpty(t.PersonnelNumber)
&& t.PersonnelNumber.IndexOf(workNumber) > -1)?.OrderBy(t => t.PersonnelNumber).ThenByDescending(t => t.DoctorName).ToList();
var employees = peremployeeRepository.GetEntities(t => t.AllotId == allot.ID && !string.IsNullOrEmpty(t.PersonnelNumber) && t.PersonnelNumber.IndexOf(workNumber) > -1)
?.OrderBy(t => t.PersonnelNumber).ThenByDescending(t => t.DoctorName).ToList();
if (employees == null || !employees.Any()) return new JArray();
var bodysources = new List<ag_bodysource>();
......
......@@ -437,9 +437,9 @@ private List<BodyItem> GetEmployees(List<per_employee> employees, ag_secondallot
employees = employees?.Where(w => !string.IsNullOrEmpty(w.PersonnelNumber) && w.PersonnelNumber.Trim() == jobNumber.Trim()).ToList();
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 && second.UnitType == t.UnitType
? perapramounts?.Where(w => w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim())?.Sum(w => w.Amount)
: 0;
Dictionary<(string, string), Func<per_employee, object>> dict = new Dictionary<(string, string), Func<per_employee, object>>
{
......@@ -1928,7 +1928,7 @@ 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
Func<per_employee, decimal?> getAprAmount = (t) => second.Department == t.AccountingUnit && second.UnitType == t.UnitType
? perapramounts?.Where(w => w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim())?.Sum(w => w.Amount)
: 0;
......
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