|
|
@ -11,6 +11,8 @@ using Microsoft.Extensions.Options;
|
|
|
|
using GDZZ.Core.Entity;
|
|
|
|
using GDZZ.Core.Entity;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading;
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
|
|
|
|
using GDZZ.Core.Service;
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GDZZ.Application
|
|
|
|
namespace GDZZ.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -22,23 +24,26 @@ namespace GDZZ.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly SqlSugarRepository<BaseUser> _rep;
|
|
|
|
private readonly SqlSugarRepository<BaseUser> _rep;
|
|
|
|
private readonly SqlSugarRepository<SeIF> Self; //职业仓储
|
|
|
|
private readonly SqlSugarRepository<SeIF> Self; //职业仓储
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<SysPos> SysPosRep;//职位查询
|
|
|
|
private readonly SqlSugarRepository<SysUser> _sysUserRep; // 用户表仓储
|
|
|
|
private readonly SqlSugarRepository<SysUser> _sysUserRep; // 用户表仓储
|
|
|
|
private readonly SqlSugarRepository<OnlineUser> _sysOnlineUerRep; // 在线用户表仓储
|
|
|
|
private readonly SqlSugarRepository<OnlineUser> _sysOnlineUerRep; // 在线用户表仓储
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//服务
|
|
|
|
|
|
|
|
private readonly ISysEmpService _sysEmpService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BaseUserService(SqlSugarRepository<BaseUser> rep,
|
|
|
|
public BaseUserService(SqlSugarRepository<BaseUser> rep,
|
|
|
|
SqlSugarRepository<SeIF> Self,
|
|
|
|
SqlSugarRepository<SeIF> Self,
|
|
|
|
|
|
|
|
SqlSugarRepository<SysPos> SysPosRep,ISysEmpService _sysEmpService,
|
|
|
|
SqlSugarRepository<OnlineUser> _sysOnlineUerRep,
|
|
|
|
SqlSugarRepository<OnlineUser> _sysOnlineUerRep,
|
|
|
|
SqlSugarRepository<SysUser> _sysUserRep)
|
|
|
|
SqlSugarRepository<SysUser> _sysUserRep)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_rep = rep;
|
|
|
|
_rep = rep;
|
|
|
|
|
|
|
|
|
|
|
|
this.Self= Self;
|
|
|
|
this.Self= Self;
|
|
|
|
|
|
|
|
this._sysEmpService = _sysEmpService;
|
|
|
|
|
|
|
|
this.SysPosRep = SysPosRep;
|
|
|
|
this._sysUserRep = _sysUserRep;
|
|
|
|
this._sysUserRep = _sysUserRep;
|
|
|
|
this._sysOnlineUerRep= _sysOnlineUerRep;
|
|
|
|
this._sysOnlineUerRep= _sysOnlineUerRep;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -89,19 +94,42 @@ namespace GDZZ.Application
|
|
|
|
/// 获取教师列表
|
|
|
|
/// 获取教师列表
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("/Mini/BaseUser/list")]
|
|
|
|
[HttpGet("/Mini/BaseUser/GetTeacherList")]
|
|
|
|
public async Task<dynamic> TeacherList()
|
|
|
|
public async Task<dynamic> GetTeacherList()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var thls = await this._sysUserRep.AsQueryable()
|
|
|
|
List<UserOutput> userls = new List<UserOutput>();
|
|
|
|
.InnerJoin<OnlineUser>((u, r) => u.Id == r.UserId)
|
|
|
|
var users = await this._sysUserRep.AsQueryable().Filter("TenantId", true)
|
|
|
|
.Where(u => u.AdminType == AdminType.None)
|
|
|
|
.LeftJoin<OnlineUser>((u, o) => u.Id == o.UserId)
|
|
|
|
|
|
|
|
.Where((u, o) => u.AdminType == AdminType.None)
|
|
|
|
|
|
|
|
.Select((u, o) => new UserOutput
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Account = u.Account,
|
|
|
|
|
|
|
|
Avatar = u.Avatar,
|
|
|
|
|
|
|
|
Birthday = u.Birthday,
|
|
|
|
|
|
|
|
Email = u.Email,
|
|
|
|
|
|
|
|
Id = u.Id.ToString(),
|
|
|
|
|
|
|
|
Name = u.Name,
|
|
|
|
|
|
|
|
NickName = u.NickName,
|
|
|
|
|
|
|
|
Phone = u.Phone,
|
|
|
|
|
|
|
|
Sex = (int)u.Sex,
|
|
|
|
|
|
|
|
Status = (int)u.Status,
|
|
|
|
|
|
|
|
Tel = u.Tel,
|
|
|
|
|
|
|
|
TenantId = u.TenantId,
|
|
|
|
|
|
|
|
ConnectionId = o.ConnectionId,
|
|
|
|
|
|
|
|
Profile = u.Profile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
.ToListAsync();
|
|
|
|
.ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
//var user = await _sysOnlineUerRep.AsQueryable()
|
|
|
|
foreach (var user in users)
|
|
|
|
// .Filter("TenantId", true)
|
|
|
|
{
|
|
|
|
// .Where(m => m.UserId == entity.OtherUserID).OrderByDescending(x => x.LastTime).FirstAsync();
|
|
|
|
var userDto = user.Adapt<UserOutput>();
|
|
|
|
|
|
|
|
userDto.SysEmpInfo = await _sysEmpService.GetEmpTSInfo(long.Parse(user.Id));
|
|
|
|
|
|
|
|
if(!userDto.SysEmpInfo.Positions.Count.IsNullOrZero())
|
|
|
|
|
|
|
|
userls.Add(userDto);
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return userls;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|