|
@@ -18,8 +18,6 @@ namespace OASystem.Infrastructure.Repositories.System
|
|
|
public class MessageRepository : BaseRepository<Sys_Message, MessageView>
|
|
|
{
|
|
|
private readonly SetDataRepository _setData;
|
|
|
- private readonly List<int> _operationTypeList = new List<int>() { 1, 2, 3, 4, 5 }; //操作通知所属类型
|
|
|
- private readonly List<int> _taskTypeList = new List<int>() { 6 };//任务通知 TaskNotification
|
|
|
|
|
|
public MessageRepository(SqlSugarClient sqlSugar, SetDataRepository setData)
|
|
|
: base(sqlSugar)
|
|
@@ -59,7 +57,8 @@ namespace OASystem.Infrastructure.Repositories.System
|
|
|
DeleteTime = "1990-01-01 00:00:00.000",
|
|
|
Remark = "",
|
|
|
IsDel = 0,
|
|
|
- DiId = msgDto.DiId
|
|
|
+ DiId = msgDto.DiId,
|
|
|
+ Param = msgDto.Param,
|
|
|
};
|
|
|
|
|
|
int? msgId = await _sqlSugar.Insertable(message).ExecuteReturnIdentityAsync();
|
|
@@ -191,7 +190,11 @@ namespace OASystem.Infrastructure.Repositories.System
|
|
|
|
|
|
//消息类型
|
|
|
List<NotificationTypeView> messageTypeViews = AppSettingsHelper.Get<NotificationTypeView>("MessageNotificationType");
|
|
|
-
|
|
|
+ List<int> _operationTypeList = messageTypeViews.Where(it =>it.TypeId == 1).FirstOrDefault().MsgTypeIds.ToList();
|
|
|
+ List<int> _taskTypeList = messageTypeViews.Where(it => it.TypeId == 2).FirstOrDefault().MsgTypeIds.ToList();
|
|
|
+ List<int> _noticeTypeList = messageTypeViews.Where(it => it.TypeId == 0).FirstOrDefault().MsgTypeIds.ToList();
|
|
|
+
|
|
|
+
|
|
|
string msgSql = string.Format(@"Select * From(
|
|
|
Select row_number() over(order by sm.ReleaseTime Desc) as RowNumber,
|
|
|
sm.Id,sm.Type,sm.Title,sm.Content,sd.DepName issuerDep,su.CnName issuerUser,
|
|
@@ -223,14 +226,20 @@ namespace OASystem.Infrastructure.Repositories.System
|
|
|
int operationNotificationDataCount = operationNotificationData.Where(it => it.IsRead == 0).ToList().Count;
|
|
|
|
|
|
//任务通知
|
|
|
- var taskNotificationData = data.Where(it => _taskTypeList.Contains(it.Type)).OrderBy(it => it.IsRead).ToList();
|
|
|
- int taskNotificationDataCount = taskNotificationData.Where(it => it.IsRead == 0).ToList().Count;
|
|
|
+ var taskNotificationData = data.Where(it => _taskTypeList.Contains(it.Type)).OrderBy(it => it.IsRead).ToList();//操作通知所属类型
|
|
|
+ int taskNotificationDataCount = taskNotificationData.Where(it => it.IsRead == 0).ToList().Count; //任务通知 TaskNotification
|
|
|
+
|
|
|
+ //公告通知 notice
|
|
|
+ var noticeNotificationData = data.Where(it => _noticeTypeList.Contains(it.Type)).OrderBy(it => it.IsRead).ToList();//操作通知所属类型
|
|
|
+ int noticeNotificationDataCount = noticeNotificationData.Where(it => it.IsRead == 0).ToList().Count; //任务通知 TaskNotification
|
|
|
+
|
|
|
|
|
|
foreach (var item in msgTypeData)
|
|
|
{
|
|
|
- //1021 团组操作通知 1020 任务操作通知
|
|
|
+ //1021 团组操作通知 1020 任务操作通知 1022 公告通知
|
|
|
if (item.Id == 1020) item.UnReadCount = taskNotificationDataCount;
|
|
|
else if (item.Id == 1021) item.UnReadCount = operationNotificationDataCount;
|
|
|
+ else if (item.Id == 1022) item.UnReadCount = noticeNotificationDataCount;
|
|
|
}
|
|
|
|
|
|
if (dto.PortType == 1 || dto.PortType == 2) // web/android
|
|
@@ -241,7 +250,6 @@ namespace OASystem.Infrastructure.Repositories.System
|
|
|
}
|
|
|
else if (dto.PortType == 3)
|
|
|
{
|
|
|
-
|
|
|
result.Code = 0;
|
|
|
result.Data = new {
|
|
|
MsgTypeData = msgTypeData,
|