修复bug
This commit is contained in:
Binary file not shown.
@@ -339,13 +339,23 @@ namespace WMS.Web.Repositories
|
|||||||
var materials = materials_result.Data.ToList();
|
var materials = materials_result.Data.ToList();
|
||||||
List<int> ids = new List<int>();
|
List<int> ids = new List<int>();
|
||||||
|
|
||||||
|
List<OutStockTask> list = new List<OutStockTask>();
|
||||||
var list = await _context.OutStockTask.Include(x => x.Details).ThenInclude(s => s.ErpDetails)
|
var list1 = await _context.OutStockTask.Include(x => x.Details).ThenInclude(s => s.ErpDetails)
|
||||||
.Where(f => (EF.Functions.Like(f.BillNo, "%" + billNo + "%") ||
|
.Where(f => EF.Functions.Like(f.BillNo, "%" + billNo + "%") &&
|
||||||
f.Details.SelectMany(s => s.ErpDetails).Where(w => EF.Functions.Like(w.SourceBillNo, "%" + billNo + "%")).Any()) &&
|
|
||||||
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait))
|
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait))
|
||||||
.OrderByDescending(o => o.Id)
|
.OrderByDescending(o => o.Id)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
if (list1 != null && list1.Count() > 0)
|
||||||
|
list.AddRange(list1);
|
||||||
|
|
||||||
|
var list2 = await _context.OutStockTask.Include(x => x.Details).ThenInclude(s => s.ErpDetails)
|
||||||
|
.Where(f => (f.Details.SelectMany(s => s.ErpDetails).Where(w => EF.Functions.Like(w.SourceBillNo, "%" + billNo + "%")).Any()) &&
|
||||||
|
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait))
|
||||||
|
.OrderByDescending(o => o.Id)
|
||||||
|
.ToListAsync();
|
||||||
|
if (list2 != null && list2.Count() > 0)
|
||||||
|
list.AddRange(list2);
|
||||||
|
|
||||||
var response = _mapper.Map<List<GetOutStockTaskByNoResponse>>(list);
|
var response = _mapper.Map<List<GetOutStockTaskByNoResponse>>(list);
|
||||||
foreach (var r in response)
|
foreach (var r in response)
|
||||||
{
|
{
|
||||||
@@ -448,13 +458,21 @@ namespace WMS.Web.Repositories
|
|||||||
|
|
||||||
public async Task<List<string>> GetOutStockTaskNosByNo(string billNo)
|
public async Task<List<string>> GetOutStockTaskNosByNo(string billNo)
|
||||||
{
|
{
|
||||||
return await _context.OutStockTask.Include(x => x.Details).ThenInclude(s => s.ErpDetails)
|
var res = await _context.OutStockTask.Include(x => x.Details).ThenInclude(s => s.ErpDetails)
|
||||||
.Where(f => (EF.Functions.Like(f.BillNo, "%" + billNo + "%") ||
|
.Where(f => EF.Functions.Like(f.BillNo, "%" + billNo + "%") &&
|
||||||
f.Details.SelectMany(s => s.ErpDetails).Where(w => EF.Functions.Like(w.SourceBillNo, "%" + billNo + "%")).Any()) &&
|
|
||||||
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait))
|
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait))
|
||||||
.OrderByDescending(o => o.Id)
|
.OrderByDescending(o => o.Id)
|
||||||
.Select(s => s.BillNo)
|
.Select(s => s.BillNo)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
var ress = await _context.OutStockTask.Include(x => x.Details).ThenInclude(s => s.ErpDetails)
|
||||||
|
.Where(f => (f.Details.SelectMany(s => s.ErpDetails).Where(w => EF.Functions.Like(w.SourceBillNo, "%" + billNo + "%")).Any()) &&
|
||||||
|
(f.Status == OutStockStatus.Part || f.Status == OutStockStatus.Wait))
|
||||||
|
.OrderByDescending(o => o.Id)
|
||||||
|
.Select(s => s.BillNo)
|
||||||
|
.ToListAsync();
|
||||||
|
res.AddRange(ress);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user