diff --git a/src/Shentun.Peis.Application.Contracts/CardBills/GetCardBillListDto.cs b/src/Shentun.Peis.Application.Contracts/CardBills/GetCardBillListDto.cs index 96aa9888..353b3538 100644 --- a/src/Shentun.Peis.Application.Contracts/CardBills/GetCardBillListDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CardBills/GetCardBillListDto.cs @@ -53,5 +53,11 @@ namespace Shentun.Peis.CardBills /// 支付方式 集合 /// public List PayModeIds { get; set; } = new List(); + + + /// + /// 操作用户id 集合 + /// + public List OperateUserIds { get; set; } = new List(); } } diff --git a/src/Shentun.Peis.Application.Contracts/CardBills/GetCardBillStatisticsReportInputDto.cs b/src/Shentun.Peis.Application.Contracts/CardBills/GetCardBillStatisticsReportInputDto.cs index aec81bd5..edefb1a4 100644 --- a/src/Shentun.Peis.Application.Contracts/CardBills/GetCardBillStatisticsReportInputDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CardBills/GetCardBillStatisticsReportInputDto.cs @@ -26,7 +26,7 @@ namespace Shentun.Peis.CardBills /// 手机 /// public string Phone { get; set; } - + /// /// 记账标志 0、充值 1、扣费 2、退费 @@ -48,5 +48,11 @@ namespace Shentun.Peis.CardBills /// 支付方式 集合 /// public List PayModeIds { get; set; } = new List(); + + + /// + /// 操作用户id 集合 + /// + public List OperateUserIds { get; set; } = new List(); } } diff --git a/src/Shentun.Peis.Application/CardBills/CardBillAppService.cs b/src/Shentun.Peis.Application/CardBills/CardBillAppService.cs index 966fc768..a6059dad 100644 --- a/src/Shentun.Peis.Application/CardBills/CardBillAppService.cs +++ b/src/Shentun.Peis.Application/CardBills/CardBillAppService.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.EntityFrameworkCore; using Shentun.Peis.Enums; using Shentun.Peis.Models; +using SqlSugar; using System; using System.Collections.Generic; using System.Linq; @@ -114,6 +115,11 @@ namespace Shentun.Peis.CardBills queryable = queryable.Where(m => input.PayModeIds.Contains(m.PayModeId)); } + if (input.OperateUserIds.Any()) + { + queryable = queryable.Where(m => input.OperateUserIds.Contains(m.CreatorId.Value)); + } + var userlist = await _userRepository.GetListAsync(); var entlist = queryable.Select(s => new CardBillDto @@ -415,6 +421,11 @@ namespace Shentun.Peis.CardBills query = query.Where(m => input.PayModeIds.Contains(m.cardBill.PayModeId)); } + if (input.OperateUserIds.Any()) + { + query = query.Where(m => input.OperateUserIds.Contains(m.cardBill.CreatorId.Value)); + } + var queryList = query.ToList().GroupBy(g => g.cardRegister);