fix 券发放查询增加厂区
This commit is contained in:
@@ -173,6 +173,7 @@ public class BookingOrderService : IBookingOrderService
|
||||
.Where(p => p.OrderNo == x.No)
|
||||
.Where(p => p.BookingDate >= request.BookingPeriod.Start)
|
||||
.Where(p => p.BookingDate <= request.BookingPeriod.End)
|
||||
.Where(p => p.IsDeleted == false)
|
||||
.Any()
|
||||
)
|
||||
.WhereIF(request.ShiftType.HasValue, x => x.ShiftType == request.ShiftType)
|
||||
|
||||
@@ -30,7 +30,10 @@ public class WalletService : IWalletService
|
||||
{
|
||||
Code = x.Code,
|
||||
Name = x.Name + "钱包",
|
||||
Factories = SqlFunc.Subqueryable<WalletEntity>().Where(p => p.Code == x.Code).ToList(p => p.Factory)
|
||||
Factories = SqlFunc.Subqueryable<WalletEntity>()
|
||||
.Where(p => p.Code == x.Code)
|
||||
.Where(p => p.IsDeleted == false)
|
||||
.ToList(p => p.Factory)
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Dlhis.Basic.Vouchers.Request;
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Canteen.Tickets.Request;
|
||||
using Dlhis.Canteen.Tickets.Services;
|
||||
using Dlhis.Canteen.Voucher.Requests;
|
||||
@@ -39,6 +37,7 @@ public class VouchersController : ControllerBase
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
[IgnoreTenant]
|
||||
public async Task<Pagination<VoucherPageResponse>> GetPageAsync([FromQuery] VoucherPageRequest request)
|
||||
{
|
||||
return await _namedResolver.GetService<IVoucherService>(request.Type.ToString() + "VoucherService").GetPageAsync(request);
|
||||
|
||||
@@ -32,4 +32,9 @@ public class VoucherPageRequest : PageDto
|
||||
/// 二级部门
|
||||
/// </summary>
|
||||
public string DepartmentNoSecond { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 筛选厂区
|
||||
/// </summary>
|
||||
public List<string> Factories { get; set; }
|
||||
}
|
||||
@@ -26,12 +26,13 @@ public abstract class BaseVoucherService : IVoucherService
|
||||
|
||||
public async Task<Pagination<VoucherPageResponse>> GetPageAsync(VoucherPageRequest request)
|
||||
{
|
||||
var tenantId = _currentUser.GetStringTenantId();
|
||||
//var tenantId = _currentUser.GetStringTenantId();
|
||||
|
||||
var pagination = await DbContext.Queryable<VoucherEntity>()
|
||||
.LeftJoin<VoucherUserInfoEntity>((x, u) => x.No == u.VoucherNo)
|
||||
.LeftJoin<GainfoEntity>((x, u, ga) => u.UserCode == ga.Code)
|
||||
.Where((x, u) => x.Type == request.Type && u.Factory == tenantId)
|
||||
.Where((x, u) => x.Type == request.Type)
|
||||
.WhereIF(request.Factories.IsPresent(), (x, u) => request.Factories.Contains(u.Factory))
|
||||
.WhereIF(request.UserCode.IsPresent(), (x, u, ga) => u.UserCode == request.UserCode)
|
||||
.WhereIF(request.SearchDateTimePeriod.HasValue(),
|
||||
(x, u, ga) => x.CreateTime >= request.SearchDateTimePeriod.Start &&
|
||||
|
||||
Reference in New Issue
Block a user