Commit ba1972d6 by lcx

全员发放补充数据

parent c1a948f2
...@@ -27,6 +27,7 @@ public class ComputeService : IAutoInjection ...@@ -27,6 +27,7 @@ public class ComputeService : IAutoInjection
private readonly PerforImemployeeRepository _perforImemployeeRepository; private readonly PerforImemployeeRepository _perforImemployeeRepository;
private readonly PerforPerallotRepository perforPerallotRepository; private readonly PerforPerallotRepository perforPerallotRepository;
private readonly PerforHospitalRepository hospitalRepository; private readonly PerforHospitalRepository hospitalRepository;
private readonly PerforPerapramountRepository perapramountRepository;
public ComputeService(PerforResaccountRepository perforResaccountRepository, public ComputeService(PerforResaccountRepository perforResaccountRepository,
PerforPersheetRepository perforPerSheetRepository, PerforPersheetRepository perforPerSheetRepository,
...@@ -40,7 +41,8 @@ public class ComputeService : IAutoInjection ...@@ -40,7 +41,8 @@ public class ComputeService : IAutoInjection
PerforImemployeeclinicRepository perforImemployeeclinicRepository, PerforImemployeeclinicRepository perforImemployeeclinicRepository,
PerforImemployeeRepository perforImemployeeRepository, PerforImemployeeRepository perforImemployeeRepository,
PerforPerallotRepository perforPerallotRepository, PerforPerallotRepository perforPerallotRepository,
PerforHospitalRepository hospitalRepository) PerforHospitalRepository hospitalRepository,
PerforPerapramountRepository perapramountRepository)
{ {
this.perforResaccountRepository = perforResaccountRepository; this.perforResaccountRepository = perforResaccountRepository;
this._perforPerSheetRepository = perforPerSheetRepository; this._perforPerSheetRepository = perforPerSheetRepository;
...@@ -55,6 +57,7 @@ public class ComputeService : IAutoInjection ...@@ -55,6 +57,7 @@ public class ComputeService : IAutoInjection
this._perforImemployeeRepository = perforImemployeeRepository; this._perforImemployeeRepository = perforImemployeeRepository;
this.perforPerallotRepository = perforPerallotRepository; this.perforPerallotRepository = perforPerallotRepository;
this.hospitalRepository = hospitalRepository; this.hospitalRepository = hospitalRepository;
this.perapramountRepository = perapramountRepository;
} }
public int IsShowManage(int allotId) public int IsShowManage(int allotId)
...@@ -396,7 +399,7 @@ public List<ComputeResponse> AllCompute(int allotId) ...@@ -396,7 +399,7 @@ public List<ComputeResponse> AllCompute(int allotId)
RealGiveFee = t.fee RealGiveFee = t.fee
}).OrderByDescending(t => t.AccountingUnit)); }).OrderByDescending(t => t.AccountingUnit));
} }
return list; return AddAprAmount(allotId, list);
} }
/// <summary> /// <summary>
...@@ -444,7 +447,7 @@ public List<ComputeResponse> AllManageCompute(int allotId) ...@@ -444,7 +447,7 @@ public List<ComputeResponse> AllManageCompute(int allotId)
RealGiveFee = t.fee RealGiveFee = t.fee
}).OrderByDescending(t => t.AccountingUnit)); }).OrderByDescending(t => t.AccountingUnit));
} }
return list; return AddAprAmount(allotId, list);
} }
public res_compute GetComputeSingle(int computeid) public res_compute GetComputeSingle(int computeid)
...@@ -587,5 +590,52 @@ public int GetAccountId(int secondId) ...@@ -587,5 +590,52 @@ public int GetAccountId(int secondId)
} }
return 0; return 0;
} }
/// <summary>
/// 添加额外绩效金额(基础绩效、其他绩效等)
/// </summary>
/// <param name="allotId"></param>
/// <param name="computes"></param>
private List<ComputeResponse> AddAprAmount(int allotId, List<ComputeResponse> computes)
{
if (computes == null || !computes.Any())
return computes;
var list = perapramountRepository.GetEntities(t => t.AllotId == allotId);
if (list == null || !list.Any())
return computes;
var source = new string[] { "一次绩效", "二次绩效" };
foreach (var item in list.Where(t => t.Amount.HasValue))
{
var flag = false;
foreach (var s in source)
{
if (flag) continue;
var emp = computes.FirstOrDefault(t => t.Source == s && t.JobNumber == item.PersonnelNumber && t.EmployeeName == item.DoctorName);
if (emp != null)
{
emp.RealGiveFee += item.Amount;
flag = true;
continue;
}
emp = computes.FirstOrDefault(t => t.Source == s && t.JobNumber == item.PersonnelNumber);
if (emp != null)
{
emp.RealGiveFee += item.Amount;
flag = true;
continue;
}
emp = computes.FirstOrDefault(t => t.Source == s && t.EmployeeName == item.DoctorName);
if (emp != null)
{
emp.RealGiveFee += item.Amount;
flag = true;
continue;
}
}
}
return computes;
}
} }
} }
...@@ -429,7 +429,7 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account ...@@ -429,7 +429,7 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account
allExtract.AddRange(result); allExtract.AddRange(result);
} }
logger.LogInformation($"{sheet.SheetName}合计值为: " + allExtract.Sum(t => t.Value)); logger.LogInformation($"{sheet.SheetName}合计值为: " + allExtract?.Sum(t => t.Value));
var category = allExtract.Select(t => t.Category).Distinct().ToList(); var category = allExtract.Select(t => t.Category).Distinct().ToList();
WriteIncomeHeaderAndFactor(sheet, sheetRead, category, isNewTemp); WriteIncomeHeaderAndFactor(sheet, sheetRead, category, isNewTemp);
...@@ -507,8 +507,10 @@ private void WriteWorkload(ISheet sheet, IPerSheetDataRead sheetRead, List<Accou ...@@ -507,8 +507,10 @@ private void WriteWorkload(ISheet sheet, IPerSheetDataRead sheetRead, List<Accou
if (config == null) continue; if (config == null) continue;
var result = QueryDatabase(config, item, Allot, moditem.ItemName); var result = QueryDatabase(config, item, Allot, moditem.ItemName);
if (result != null) if (result != null)
{
allExtract.AddRange(result); allExtract.AddRange(result);
logger.LogInformation($"{module.ModuleName}提取{moditem.ItemName}的合计值为: " + result.Sum(t => t.Value)); logger.LogInformation($"{module.ModuleName}提取{moditem.ItemName}的合计值为: " + result.Sum(t => t.Value));
}
} }
} }
......
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