Commit 8798741c by 李承祥

排序

parent 35815337
......@@ -96,7 +96,7 @@ public List<res_specialunit> GetSpecial(int allotId)
public List<DeptResponse> GetDoctorPerformance(int allotId)
{
List<int> types = new List<int> { (int)UnitType.医生组, (int)UnitType.医技组 };
var list = perforResaccountRepository.GetEntities(t => types.Contains(t.UnitType.Value) && t.AllotID == allotId)?.OrderByDescending(t => t.AccountingUnit);
var list = perforResaccountRepository.GetEntities(t => types.Contains(t.UnitType.Value) && t.AllotID == allotId)?.OrderBy(t => t.UnitType).ThenByDescending(t => t.AccountingUnit);
List<DeptResponse> doctor = Mapper.Map<List<DeptResponse>>(list);
doctor?.ForEach(t => t.UnitName = ((UnitType)t.UnitType).ToString());
return doctor;
......@@ -109,7 +109,7 @@ public List<DeptResponse> GetDoctorPerformance(int allotId)
/// <returns></returns>
public List<DeptResponse> GetNursePerformance(int allotId)
{
var list = perforResaccountRepository.GetEntities(t => t.UnitType == (int)UnitType.护理组 && t.AllotID == allotId)?.OrderByDescending(t => t.AccountingUnit);
var list = perforResaccountRepository.GetEntities(t => t.UnitType == (int)UnitType.护理组 && t.AllotID == allotId)?.OrderBy(t => t.UnitType).ThenByDescending(t => t.AccountingUnit);
List<DeptResponse> nurse = Mapper.Map<List<DeptResponse>>(list);
nurse?.ForEach(t => t.UnitName = ((UnitType)t.UnitType).ToString());
return nurse;
......@@ -123,7 +123,7 @@ public List<DeptResponse> GetNursePerformance(int allotId)
public List<DeptResponse> GetOtherPerformance(int allotId)
{
var unitType = new List<int> { (int)UnitType.其他组, (int)UnitType.专家组 };
var list = perforResaccountRepository.GetEntities(t => unitType.Contains(t.UnitType.Value) && t.AllotID == allotId)?.OrderByDescending(t => t.AccountingUnit);
var list = perforResaccountRepository.GetEntities(t => unitType.Contains(t.UnitType.Value) && t.AllotID == allotId)?.OrderBy(t => t.UnitType).ThenByDescending(t => t.AccountingUnit);
List<DeptResponse> other = Mapper.Map<List<DeptResponse>>(list);
other?.ForEach(t => t.UnitName = ((UnitType)t.UnitType).ToString());
return other;
......
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