新增公司处理

development
温天培 2 years ago
parent b65f715c5c
commit 58a0cf58df

@ -2,6 +2,8 @@
using SqlSugar; using SqlSugar;
using System.ComponentModel; using System.ComponentModel;
using GDZZ.Core.Entity; using GDZZ.Core.Entity;
using GDZZ.Application.Enum;
namespace GDZZ.Application.Entity namespace GDZZ.Application.Entity
{ {
/// <summary> /// <summary>
@ -27,5 +29,17 @@ namespace GDZZ.Application.Entity
/// 公司详情图片 /// 公司详情图片
/// </summary> /// </summary>
public string CompanyInfoUrl { get; set; } public string CompanyInfoUrl { get; set; }
/// <summary>
/// 审核状态
/// </summary>
public CompanyEnum ApprovalStatus { get; set; }
/// <summary>
/// 审核人
/// </summary>
public string Approver { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public DateTime ApprovalTime { get; set; }
} }
} }

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GDZZ.Application.Enum
{
public enum CompanyEnum
{
/// <summary>
/// 待审核
/// </summary>
[Description("联系费用")] Pending = 0,
/// <summary>
/// 联系费用
/// </summary>
[Description("审核通过")] Approved = 1,
/// <summary>
/// 联系费用
/// </summary>
[Description("审核未通过")] Rejected = 2,
}
}

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GDZZ.Application.Enum namespace GDZZ.Application
{ {
public enum ConsumeEnum public enum ConsumeEnum
{ {

@ -99,6 +99,21 @@
公司详情图片 公司详情图片
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Application.Entity.Company.ApprovalStatus">
<summary>
审核状态
</summary>
</member>
<member name="P:GDZZ.Application.Entity.Company.Approver">
<summary>
审核人
</summary>
</member>
<member name="P:GDZZ.Application.Entity.Company.ApprovalTime">
<summary>
审核时间
</summary>
</member>
<member name="T:GDZZ.Application.Entity.Consume"> <member name="T:GDZZ.Application.Entity.Consume">
<summary> <summary>
消费记录 消费记录
@ -409,7 +424,22 @@
地区级别 1-省、自治区、直辖市 2-地级市、地区、自治州、盟 3-市辖区、县级市、县 地区级别 1-省、自治区、直辖市 2-地级市、地区、自治州、盟 3-市辖区、县级市、县
</summary> </summary>
</member> </member>
<member name="F:GDZZ.Application.Enum.ConsumeEnum.Contact"> <member name="F:GDZZ.Application.Enum.CompanyEnum.Pending">
<summary>
待审核
</summary>
</member>
<member name="F:GDZZ.Application.Enum.CompanyEnum.Approved">
<summary>
联系费用
</summary>
</member>
<member name="F:GDZZ.Application.Enum.CompanyEnum.Rejected">
<summary>
联系费用
</summary>
</member>
<member name="F:GDZZ.Application.ConsumeEnum.Contact">
<summary> <summary>
联系费用 联系费用
</summary> </summary>
@ -764,7 +794,7 @@
<param name="input"></param> <param name="input"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:GDZZ.Application.BaseUserService.TeacherList"> <member name="M:GDZZ.Application.BaseUserService.GetTeacherList">
<summary> <summary>
获取教师列表 获取教师列表
</summary> </summary>
@ -1087,6 +1117,11 @@
公司简介 公司简介
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Application.CompanyDto.ApprovalStatus">
<summary>
审核状态
</summary>
</member>
<member name="T:GDZZ.Application.CompanyInput"> <member name="T:GDZZ.Application.CompanyInput">
<summary> <summary>
公司属性输入参数 公司属性输入参数
@ -1216,14 +1251,13 @@
<summary> <summary>
获取意见反馈 获取意见反馈
</summary> </summary>
<param name="input"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:GDZZ.Application.FeedBackService.AddFeedBack(GDZZ.Application.FeedBackInput)"> <member name="M:GDZZ.Application.FeedBackService.AddFeedBack(GDZZ.Application.FeedBackInput)">
<summary> <summary>
获取意见反馈 获取意见反馈
</summary> </summary>
<param name="input"></param> <param name="backInput"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="T:GDZZ.Application.LiveHistoryContactsDto"> <member name="T:GDZZ.Application.LiveHistoryContactsDto">
@ -1426,6 +1460,16 @@
文件名称 文件名称
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Application.AddLiveFriendInput.UserId">
<summary>
</summary>
</member>
<member name="P:GDZZ.Application.AddLiveFriendInput.ContenID">
<summary>
</summary>
</member>
<member name="P:GDZZ.Application.AddLiveFriendInput.CompanyID"> <member name="P:GDZZ.Application.AddLiveFriendInput.CompanyID">
<summary> <summary>
公司ID 公司ID
@ -1507,6 +1551,12 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:GDZZ.Application.LiveHistoryContactsService.AddConsultLive(GDZZ.Application.AddLiveFriendInput)">
<summary>
咨询聊天
</summary>
<returns></returns>
</member>
<member name="M:GDZZ.Application.LiveHistoryContactsService.List"> <member name="M:GDZZ.Application.LiveHistoryContactsService.List">
<summary> <summary>
获取联系人列表 获取联系人列表
@ -1539,6 +1589,7 @@
</summary> </summary>
<param name="file"></param> <param name="file"></param>
<param name="pathType"></param> <param name="pathType"></param>
<param name="fileLocation"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="T:GDZZ.Application.MiniBannerDto"> <member name="T:GDZZ.Application.MiniBannerDto">
@ -1939,7 +1990,6 @@
<summary> <summary>
查询所有城市列表 查询所有城市列表
</summary> </summary>
<param name="input"></param>
<returns></returns> <returns></returns>
</member> </member>
</members> </members>

@ -145,6 +145,11 @@ namespace GDZZ.Application.Service.Auth
UserName = phoneInfo.PhoneNumber, UserName = phoneInfo.PhoneNumber,
}); });
} }
else
{
wxUser.Type = (int)UserEnum.JOB;
var bsUser = await this.Baseuser.UpdateAsync(wxUser);
}
} }
else else
{ {
@ -152,6 +157,10 @@ namespace GDZZ.Application.Service.Auth
if (wxUser.IsEmpty()|| wxUser.CompanyID.IsNullOrZero()) if (wxUser.IsEmpty()|| wxUser.CompanyID.IsNullOrZero())
throw Oops.Oh(ErrorCode.xg1002); throw Oops.Oh(ErrorCode.xg1002);
wxUser.Type= (int)UserEnum.ADVERTISE;
var bsUser = await this.Baseuser.UpdateAsync(wxUser);
//获取公司信息 //获取公司信息
company = await this.CompanyRep.SingleAsync(x=>x.Id == wxUser.CompanyID); company = await this.CompanyRep.SingleAsync(x=>x.Id == wxUser.CompanyID);
authUserOut.companyDto = company.Adapt<CompanyDto>(); authUserOut.companyDto = company.Adapt<CompanyDto>();

@ -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;
} }

