Zxd.Core/code/Zxd.Core.Domain/OrderDomain.cs

50 lines
2.5 KiB
C#

using System;
namespace Zxd.Domain
{
public class OrderDomain
{
private readonly IBaseRepository<ZxdDbContext> _zxdRepository;
private readonly IDeptmentDomain _deptmentDomain;
public OrderDomain(IBaseRepository<ZxdDbContext> zxdRepository,
IDeptmentDomain deptmentDomain)
{
_zxdRepository = zxdRepository;
_deptmentDomain = deptmentDomain;
}
/*public async Task<PageResult<OrderDto>> GetOrderPage(SearchOrderDto dto)
{
var query = _zxdRepository.GetRepository<WxSzzOrder>().Query()
.If(dto.Orderid != null, x => x.Where(x => x.SzzyOrderid == dto.Orderid))
.If(dto.OrderStatus != null, x => x.Where(x => x.OrderStatus == dto.OrderStatus))
.If(dto.RiskctrlStatus != null, x => x.Where(x => x.RiskctrlStatus == dto.RiskctrlStatus))
.If(dto.Deptid != null, x => x.Where(x => x.Deptid == dto.Deptid))
.If(dto.ProductSeriesId != null, x => x.Where(x => x.FinishedProduct.ProductSeriesId == dto.ProductSeriesId))
.If(dto.ProductTypeId != null, x => x.Where(x => x.FinishedProduct.ProductTypeId == dto.ProductTypeId))
.If(dto.Activity != null, x => x.Where(x => x.FinishedProductId == dto.Activity))
.If(!string.IsNullOrEmpty(dto.ProductName), x => x.Where(x => x.FinishedProduct.ProductName.Contains(dto.ProductName)))
.If(!string.IsNullOrEmpty(dto.ProductCode), x => x.Where(x => x.FinishedProduct.ProductCode == dto.ProductCode))
.If(dto.SzzyOrderid != null, x => x.Where(x => x.SzzyOrderid == dto.SzzyOrderid))
.If(dto.OrderAmountMax != null, x => x.Where(x => x.NeedPay > dto.OrderAmountMax))
.If(dto.OrderTimeFrom != null, x => x.Where(x => x.Ctime >= dto.OrderTimeFrom))
.If(dto.OpenDateTo != null, x => x.Where(x => x.Ctime < dto.OrderTimeFrom.Value.AddDays(1)))
.If(dto.AccountingDateFrom != null, x => x.Where(x => x.Arrivaltime >= dto.AccountingDateFrom))
.If(dto.AccountingDateTo != null, x => x.Where(x => x.Arrivaltime < dto.AccountingDateFrom.Value.AddDays(1)))
.If(!dto.IncludeNotOpen, x => x.Where(x => x.Otime != null))
.Include(x => x.FinishedProduct);
var total = await query.CountAsync();
var data = await query
.Select(x => new OrderDto
{
})
.Skip((dto.PageIndex - 1) * dto.PageSize)
.Take(dto.PageSize)
.ToListAsync();
return new PageResult<OrderDto>(dto.PageIndex, dto.PageSize, total, data);
}*/
}
}