新增公司处理

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

@ -2,6 +2,8 @@
using SqlSugar;
using System.ComponentModel;
using GDZZ.Core.Entity;
using GDZZ.Application.Enum;
namespace GDZZ.Application.Entity
{
/// <summary>
@ -27,5 +29,17 @@ namespace GDZZ.Application.Entity
/// 公司详情图片
/// </summary>
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.Threading.Tasks;
namespace GDZZ.Application.Enum
namespace GDZZ.Application
{
public enum ConsumeEnum
{

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

@ -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<CompanyDto>();

@ -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<BaseUser> _rep;
private readonly SqlSugarRepository<SeIF> Self; //职业仓储
private readonly SqlSugarRepository<SysPos> SysPosRep;//职位查询
private readonly SqlSugarRepository<SysUser> _sysUserRep; // 用户表仓储
private readonly SqlSugarRepository<OnlineUser> _sysOnlineUerRep; // 在线用户表仓储
//服务
private readonly ISysEmpService _sysEmpService;
public BaseUserService(SqlSugarRepository<BaseUser> rep,
SqlSugarRepository<SeIF> Self,
SqlSugarRepository<SysPos> SysPosRep,ISysEmpService _sysEmpService,
SqlSugarRepository<OnlineUser> _sysOnlineUerRep,
SqlSugarRepository<SysUser> _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
/// 获取教师列表
/// </summary>
/// <returns></returns>
[HttpGet("/Mini/BaseUser/list")]
public async Task<dynamic> TeacherList()
[HttpGet("/Mini/BaseUser/GetTeacherList")]
public async Task<dynamic> GetTeacherList()
{
var thls = await this._sysUserRep.AsQueryable()
.InnerJoin<OnlineUser>((u, r) => u.Id == r.UserId)
.Where(u => u.AdminType == AdminType.None)
List<UserOutput> userls = new List<UserOutput>();
var users = await this._sysUserRep.AsQueryable().Filter("TenantId", true)
.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();
//var user = await _sysOnlineUerRep.AsQueryable()
// .Filter("TenantId", true)
// .Where(m => m.UserId == entity.OtherUserID).OrderByDescending(x => x.LastTime).FirstAsync();
foreach (var user in users)
{
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 GDZZ.Application.Enum;
using GDZZ.Core;
namespace GDZZ.Application
@ -28,5 +29,11 @@ namespace GDZZ.Application
/// </summary>
public string Info { get; set; }
/// <summary>
/// 审核状态
/// </summary>
public CompanyEnum ApprovalStatus { get; set; }
}
}

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

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

@ -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;
}
/// <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);
return user;
}
/// <summary>
/// 获取联系人列表
/// </summary>
@ -182,11 +217,6 @@ namespace GDZZ.Application
return historyLists;
}
#endregion
#region 聊天详情
@ -257,6 +287,7 @@ namespace GDZZ.Application
/// </summary>
/// <param name="file"></param>
/// <param name="pathType"></param>
/// <param name="fileLocation"></param>
/// <returns></returns>
private static async Task<LiveFileOutput> UploadFile(IFormFile file, string pathType, FileLocation fileLocation)
{

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

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

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

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

@ -38,7 +38,7 @@ public class ChatHub : Hub<IChatClient>
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);
}

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

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

@ -74,6 +74,24 @@ public class SysEmpPosService : ISysEmpPosService, ITransient
}).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)
{
return await _sysEmpPosRep.AsQueryable().InnerJoin<SysPos>((e, p) => e.SysPosId == p.Id)

@ -50,6 +50,26 @@ public class SysEmpService : ISysEmpService, ITransient
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>

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

@ -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<SysUser>();
user.AdminType = AdminType.None;
user.Password = MD5Encryption.Encrypt(input.Password);

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

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

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

Loading…
Cancel
Save