@ -1,4 +1,5 @@
using System; using System;
using GDZZ.Application.Enum;
using GDZZ.Core; using GDZZ.Core;
namespace GDZZ.Application namespace GDZZ.Application
@ -28,5 +29,11 @@ namespace GDZZ.Application
/// </summary> /// </summary>
public string Info { get; set; } public string Info { get; set; }
/// <summary>
/// 审核状态
/// </summary>
public CompanyEnum ApprovalStatus { get; set; }
} }
} }

@ -29,7 +29,6 @@ namespace GDZZ.Application
/// <summary> /// <summary>
/// 获取意见反馈 /// 获取意见反馈
/// </summary> /// </summary>
/// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("Mini/GetFeedBackList")] [HttpGet("Mini/GetFeedBackList")]
public async Task<dynamic> GetFeedBackList() public async Task<dynamic> GetFeedBackList()
@ -43,7 +42,7 @@ namespace GDZZ.Application
/// <summary> /// <summary>
/// 获取意见反馈 /// 获取意见反馈
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="backInput"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("Mini/AddFeedBack")] [HttpPost("Mini/AddFeedBack")]
public async Task AddFeedBack(FeedBackInput backInput) public async Task AddFeedBack(FeedBackInput backInput)

@ -120,7 +120,16 @@ namespace GDZZ.Application
public class AddLiveFriendInput public class AddLiveFriendInput
{ {
/// <summary>
///
/// </summary>
public long UserId { get; set; }
/// <summary>
///
/// </summary>
public string ContenID { get; set; }
/// <summary> /// <summary>
/// 公司ID /// 公司ID
/// </summary> /// </summary>

@ -88,7 +88,6 @@ namespace GDZZ.Application
throw Oops.Oh(ErrorCode.xg1002); throw Oops.Oh(ErrorCode.xg1002);
//判断是是好友 //判断是是好友
var fends =await this.liveUserFriend.Where(x => x.FriendID == UserManager.UserId && x.CreatedUserId == user.Id).FirstAsync(); var fends =await this.liveUserFriend.Where(x => x.FriendID == UserManager.UserId && x.CreatedUserId == user.Id).FirstAsync();
if (fends.IsNullOrZero()) if (fends.IsNullOrZero())
{ {
@ -112,16 +111,52 @@ namespace GDZZ.Application
await this.liveUserFriend.InsertAsync(item); await this.liveUserFriend.InsertAsync(item);
} }
} }
else await this.cacheService.DelLiveHistoryService(UserManager.UserId);
{ return user;
}
}
/// <summary>
/// 咨询聊天
/// </summary>
/// <returns></returns>
[HttpPost("/Mini/LiveHistoryContacts/AddConsultLive")]
public async Task<dynamic> AddConsultLive(AddLiveFriendInput input)
{
var user = await this._sysUserRep.Where(x => x.Id == input.UserId).SingleAsync();
if (user.IsNullOrZero())
throw Oops.Oh(ErrorCode.xg1002);
//判断是是好友
var fends = await this.liveUserFriend.Where(x => x.FriendID == UserManager.UserId && x.CreatedUserId == user.Id).FirstAsync();
if (fends.IsNullOrZero())
{
List<LiveUserFriend> friends = new List<LiveUserFriend>();
if (user.Id != UserManager.UserId)
{
friends.Add(new LiveUserFriend()
{
FriendID = user.Id,
});
}
friends.Add(new LiveUserFriend()
{
FriendID = UserManager.UserId,
CreatedUserId = user.Id
});
foreach (var item in friends)
{
await this.liveUserFriend.InsertAsync(item);
}
}
await this.cacheService.DelLiveHistoryService(UserManager.UserId); await this.cacheService.DelLiveHistoryService(UserManager.UserId);
return user; return user;
} }
/// <summary> /// <summary>
/// 获取联系人列表 /// 获取联系人列表
/// </summary> /// </summary>
@ -182,11 +217,6 @@ namespace GDZZ.Application
return historyLists; return historyLists;
} }
#endregion #endregion
#region 聊天详情 #region 聊天详情
@ -257,6 +287,7 @@ namespace GDZZ.Application
/// </summary> /// </summary>
/// <param name="file"></param> /// <param name="file"></param>
/// <param name="pathType"></param> /// <param name="pathType"></param>
/// <param name="fileLocation"></param>
/// <returns></returns> /// <returns></returns>
private static async Task<LiveFileOutput> UploadFile(IFormFile file, string pathType, FileLocation fileLocation) private static async Task<LiveFileOutput> UploadFile(IFormFile file, string pathType, FileLocation fileLocation)
{ {

@ -29,7 +29,6 @@ namespace GDZZ.Application
/// <summary> /// <summary>
/// 查询所有城市列表 /// 查询所有城市列表
/// </summary> /// </summary>
/// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("/Mini/GetRegionList")] [HttpGet("/Mini/GetRegionList")]
[AllowAnonymous] [AllowAnonymous]

@ -1,105 +1,75 @@
using System;
using SqlSugar; using SqlSugar;
using System;
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using GDZZ.Core.Entity;
namespace GDZZ.Core.Entity; namespace GDZZ.Core.Entity
/// <summary>
/// 用户表
/// </summary>
[SugarTable("sys_user")]
[Description("用户表")]
public class SysUser : DBEntityTenant
{ {
/// <summary> /// <summary>
/// 账号 /// 用户表
/// </summary> /// </summary>
[Required, MaxLength(20)] [SugarTable("sys_user")]
[SugarColumn(ColumnDescription = "账号")] [Description("用户表")]
public string Account { get; set; } public class SysUser : DBEntityTenant
{
/// <summary> /// <summary>
/// 密码默认MD5加密 /// 账号
/// </summary> /// </summary>
[Required, MaxLength(50)] public string Account { get; set; }
[SugarColumn(ColumnDescription = "密码默认MD5加密")] /// <summary>
public string Password { get; set; } /// 密码
/// </summary>
/// <summary> public string Password { get; set; }
/// 昵称 /// <summary>
/// </summary> /// 昵称
[MaxLength(20)] /// </summary>
[SugarColumn(ColumnDescription = "昵称", IsNullable = true)] public string NickName { get; set; }
public string NickName { get; set; } /// <summary>
/// 姓名
/// <summary> /// </summary>
/// 姓名 public string Name { get; set; }
/// </summary> /// <summary>
[MaxLength(20)] /// 头像
[SugarColumn(ColumnDescription = "姓名", IsNullable = true)] /// </summary>
public string Name { get; set; } public string Avatar { get; set; }
/// <summary>
/// <summary> /// 生日
/// 头像 /// </summary>
/// </summary> public DateTime Birthday { get; set; }
[SugarColumn(ColumnDescription = "头像", IsNullable = true)] /// <summary>
public string Avatar { get; set; } /// 性别-男_1、女_2
/// </summary>
/// <summary> public Gender Sex { get; set; }
/// 生日 /// <summary>
/// </summary> /// 邮箱
[SugarColumn(ColumnDescription = "生日", IsNullable = true)] /// </summary>
public DateTime Birthday { get; set; } public string Email { get; set; }
/// <summary>
/// <summary> /// 手机
/// 性别-男_1、女_2 /// </summary>
/// </summary> public string Phone { get; set; }
[SugarColumn(ColumnDescription = "性别-男_1、女_2")] /// <summary>
public Gender Sex { get; set; } /// 电话
/// </summary>
/// <summary> public string Tel { get; set; }
/// 邮箱 /// <summary>
/// </summary> /// 最后登录IP
[MaxLength(20)] /// </summary>
[SugarColumn(ColumnDescription = "邮箱", IsNullable = true)] public string LastLoginIp { get; set; }
public string Email { get; set; } /// <summary>
/// 最后登录时间
/// <summary> /// </summary>
/// 手机 public DateTime LastLoginTime { get; set; }
/// </summary> /// <summary>
[MaxLength(20)] /// 管理员类型-超级管理员_1、非管理员_2
[SugarColumn(ColumnDescription = "手机", IsNullable = true)] /// </summary>
public string Phone { get; set; } public AdminType AdminType { get; set; }
/// <summary>
/// <summary> /// 状态-正常_0、停用_1、删除_2
/// 电话 /// </summary>
/// </summary> public CommonStatus Status { get; set; }
[MaxLength(20)] /// <summary>
[SugarColumn(ColumnDescription = "电话", IsNullable = true)] /// 简介
public string Tel { get; set; } /// </summary>
public string Profile { get; set; }
/// <summary> }
/// 最后登录IP
/// </summary>
[MaxLength(20)]
[SugarColumn(ColumnDescription = "最后登录IP", IsNullable = true)]
public string LastLoginIp { get; set; }
/// <summary>
/// 最后登录时间
/// </summary>
[SugarColumn(ColumnDescription = "最后登录时间", IsNullable = true)]
public DateTime LastLoginTime { get; set; }
/// <summary>
/// 管理员类型-超级管理员_1、非管理员_2
/// </summary>
[SugarColumn(ColumnDescription = "管理员类型-超级管理员_1、非管理员_2")]
public AdminType? AdminType { get; set; }
/// <summary>
/// 状态-正常_0、停用_1、删除_2
/// </summary>
[SugarColumn(ColumnDescription = "状态-正常_0、停用_1、删除_2")]
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
} }

@ -425,5 +425,10 @@ public enum ErrorCode
/// 未绑定公司 /// 未绑定公司
/// </summary> /// </summary>
[ErrorCodeItemMetadata("未绑定公司")] [ErrorCodeItemMetadata("未绑定公司")]
B1002 B1002,
/// <summary>
/// 手机已经存在
/// </summary>
[ErrorCodeItemMetadata("手机已经存在")]
B1003,
} }

@ -1897,7 +1897,7 @@
</member> </member>
<member name="P:GDZZ.Core.Entity.SysUser.Password"> <member name="P:GDZZ.Core.Entity.SysUser.Password">
<summary> <summary>
密码默认MD5加密 密码
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Core.Entity.SysUser.NickName"> <member name="P:GDZZ.Core.Entity.SysUser.NickName">
@ -1960,6 +1960,11 @@
状态-正常_0、停用_1、删除_2 状态-正常_0、停用_1、删除_2
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Core.Entity.SysUser.Profile">
<summary>
简介
</summary>
</member>
<member name="T:GDZZ.Core.Entity.SysUserDataScope"> <member name="T:GDZZ.Core.Entity.SysUserDataScope">
<summary> <summary>
用户数据范围表 用户数据范围表
@ -2590,6 +2595,11 @@
未绑定公司 未绑定公司
</summary> </summary>
</member> </member>
<member name="F:GDZZ.Core.ErrorCode.B1003">
<summary>
手机已经存在
</summary>
</member>
<member name="T:GDZZ.Core.FileExtensionEnum"> <member name="T:GDZZ.Core.FileExtensionEnum">
<summary> <summary>
文件扩展枚举 文件扩展枚举
@ -5818,6 +5828,12 @@
</summary> </summary>
<param name="empId">员工Id用户Id</param> <param name="empId">员工Id用户Id</param>
</member> </member>
<member name="M:GDZZ.Core.Service.SysEmpPosService.GetEmpTSPosList(System.Int64)">
<summary>
获取特殊所属职位信息
</summary>
<param name="empId">员工Id用户Id</param>
</member>
<member name="M:GDZZ.Core.Service.SysEmpPosService.HasPosEmp(System.Int64)"> <member name="M:GDZZ.Core.Service.SysEmpPosService.HasPosEmp(System.Int64)">
<summary> <summary>
根据职位Id判断该职位下是否有员工 根据职位Id判断该职位下是否有员工
@ -5844,6 +5860,13 @@
<param name="empId"></param> <param name="empId"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:GDZZ.Core.Service.SysEmpService.GetEmpTSInfo(System.Int64)">
<summary>
获取用户员工相关信息(包括登录)
</summary>
<param name="empId"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Core.Service.SysEmpService.GetEmpInfo(System.Collections.Generic.List{System.Int64})"> <member name="M:GDZZ.Core.Service.SysEmpService.GetEmpInfo(System.Collections.Generic.List{System.Int64})">
<summary> <summary>
获取用户员工相关信息 获取用户员工相关信息
@ -8494,6 +8517,11 @@
员工信息 员工信息
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Core.Service.UserOutput.Profile">
<summary>
简介
</summary>
</member>
<member name="P:GDZZ.Core.Service.UserOutput.TenantId"> <member name="P:GDZZ.Core.Service.UserOutput.TenantId">
<summary> <summary>
所属租户 所属租户

@ -38,7 +38,7 @@ public class ChatHub : Hub<IChatClient>
var name= claims.FirstOrDefault(e => e.Type == ClaimConst.CLAINM_NAME)?.Value; var name= claims.FirstOrDefault(e => e.Type == ClaimConst.CLAINM_NAME)?.Value;
var tenantId= claims.FirstOrDefault(e => e.Type == ClaimConst.TENANT_ID)?.Value; var tenantId= claims.FirstOrDefault(e => e.Type == ClaimConst.TENANT_ID)?.Value;
var ip = HttpNewUtil.Ip; var ip = HttpNewUtil.Ip;
if (_sysOnlineUerRep.Any(m => m.Account == account && m.LastLoginIp == ip)) { if (await _sysOnlineUerRep.AsQueryable().Filter("TenantId", true).AnyAsync(m => m.Account.Equals(account))) {
await _sysOnlineUerRep.DeleteAsync(m => m.Account == account && m.LastLoginIp == ip); await _sysOnlineUerRep.DeleteAsync(m => m.Account == account && m.LastLoginIp == ip);
} }

@ -8,6 +8,8 @@ public interface ISysEmpPosService
Task AddOrUpdate(long empId, List<long> posIdList); Task AddOrUpdate(long empId, List<long> posIdList);
Task DeleteEmpPosInfoByUserId(long empId); Task DeleteEmpPosInfoByUserId(long empId);
Task<List<EmpPosOutput>> GetEmpPosList(long empId); Task<List<EmpPosOutput>> GetEmpPosList(long empId);
Task<List<EmpPosOutput>> GetEmpTSPosList(long empId);
Task<List<EmpPosOutput>> GetEmpPosList(List<long> empIds); Task<List<EmpPosOutput>> GetEmpPosList(List<long> empIds);
Task<bool> HasPosEmp(long posId); Task<bool> HasPosEmp(long posId);
} }

