|
@@ -1,6 +1,8 @@
|
|
|
-using NPOI.SS.Formula.Functions;
|
|
|
+using NPOI.POIFS.Crypt.Dsig;
|
|
|
+using NPOI.SS.Formula.Functions;
|
|
|
using OASystem.Domain;
|
|
|
using OASystem.Domain.Dtos.System;
|
|
|
+using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
@@ -113,25 +115,37 @@ 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;
|
|
|
+ int pageSize = dto.PageSize; // 每页显示的记录数量
|
|
|
+ int currentPage = dto.PageIndex; // 当前页码(从1开始)
|
|
|
+
|
|
|
+
|
|
|
//操作通知 OperationNotification
|
|
|
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();
|
|
|
+ int operationNotificatioDataCount = operationNotificatioData.Count;
|
|
|
+ // 计算起始索引和结束索引
|
|
|
+ int operationStartIndex = (currentPage - 1) * pageSize;
|
|
|
+ int operationEndIndex = Math.Min(operationStartIndex + pageSize, operationNotificatioDataCount);
|
|
|
+
|
|
|
var operationNotificatioDataView = new {
|
|
|
- Count = operationNotificatioData.Count,
|
|
|
+ Count = operationNotificatioDataCount,
|
|
|
UnReadCount = operationNotificatioData.Where(it => it.IsRead == 0).Count(),
|
|
|
- OperationNotificatioData = operationNotificatioData.Skip(pageIndex).Take(pageSize).ToList()
|
|
|
+ OperationNotificatioData = operationNotificatioData.Skip(operationStartIndex).Take(pageSize).ToList()
|
|
|
};
|
|
|
|
|
|
//任务通知 TaskNotification
|
|
|
List<int> taskTypeList = new List<int>() { 6 };
|
|
|
var taskNotificatioData = _readableMsgList.Where(it => taskTypeList.Contains(it.Type)).OrderBy(it => it.IsRead).ToList();
|
|
|
+ int taskNotificatioDataCount = taskNotificatioData.Count;
|
|
|
+ // 计算起始索引和结束索引
|
|
|
+ int taskStartIndex = (currentPage - 1) * pageSize;
|
|
|
+ int taskEndIndex = Math.Min(operationStartIndex + pageSize, operationNotificatioDataCount);
|
|
|
+
|
|
|
var taskNotificatioDataView = new
|
|
|
{
|
|
|
- Count = taskNotificatioData.Count,
|
|
|
+ Count = taskNotificatioDataCount,
|
|
|
UnReadCount = taskNotificatioData.Where(it => it.IsRead == 0).Count(),
|
|
|
- TaskNotificatioData = taskNotificatioData.Skip(pageIndex).Take(pageSize).ToList()
|
|
|
+ TaskNotificatioData = taskNotificatioData.Skip(taskStartIndex).Take(pageSize).ToList()
|
|
|
};
|
|
|
|
|
|
var _view = new {
|