原材料/成品调拨出库接口、采购收货添加是否赠品、单价、是否自制字段

This commit is contained in:
2024-08-19 10:30:34 +08:00
parent 4cc672766b
commit 3d74fea016
15 changed files with 635 additions and 149 deletions

View File

@@ -250,6 +250,8 @@ namespace Tnb.WarehouseMgr
List<WmsCarrybindCode> wmsCarrybindCodes = new List<WmsCarrybindCode>();
List<WmsTempCode> wmsTempCodes = await _db.Queryable<WmsTempCode>().Where(r => input.details.Select(c => c.barcode).Contains(r.barcode)).ToListAsync();
foreach (var detail in input.details)
{
var WmsCarryCode = detail.Adapt<WmsCarryCode>();
@@ -261,6 +263,12 @@ namespace Tnb.WarehouseMgr
WmsCarryCode.create_time = DateTime.Now;
WmsCarryCodes.Add(WmsCarryCode);
WmsTempCode wmsTempCode = wmsTempCodes.Where(r => r.barcode == detail.barcode).First();
if (wmsTempCode == null)
{
throw new Exception($"条码{wmsTempCode.barcode}在系统中不存在");
}
wmsTempCode.codeqty = detail.codeqty;
var wmsCarrybindCode = detail.Adapt<WmsCarrybindCode>();
wmsCarrybindCode.carrybind_id = wmsCarrybindH.id;
wmsCarrybindCodes.Add(wmsCarrybindCode);
@@ -271,6 +279,7 @@ namespace Tnb.WarehouseMgr
rows = await _db.Insertable(WmsCarryCodes).ExecuteCommandAsync();
await _db.Insertable(wmsCarrybindH).ExecuteCommandAsync();
await _db.Insertable(wmsCarrybindCodes).ExecuteCommandAsync();
await _db.Updateable(wmsTempCodes).ExecuteCommandAsync();
}