BUG空值报错

parent 6061831b
......@@ -63,10 +63,8 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron
else
{
var executedContext = await next();
if (executedContext.Exception != null)
throw executedContext.Exception;
if (executedContext.Result is ObjectResult)
if (executedContext.Exception == null && executedContext.Result is ObjectResult)
{
_logger.LogInformation("响应结果" + JsonHelper.Serialize(executedContext.Result));
var objectResult = (ObjectResult)executedContext.Result;
......
......@@ -376,13 +376,13 @@ private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> head
if (employees == null || !employees.Any()) return list;
if (!string.IsNullOrEmpty(empName))
employees = employees?.Where(w => w.DoctorName.Trim() == empName.Trim()).ToList();
employees = employees?.Where(w => w.DoctorName?.Trim() == empName?.Trim()).ToList();
if (!string.IsNullOrEmpty(jobNumber))
employees = employees?.Where(w => w.PersonnelNumber.Trim() == jobNumber.Trim()).ToList();
employees = employees?.Where(w => w.PersonnelNumber?.Trim() == jobNumber?.Trim()).ToList();
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == allotId);
Func<per_employee, decimal?> getAprAmount = (t) => perapramounts
?.Where(w => w.DoctorName.Trim() == t.DoctorName.Trim() && w.PersonnelNumber.Trim() == t.PersonnelNumber.Trim())
?.Where(w => w.DoctorName?.Trim() == t.DoctorName?.Trim() && w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim())
?.Sum(w => w.Amount);
Dictionary<(string, string), Func<per_employee, object>> dict = new Dictionary<(string, string), Func<per_employee, object>>
......@@ -1360,6 +1360,11 @@ public List<ag_othersource> OtherList(int secondId, int userId)
var employees = personService.GetPersons(second.AllotId.Value, userId);
if (employees == null || !employees.Any()) return new List<ag_othersource>();
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == second.AllotId);
Func<per_employee, decimal?> getAprAmount = (t) => perapramounts
?.Where(w => w.DoctorName?.Trim() == t.DoctorName?.Trim() && w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim())
?.Sum(w => w.Amount);
return employees.Select(t => new ag_othersource
{
SecondId = secondId,
......@@ -1367,7 +1372,8 @@ public List<ag_othersource> OtherList(int secondId, int userId)
Name = t.DoctorName,
Department = t.Department,
WorkPost = t.JobTitle,
ReservedRatio = t.ReservedRatio
ReservedRatio = t.ReservedRatio,
OtherPerformance = getAprAmount(t)
}).ToList();
}
}
......
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