update: 获取轨迹模板内容,增加按排序键排序逻辑
This commit is contained in:
parent
750e96d7cf
commit
c27e55b69f
@ -54,4 +54,9 @@ public class TemplateContentDtoVo
|
||||
/// 轨迹节点
|
||||
/// </summary>
|
||||
public string Node { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序键
|
||||
/// </summary>
|
||||
public int Sort { get; set; }
|
||||
}
|
||||
|
||||
@ -214,7 +214,8 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
ContentCn = b.Content,
|
||||
ContentEn = b.EnContent,
|
||||
Status = c.Status,
|
||||
Node = d.NodeName
|
||||
Node = d.NodeName,
|
||||
Sort = a.Sort
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
@ -222,7 +223,8 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
{
|
||||
var templateContents = contents.Where(x => x.TemplateId == template.Id).ToList();
|
||||
|
||||
template.TemplateContents = templateContents;
|
||||
//根据排序键排序
|
||||
template.TemplateContents = templateContents.OrderBy(x => x.Sort).ToList();
|
||||
}
|
||||
|
||||
return templates;
|
||||
@ -262,10 +264,13 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
ContentCn = b.Content,
|
||||
ContentEn = b.EnContent,
|
||||
Status = c.Status,
|
||||
Node = d.NodeName
|
||||
Node = d.NodeName,
|
||||
Sort = a.Sort
|
||||
})
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
|
||||
//返回轨迹模板内容时按排序键排序
|
||||
contents.List = contents.List.OrderBy(x => x.Sort).ToList();
|
||||
return contents;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user