|
|
@@ -386,8 +386,6 @@ namespace Business.ResourceExamineManagement
|
|
|
var seorder = await _crm_seorder.FindAsync(x => x.Id == OrderId);
|
|
|
//获取销售订单子表
|
|
|
var seorderentry = await _crm_seorderentry.FindAsync(x => x.seorder_id == OrderId);
|
|
|
- //获取物料详情
|
|
|
- var mysql_ic_item = await _ic_item_stock.(x => x.number == seorderentry.bom_number);
|
|
|
if (string.IsNullOrEmpty(seorderentry.bom_number))
|
|
|
{
|
|
|
return false;
|
|
|
@@ -755,14 +753,14 @@ namespace Business.ResourceExamineManagement
|
|
|
/// 计算库存量
|
|
|
/// </summary>
|
|
|
/// <param name="returnlist"></param>
|
|
|
- public void BomStock(List<BomChildExamineDto> returnlist,long bangid,long orderid,long orderentryid, long factoryid)
|
|
|
+ public void BomStock(List<BomChildExamineDto> returnlist, long bangid, long orderid, long orderentryid, long factoryid)
|
|
|
{
|
|
|
returnlist = returnlist.OrderBy(s => s.num).ToList();
|
|
|
//取物料库存记录
|
|
|
FilterDefinition<ic_item_stock> filter = Builders<ic_item_stock>.Filter.In(s => s.icitem_id, returnlist.Select(c => c.item_id).ToList());
|
|
|
var stocklist = _ic_item_stock.GetManyByIds(filter).Result;
|
|
|
//取当前订单的物料库存占用记录
|
|
|
- var occupylist = _ic_item_stockoccupy.GetManyByCondition(p=>p.bang_id == bangid && p.order_id == orderid).Result;
|
|
|
+ var occupylist = _ic_item_stockoccupy.GetManyByCondition(p => p.bang_id == bangid && p.order_id == orderid).Result;
|
|
|
//计算剩余库存
|
|
|
foreach (var item in returnlist)
|
|
|
{
|
|
|
@@ -772,9 +770,9 @@ namespace Business.ResourceExamineManagement
|
|
|
}
|
|
|
//非虚拟件
|
|
|
//当前物料的库存数量
|
|
|
- decimal stockQty = stocklist.Where(s => s.icitem_id == item.item_id).Sum(p=>p.sqty.GetValueOrDefault());
|
|
|
+ decimal stockQty = stocklist.Where(s => s.icitem_id == item.item_id).Sum(p => p.sqty.GetValueOrDefault());
|
|
|
//获取当前订单其他订单行当前物料的占用数量
|
|
|
- decimal otherStockQty = occupylist.Where(s => s.icitem_id == item.item_id).Sum(p=>p.quantity);
|
|
|
+ decimal otherStockQty = occupylist.Where(s => s.icitem_id == item.item_id).Sum(p => p.quantity);
|
|
|
//当前订单行物料库存情况
|
|
|
item.sqty = stockQty - otherStockQty;
|
|
|
}
|