人均绩效

parent 109494f0
......@@ -212,9 +212,15 @@ public ApiResponse AllComputeAvg([FromBody] ComputerRequest request)
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
List<res_baiscnorm> avgs = new List<res_baiscnorm>();
var isShowManage = _computeService.IsShowManage(request.AllotId);
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>();
......
......@@ -212,14 +212,14 @@ public List<res_baiscnorm> AllComputeAvg(int allotId, List<ComputeResponse> list
{
List<res_baiscnorm> avgs = new List<res_baiscnorm>();
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)
{
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
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
{
PositionName = item,
......
......@@ -1519,7 +1519,7 @@ public List<ag_othersource> OtherAutoComplete(SecondEmpRequest request, int user
if (!string.IsNullOrEmpty(request.EmployeeName))
employees = employees?.Where(w => w.DoctorName?.Trim() == request.EmployeeName?.Trim()).ToList();
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
.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