This commit is contained in:
2023-05-31 10:19:05 +08:00
parent 1b65a7a9e5
commit 9c621c75cd
238 changed files with 9905 additions and 4034 deletions

View File

@@ -119,7 +119,8 @@ public class MessageService : IMessageService, IDynamicApiController, ITransient
releaseUser = SqlFunc.MergeString(c.RealName, "/", c.Account),
title = a.Title,
type = a.Type,
isRead = b.IsRead
isRead = b.IsRead,
flowType=a.FlowType
}).ToPagedListAsync(input.currentPage, input.pageSize);
return PageResult<MessageListOutput>.SqlSugarPageResult(list);
}
@@ -297,7 +298,7 @@ public class MessageService : IMessageService, IDynamicApiController, ITransient
{
try
{
_repository.AsSugarClient().Insertable(receiveEntityList).ExecuteCommandAsync();
_repository.AsSugarClient().Insertable(receiveEntityList).ExecuteCommand();
return _repository.AsInsertable(entity).IgnoreColumns(ignoreNullColumn: true).CallEntityMethod(m => m.Create()).ExecuteCommand();
}
@@ -317,7 +318,7 @@ public class MessageService : IMessageService, IDynamicApiController, ITransient
{
try
{
_repository.AsSugarClient().Insertable(receiveEntityList).ExecuteCommandAsync();
_repository.AsSugarClient().Insertable(receiveEntityList).ExecuteCommand();
return _repository.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).CallEntityMethod(m => m.LastModify()).ExecuteCommand();
}
catch (Exception)
@@ -405,7 +406,7 @@ public class MessageService : IMessageService, IDynamicApiController, ITransient
/// <param name="title">标题.</param>
/// <param name="bodyText">内容.</param>
[NonAction]
public async Task SentMessage(List<string> toUserIds, string title, string bodyText = null, Dictionary<string, object> bodyDic = null)
public async Task SentMessage(List<string> toUserIds, string title, string bodyText = null, Dictionary<string, object> bodyDic = null, int type = 2, string flowType = "1")
{
try
{
@@ -413,9 +414,10 @@ public class MessageService : IMessageService, IDynamicApiController, ITransient
entity.Id = SnowflakeIdHelper.NextId();
entity.Title = title;
entity.BodyText = bodyText;
entity.Type = 2;
entity.Type = type;
entity.LastModifyTime = DateTime.Now;
entity.LastModifyUserId = _userManager.UserId;
entity.FlowType = flowType.ParseToInt();
List<MessageReceiveEntity> receiveEntityList = toUserIds
.Select(x => new MessageReceiveEntity()
{
@@ -432,7 +434,7 @@ public class MessageService : IMessageService, IDynamicApiController, ITransient
{
var userId = item.Replace("-delegate", string.Empty);
// 消息推送 - 指定用户
await _imHandler.SendMessageToUserAsync(string.Format("{0}-{1}", _userManager.TenantId, item), new { method = "messagePush", messageType = 2, userId = _userManager.UserId, toUserId = toUserIds, title = entity.Title, unreadNoticeCount = 1, id = entity.Id }.ToJsonString());
await _imHandler.SendMessageToUserAsync(string.Format("{0}-{1}", _userManager.TenantId, userId), new { method = "messagePush", messageType = 2, userId = _userManager.UserId, toUserId = toUserIds, title = entity.Title, unreadNoticeCount = 1, id = entity.Id }.ToJsonString());
}
}
}