@ -9,6 +9,7 @@ public interface ISysEmpService
Task AddOrUpdate(EmpOutput2 sysEmpParam); Task AddOrUpdate(EmpOutput2 sysEmpParam);
Task DeleteEmpInfoByUserId(long empId); Task DeleteEmpInfoByUserId(long empId);
Task<EmpOutput> GetEmpInfo(long empId); Task<EmpOutput> GetEmpInfo(long empId);
Task<EmpOutput> GetEmpTSInfo(long empId);
Task<List<EmpOutput>> GetEmpInfo(List<long> empIds); Task<List<EmpOutput>> GetEmpInfo(List<long> empIds);
Task<long> GetEmpOrgId(long empId); Task<long> GetEmpOrgId(long empId);
Task<bool> HasOrgEmp(long orgId); Task<bool> HasOrgEmp(long orgId);

@ -74,6 +74,24 @@ public class SysEmpPosService : ISysEmpPosService, ITransient
}).ToListAsync(); }).ToListAsync();
} }
/// <summary>
/// 获取特殊所属职位信息
/// </summary>
/// <param name="empId">员工Id用户Id</param>
public async Task<List<EmpPosOutput>> GetEmpTSPosList(long empId)
{
return await _sysEmpPosRep.AsQueryable().InnerJoin<SysPos>((e, p) => e.SysPosId == p.Id)
.Where((e, p) => e.SysEmpId == empId)
.Where((e,p)=>p.Name == "老师")
.Select((e, p) => new EmpPosOutput
{
PosId = p.Id,
PosCode = p.Code,
PosName = p.Name
}).ToListAsync();
}
public async Task<List<EmpPosOutput>> GetEmpPosList(List<long> empIds) public async Task<List<EmpPosOutput>> GetEmpPosList(List<long> empIds)
{ {
return await _sysEmpPosRep.AsQueryable().InnerJoin<SysPos>((e, p) => e.SysPosId == p.Id) return await _sysEmpPosRep.AsQueryable().InnerJoin<SysPos>((e, p) => e.SysPosId == p.Id)

@ -50,6 +50,26 @@ public class SysEmpService : ISysEmpService, ITransient
return empInfoOutput; return empInfoOutput;
} }
/// <summary>
/// 获取用户员工相关信息(包括登录)
/// </summary>
/// <param name="empId"></param>
/// <returns></returns>
public async Task<EmpOutput> GetEmpTSInfo(long empId)
{
var empInfoOutput = new EmpOutput();
var sysEmp = await _sysEmpRep.FirstOrDefaultAsync(u => u.Id == empId);
if (sysEmp == null) return empInfoOutput;
empInfoOutput = sysEmp.Adapt<EmpOutput>();
empInfoOutput.ExtOrgPos = await _sysEmpExtOrgPosService.GetEmpExtOrgPosList(empId);
empInfoOutput.Positions = await _sysEmpPosService.GetEmpTSPosList(empId);
if (empInfoOutput.Positions.Count.IsNullOrZero())
return empInfoOutput;
return empInfoOutput;
}
/// <summary> /// <summary>
/// 获取用户员工相关信息 /// 获取用户员工相关信息
/// </summary> /// </summary>

