|
@@ -10,6 +10,7 @@ using OASystem.Domain.ViewModels.Groups;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
|
+using System.Security.Cryptography;
|
|
using System.Text;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
@@ -87,10 +88,42 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
List<InvitationOfficialActivitiesView> _DecreasePayments = await _sqlSugar.SqlQueryable<InvitationOfficialActivitiesView>(sql).ToListAsync();
|
|
List<InvitationOfficialActivitiesView> _DecreasePayments = await _sqlSugar.SqlQueryable<InvitationOfficialActivitiesView>(sql).ToListAsync();
|
|
if (_DecreasePayments.Count != 0)
|
|
if (_DecreasePayments.Count != 0)
|
|
{
|
|
{
|
|
- result = new Result() { Code = 0, Msg = "查询成功!", Data = _DecreasePayments };
|
|
|
|
|
|
+ if (dto.PageIndex != 0 && dto.PageSize != 0)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ int count = _DecreasePayments.Count;
|
|
|
|
+ float totalPage = (float)count / dto.PageSize;//总页数
|
|
|
|
+ if (totalPage == 0) totalPage = 1;
|
|
|
|
+ else totalPage = (int)Math.Ceiling((double)totalPage);
|
|
|
|
+
|
|
|
|
+ List<InvitationOfficialActivitiesView> invitationOfficialActivities = new List<InvitationOfficialActivitiesView>();
|
|
|
|
+ for (int i = 0; i < dto.PageSize; i++)
|
|
|
|
+ {
|
|
|
|
+ var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
|
|
|
|
+ if (RowIndex < _DecreasePayments.Count)
|
|
|
|
+ {
|
|
|
|
+ invitationOfficialActivities.Add(_DecreasePayments[RowIndex]);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ListViewBase<InvitationOfficialActivitiesView> rst = new ListViewBase<InvitationOfficialActivitiesView>();
|
|
|
|
+ rst.DataList = invitationOfficialActivities;
|
|
|
|
+ rst.DataCount = count;
|
|
|
|
+ rst.CurrPageIndex = dto.PageIndex;
|
|
|
|
+ rst.CurrPageSize = dto.PageSize;
|
|
|
|
+ return result = new Result() { Code = 0, Msg = "查询成功!", Data = rst };
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return result = new Result() { Code = 0, Msg = "查询成功!", Data = _DecreasePayments };
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+
|
|
result = new Result() { Code = 0, Msg = "暂无数据!", Data = _DecreasePayments };
|
|
result = new Result() { Code = 0, Msg = "暂无数据!", Data = _DecreasePayments };
|
|
}
|
|
}
|
|
}
|
|
}
|