This commit is contained in:
tongfei
2024-04-17 10:14:28 +08:00
2 changed files with 30 additions and 16 deletions

View File

@@ -277,18 +277,28 @@ namespace WMS.Web.Repositories
if (customer_result.IsSuccess)
customers = customer_result.Data.ToList();
List<int> taskIds = new List<int>();
List<int> taskIds = null;
List<int> taskIds_s = new List<int>();
List<int> taskIds_b = new List<int>();
//序列码出库单
if (dto.SerialNumbers.Count() > 0)
if (dto.SerialNumbers != null && dto.SerialNumbers.Count() > 0)
{
taskIds = new List<int>();
var res = await _outStockRepositories.GetEntityListBySerialNumbers(dto.SerialNumbers);
taskIds.AddRange(res.Select(s => s.TaskId));
}
//箱号取出库单
if (dto.BoxBillNos.Count() > 0)
if (dto.BoxBillNos != null && dto.BoxBillNos.Count() > 0)
{
var res = await _outStockRepositories.GetEntityListByBoxBillNos(dto.BoxBillNos);
taskIds.AddRange(res.Select(s => s.TaskId));
//要跟上面的序列码搜索取交集
if (taskIds == null)
{
taskIds = new List<int>();
taskIds.AddRange(res.Select(s => s.TaskId));
}
else
taskIds = res.Select(s => s.TaskId).Intersect(taskIds).ToList();
}
#endregion
@@ -332,7 +342,7 @@ namespace WMS.Web.Repositories
DateTime dt_end = ((DateTime)dto.CreateEndDate).AddDays(1);
query = query.Where(w => w.order.OperateTime <= dt_end);
}
if (taskIds.Count() > 0)
if (taskIds != null)
{
query = query.Where(w => taskIds.Contains(w.order.Id));
}