质检模块
This commit is contained in:
@@ -140,6 +140,21 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
wmsMaterialSignH.biz_type = wmsDistaskH.biz_type;
|
||||
|
||||
//已记录的物料签收记录表
|
||||
var wmsMaterialSignDs_ed = await _db.Queryable<WmsMaterialSignD>().Where(r => r.source_id == wmsDistaskH.source_id).ToListAsync();
|
||||
if (wmsMaterialSignDs_ed != null && wmsMaterialSignDs_ed.Count > 0)
|
||||
{
|
||||
//已下发数量
|
||||
var wmsRawmatOutstockD = await _db.Queryable<WmsRawmatOutstockD>().Where(r => r.id == wmsDistaskH.source_id).FirstAsync();
|
||||
var signed_qty = wmsMaterialSignDs_ed.Sum(r => r.sign_qty);//已签收数量
|
||||
var nowSign_qty = input.details.Sum(r => r.sign_qty);//当前需要签收数量
|
||||
//总签收数量不能大于总的下发数量
|
||||
if (signed_qty + nowSign_qty > wmsRawmatOutstockD.actual_outstock_qty)
|
||||
{
|
||||
throw new AppFriendlyException($"已签收数量{signed_qty},当前签收数量{nowSign_qty},总签收数量{signed_qty + nowSign_qty}不能大于已下发数量{wmsRawmatOutstockD.actual_outstock_qty}", 500);
|
||||
}
|
||||
}
|
||||
|
||||
// wms其它出库记录主表
|
||||
OtherOutstockAddDetailInput otherOutstockAddDetailInput = new OtherOutstockAddDetailInput();
|
||||
switch (wmsDistaskH.biz_type)
|
||||
@@ -197,6 +212,7 @@ namespace Tnb.WarehouseMgr
|
||||
wmsMaterialSignD.code_batch = wmsCarryCode.code_batch;
|
||||
wmsMaterialSignD.qty = wmsCarryCode.codeqty;
|
||||
wmsMaterialSignD.sign_qty = item.sign_qty;
|
||||
wmsMaterialSignD.source_id = wmsDistaskH.source_id;
|
||||
wmsMaterialSignDs.Add(wmsMaterialSignD);
|
||||
wmsCarryCode.codeqty = wmsCarryCode.codeqty - item.sign_qty;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user