|
|
|
@ -55,58 +55,47 @@ namespace Admin.Core.Service
|
|
|
|
|
if (orderBomInfoList == null) return null;
|
|
|
|
|
foreach (BaseOrderInfo order in orderList)
|
|
|
|
|
{
|
|
|
|
|
var bomList = await _orderBomInfoRepository.QueryAsync(d => d.ParentId.Equals(order.MaterialCode));
|
|
|
|
|
if (bomList != null)
|
|
|
|
|
{
|
|
|
|
|
bomList.ForEach(b =>
|
|
|
|
|
{
|
|
|
|
|
List<OrderBomInfo> bbList = RecursionFn(orderBomInfoList, b.MaterialCode);
|
|
|
|
|
if (b.ParentId.IsNotEmptyOrNull() && (b.MaterialName.Contains("箱体") || b.MaterialName.Contains("内胆")))
|
|
|
|
|
{
|
|
|
|
|
bbList.ForEach(bb =>
|
|
|
|
|
{
|
|
|
|
|
list.Add(new PrintPlanInfoView()
|
|
|
|
|
{
|
|
|
|
|
OrderCode = order.OrderCode,
|
|
|
|
|
ProductCode = order.MaterialCode,
|
|
|
|
|
ProductName = order.MaterialName,
|
|
|
|
|
PlanAmount = order.OrderAmount,
|
|
|
|
|
MaterialCode = bb.MaterialCode,
|
|
|
|
|
MaterialName = bb.MaterialName,
|
|
|
|
|
LinerAmount = bb.StandardAmount,
|
|
|
|
|
BoxAmount = bb.StandardAmount,
|
|
|
|
|
StandardAmount = bb.StandardAmount,
|
|
|
|
|
CreateTime = order.CreatedTime
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
List<OrderBomInfo> bbList = RecursionFn(orderBomInfoList, order.MaterialCode);
|
|
|
|
|
|
|
|
|
|
//bomList.ForEach(b =>
|
|
|
|
|
//{
|
|
|
|
|
// List<OrderBomInfo> bbList = RecursionFn(orderBomInfoList, b.MaterialCode);
|
|
|
|
|
// if (b.ParentId.IsNotEmptyOrNull() && (b.MaterialName.Contains("箱体") || b.MaterialName.Contains("内胆")))
|
|
|
|
|
// {
|
|
|
|
|
// bbList.ForEach(bb =>
|
|
|
|
|
// {
|
|
|
|
|
// list.Add(new PrintPlanInfoView()
|
|
|
|
|
// {
|
|
|
|
|
// OrderCode = order.OrderCode,
|
|
|
|
|
// ProductCode = order.MaterialCode,
|
|
|
|
|
// ProductName = order.MaterialName,
|
|
|
|
|
// PlanAmount = order.OrderAmount,
|
|
|
|
|
// MaterialCode = bb.MaterialCode,
|
|
|
|
|
// MaterialName = bb.MaterialName,
|
|
|
|
|
// LinerAmount = bb.StandardAmount,
|
|
|
|
|
// BoxAmount = bb.StandardAmount,
|
|
|
|
|
// StandardAmount = bb.StandardAmount,
|
|
|
|
|
// CreateTime = order.CreatedTime
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
//var list = (from order in orderList
|
|
|
|
|
// join b in orderBomInfoList
|
|
|
|
|
// on order.MaterialCode equals b.ParentId
|
|
|
|
|
// select new PrintPlanInfoView
|
|
|
|
|
// {
|
|
|
|
|
// OrderCode = order.OrderCode,
|
|
|
|
|
// ProductCode = order.MaterialCode,
|
|
|
|
|
// ProductName = order.MaterialName,
|
|
|
|
|
// PlanAmount = order.OrderAmount,
|
|
|
|
|
// MaterialCode = b.MaterialCode,
|
|
|
|
|
// MaterialName = b.MaterialName,
|
|
|
|
|
// StandardAmount = b.StandardAmount,
|
|
|
|
|
// CreateTime = order.CreatedTime
|
|
|
|
|
// }).ToList();
|
|
|
|
|
}
|
|
|
|
|
//var list = (from order in orderList
|
|
|
|
|
// join b in orderBomInfoList
|
|
|
|
|
// on order.MaterialCode equals b.ParentId
|
|
|
|
|
// select new PrintPlanInfoView
|
|
|
|
|
// {
|
|
|
|
|
// OrderCode = order.OrderCode,
|
|
|
|
|
// ProductCode = order.MaterialCode,
|
|
|
|
|
// ProductName = order.MaterialName,
|
|
|
|
|
// PlanAmount = order.OrderAmount,
|
|
|
|
|
// MaterialCode = b.MaterialCode,
|
|
|
|
|
// MaterialName = b.MaterialName,
|
|
|
|
|
// StandardAmount = b.StandardAmount,
|
|
|
|
|
// CreateTime = order.CreatedTime
|
|
|
|
|
// }).ToList();
|
|
|
|
|
|
|
|
|
|
list.ForEach(b =>
|
|
|
|
|
{
|
|
|
|
|
PrintOrderInfo info = printOrderInfoList.FirstOrDefault(d => d.OrderCode == b.OrderCode);
|
|
|
|
|
if (info != null)
|
|
|
|
|
{
|
|
|
|
|
b.LinerAmount = info.LinerAmount;
|
|
|
|
|
b.BoxAmount = info.BoxAmount;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -200,7 +189,8 @@ namespace Admin.Core.Service
|
|
|
|
|
OrderBomInfo n = it.Current;
|
|
|
|
|
if (n.ParentId.IsNotEmptyOrNull())
|
|
|
|
|
{
|
|
|
|
|
tlist.Add(n);
|
|
|
|
|
if (n.MaterialType == "300" && n.MaterialType == "200")
|
|
|
|
|
tlist.Add(n);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tlist;
|
|
|
|
|