Commit c80be479 by 钟博

优化下拉查询时间

parent 59cc4010
...@@ -181,14 +181,16 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d ...@@ -181,14 +181,16 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
int imDataAllotId = prevAllotList.FirstOrDefault(t => new int[] { 6, 8, 10 }.Contains(t.States))?.ID ?? 0; int imDataAllotId = prevAllotList.FirstOrDefault(t => new int[] { 6, 8, 10 }.Contains(t.States))?.ID ?? 0;
var imData = imdataRepository.GetEntities(t => t.AllotID == imDataAllotId && sheetId.Contains(t.SheetID.Value)); var unitValue = EnumHelper.GetItems<UnitType>().Find(t => t.Name == detail.UnitType)?.Value;
var imData = imdataRepository.GetEntities(t => t.AllotID == imDataAllotId && sheetId.Contains(t.SheetID.Value) && t.UnitType == unitValue);
if (imData == null || !imData.Any()) return common; if (imData == null || !imData.Any()) return common;
var commons = new List<Common>(); var commons = new List<Common>();
var unitValue = EnumHelper.GetItems<UnitType>().Find(t => t.Name == detail.UnitType)?.Value;
if (imData != null && imData.Any(t => t.UnitType == unitValue)) if (imData != null && imData.Any())
{ {
var datas = from im in imData.Where(t => t.UnitType == unitValue) var datas = from im in imData
group im by new { im.SheetID, im.TypeName, im.FactorValue } into i group im by new { im.SheetID, im.TypeName, im.FactorValue } into i
select new { i.Key, i }; select new { i.Key, i };
commons = datas.Select(t => new Common commons = datas.Select(t => new Common
......
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