sss
This commit is contained in:
parent
c743659687
commit
0849a3eb2b
@ -191,6 +191,21 @@ namespace VOL.Ai.IServices
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IsActivityInListDto> IsActivityInList(IsActivityInListRequest paramDto);
|
Task<IsActivityInListDto> IsActivityInList(IsActivityInListRequest paramDto);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ai一体机扫描那登录轮询
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paramDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Ai_TeacherFaceInfo> ScanCodeLogin(Ai_Request paramDto);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 退出登录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paramDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> LogOut(LoginOutDto paramDto);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1199,5 +1199,67 @@ namespace VOL.Ai.Services
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ai一体机扫描那登录轮询
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paramDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<Ai_TeacherFaceInfo> ScanCodeLogin(Ai_Request paramDto)
|
||||||
|
{
|
||||||
|
var loginInfo = await _teacherRepository.DbContext.Set<Ai_ScanCodeLogin>().Where(x => x.Code == paramDto.Code && x.SchoolCode == paramDto.SchoolCode).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (loginInfo == null)
|
||||||
|
return new Ai_TeacherFaceInfo();
|
||||||
|
|
||||||
|
|
||||||
|
var res = await _teacherRepository.FindAsIQueryable(x => x.SchoolCode == paramDto.SchoolCode && x.TeacherStatus != TeacherStatus.Depart && x.TeacherPhoneNo == loginInfo.TeacherPhoneNo && x.Id == loginInfo.TeacherId)
|
||||||
|
.Select(x =>
|
||||||
|
new Ai_TeacherFaceInfo()
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
Age = x.Age,
|
||||||
|
//SchoolCode = x.SchoolCode,
|
||||||
|
Sex = x.Sex,
|
||||||
|
Phone = x.TeacherPhoneNo,
|
||||||
|
TeacherName = x.TeacherName,
|
||||||
|
Photo = x.TeacherPhoto,
|
||||||
|
}).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (res == null)
|
||||||
|
throw new Exception("未查询到登陆信息");
|
||||||
|
|
||||||
|
|
||||||
|
var grades = await (
|
||||||
|
from t in _studentRepository.DbContext.Set<S_ClassAssocTeacher>()
|
||||||
|
join c in _studentRepository.DbContext.Set<S_Class>() on t.ClassId equals c.Id into classGroup
|
||||||
|
from c in classGroup.DefaultIfEmpty()
|
||||||
|
where t.TeacherId == res.Id && c != null
|
||||||
|
select new Classes()
|
||||||
|
{
|
||||||
|
Id = c.Id,
|
||||||
|
Name = $"{c.GradeName}-{c.ClassName}",
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
res.GradeAndClassList = grades;
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 退出登录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paramDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
|
||||||
|
public async Task<bool> LogOut(LoginOutDto paramDto)
|
||||||
|
{
|
||||||
|
var teacher = await _teacherRepository.DbContext.Set<Ai_ScanCodeLogin>().Where(x => x.Code == paramDto.Code && x.SchoolCode == paramDto.SchoolCode).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (teacher == null) return true;
|
||||||
|
|
||||||
|
_teacherRepository.DbContext.Set<Ai_ScanCodeLogin>().Remove(teacher);
|
||||||
|
return await _teacherRepository.SaveChangesAsync() > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,4 +77,17 @@ namespace VOL.Model.Ai
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
//public string StudentNo { get; set; }
|
//public string StudentNo { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 退出登录
|
||||||
|
/// </summary>
|
||||||
|
public class LoginOutDto : Ai_Request
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 教师Id
|
||||||
|
/// </summary>
|
||||||
|
public int TeacherId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -436,5 +436,31 @@ namespace VOL.WebApi.Controllers
|
|||||||
var result = await _aiAppService.FastJumpRopeRanking(paramDto);
|
var result = await _aiAppService.FastJumpRopeRanking(paramDto);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ai一体机扫描那登录轮询
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paramDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost(nameof(ScanCodeLogin))]
|
||||||
|
public async Task<Ai_TeacherFaceInfo> ScanCodeLogin([FromBody] Ai_Request paramDto)
|
||||||
|
{
|
||||||
|
var result = await _aiAppService.ScanCodeLogin(paramDto);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 退出登录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paramDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost(nameof(LogOut))]
|
||||||
|
public async Task<bool> LogOut([FromBody] LoginOutDto paramDto)
|
||||||
|
{
|
||||||
|
var result = await _aiAppService.LogOut(paramDto);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user