修复bug

This commit is contained in:
18942506660
2023-11-16 11:50:46 +08:00
parent 83c866aeee
commit 110fcbed24

View File

@@ -82,10 +82,6 @@ namespace WMS.Web.Repositories
/// <returns></returns>
public async Task<(List<OutStockQueryInfoResponse> list, int total)> GetListAsync(OutStockQueryRequest dto)
{
List<int> detailIds = new List<int>();
if (!string.IsNullOrEmpty(dto.SourceBillNo))
detailIds = await _context.OutStockTaskDetails.FromSqlRaw($"SELECT Id FROM t_wms_outstock_details WHERE SourceBillNo like '%{dto.SourceBillNo}%'").Select(s => s.Id).ToListAsync();
List<int> ids = new List<int>();
if (!string.IsNullOrEmpty(dto.Creator))
{
@@ -138,8 +134,8 @@ namespace WMS.Web.Repositories
query = query.Where(w => mIds.Contains(w.detail.MaterialId));
if (ids.Count() > 0)
query = query.Where(w => ids.Contains(w.order.CreatorId));
if (detailIds.Count()!=0)
query = query.Where(w => detailIds.Contains(w.detail.Id));
if (!string.IsNullOrEmpty(dto.SourceBillNo))
query = query.Where(w => w.detail.ErpDetails.Where(wd => EF.Functions.Like(wd.SourceBillNo, "%" + dto.SourceBillNo + "%")).Select(s => s.DetailId).Contains(w.detail.Id));
if (dto.Type != null)
query = query.Where(w => w.order.Type == (OutStockType)dto.Type);
if (dto.SuccessSync != null)