This commit is contained in:
tanglong 2026-04-02 13:53:26 +08:00
parent 24d6349a22
commit 04165aacc7
3 changed files with 18 additions and 17 deletions

View File

@ -39,7 +39,9 @@ namespace YD_YiLu.Api.Controllers
dto.PageSize = 10;
if (dto.PageIndex < 1)
dto.PageIndex = 1;
return await _deviceSyncService.UserPageAsync(dto);
var res = await _deviceSyncService.UserPageAsync(dto);
return res;
}
/// <summary>

View File

@ -22,11 +22,10 @@ namespace YD_YiLu.Api.Services.Impl
public async Task<int?> GetOrgIdByDeviceAsync(string deviceSerial)
{
var device = await _context.YL_Device.FirstOrDefaultAsync(x =>
x.AndroidId == deviceSerial || x.SerialNumber == deviceSerial);
if (device?.OrgId != null) return device.OrgId;
var school = await _context.School.FirstOrDefaultAsync();
return school?.Id;
var device = await _context.YL_Device.FirstOrDefaultAsync(x => x.SerialNumber == deviceSerial);
if (device?.OrgId != null)
return device.OrgId;
else return 0;
}
public async Task<DeviceSyncUserPageResponseDto> UserPageAsync(DeviceSyncUserPageRequestDto dto)
@ -37,9 +36,9 @@ namespace YD_YiLu.Api.Services.Impl
string schoolCode = await _context.School.Where(x => x.Id == orgId).Select(x => x.SchoolCode).FirstAsync();
var query = _context.Student.Where(x => x.SchoolCode == schoolCode);
if (dto.UserType == 1) query = query.Where(x => false);
else if (dto.UserType == 2) { }
else if (dto.UserType == 3) query = query.Where(x => false);
//if (dto.UserType == 1) query = query.Where(x => false);
//else if (dto.UserType == 2) { }
//else if (dto.UserType == 3) query = query.Where(x => false);
var total = await query.CountAsync();
var pageIndex = dto.PageIndex < 1 ? 1 : dto.PageIndex;
@ -55,14 +54,14 @@ namespace YD_YiLu.Api.Services.Impl
UserType = 2,
Username = s.StudentNo,
Nickname = s.StudentName,
OrganizationId = s.ClassId ?? 0,
OrganizationName = s.ClassName ?? "",
GradeName = "",
OrganizationId = s.Id,
OrganizationName = s.ClassName ?? "",
FacePictureUrl = s.Photo ?? "",
Identity = "学生",
Gender = s.Sex == 1 ? "男" : "女",
Birthday = s.Birthday.HasValue ? s.Birthday.Value.ToString("yyyy-MM-dd") : "",
UserSerial = s.StudentNo
UserSerial = s.StudentNo,
})
.ToListAsync();

View File

@ -105,6 +105,6 @@ namespace VOL.Entity.DomainModels.XinWei
/// 备注
/// </summary>
[MaxLength(500)]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}