|
@@ -1,10 +1,12 @@
|
|
|
-using OASystem.Domain;
|
|
|
+using NPOI.SS.Formula.Functions;
|
|
|
+using OASystem.Domain;
|
|
|
using OASystem.Domain.Dtos.System;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Security.Cryptography;
|
|
|
using System.Text;
|
|
|
+using System.Threading;
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
namespace OASystem.Infrastructure.Repositories.System
|
|
@@ -95,9 +97,9 @@ namespace OASystem.Infrastructure.Repositories.System
|
|
|
{
|
|
|
Result result = new Result() { Code = -1, Msg = "未知错误", Data = null };
|
|
|
|
|
|
- if (dto.PortType == 1 || dto.PortType == 2)
|
|
|
+ if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)
|
|
|
{
|
|
|
- string msgSqlWhere = string.Format(@"Select sm.Type,sm.Title,sm.Content,sd.DepName issuerDep,su.CnName issuerUser,
|
|
|
+ string msgSqlWhere = string.Format(@"Select sm.Id,sm.Type,sm.Title,sm.Content,sd.DepName issuerDep,su.CnName issuerUser,
|
|
|
sm.ReleaseTime,smra.Id AuthId,smra.ReadableUId,smra.IsRead,smra.ReadTime
|
|
|
From Sys_Message sm
|
|
|
Inner Join Sys_MessageReadAuth smra On sm.Id = smra.MsgId
|
|
@@ -111,9 +113,35 @@ namespace OASystem.Infrastructure.Repositories.System
|
|
|
var _readableMsgList = await _sqlSugar.SqlQueryable<ReadbleMessageView>(msgSqlWhere).ToListAsync();
|
|
|
if (_readableMsgList.Count > 0)
|
|
|
{
|
|
|
+ int pageIndex = dto.PageIndex;
|
|
|
+ int pageSize = pageIndex + 9;
|
|
|
+
|
|
|
+ List<int> operationTypeList = new List<int>() {1,2,3,4,5 };
|
|
|
+ var operationNotificatioData = _readableMsgList.Where(it => operationTypeList.Contains(it.Type)).OrderBy(it => it.IsRead).ToList();
|
|
|
+ var operationNotificatioDataView = new {
|
|
|
+ Count = operationNotificatioData.Count,
|
|
|
+ UnReadCount = operationNotificatioData.Where(it => it.IsRead == 0).Count(),
|
|
|
+ OperationNotificatioData = operationNotificatioData.Skip(pageIndex).Take(pageSize).ToList()
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ List<int> taskTypeList = new List<int>() { 6 };
|
|
|
+ var taskNotificatioData = _readableMsgList.Where(it => taskTypeList.Contains(it.Type)).OrderBy(it => it.IsRead).ToList();
|
|
|
+ var taskNotificatioDataView = new
|
|
|
+ {
|
|
|
+ Count = taskNotificatioData.Count,
|
|
|
+ UnReadCount = taskNotificatioData.Where(it => it.IsRead == 0).Count(),
|
|
|
+ TaskNotificatioData = taskNotificatioData.Skip(pageIndex).Take(pageSize).ToList()
|
|
|
+ };
|
|
|
+
|
|
|
+ var _view = new {
|
|
|
+ OperationNotificatio = operationNotificatioDataView,
|
|
|
+ TaskNotificatio = taskNotificatioDataView
|
|
|
+ };
|
|
|
+
|
|
|
result.Code = 0;
|
|
|
result.Msg = "成功!";
|
|
|
- result.Data = _readableMsgList;
|
|
|
+ result.Data = _view;
|
|
|
}
|
|
|
else
|
|
|
{
|