From 58a0cf58df8fbd8804df7a9de26a848402d5ed79 Mon Sep 17 00:00:00 2001 From: wtp <1813748440@qq.com> Date: Thu, 30 Mar 2023 18:55:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E5=8F=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GDZZ.Application/Entity/Company.cs | 14 ++ GDZZ.Application/Enum/CompanyEnum.cs | 27 +++ GDZZ.Application/Enum/ConsumeEnum.cs | 2 +- GDZZ.Application/GDZZ.Application.xml | 60 +++++- GDZZ.Application/Service/Auth/AuthService.cs | 9 + .../Service/BaseUser/BaseUserService.cs | 56 ++++-- .../Service/Company/Dto/CompanyDto.cs | 9 +- .../Service/FeedBack/FeedBackService.cs | 3 +- .../Dto/LiveHistoryContactsInput.cs | 9 + .../LiveHistoryContactsService.cs | 49 ++++- .../Service/SysRegion/SysRegionService.cs | 1 - GDZZ.Core/Entity/SysUser.cs | 174 ++++++++---------- GDZZ.Core/Enum/ErrorCode.cs | 7 +- GDZZ.Core/GDZZ.Core.xml | 30 ++- GDZZ.Core/Hubs/ChatHub.cs | 2 +- GDZZ.Core/Service/Emp/ISysEmpPosService.cs | 2 + GDZZ.Core/Service/Emp/ISysEmpService.cs | 1 + GDZZ.Core/Service/Emp/SysEmpPosService.cs | 18 ++ GDZZ.Core/Service/Emp/SysEmpService.cs | 20 ++ GDZZ.Core/Service/User/Dto/UserOutput.cs | 10 + GDZZ.Core/Service/User/SysUserService.cs | 4 + .../MemcachedContainerCacheStrategy.cs | 2 +- .../Containers/BaseContainer.cs | 1 - .../SenparcWeixinRegisterServiceExtension.cs | 2 +- 24 files changed, 371 insertions(+), 141 deletions(-) create mode 100644 GDZZ.Application/Enum/CompanyEnum.cs diff --git a/GDZZ.Application/Entity/Company.cs b/GDZZ.Application/Entity/Company.cs index 2b8b2ff..e65a67d 100644 --- a/GDZZ.Application/Entity/Company.cs +++ b/GDZZ.Application/Entity/Company.cs @@ -2,6 +2,8 @@ using SqlSugar; using System.ComponentModel; using GDZZ.Core.Entity; +using GDZZ.Application.Enum; + namespace GDZZ.Application.Entity { /// @@ -27,5 +29,17 @@ namespace GDZZ.Application.Entity /// 公司详情图片 /// public string CompanyInfoUrl { get; set; } + /// + /// 审核状态 + /// + public CompanyEnum ApprovalStatus { get; set; } + /// + /// 审核人 + /// + public string Approver { get; set; } + /// + /// 审核时间 + /// + public DateTime ApprovalTime { get; set; } } } \ No newline at end of file diff --git a/GDZZ.Application/Enum/CompanyEnum.cs b/GDZZ.Application/Enum/CompanyEnum.cs new file mode 100644 index 0000000..dacc8c3 --- /dev/null +++ b/GDZZ.Application/Enum/CompanyEnum.cs @@ -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 + { + /// + /// 待审核 + /// + [Description("联系费用")] Pending = 0, + + /// + /// 联系费用 + /// + [Description("审核通过")] Approved = 1, + + /// + /// 联系费用 + /// + [Description("审核未通过")] Rejected = 2, + } +} diff --git a/GDZZ.Application/Enum/ConsumeEnum.cs b/GDZZ.Application/Enum/ConsumeEnum.cs index d00e428..28f68dc 100644 --- a/GDZZ.Application/Enum/ConsumeEnum.cs +++ b/GDZZ.Application/Enum/ConsumeEnum.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace GDZZ.Application.Enum +namespace GDZZ.Application { public enum ConsumeEnum { diff --git a/GDZZ.Application/GDZZ.Application.xml b/GDZZ.Application/GDZZ.Application.xml index 530a62f..a8df335 100644 --- a/GDZZ.Application/GDZZ.Application.xml +++ b/GDZZ.Application/GDZZ.Application.xml @@ -99,6 +99,21 @@ 公司详情图片 + + + 审核状态 + + + + + 审核人 + + + + + 审核时间 + + 消费记录 @@ -409,7 +424,22 @@ 地区级别 1-省、自治区、直辖市 2-地级市、地区、自治州、盟 3-市辖区、县级市、县 - + + + 待审核 + + + + + 联系费用 + + + + + 联系费用 + + + 联系费用 @@ -764,7 +794,7 @@ - + 获取教师列表 @@ -1087,6 +1117,11 @@ 公司简介 + + + 审核状态 + + 公司属性输入参数 @@ -1216,14 +1251,13 @@ 获取意见反馈 - 获取意见反馈 - + @@ -1426,6 +1460,16 @@ 文件名称 + + + + + + + + + + 公司ID @@ -1507,6 +1551,12 @@ + + + 咨询聊天 + + + 获取联系人列表 @@ -1539,6 +1589,7 @@ + @@ -1939,7 +1990,6 @@ 查询所有城市列表 - diff --git a/GDZZ.Application/Service/Auth/AuthService.cs b/GDZZ.Application/Service/Auth/AuthService.cs index 32c3e5a..88b2cb4 100644 --- a/GDZZ.Application/Service/Auth/AuthService.cs +++ b/GDZZ.Application/Service/Auth/AuthService.cs @@ -145,6 +145,11 @@ namespace GDZZ.Application.Service.Auth UserName = phoneInfo.PhoneNumber, }); } + else + { + wxUser.Type = (int)UserEnum.JOB; + var bsUser = await this.Baseuser.UpdateAsync(wxUser); + } } else { @@ -152,6 +157,10 @@ namespace GDZZ.Application.Service.Auth if (wxUser.IsEmpty()|| wxUser.CompanyID.IsNullOrZero()) 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); authUserOut.companyDto = company.Adapt(); diff --git a/GDZZ.Application/Service/BaseUser/BaseUserService.cs b/GDZZ.Application/Service/BaseUser/BaseUserService.cs index 09511b6..83cb987 100644 --- a/GDZZ.Application/Service/BaseUser/BaseUserService.cs +++ b/GDZZ.Application/Service/BaseUser/BaseUserService.cs @@ -11,6 +11,8 @@ using Microsoft.Extensions.Options; using GDZZ.Core.Entity; using System.Threading; using Furion.FriendlyException; +using GDZZ.Core.Service; +using System.Collections.Generic; namespace GDZZ.Application { @@ -22,23 +24,26 @@ namespace GDZZ.Application { private readonly SqlSugarRepository _rep; private readonly SqlSugarRepository Self; //职业仓储 - + private readonly SqlSugarRepository SysPosRep;//职位查询 private readonly SqlSugarRepository _sysUserRep; // 用户表仓储 private readonly SqlSugarRepository _sysOnlineUerRep; // 在线用户表仓储 + //服务 + private readonly ISysEmpService _sysEmpService; - public BaseUserService(SqlSugarRepository rep, SqlSugarRepository Self, - + SqlSugarRepository SysPosRep,ISysEmpService _sysEmpService, SqlSugarRepository _sysOnlineUerRep, SqlSugarRepository _sysUserRep) { _rep = rep; this.Self= Self; + this._sysEmpService = _sysEmpService; + this.SysPosRep = SysPosRep; this._sysUserRep = _sysUserRep; this._sysOnlineUerRep= _sysOnlineUerRep; } @@ -89,19 +94,42 @@ namespace GDZZ.Application /// 获取教师列表 /// /// - [HttpGet("/Mini/BaseUser/list")] - public async Task TeacherList() + [HttpGet("/Mini/BaseUser/GetTeacherList")] + public async Task GetTeacherList() { - var thls = await this._sysUserRep.AsQueryable() - .InnerJoin((u, r) => u.Id == r.UserId) - .Where(u => u.AdminType == AdminType.None) + List userls = new List(); + var users = await this._sysUserRep.AsQueryable().Filter("TenantId", true) + .LeftJoin((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(); - - //var user = await _sysOnlineUerRep.AsQueryable() - // .Filter("TenantId", true) - // .Where(m => m.UserId == entity.OtherUserID).OrderByDescending(x => x.LastTime).FirstAsync(); - - return null; + + foreach (var user in users) + { + var userDto = user.Adapt(); + userDto.SysEmpInfo = await _sysEmpService.GetEmpTSInfo(long.Parse(user.Id)); + if(!userDto.SysEmpInfo.Positions.Count.IsNullOrZero()) + userls.Add(userDto); + + } + return userls; } diff --git a/GDZZ.Application/Service/Company/Dto/CompanyDto.cs b/GDZZ.Application/Service/Company/Dto/CompanyDto.cs index 5568025..7ae6618 100644 --- a/GDZZ.Application/Service/Company/Dto/CompanyDto.cs +++ b/GDZZ.Application/Service/Company/Dto/CompanyDto.cs @@ -1,4 +1,5 @@ using System; +using GDZZ.Application.Enum; using GDZZ.Core; namespace GDZZ.Application @@ -27,6 +28,12 @@ namespace GDZZ.Application /// 公司简介 /// public string Info { get; set; } - + + /// + /// 审核状态 + /// + public CompanyEnum ApprovalStatus { get; set; } + + } } diff --git a/GDZZ.Application/Service/FeedBack/FeedBackService.cs b/GDZZ.Application/Service/FeedBack/FeedBackService.cs index 293e584..848caf7 100644 --- a/GDZZ.Application/Service/FeedBack/FeedBackService.cs +++ b/GDZZ.Application/Service/FeedBack/FeedBackService.cs @@ -29,7 +29,6 @@ namespace GDZZ.Application /// /// 获取意见反馈 /// - /// /// [HttpGet("Mini/GetFeedBackList")] public async Task GetFeedBackList() @@ -43,7 +42,7 @@ namespace GDZZ.Application /// /// 获取意见反馈 /// - /// + /// /// [HttpPost("Mini/AddFeedBack")] public async Task AddFeedBack(FeedBackInput backInput) diff --git a/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsInput.cs b/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsInput.cs index 9ffe22f..e6d16bf 100644 --- a/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsInput.cs +++ b/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsInput.cs @@ -120,7 +120,16 @@ namespace GDZZ.Application public class AddLiveFriendInput { + /// + /// + /// + + public long UserId { get; set; } + /// + /// + /// + public string ContenID { get; set; } /// /// 公司ID /// diff --git a/GDZZ.Application/Service/LiveHistoryContacts/LiveHistoryContactsService.cs b/GDZZ.Application/Service/LiveHistoryContacts/LiveHistoryContactsService.cs index d8f3122..a16d361 100644 --- a/GDZZ.Application/Service/LiveHistoryContacts/LiveHistoryContactsService.cs +++ b/GDZZ.Application/Service/LiveHistoryContacts/LiveHistoryContactsService.cs @@ -88,7 +88,6 @@ namespace GDZZ.Application throw Oops.Oh(ErrorCode.xg1002); //判断是是好友 - var fends =await this.liveUserFriend.Where(x => x.FriendID == UserManager.UserId && x.CreatedUserId == user.Id).FirstAsync(); if (fends.IsNullOrZero()) { @@ -112,16 +111,52 @@ namespace GDZZ.Application await this.liveUserFriend.InsertAsync(item); } } - else - { + await this.cacheService.DelLiveHistoryService(UserManager.UserId); + return user; + } - } + /// + /// 咨询聊天 + /// + /// + [HttpPost("/Mini/LiveHistoryContacts/AddConsultLive")] + public async Task 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 friends = new List(); + 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); return user; } + /// /// 获取联系人列表 /// @@ -182,11 +217,6 @@ namespace GDZZ.Application return historyLists; } - - - - - #endregion #region 聊天详情 @@ -257,6 +287,7 @@ namespace GDZZ.Application /// /// /// + /// /// private static async Task UploadFile(IFormFile file, string pathType, FileLocation fileLocation) { diff --git a/GDZZ.Application/Service/SysRegion/SysRegionService.cs b/GDZZ.Application/Service/SysRegion/SysRegionService.cs index faa17ee..e1fb800 100644 --- a/GDZZ.Application/Service/SysRegion/SysRegionService.cs +++ b/GDZZ.Application/Service/SysRegion/SysRegionService.cs @@ -29,7 +29,6 @@ namespace GDZZ.Application /// /// 查询所有城市列表 /// - /// /// [HttpGet("/Mini/GetRegionList")] [AllowAnonymous] diff --git a/GDZZ.Core/Entity/SysUser.cs b/GDZZ.Core/Entity/SysUser.cs index 7670333..b26d208 100644 --- a/GDZZ.Core/Entity/SysUser.cs +++ b/GDZZ.Core/Entity/SysUser.cs @@ -1,105 +1,75 @@ +using System; using SqlSugar; -using System; using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -namespace GDZZ.Core.Entity; - -/// -/// 用户表 -/// -[SugarTable("sys_user")] -[Description("用户表")] -public class SysUser : DBEntityTenant +using GDZZ.Core.Entity; +namespace GDZZ.Core.Entity { - /// - /// 账号 - /// - [Required, MaxLength(20)] - [SugarColumn(ColumnDescription = "账号")] - public string Account { get; set; } - - /// - /// 密码(默认MD5加密) - /// - [Required, MaxLength(50)] - [SugarColumn(ColumnDescription = "密码(默认MD5加密)")] - public string Password { get; set; } - - /// - /// 昵称 - /// - [MaxLength(20)] - [SugarColumn(ColumnDescription = "昵称", IsNullable = true)] - public string NickName { get; set; } - - /// - /// 姓名 - /// - [MaxLength(20)] - [SugarColumn(ColumnDescription = "姓名", IsNullable = true)] - public string Name { get; set; } - - /// - /// 头像 - /// - [SugarColumn(ColumnDescription = "头像", IsNullable = true)] - public string Avatar { get; set; } - - /// - /// 生日 - /// - [SugarColumn(ColumnDescription = "生日", IsNullable = true)] - public DateTime Birthday { get; set; } - - /// - /// 性别-男_1、女_2 - /// - [SugarColumn(ColumnDescription = "性别-男_1、女_2")] - public Gender Sex { get; set; } - - /// - /// 邮箱 - /// - [MaxLength(20)] - [SugarColumn(ColumnDescription = "邮箱", IsNullable = true)] - public string Email { get; set; } - - /// - /// 手机 - /// - [MaxLength(20)] - [SugarColumn(ColumnDescription = "手机", IsNullable = true)] - public string Phone { get; set; } - - /// - /// 电话 - /// - [MaxLength(20)] - [SugarColumn(ColumnDescription = "电话", IsNullable = true)] - public string Tel { get; set; } - - /// - /// 最后登录IP - /// - [MaxLength(20)] - [SugarColumn(ColumnDescription = "最后登录IP", IsNullable = true)] - public string LastLoginIp { get; set; } - - /// - /// 最后登录时间 - /// - [SugarColumn(ColumnDescription = "最后登录时间", IsNullable = true)] - public DateTime LastLoginTime { get; set; } - - /// - /// 管理员类型-超级管理员_1、非管理员_2 - /// - [SugarColumn(ColumnDescription = "管理员类型-超级管理员_1、非管理员_2")] - public AdminType? AdminType { get; set; } - - /// - /// 状态-正常_0、停用_1、删除_2 - /// - [SugarColumn(ColumnDescription = "状态-正常_0、停用_1、删除_2")] - public CommonStatus Status { get; set; } = CommonStatus.ENABLE; -} + /// + /// 用户表 + /// + [SugarTable("sys_user")] + [Description("用户表")] + public class SysUser : DBEntityTenant + { + /// + /// 账号 + /// + public string Account { get; set; } + /// + /// 密码 + /// + public string Password { get; set; } + /// + /// 昵称 + /// + public string NickName { get; set; } + /// + /// 姓名 + /// + public string Name { get; set; } + /// + /// 头像 + /// + public string Avatar { get; set; } + /// + /// 生日 + /// + public DateTime Birthday { get; set; } + /// + /// 性别-男_1、女_2 + /// + public Gender Sex { get; set; } + /// + /// 邮箱 + /// + public string Email { get; set; } + /// + /// 手机 + /// + public string Phone { get; set; } + /// + /// 电话 + /// + public string Tel { get; set; } + /// + /// 最后登录IP + /// + public string LastLoginIp { get; set; } + /// + /// 最后登录时间 + /// + public DateTime LastLoginTime { get; set; } + /// + /// 管理员类型-超级管理员_1、非管理员_2 + /// + public AdminType AdminType { get; set; } + /// + /// 状态-正常_0、停用_1、删除_2 + /// + public CommonStatus Status { get; set; } + /// + /// 简介 + /// + public string Profile { get; set; } + } +} \ No newline at end of file diff --git a/GDZZ.Core/Enum/ErrorCode.cs b/GDZZ.Core/Enum/ErrorCode.cs index bfe7dff..854bc8c 100644 --- a/GDZZ.Core/Enum/ErrorCode.cs +++ b/GDZZ.Core/Enum/ErrorCode.cs @@ -425,5 +425,10 @@ public enum ErrorCode /// 未绑定公司 /// [ErrorCodeItemMetadata("未绑定公司")] - B1002 + B1002, + /// + /// 手机已经存在 + /// + [ErrorCodeItemMetadata("手机已经存在")] + B1003, } diff --git a/GDZZ.Core/GDZZ.Core.xml b/GDZZ.Core/GDZZ.Core.xml index 76aefa7..b65fc7f 100644 --- a/GDZZ.Core/GDZZ.Core.xml +++ b/GDZZ.Core/GDZZ.Core.xml @@ -1897,7 +1897,7 @@ - 密码(默认MD5加密) + 密码 @@ -1960,6 +1960,11 @@ 状态-正常_0、停用_1、删除_2 + + + 简介 + + 用户数据范围表 @@ -2590,6 +2595,11 @@ 未绑定公司 + + + 手机已经存在 + + 文件扩展枚举 @@ -5818,6 +5828,12 @@ 员工Id(用户Id) + + + 获取特殊所属职位信息 + + 员工Id(用户Id) + 根据职位Id判断该职位下是否有员工 @@ -5844,6 +5860,13 @@ + + + 获取用户员工相关信息(包括登录) + + + + 获取用户员工相关信息 @@ -8494,6 +8517,11 @@ 员工信息 + + + 简介 + + 所属租户 diff --git a/GDZZ.Core/Hubs/ChatHub.cs b/GDZZ.Core/Hubs/ChatHub.cs index 7ab5f62..5febd6d 100644 --- a/GDZZ.Core/Hubs/ChatHub.cs +++ b/GDZZ.Core/Hubs/ChatHub.cs @@ -38,7 +38,7 @@ public class ChatHub : Hub var name= claims.FirstOrDefault(e => e.Type == ClaimConst.CLAINM_NAME)?.Value; var tenantId= claims.FirstOrDefault(e => e.Type == ClaimConst.TENANT_ID)?.Value; 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); } diff --git a/GDZZ.Core/Service/Emp/ISysEmpPosService.cs b/GDZZ.Core/Service/Emp/ISysEmpPosService.cs index d6b57a9..a74c177 100644 --- a/GDZZ.Core/Service/Emp/ISysEmpPosService.cs +++ b/GDZZ.Core/Service/Emp/ISysEmpPosService.cs @@ -8,6 +8,8 @@ public interface ISysEmpPosService Task AddOrUpdate(long empId, List posIdList); Task DeleteEmpPosInfoByUserId(long empId); Task> GetEmpPosList(long empId); + + Task> GetEmpTSPosList(long empId); Task> GetEmpPosList(List empIds); Task HasPosEmp(long posId); } diff --git a/GDZZ.Core/Service/Emp/ISysEmpService.cs b/GDZZ.Core/Service/Emp/ISysEmpService.cs index b1283a6..e8c676c 100644 --- a/GDZZ.Core/Service/Emp/ISysEmpService.cs +++ b/GDZZ.Core/Service/Emp/ISysEmpService.cs @@ -9,6 +9,7 @@ public interface ISysEmpService Task AddOrUpdate(EmpOutput2 sysEmpParam); Task DeleteEmpInfoByUserId(long empId); Task GetEmpInfo(long empId); + Task GetEmpTSInfo(long empId); Task> GetEmpInfo(List empIds); Task GetEmpOrgId(long empId); Task HasOrgEmp(long orgId); diff --git a/GDZZ.Core/Service/Emp/SysEmpPosService.cs b/GDZZ.Core/Service/Emp/SysEmpPosService.cs index 67887af..0161197 100644 --- a/GDZZ.Core/Service/Emp/SysEmpPosService.cs +++ b/GDZZ.Core/Service/Emp/SysEmpPosService.cs @@ -74,6 +74,24 @@ public class SysEmpPosService : ISysEmpPosService, ITransient }).ToListAsync(); } + + /// + /// 获取特殊所属职位信息 + /// + /// 员工Id(用户Id) + public async Task> GetEmpTSPosList(long empId) + { + return await _sysEmpPosRep.AsQueryable().InnerJoin((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> GetEmpPosList(List empIds) { return await _sysEmpPosRep.AsQueryable().InnerJoin((e, p) => e.SysPosId == p.Id) diff --git a/GDZZ.Core/Service/Emp/SysEmpService.cs b/GDZZ.Core/Service/Emp/SysEmpService.cs index 65bc6b1..071e8f7 100644 --- a/GDZZ.Core/Service/Emp/SysEmpService.cs +++ b/GDZZ.Core/Service/Emp/SysEmpService.cs @@ -50,6 +50,26 @@ public class SysEmpService : ISysEmpService, ITransient return empInfoOutput; } + + /// + /// 获取用户员工相关信息(包括登录) + /// + /// + /// + public async Task GetEmpTSInfo(long empId) + { + var empInfoOutput = new EmpOutput(); + var sysEmp = await _sysEmpRep.FirstOrDefaultAsync(u => u.Id == empId); + if (sysEmp == null) return empInfoOutput; + empInfoOutput = sysEmp.Adapt(); + empInfoOutput.ExtOrgPos = await _sysEmpExtOrgPosService.GetEmpExtOrgPosList(empId); + empInfoOutput.Positions = await _sysEmpPosService.GetEmpTSPosList(empId); + if (empInfoOutput.Positions.Count.IsNullOrZero()) + return empInfoOutput; + return empInfoOutput; + } + + /// /// 获取用户员工相关信息 /// diff --git a/GDZZ.Core/Service/User/Dto/UserOutput.cs b/GDZZ.Core/Service/User/Dto/UserOutput.cs index 87c925b..581f4cb 100644 --- a/GDZZ.Core/Service/User/Dto/UserOutput.cs +++ b/GDZZ.Core/Service/User/Dto/UserOutput.cs @@ -67,6 +67,16 @@ public class UserOutput /// public EmpOutput SysEmpInfo { get; set; } + /// + /// 简介 + /// + public string Profile { get; set; } + + + public string ConnectionId { get; set; } + + + /// /// 所属租户 /// diff --git a/GDZZ.Core/Service/User/SysUserService.cs b/GDZZ.Core/Service/User/SysUserService.cs index 519200a..62b2865 100644 --- a/GDZZ.Core/Service/User/SysUserService.cs +++ b/GDZZ.Core/Service/User/SysUserService.cs @@ -96,6 +96,10 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient var isExist = await _sysUserRep.AnyAsync(u => u.Account == input.Account); 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(); user.AdminType = AdminType.None; user.Password = MD5Encryption.Encrypt(input.Password); diff --git a/pkg/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/ContainerCacheStrategy/MemcachedContainerCacheStrategy.cs b/pkg/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/ContainerCacheStrategy/MemcachedContainerCacheStrategy.cs index 4c3fb0d..3f87b8f 100644 --- a/pkg/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/ContainerCacheStrategy/MemcachedContainerCacheStrategy.cs +++ b/pkg/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/ContainerCacheStrategy/MemcachedContainerCacheStrategy.cs @@ -103,7 +103,7 @@ namespace Senparc.Weixin.Cache.Memcached /// /// /// - public override async Task> GetAllAsync() + public override Task> GetAllAsync() { throw new NotImplementedException(); } diff --git a/pkg/Senparc.Weixin/Senparc.Weixin/Containers/BaseContainer.cs b/pkg/Senparc.Weixin/Senparc.Weixin/Containers/BaseContainer.cs index 5ea4cef..b216a8e 100644 --- a/pkg/Senparc.Weixin/Senparc.Weixin/Containers/BaseContainer.cs +++ b/pkg/Senparc.Weixin/Senparc.Weixin/Containers/BaseContainer.cs @@ -450,7 +450,6 @@ namespace Senparc.Weixin.Containers break; default: throw new ArgumentOutOfRangeException($"未知的 PlatformType {nameof(platformType)}:{platformType.ToString()}"); - break; } if (appId == null) diff --git a/pkg/Senparc.Weixin/Senparc.Weixin/RegisterServices/SenparcWeixinRegisterServiceExtension.cs b/pkg/Senparc.Weixin/Senparc.Weixin/RegisterServices/SenparcWeixinRegisterServiceExtension.cs index f4af0f2..5a73e66 100644 --- a/pkg/Senparc.Weixin/Senparc.Weixin/RegisterServices/SenparcWeixinRegisterServiceExtension.cs +++ b/pkg/Senparc.Weixin/Senparc.Weixin/RegisterServices/SenparcWeixinRegisterServiceExtension.cs @@ -216,7 +216,7 @@ namespace Senparc.Weixin.RegisterServices } catch (Exception ex) { - throw; + throw ; } finally {