Commit edfe9a03 by lcx

获取绩效列表数据时,如果不存在,返回空列表

parent a2471c96
...@@ -567,10 +567,10 @@ private per_allot PrevAllot(int hospitalId, int allotId) ...@@ -567,10 +567,10 @@ private per_allot PrevAllot(int hospitalId, int allotId)
private List<per_allot> PrevAllotList(int hospitalId, int allotId) private List<per_allot> PrevAllotList(int hospitalId, int allotId)
{ {
var allotList = perallotRepository.GetEntities(w => w.HospitalId == hospitalId)?.OrderBy(s => s.Year).ThenBy(s => s.Month).ToList(); var allotList = perallotRepository.GetEntities(w => w.HospitalId == hospitalId)?.OrderBy(s => s.Year).ThenBy(s => s.Month).ToList();
if (allotList == null || !allotList.Any()) throw new PerformanceException("未查询到符合的绩效记录"); if (allotList == null || !allotList.Any()) return new List<per_allot>();
var allot = allotList.FirstOrDefault(w => w.ID == allotId); var allot = allotList.FirstOrDefault(w => w.ID == allotId);
if (allot == null) throw new PerformanceException("未查询到符合的绩效记录"); if (allot == null) return new List<per_allot>();
return allotList.Where(t => t.Year <= allot.Year && t.Month <= allot.Month)?.ToList(); return allotList.Where(t => t.Year <= allot.Year && t.Month <= allot.Month)?.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