入库单-列表接口

This commit is contained in:
tongfei
2023-10-27 09:30:17 +08:00
parent eec8396a91
commit 8221eae779
8 changed files with 126 additions and 4 deletions

View File

@@ -1,8 +1,11 @@
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMS.Web.Core;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Infrastructure;
@@ -27,11 +30,46 @@ namespace WMS.Web.Repositories
_serviceProvider = serviceProvider;
}
/// <summary>
/// 列表-分页
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
public async Task<ResultPagedList<InStockQueryResponse>> GetPagedList(InStockQueryRequest dto)
{
//var query=_context.
var query=_context.InStockDetails
.GroupJoin(_context.Instock, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
.Where(adv => 1 == 1);
return null;
if (!string.IsNullOrEmpty(dto.SourceBillNo))
query = query.Where(w => EF.Functions.Like(w.detail.SourceBillNo, "%" + dto.SourceBillNo + "%"));
var response = new ResultPagedList<InStockQueryResponse>();
int total = await query.CountAsync();
response.TotalCount = total;
var list = await query.Select(s => new InStockQueryResponse()
{
Id=s.order.Id,
DetailsId=s.detail.Id,
BillNo=s.order.BillNo,
Type=s.order.Type.GetRemark(),
SourceBillNo=s.detail.SourceBillNo,
Supplier="",
Org="",
MaterialName="",
MaterialNumber="",
Specifications="",
Stock="",
Qty=s.detail.Qty,
Creator="",
CreateTime=s.order.CreateTime,
SuccessSync=s.order.SuccessSync
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
response.Data = list;
return response;
}
}
}