diff --git a/GDZZ.Application/Entity/LiveHistoryContacts.cs b/GDZZ.Application/Entity/LiveHistoryContacts.cs
new file mode 100644
index 0000000..17e35da
--- /dev/null
+++ b/GDZZ.Application/Entity/LiveHistoryContacts.cs
@@ -0,0 +1,51 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using GDZZ.Core.Entity;
+namespace GDZZ.Application.Entity
+{
+ ///
+ /// 聊天历史任务列表
+ ///
+ [SugarTable("live_historycontacts")]
+ [Description("聊天历史任务列表")]
+ public class LiveHistoryContacts : DEntityBase
+ {
+ ///
+ /// 租户Id
+ ///
+ public long TenantId { get; set; }
+ ///
+ /// 名称
+ ///
+ public string DisplayName { get; set; }
+ ///
+ /// 头像
+ ///
+ public string Avatar { get; set; }
+ ///
+ /// 类型
+ ///
+ public string Type { get; set; }
+ ///
+ /// 排序
+ ///
+ public string Index { get; set; }
+ ///
+ /// 消息条数
+ ///
+ public string Unread { get; set; }
+ ///
+ /// 最后时间
+ ///
+ public DateTime LastSendTime { get; set; }
+ ///
+ /// 最后消息
+ ///
+ public string LastContent { get; set; }
+ ///
+ /// 用户ID
+ ///
+ public long UserID { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/GDZZ.Application/Entity/LiveMessage.cs b/GDZZ.Application/Entity/LiveMessage.cs
new file mode 100644
index 0000000..e59aa23
--- /dev/null
+++ b/GDZZ.Application/Entity/LiveMessage.cs
@@ -0,0 +1,47 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using GDZZ.Core.Entity;
+namespace GDZZ.Application.Entity
+{
+ ///
+ /// 聊天信息列表
+ ///
+ [SugarTable("live_messages")]
+ [Description("聊天信息列表")]
+ public class LiveMessage : DEntityBase
+ {
+ ///
+ /// 租户Id
+ ///
+ public long TenantId { get; set; }
+ ///
+ /// 消息
+ ///
+ public string Content { get; set; }
+ ///
+ /// 对方信息
+ ///
+ public long OtherUserID { get; set; }
+ ///
+ /// 消息类型
+ ///
+ public string Type { get; set; }
+ ///
+ /// 状态
+ ///
+ public string Status { get; set; }
+ ///
+ /// 发送时间
+ ///
+ public DateTime SendTime { get; set; }
+ ///
+ /// 文件名称
+ ///
+ public string FileName { get; set; }
+ ///
+ /// 文件大小
+ ///
+ public int FileSize { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/GDZZ.Application/Entity/LiveUserFriend.cs b/GDZZ.Application/Entity/LiveUserFriend.cs
new file mode 100644
index 0000000..9d20003
--- /dev/null
+++ b/GDZZ.Application/Entity/LiveUserFriend.cs
@@ -0,0 +1,23 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using GDZZ.Core.Entity;
+namespace GDZZ.Application.Entity
+{
+ ///
+ /// 聊天用户好友表
+ ///
+ [SugarTable("live_user_friend")]
+ [Description("聊天用户好友表")]
+ public class LiveUserFriend : DEntityBase
+ {
+ ///
+ /// 租户Id
+ ///
+ public long TenantId { get; set; }
+ ///
+ /// 好友ID
+ ///
+ public long FriendID { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/GDZZ.Application/GDZZ.Application.csproj b/GDZZ.Application/GDZZ.Application.csproj
index 30651eb..14cb6fc 100644
--- a/GDZZ.Application/GDZZ.Application.csproj
+++ b/GDZZ.Application/GDZZ.Application.csproj
@@ -23,7 +23,6 @@
-
diff --git a/GDZZ.Application/GDZZ.Application.xml b/GDZZ.Application/GDZZ.Application.xml
index bd67c15..82849f6 100644
--- a/GDZZ.Application/GDZZ.Application.xml
+++ b/GDZZ.Application/GDZZ.Application.xml
@@ -79,6 +79,116 @@
公司详情
+
+
+ 聊天历史任务列表
+
+
+
+
+ 租户Id
+
+
+
+
+ 名称
+
+
+
+
+ 头像
+
+
+
+
+ 类型
+
+
+
+
+ 排序
+
+
+
+
+ 消息条数
+
+
+
+
+ 最后时间
+
+
+
+
+ 最后消息
+
+
+
+
+ 用户ID
+
+
+
+
+ 聊天信息列表
+
+
+
+
+ 租户Id
+
+
+
+
+ 消息
+
+
+
+
+ 对方信息
+
+
+
+
+ 消息类型
+
+
+
+
+ 状态
+
+
+
+
+ 发送时间
+
+
+
+
+ 文件名称
+
+
+
+
+ 文件大小
+
+
+
+
+ 聊天用户好友表
+
+
+
+
+ 租户Id
+
+
+
+
+ 好友ID
+
+
获取配置文件
@@ -94,10 +204,24 @@
即时聊天
-
+
+
+ 聊天总线
+
+
+
+
+ 聊天服务
+
+
+
+
+
- 创建聊天
+ 发送消息
+
+
@@ -489,5 +613,276 @@
公司详情
+
+
+ 聊天历史任务列表输出参数
+
+
+
+
+ 主键Id
+
+
+
+
+ 租户Id
+
+
+
+
+ 名称
+
+
+
+
+ 头像
+
+
+
+
+ 类型
+
+
+
+
+ 排序
+
+
+
+
+ 消息条数
+
+
+
+
+ 最后时间
+
+
+
+
+ 最后消息
+
+
+
+
+ 历史聊天列表输出参数
+
+
+
+
+ 联系人ID
+
+
+
+
+ 名称
+
+
+
+
+ 头像
+
+
+
+
+ 消息类型
+
+
+
+
+ 索引
+
+
+
+
+ 未读消息数
+
+
+
+
+ 最新消息时间戳
+
+
+
+
+ 最新消息内容
+
+
+
+
+ 聊天记录输出参数
+
+
+
+
+ 聊天历史任务列表输入参数
+
+
+
+
+ 名称
+
+
+
+
+ 头像
+
+
+
+
+ 类型
+
+
+
+
+ 排序
+
+
+
+
+ 消息条数
+
+
+
+
+ 最后时间
+
+
+
+
+ 最后消息
+
+
+
+
+ 主键Id
+
+
+
+
+ 主键Id
+
+
+
+
+ 租户Id
+
+
+
+
+ 消息
+
+
+
+
+ 对方信息
+
+
+
+
+ 消息类型
+
+
+
+
+ 状态
+
+
+
+
+ 发送时间
+
+
+
+
+ 文件大小
+
+
+
+
+ 文件名称
+
+
+
+
+ 聊天历史任务列表输出参数
+
+
+
+
+ 主键Id
+
+
+
+
+ 租户Id
+
+
+
+
+ 名称
+
+
+
+
+ 头像
+
+
+
+
+ 类型
+
+
+
+
+ 排序
+
+
+
+
+ 消息条数
+
+
+
+
+ 最后时间
+
+
+
+
+ 最后消息
+
+
+
+
+ 聊天服务
+
+
+
+
+ 新增联系人
+
+
+
+
+
+ 获取联系人
+
+
+
+
+
+
+ 获取聊天信息列表
+
+
+
+
+
+ 增加聊天历史任务列表
+
+
+
+
diff --git a/GDZZ.Application/Mapper/Mapper.cs b/GDZZ.Application/Mapper/Mapper.cs
new file mode 100644
index 0000000..b35b692
--- /dev/null
+++ b/GDZZ.Application/Mapper/Mapper.cs
@@ -0,0 +1,22 @@
+using GDZZ.Application.Entity;
+using Mapster;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GDZZ.Application.Mapper
+{
+ public class Mapper : IRegister
+ {
+ public void Register(TypeAdapterConfig config)
+ {
+ config.ForType()
+ .Map(d => d.ToContactId, s => s.CreatedUserId);
+
+ config.ForType()
+ .Map(d => d.Id, s => s.CreatedUserId);
+ }
+ }
+}
diff --git a/GDZZ.Application/Service/LiveChat/ILiveChatService.cs b/GDZZ.Application/Service/LiveChat/ILiveChatService.cs
index 5d64cb6..5a2a4c4 100644
--- a/GDZZ.Application/Service/LiveChat/ILiveChatService.cs
+++ b/GDZZ.Application/Service/LiveChat/ILiveChatService.cs
@@ -11,7 +11,7 @@ namespace GDZZ.Application.Service.LiveChat
///
public interface ILiveChatService
{
- Task CreateLinkCaht();
+
}
diff --git a/GDZZ.Application/Service/LiveChat/LiveChatService.cs b/GDZZ.Application/Service/LiveChat/LiveChatService.cs
index b1989b4..9f893db 100644
--- a/GDZZ.Application/Service/LiveChat/LiveChatService.cs
+++ b/GDZZ.Application/Service/LiveChat/LiveChatService.cs
@@ -1,25 +1,62 @@
-using Microsoft.AspNetCore.SignalR;
+using GDZZ.Core;
+using GDZZ.Core.Entity;
+using GDZZ.Core.Service;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.SignalR;
+using System.Collections.Generic;
using System.Threading.Tasks;
+using System.Linq;
+using Furion.DependencyInjection;
+using Furion.DynamicApiController;
namespace GDZZ.Application.Service.LiveChat
{
///
/// 即时聊天
///
- public class LiveChatService: Hub
+ [ApiDescriptionSettings("Application", Name = "LiveChat", Order = 1)]
+ public class LiveChatService:Hub ,ILiveChatService, IDynamicApiController, ITransient
{
- public LiveChatService()
- {
-
+ ///
+ /// 聊天总线
+ ///
+ private readonly IHubContext _chatHubContext;
+
+ private readonly SqlSugarRepository sysOnlineUerRep; // 在线用户表仓储
+
+
+ ///
+ /// 聊天服务
+ ///
+ ///
+ ///
+ public LiveChatService(IHubContext chatHubContext,
+ SqlSugarRepository _sysOnlineUerRep)
+ {
+ this.sysOnlineUerRep = _sysOnlineUerRep;
+ _chatHubContext = chatHubContext;
}
+
+
///
- /// 创建聊天
+ /// 发送消息
///
+ ///
+ ///
///
- Task CreateLinkCaht()
+ [HttpPost("/LiveChat/PushMessage")]
+ public async Task PushMessages(List userIds, string message)
{
- return Task.FromResult(true);
+ var userList = this.sysOnlineUerRep.Where(m => userIds.Contains(m.UserId)).ToList();
+ if (userList.Any())
+ {
+ foreach (var item in userList)
+ {
+ await _chatHubContext.Clients.Client(item.ConnectionId).SendMessage("", item.Name, message);
+ }
+ }
+
}
}
diff --git a/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsDto.cs b/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsDto.cs
new file mode 100644
index 0000000..60b5148
--- /dev/null
+++ b/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsDto.cs
@@ -0,0 +1,118 @@
+using System;
+using GDZZ.Core;
+
+namespace GDZZ.Application
+{
+ ///
+ /// 聊天历史任务列表输出参数
+ ///
+ public class LiveHistoryContactsDto
+ {
+ ///
+ /// 主键Id
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// 租户Id
+ ///
+ public long TenantId { get; set; }
+
+ ///
+ /// 名称
+ ///
+ public string displayName { get; set; }
+
+ ///
+ /// 头像
+ ///
+ public string avatar { get; set; }
+
+ ///
+ /// 类型
+ ///
+ public string type { get; set; }
+
+ ///
+ /// 排序
+ ///
+ public string index { get; set; }
+
+ ///
+ /// 消息条数
+ ///
+ public string unread { get; set; }
+
+ ///
+ /// 最后时间
+ ///
+ public DateTime lastSendTime { get; set; }
+
+ ///
+ /// 最后消息
+ ///
+ public string lastContent { get; set; }
+
+ }
+
+ ///
+ /// 历史聊天列表输出参数
+ ///
+ public class LiveHistoryLists
+ {
+ ///
+ /// 联系人ID
+ ///
+ public long Id { get; set; }
+ ///
+ /// 名称
+ ///
+ public string DisplayName { get; set; }
+ ///
+ /// 头像
+ ///
+ public string Avatar { get; set; }
+ ///
+ /// 消息类型
+ ///
+ public string Type { get; set; }
+
+ ///
+ /// 索引
+ ///
+ public string Index { get; set; }
+
+ ///
+ /// 未读消息数
+ ///
+ public int Unread { get; set; }
+
+ ///
+ /// 最新消息时间戳
+ ///
+ public string LastSendTime { get; set; }
+
+ ///
+ /// 最新消息内容
+ ///
+ public string LastContent { get; set; }
+
+ }
+
+ ///
+ /// 聊天记录输出参数
+ ///
+ public class LiveMessageList
+ {
+ public string ID { get; set; }
+ public string Status { get; set; }
+ public string Type { get; set; }
+ public DateTime SendTime { get; set; }
+ public string Content { get; set; }
+ public long ToContactId { get; set; }
+
+
+
+ }
+}
+
diff --git a/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsInput.cs b/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsInput.cs
new file mode 100644
index 0000000..698c451
--- /dev/null
+++ b/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsInput.cs
@@ -0,0 +1,113 @@
+using GDZZ.Core;
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace GDZZ.Application
+{
+ ///
+ /// 聊天历史任务列表输入参数
+ ///
+ public class LiveHistoryContactsInput : PageInputBase
+ {
+
+
+ }
+
+ public class AddLiveHistoryContactsInput : LiveHistoryContactsInput
+ {
+
+ ///
+ /// 名称
+ ///
+ public string displayName { get; set; }
+ ///
+ /// 头像
+ ///
+ public string avatar { get; set; }
+ ///
+ /// 类型
+ ///
+ public string type { get; set; }
+ ///
+ /// 排序
+ ///
+ public string index { get; set; }
+ ///
+ /// 消息条数
+ ///
+ public string unread { get; set; }
+ ///
+ /// 最后时间
+ ///
+ public DateTime lastSendTime { get; set; }
+ ///
+ /// 最后消息
+ ///
+ public string lastContent { get; set; }
+ }
+
+ public class DeleteLiveHistoryContactsInput
+ {
+ ///
+ /// 主键Id
+ ///
+ [Required(ErrorMessage = "主键Id不能为空")]
+ public long Id { get; set; }
+
+ }
+
+ public class UpdateLiveHistoryContactsInput : LiveHistoryContactsInput
+ {
+ ///
+ /// 主键Id
+ ///
+ [Required(ErrorMessage = "主键Id不能为空")]
+ public long Id { get; set; }
+
+ }
+
+ public class QueryeLiveHistoryContactsInput : DeleteLiveHistoryContactsInput
+ {
+
+ }
+
+
+
+
+
+ public class AddLiveMessageInput
+ {
+ ///
+ /// 租户Id
+ ///
+ public long TenantId { get; set; }
+ ///
+ /// 消息
+ ///
+ public string Content { get; set; }
+ ///
+ /// 对方信息
+ ///
+ public long OtherUserID { get; set; }
+ ///
+ /// 消息类型
+ ///
+ public string Type { get; set; }
+ ///
+ /// 状态
+ ///
+ public string Status { get; set; }
+ ///
+ /// 发送时间
+ ///
+ public DateTime SendTime { get; set; }
+ ///
+ /// 文件大小
+ ///
+ public string FileSize { get; set; }
+ ///
+ /// 文件名称
+ ///
+ public string FileName { get; set; }
+ }
+}
diff --git a/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsOutput.cs b/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsOutput.cs
new file mode 100644
index 0000000..9af915d
--- /dev/null
+++ b/GDZZ.Application/Service/LiveHistoryContacts/Dto/LiveHistoryContactsOutput.cs
@@ -0,0 +1,56 @@
+using System;
+
+namespace GDZZ.Application
+{
+ ///
+ /// 聊天历史任务列表输出参数
+ ///
+ public class LiveHistoryContactsOutput
+ {
+ ///
+ /// 主键Id
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// 租户Id
+ ///
+ public long TenantId { get; set; }
+
+ ///
+ /// 名称
+ ///
+ public string displayName { get; set; }
+
+ ///
+ /// 头像
+ ///
+ public string avatar { get; set; }
+
+ ///
+ /// 类型
+ ///
+ public string type { get; set; }
+
+ ///
+ /// 排序
+ ///
+ public string index { get; set; }
+
+ ///
+ /// 消息条数
+ ///
+ public string unread { get; set; }
+
+ ///
+ /// 最后时间
+ ///
+ public DateTime lastSendTime { get; set; }
+
+ ///
+ /// 最后消息
+ ///
+ public string lastContent { get; set; }
+
+ }
+}
diff --git a/GDZZ.Application/Service/LiveHistoryContacts/ILiveHistoryContactsService.cs b/GDZZ.Application/Service/LiveHistoryContacts/ILiveHistoryContactsService.cs
new file mode 100644
index 0000000..6d4efff
--- /dev/null
+++ b/GDZZ.Application/Service/LiveHistoryContacts/ILiveHistoryContactsService.cs
@@ -0,0 +1,14 @@
+using GDZZ.Core;
+using Microsoft.AspNetCore.Mvc;
+using System.Threading.Tasks;
+using GDZZ.Application.Entity;
+using System.Collections.Generic;
+
+namespace GDZZ.Application
+{
+ public interface ILiveHistoryContactsService
+ {
+
+ Task> List();
+ }
+}
\ No newline at end of file
diff --git a/GDZZ.Application/Service/LiveHistoryContacts/LiveHistoryContactsService.cs b/GDZZ.Application/Service/LiveHistoryContacts/LiveHistoryContactsService.cs
new file mode 100644
index 0000000..725956d
--- /dev/null
+++ b/GDZZ.Application/Service/LiveHistoryContacts/LiveHistoryContactsService.cs
@@ -0,0 +1,115 @@
+using GDZZ.Core;
+using Furion.DependencyInjection;
+using Furion.DynamicApiController;
+using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using SqlSugar;
+using System.Linq;
+using System.Threading.Tasks;
+using GDZZ.Application.Entity;
+using System.Collections.Generic;
+using K4os.Hash.xxHash;
+using GDZZ.Core.Entity;
+
+namespace GDZZ.Application
+{
+ ///
+ /// 聊天服务
+ ///
+ [ApiDescriptionSettings("Application", Name = "LiveHistoryContacts", Order = 1)]
+ public class LiveHistoryContactsService : ILiveHistoryContactsService, IDynamicApiController, ITransient
+ {
+ private readonly SqlSugarRepository _rep;
+ private readonly SqlSugarRepository liveMessageRep;
+ private readonly SqlSugarRepository liveUserFriend; //好友表仓储
+ private readonly SqlSugarRepository _sysUserRep; // 用户表仓储
+ public LiveHistoryContactsService(SqlSugarRepository rep,
+ SqlSugarRepository liveUserFriend,
+ SqlSugarRepository liveMessageRep)
+ {
+ _rep = rep;
+ this.liveUserFriend = liveUserFriend;
+ this.liveMessageRep = liveMessageRep;
+ }
+
+ ///
+ /// 新增联系人
+ ///
+ ///
+ [HttpPost("/LiveHistoryContacts/AddLive")]
+ public async Task AddLive(AddLiveHistoryContactsInput input)
+ {
+ var entity = input.Adapt();
+ await _rep.InsertAsync(entity);
+ }
+
+ ///
+ /// 获取联系人
+ ///
+ ///
+ ///
+ [HttpGet("/LiveHistoryContacts/list")]
+ public async Task> List()
+ {
+ List historyLists= new List();
+ //获取好友列表
+ var friends = await this.liveUserFriend.Where(x => x.CreatedUserId == UserManager.UserId).ToListAsync();
+ foreach (var item in friends)
+ {
+ var friend = await this._sysUserRep.SingleAsync(x => x.Id == item.FriendID);
+ if (friend == null)
+ continue;
+ historyLists.Add(new LiveHistoryLists()
+ {
+ Avatar = friend.Avatar,
+ DisplayName = friend.NickName,
+ Id = item.FriendID,
+ Index = friend.Name.Substring(0, 1),
+
+ //rm -rf mk dir ls install cd home
+
+ }) ;
+
+ }
+ return historyLists;
+ }
+
+
+
+
+
+ #region 聊天详情
+
+ ///
+ /// 获取聊天信息列表
+ ///
+ ///
+ [HttpGet("/LiveHistoryContacts/GetMessageLists")]
+ public async Task> GetMessageLists()
+ {
+ var res = await this.liveMessageRep.Where(x => x.CreatedUserId == UserManager.UserId || x.OtherUserID == UserManager.UserId).ToListAsync();
+ return res.Adapt>();
+ }
+
+ ///
+ /// 增加聊天历史任务列表
+ ///
+ ///
+ ///
+ [HttpPost("/LiveHistoryContacts/addMessage")]
+ public async Task AddMessage(AddLiveMessageInput input)
+ {
+
+ var entity = input.Adapt();
+ var history = await this._rep.Where(x => (x.CreatedUserId == input.OtherUserID && x.UserID == UserManager.UserId) || (x.UserID == input.OtherUserID && x.CreatedUserId == UserManager.UserId)).SingleAsync();
+
+ await this.liveMessageRep.InsertAsync(entity);
+ }
+
+ #endregion
+
+
+
+
+ }
+}
diff --git a/GDZZ.Core/GDZZ.Core.xml b/GDZZ.Core/GDZZ.Core.xml
index 3ed4033..6c47aeb 100644
--- a/GDZZ.Core/GDZZ.Core.xml
+++ b/GDZZ.Core/GDZZ.Core.xml
@@ -7063,12 +7063,12 @@
-
+
发送消息
-
-
+
+
diff --git a/GDZZ.Core/Hubs/ChatHub.cs b/GDZZ.Core/Hubs/ChatHub.cs
index e04e555..7ab5f62 100644
--- a/GDZZ.Core/Hubs/ChatHub.cs
+++ b/GDZZ.Core/Hubs/ChatHub.cs
@@ -2,6 +2,7 @@ using Furion.DataEncryption;
using GDZZ.Core.Entity;
using GDZZ.Core.Service;
using Microsoft.AspNetCore.SignalR;
+using Furion.InstantMessaging;
using System;
using System.Linq;
using System.Threading.Tasks;
@@ -11,6 +12,7 @@ namespace GDZZ.Core;
///
/// 聊天集线器
///
+//[MapHub("/hubs/chathub")]
public class ChatHub : Hub
{
private readonly ISysCacheService _cache;
@@ -66,11 +68,6 @@ public class ChatHub : Hub
}
- public async Task SendMessage(string user, string message)
- {
- //await Clients.All.SendAsync("ReceiveMessage", user, message);
- }
-
}
diff --git a/GDZZ.Core/Service/Emp/SysEmpService.cs b/GDZZ.Core/Service/Emp/SysEmpService.cs
index 9dc9e18..65bc6b1 100644
--- a/GDZZ.Core/Service/Emp/SysEmpService.cs
+++ b/GDZZ.Core/Service/Emp/SysEmpService.cs
@@ -83,7 +83,6 @@ public class SysEmpService : ISysEmpService, ITransient
{
_sysEmpRep.CurrentBeginTran();
- var emppos = await this.sysEmpPosRep.FirstOrDefaultAsync(x => x.SysEmpId == long.Parse(sysEmpParam.Id));
await this.sysEmpPosRep.DeleteAsync(x =>x.SysEmpId == long.Parse(sysEmpParam.Id));
// 先删除员工信息
diff --git a/GDZZ.Core/Service/Menu/SysMenuService.cs b/GDZZ.Core/Service/Menu/SysMenuService.cs
index ae49971..8ad1dd1 100644
--- a/GDZZ.Core/Service/Menu/SysMenuService.cs
+++ b/GDZZ.Core/Service/Menu/SysMenuService.cs
@@ -277,10 +277,13 @@ public class SysMenuService : ISysMenuService, IDynamicApiController, ITransient
try
{
_sysMenuRep.CurrentBeginTran();
- await _sysMenuRep.DeleteAsync(u => childIdList.Contains(u.Id));
+
// 级联删除该菜单及子菜单对应的角色-菜单表信息
await _sysRoleMenuService.DeleteRoleMenuListByMenuIdList(childIdList);
+ await _sysMenuRep.DeleteAsync(u => childIdList.Contains(u.Id));
+
+
// 清除缓存
await _sysCacheService.DelByPatternAsync(CommonConst.CACHE_KEY_MENU);
await _sysCacheService.DelByPatternAsync(CommonConst.CACHE_KEY_ALLPERMISSION);
diff --git a/GDZZ.Core/Service/OnlineUser/SysOnlineUserService.cs b/GDZZ.Core/Service/OnlineUser/SysOnlineUserService.cs
index f244e66..06dca2f 100644
--- a/GDZZ.Core/Service/OnlineUser/SysOnlineUserService.cs
+++ b/GDZZ.Core/Service/OnlineUser/SysOnlineUserService.cs
@@ -75,17 +75,30 @@ public class SysOnlineUserService : ISysOnlineUserService, IDynamicApiController
}
+
+
+
+
+
///
/// 发送消息
///
- ///
- ///
+ ///
+ ///
///
- public async Task SendMessage(string user, string message)
+ [NonAction]
+ public async Task PushMessages(List userIds,string message)
{
- //await _chatHubContext.Clients.All.SendAsync("ReceiveMessage", user, message);
- }
+ var userList = _sysOnlineUerRep.Where(m => userIds.Contains(m.UserId)).ToList();
+ if (userList.Any())
+ {
+ foreach (var item in userList)
+ {
+ await _chatHubContext.Clients.Client(item.ConnectionId).SendMessage("", item.Name, message);
+ }
+ }
+ }
diff --git a/GDZZ.Core/SqlSugar/SqlSugarSetup.cs b/GDZZ.Core/SqlSugar/SqlSugarSetup.cs
index 5d1548f..e5187c2 100644
--- a/GDZZ.Core/SqlSugar/SqlSugarSetup.cs
+++ b/GDZZ.Core/SqlSugar/SqlSugarSetup.cs
@@ -240,6 +240,7 @@ public static class SqlSugarSetup
IsAutoCloseConnection = true,
ConfigId = item.DbNumber,
InitKeyType = InitKeyType.Attribute,
+
MoreSettings = new ConnMoreSettings()
{
IsAutoRemoveDataCache = true//自动清理缓存
diff --git a/GDZZ.Web.Core/applicationconfig.json b/GDZZ.Web.Core/applicationconfig.json
index b73fe20..90f9750 100644
--- a/GDZZ.Web.Core/applicationconfig.json
+++ b/GDZZ.Web.Core/applicationconfig.json
@@ -52,7 +52,7 @@
},
"Cache": {
"CacheType": "MemoryCache", // RedisCache
- "RedisConnectionString": "127.0.0.1:6379,password=,defaultDatabase=2"
+ "RedisConnectionString": "106.55.234.178:6379,password=zongzhi@2022,defaultDatabase=2"
},
"SnowId": {
"WorkerId": "1" // 取值范围0~63,默认1
diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/383346119102534.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/383346119102534.jpg
new file mode 100644
index 0000000..68c19b1
Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/383346119102534.jpg differ
diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/383348736938054.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/383348736938054.jpg
new file mode 100644
index 0000000..0038db6
Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/383348736938054.jpg differ