优化
This commit is contained in:
Binary file not shown.
@@ -1948,6 +1948,11 @@
|
|||||||
序列号
|
序列号
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.InStockTask.InStockTaskBoxInfoDto.SaleBillNo">
|
||||||
|
<summary>
|
||||||
|
销售订单号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Dto.InStockTask.InStockTaskDetailsInfoDto">
|
<member name="T:WMS.Web.Core.Dto.InStockTask.InStockTaskDetailsInfoDto">
|
||||||
<summary>
|
<summary>
|
||||||
入库任务单明细详情
|
入库任务单明细详情
|
||||||
|
|||||||
@@ -79,5 +79,10 @@ namespace WMS.Web.Core.Dto.InStockTask
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string SerialNumbers { get; set; }
|
public string SerialNumbers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 销售订单号
|
||||||
|
/// </summary>
|
||||||
|
public string SaleBillNo { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -236,6 +236,8 @@ namespace WMS.Web.Repositories
|
|||||||
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||||
.GroupJoin(_context.Box, p => p.detail.BoxId, ts => ts.Id, (p, ts) => new { p.detail, p.order, ts })
|
.GroupJoin(_context.Box, p => p.detail.BoxId, ts => ts.Id, (p, ts) => new { p.detail, p.order, ts })
|
||||||
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, box) => new { p.detail, p.order, box })
|
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, box) => new { p.detail, p.order, box })
|
||||||
|
.GroupJoin(_context.InStockTaskDetails, p => p.detail.TaskDetailId, ts => ts.Id, (p, ts) => new { p.detail, p.order, p.box, ts })
|
||||||
|
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, taskDet) => new { p.detail, p.order, p.box, taskDet })
|
||||||
.Where(x => x.detail.TaskId == entity.Id).Select(x => new InStockTaskBoxInfoDto()
|
.Where(x => x.detail.TaskId == entity.Id).Select(x => new InStockTaskBoxInfoDto()
|
||||||
{
|
{
|
||||||
BoxId = x.box.Id,
|
BoxId = x.box.Id,
|
||||||
@@ -244,7 +246,7 @@ namespace WMS.Web.Repositories
|
|||||||
MethodForInt = (int)x.order.Method,
|
MethodForInt = (int)x.order.Method,
|
||||||
MaterialNumber = x.detail.MaterialNumber,
|
MaterialNumber = x.detail.MaterialNumber,
|
||||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, x.detail.MaterialNumber),
|
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, x.detail.MaterialNumber),
|
||||||
|
SaleBillNo = x.taskDet.SaleBillNo,
|
||||||
Qty = 0,
|
Qty = 0,
|
||||||
RealityQty = x.detail.Qty,
|
RealityQty = x.detail.Qty,
|
||||||
ShelfTime = x.order.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
ShelfTime = x.order.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
@@ -749,13 +751,21 @@ namespace WMS.Web.Repositories
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var taskIds = new List<int>();
|
||||||
|
if (dto.BoxBillNos != null && dto.BoxBillNos.Count != 0)
|
||||||
|
{
|
||||||
|
var tids = await _context.InstockTaskBox.Where(x => dto.BoxBillNos.Contains(x.BoxBillNo)).GroupBy(x => x.TaskId).Select(x => x.Key).ToListAsync();
|
||||||
|
taskIds.AddRange(tids);
|
||||||
|
}
|
||||||
|
if (dto.SerialNumbers != null && dto.SerialNumbers.Count != 0)
|
||||||
|
{
|
||||||
|
var tids= await _context.InStockDetails.Where(w => w.SerialNumbers.SequenceEqual(dto.SerialNumbers)).GroupBy(x => x.TaskId).Select(x => x.Key).ToListAsync();
|
||||||
|
taskIds.AddRange(tids);
|
||||||
|
}
|
||||||
|
|
||||||
var query = _context.InStockTaskDetails
|
var query = _context.InStockTaskDetails
|
||||||
.GroupJoin(_context.InStockTask, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
.GroupJoin(_context.InStockTask, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
||||||
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||||
.GroupJoin(_context.InstockTaskBox,p=>p.order.Id,ts=>ts.TaskId, (p,ts)=>new { p.detail,p.order,ts})
|
|
||||||
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, box) => new { p.detail, p.order,box })
|
|
||||||
.GroupJoin(_context.InStockDetails, p => p.order.Id, ts => ts.TaskId, (p, ts) => new { p.detail, p.order, p.box,ts })
|
|
||||||
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, instockdet) => new { p.detail, p.order,p.box, instockdet })
|
|
||||||
.Where(adv => 1 == 1);
|
.Where(adv => 1 == 1);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(dto.SourceBillNo))
|
if (!string.IsNullOrEmpty(dto.SourceBillNo))
|
||||||
@@ -767,16 +777,9 @@ namespace WMS.Web.Repositories
|
|||||||
query = query.Where(w => materialNumbs.Contains(w.detail.MaterialNumber));
|
query = query.Where(w => materialNumbs.Contains(w.detail.MaterialNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
//箱号
|
if (taskIds.Count!=0)
|
||||||
if (dto.BoxBillNos != null && dto.BoxBillNos.Count != 0)
|
|
||||||
{
|
{
|
||||||
query = query.Where(w => dto.BoxBillNos.Contains(w.box.BoxBillNo));
|
query = query.Where(w => taskIds.Contains(w.order.Id));
|
||||||
}
|
|
||||||
|
|
||||||
//序列号
|
|
||||||
if (dto.SerialNumbers != null && dto.SerialNumbers.Count != 0)
|
|
||||||
{
|
|
||||||
query = query.Where(w => w.instockdet.SerialNumbers.SequenceEqual(dto.SerialNumbers));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(dto.Receiver))
|
if (!string.IsNullOrEmpty(dto.Receiver))
|
||||||
|
|||||||
Reference in New Issue
Block a user