@ -67,6 +67,16 @@ public class UserOutput
/// </summary> /// </summary>
public EmpOutput SysEmpInfo { get; set; } public EmpOutput SysEmpInfo { get; set; }
/// <summary>
/// 简介
/// </summary>
public string Profile { get; set; }
public string ConnectionId { get; set; }
/// <summary> /// <summary>
/// 所属租户 /// 所属租户
/// </summary> /// </summary>

@ -96,6 +96,10 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
var isExist = await _sysUserRep.AnyAsync(u => u.Account == input.Account); var isExist = await _sysUserRep.AnyAsync(u => u.Account == input.Account);
if (isExist) throw Oops.Oh(ErrorCode.D1003); if (isExist) throw Oops.Oh(ErrorCode.D1003);
if(await _sysUserRep.AnyAsync(u => u.Phone == input.Phone))
throw Oops.Oh(ErrorCode.B1003);
var user = input.Adapt<SysUser>(); var user = input.Adapt<SysUser>();
user.AdminType = AdminType.None; user.AdminType = AdminType.None;
user.Password = MD5Encryption.Encrypt(input.Password); user.Password = MD5Encryption.Encrypt(input.Password);

@ -103,7 +103,7 @@ namespace Senparc.Weixin.Cache.Memcached
/// </summary> /// </summary>
/// <typeparam name="TBag"></typeparam> /// <typeparam name="TBag"></typeparam>
/// <returns></returns> /// <returns></returns>
public override async Task<IDictionary<string, TBag>> GetAllAsync<TBag>() public override Task<IDictionary<string, TBag>> GetAllAsync<TBag>()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

@ -450,7 +450,6 @@ namespace Senparc.Weixin.Containers
break; break;
default: default:
throw new ArgumentOutOfRangeException($"未知的 PlatformType {nameof(platformType)}{platformType.ToString()}"); throw new ArgumentOutOfRangeException($"未知的 PlatformType {nameof(platformType)}{platformType.ToString()}");
break;
} }
if (appId == null) if (appId == null)

@ -216,7 +216,7 @@ namespace Senparc.Weixin.RegisterServices
} }
catch (Exception ex) catch (Exception ex)
{ {
throw; throw ;
} }
finally finally
{ {

Loading…
Cancel
Save