添加出入库记录逻辑,采购收货调拨打印、绑定条码更接口变更等

This commit is contained in:
2024-08-12 09:12:56 +08:00
parent 00f01db950
commit cb24d13fff
17 changed files with 688 additions and 25 deletions

View File

@@ -362,6 +362,18 @@ namespace Tnb.WarehouseMgr
wmsPurchaseOrderD.fk_wms_purchase_order_id = wmsPurchaseOrderH.id;
wmsPurchaseOrderD.matcode = detail.material_code;
wmsPurchaseOrderD.unit = detail.unit_code;
var erpExtendField = await db.Queryable<ErpExtendField>().InnerJoin<DictionaryDataEntity>((a, b) => a.table_id == b.Id).Where((a, b) => a.cunitid == detail.unit_code).Select((a, b) => b).FirstAsync();
if (erpExtendField != null)
{
wmsPurchaseOrderD.unit = erpExtendField.EnCode;
}
else
{
_LoggerErp2Mes.LogWarning($@"【PurchaseOrder】表体明细中单位{detail.unit_code}在wms系统中未找到");
throw new AppFriendlyException($@"表体明细中单位{detail.unit_code}在wms系统中未找到", 500);
}
wmsPurchaseOrderD.purchase_quantity = detail.purchase_quantity;
wmsPurchaseOrderD.stock_location = detail.stock_location;
wmsPurchaseOrderD.code_batch = detail.code_batch;
@@ -468,7 +480,18 @@ namespace Tnb.WarehouseMgr
wmsOutsourceOrderD.fk_wms_outsource_order_id = wmsOutsourceOrderH.id;
wmsOutsourceOrderD.matcode = detail.material_code;
wmsOutsourceOrderD.unit = detail.unit_code;
var erpExtendField = await db.Queryable<ErpExtendField>().InnerJoin<DictionaryDataEntity>((a, b) => a.table_id == b.Id).Where((a, b) => a.cunitid == detail.unit_code).Select((a, b) => b).FirstAsync();
if (erpExtendField != null)
{
wmsOutsourceOrderD.unit = erpExtendField.EnCode;
}
else
{
_LoggerErp2Mes.LogWarning($@"【OutsourceOrder】表体明细中单位{detail.unit_code}在wms系统中未找到");
throw new AppFriendlyException($@"表体明细中单位{detail.unit_code}在wms系统中未找到", 500);
}
wmsOutsourceOrderD.outsource_quantity = detail.outsource_quantity;
wmsOutsourceOrderD.stock_location = detail.stock_location;
wmsOutsourceOrderD.code_batch = detail.code_batch;
@@ -869,7 +892,18 @@ namespace Tnb.WarehouseMgr
msRawmatTransferinstockD.bill_id = wmsRawmatTransferinstockH.id;
msRawmatTransferinstockD.matcode = detail.material_code;
msRawmatTransferinstockD.unit = detail.unit_code;
var erpExtendField = await db.Queryable<ErpExtendField>().InnerJoin<DictionaryDataEntity>((a, b) => a.table_id == b.Id).Where((a, b) => a.cunitid == detail.unit_code).Select((a, b) => b).FirstAsync();
if (erpExtendField != null)
{
msRawmatTransferinstockD.unit = erpExtendField.EnCode;
}
else
{
_LoggerErp2Mes.LogWarning($@"【TransferOutstock】表体明细中单位{detail.unit_code}在wms系统中未找到");
throw new AppFriendlyException($@"表体明细中单位{detail.unit_code}在wms系统中未找到", 500);
}
msRawmatTransferinstockD.qty = detail.qty;
msRawmatTransferinstockD.stock_location = detail.stock_location;
msRawmatTransferinstockD.code_batch = detail.code_batch;