出库任务列表

This commit is contained in:
18942506660
2023-10-28 10:51:38 +08:00
parent 458f9d6a8e
commit ae3d0e0c2f
5 changed files with 215 additions and 1 deletions

View File

@@ -1,9 +1,13 @@
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMS.Web.Core.Dto.OutStockTask;
using WMS.Web.Core.Help;
using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure;
using WMS.Web.Repositories.Configuration;
@@ -57,5 +61,42 @@ namespace WMS.Web.Repositories
}
}
/// <summary>
/// 列表
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
public async Task<(List<OutStockTaskQueryInfoResponse> list, int total)> GetListAsync(OutStockTaskQueryRequest dto)
{
var query = _context.OutStockTask
.OrderByDescending(o => o.Id)
.Where(adv => 1 == 1);
if (dto.CreateBeginDate != null)
query = query.Where(w => w.OperateTime >= dto.CreateBeginDate);
if (dto.CreateEndDate != null)
query = query.Where(w => w.OperateTime <= dto.CreateEndDate);
//组装
int total = await query.CountAsync();
var list = await query.Select(s => new OutStockTaskQueryInfoResponse()
{
#region dto组装
Id = 0,
Status = "",
Type = "",
CreateTime = s.OperateTime.DateToStringSeconds(),
Stock = "",
SourceBillNo = "",
SaleBillNo = "",
DeliveryOrg = "",
ReceiptCustomer = "",
MaterialName = "",
MaterialNumber = "",
Specifications = ""
#endregion
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
return (list, total);
}
}
}