人均绩效

parent 109494f0
...@@ -212,9 +212,15 @@ public ApiResponse AllComputeAvg([FromBody] ComputerRequest request) ...@@ -212,9 +212,15 @@ public ApiResponse AllComputeAvg([FromBody] ComputerRequest request)
var allot = _allotService.GetAllot(request.AllotId); var allot = _allotService.GetAllot(request.AllotId);
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
List<res_baiscnorm> avgs = new List<res_baiscnorm>();
var isShowManage = _computeService.IsShowManage(request.AllotId); var isShowManage = _computeService.IsShowManage(request.AllotId);
var list = _computeService.AllCompute(request.AllotId, isShowManage); var list = _computeService.AllCompute(request.AllotId, isShowManage);
List<res_baiscnorm> avgs = _computeService.AllComputeAvg(request.AllotId,list);
if (list != null)
{
avgs = _computeService.AllComputeAvg(request.AllotId, list);
}
//List<res_baiscnorm> avgs = new List<res_baiscnorm>(); //List<res_baiscnorm> avgs = new List<res_baiscnorm>();
......
...@@ -212,14 +212,14 @@ public List<res_baiscnorm> AllComputeAvg(int allotId, List<ComputeResponse> list ...@@ -212,14 +212,14 @@ public List<res_baiscnorm> AllComputeAvg(int allotId, List<ComputeResponse> list
{ {
List<res_baiscnorm> avgs = new List<res_baiscnorm>(); List<res_baiscnorm> avgs = new List<res_baiscnorm>();
var emps = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId); var emps = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId);
var jobCategory = emps.Select(w => string.IsNullOrEmpty(w.JobCategory) ? "未知" : w.JobCategory).Distinct(); var jobCategory = emps?.Select(w => string.IsNullOrEmpty(w.JobCategory) ? "未知" : w.JobCategory).Distinct() ?? new List<string>();
foreach (var item in jobCategory) foreach (var item in jobCategory)
{ {
var sumfee = (from com in list var sumfee = (from com in list
join emp in emps.Where(w => w.JobCategory == item) join emp in emps?.Where(w => w.JobCategory == item)
on com.JobNumber equals emp.PersonnelNumber on com.JobNumber equals emp.PersonnelNumber
select com.ShouldGiveFee).Sum(w => w); select com.ShouldGiveFee).Sum(w => w);
var count = emps.Where(w => w.JobCategory == item).Select(emp => emp.PersonnelNumber).Distinct().Count(); var count = emps?.Where(w => w.JobCategory == item).Select(emp => emp.PersonnelNumber).Distinct().Count() ?? 0;
avgs.Add(new res_baiscnorm avgs.Add(new res_baiscnorm
{ {
PositionName = item, PositionName = item,
......
...@@ -1519,7 +1519,7 @@ public List<ag_othersource> OtherAutoComplete(SecondEmpRequest request, int user ...@@ -1519,7 +1519,7 @@ public List<ag_othersource> OtherAutoComplete(SecondEmpRequest request, int user
if (!string.IsNullOrEmpty(request.EmployeeName)) if (!string.IsNullOrEmpty(request.EmployeeName))
employees = employees?.Where(w => w.DoctorName?.Trim() == request.EmployeeName?.Trim()).ToList(); employees = employees?.Where(w => w.DoctorName?.Trim() == request.EmployeeName?.Trim()).ToList();
if (!string.IsNullOrEmpty(request.JobNumber)) if (!string.IsNullOrEmpty(request.JobNumber))
employees = employees?.Where(w => !string.IsNullOrEmpty(w.PersonnelNumber) && w.PersonnelNumber.Contains(request.JobNumber.Trim())).ToList(); employees = employees?.Where(w => !string.IsNullOrEmpty(w.PersonnelNumber) && w.PersonnelNumber == request.JobNumber.Trim()).ToList();
List<ag_othersource> result = employees List<ag_othersource> result = employees
.Select(t => new ag_othersource .Select(t => new ag_othersource
......
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