Commit 6d21eeaf by lcx

collect返回数据根据行号排序

parent 3fddbdd4
......@@ -310,7 +310,7 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
List<HandsonRowData> rowDatas = null;
var collectdata = perforcollectdataRepository.GetEntities(w => w.SheetName == sheet.SheetName);
var collectdata = perforcollectdataRepository.GetEntities(w => w.SheetName == sheet.SheetName && w.AllotID == allotId);
if (collectdata != null)
{
Dictionary<string, string> config = null;
......@@ -326,7 +326,7 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
config = CollectDataConfig.Default;
rowDatas = new List<HandsonRowData>();
foreach (var rownumber in collectdata.Select(w => w.RowNumber).Distinct())
foreach (var rownumber in collectdata.Select(w => w.RowNumber).Distinct().OrderBy(t => t))
{
var first = collectdata.FirstOrDefault(w => w.RowNumber == rownumber);
var json = JsonHelper.Serialize(first);
......@@ -355,6 +355,10 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
rowDatas = GetCommonData(sheet);
}
rowDatas?.RemoveAll(t => !t.CellData.Any(w => !string.IsNullOrEmpty(w.Value?.ToString())));
if (rowDatas != null && rowDatas.Any())
rowDatas = rowDatas.OrderBy(t => t.Row).ToList();
HandsonTable handson = new HandsonTable(sheet.SheetType.Value, cols, permissions);
handson.SetRowData(rowDatas);
return handson;
......
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