用户列表防区管理

This commit is contained in:
yanghongwei 2025-06-15 18:40:58 +08:00
parent b21479beed
commit bca6baef65
2 changed files with 12 additions and 0 deletions

View File

@ -46,6 +46,11 @@ namespace LY.App.Model
/// </summary>
[SugarColumn(ColumnName = "position_id", ColumnDescription = "阵地ids", IsJson = true)]
public List<long> positionId { get; set; }
[SugarColumn(IsIgnore = true)]
/// <summary>
/// 用户关键防区名称数组
/// </summary>
public List<string> positionName { get; set; }
}
public class AddUser
{

View File

@ -208,6 +208,13 @@ namespace LY.App.Service
.WhereIF(!string.IsNullOrEmpty(key), s => s.Name.Contains(key))
.OrderBy(s => s.Id)
.ToPageListAsync(pageNum, pageSize, total);
query.ForEach(s =>
{
if (s.positionId is not null && s.positionId.Any())
{
s.positionName= _db.Queryable<PositionInfo>().Where(p =>s.positionId.Contains(p.Id)).Select(p => p.Name).ToList();
}
});
return new
{
total = total.Value,