采购收货质检收货单找载具逻辑

This commit is contained in:
2024-08-21 12:37:56 +08:00
parent cdaeefa4ae
commit 3ab02675d7
10 changed files with 131 additions and 123 deletions

View File

@@ -751,11 +751,11 @@ namespace Tnb.WarehouseMgr
throw new AppFriendlyException($@"表体存在物料和批号重复的明细!", 500);
}
WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable<WmsErpWarehouserelaH>().Where(r => r.erp_warehousecode == input.erp_wh_type).FirstAsync();
WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable<WmsErpWarehouserelaH>().Where(r => r.erp_warehousecode == input.warehouse_code).FirstAsync();
if (wmsErpWarehouserelaH == null)
{
_LoggerErp2Mes.LogWarning($@"【TransferOrder】不存在erp仓库类型{input.erp_wh_type}对应wms系统的映射关系");
throw new AppFriendlyException($@"不存在erp仓库类型{input.erp_wh_type}对应wms系统的映射关系", 500);
_LoggerErp2Mes.LogWarning($@"【TransferOrder】不存在erp仓库类型{input.warehouse_code}对应wms系统的映射关系");
throw new AppFriendlyException($@"不存在erp仓库类型{input.warehouse_code}对应wms系统的映射关系", 500);
}
string warehouse_outstock_code = wmsErpWarehouserelaH.wms_warehousecode;
@@ -778,7 +778,7 @@ namespace Tnb.WarehouseMgr
wmsSaleH.status = WmsWareHouseConst.BILLSTATUS_ADD_ID;
wmsSaleH.warehouse_id = warehouse_outstock.id;
wmsSaleH.customer_code = input.customer_code;
wmsSaleH.erp_wh_type = input.erp_wh_type;
wmsSaleH.erp_wh_type = input.warehouse_code;
var customer = await db.Queryable<BasCustomer>().Where(p => p.customer_code == input.customer_code).FirstAsync();
if (customer != null)
{
@@ -866,11 +866,11 @@ namespace Tnb.WarehouseMgr
throw new AppFriendlyException($"主表主键不能为空", 500);
}
WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable<WmsErpWarehouserelaH>().Where(r => r.erp_warehousecode == input.erp_wh_type).FirstAsync();
WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable<WmsErpWarehouserelaH>().Where(r => r.erp_warehousecode == input.warehouse_instock).FirstAsync();
if (wmsErpWarehouserelaH == null)
{
_LoggerErp2Mes.LogWarning($@"【TransferOrder】不存在erp仓库类型{input.erp_wh_type}对应wms系统的映射关系");
throw new AppFriendlyException($@"不存在erp仓库类型{input.erp_wh_type}对应wms系统的映射关系", 500);
_LoggerErp2Mes.LogWarning($@"【TransferOrder】不存在erp仓库类型{input.warehouse_instock}对应wms系统的映射关系");
throw new AppFriendlyException($@"不存在erp仓库类型{input.warehouse_instock}对应wms系统的映射关系", 500);
}
string warehouse_instock_code = wmsErpWarehouserelaH.wms_warehousecode;
@@ -918,7 +918,7 @@ namespace Tnb.WarehouseMgr
wmsRawmatTransferinstockH.create_time = DateTime.Now;
wmsRawmatTransferinstockH.dept_code = input.dept_code;
wmsRawmatTransferinstockH.biller = input.biller;
wmsRawmatTransferinstockH.erp_wh_type = input.erp_wh_type;
wmsRawmatTransferinstockH.erp_wh_type = input.warehouse_instock;
wmsRawmatTransferinstockH.org_id = WmsWareHouseConst.AdministratorOrgId;
await db.Insertable(wmsRawmatTransferinstockH).ExecuteCommandAsync();
@@ -978,7 +978,7 @@ namespace Tnb.WarehouseMgr
wmsTransferInstockH.create_time = DateTime.Now;
wmsTransferInstockH.dept_code = input.dept_code;
wmsTransferInstockH.biller = input.biller;
wmsTransferInstockH.erp_wh_type = input.erp_wh_type;
wmsTransferInstockH.erp_wh_type = input.warehouse_instock;
await db.Insertable(wmsTransferInstockH).ExecuteCommandAsync();
List<WmsTransferInstockD> wmsTransferInstockDs = new List<WmsTransferInstockD>();
@@ -1079,11 +1079,11 @@ namespace Tnb.WarehouseMgr
throw new AppFriendlyException($@"表体存在物料和批号重复的明细!", 500);
}
WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable<WmsErpWarehouserelaH>().Where(r => r.erp_warehousecode == input.erp_wh_type).FirstAsync();
WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable<WmsErpWarehouserelaH>().Where(r => r.erp_warehousecode == input.warehouse_outstock).FirstAsync();
if (wmsErpWarehouserelaH == null)
{
_LoggerErp2Mes.LogWarning($@"【TransferOrder】不存在erp仓库类型{input.erp_wh_type}对应wms系统的映射关系");
throw new AppFriendlyException($@"不存在erp仓库类型{input.erp_wh_type}对应wms系统的映射关系", 500);
_LoggerErp2Mes.LogWarning($@"【TransferOrder】不存在erp仓库类型{input.warehouse_outstock}对应wms系统的映射关系");
throw new AppFriendlyException($@"不存在erp仓库类型{input.warehouse_outstock}对应wms系统的映射关系", 500);
}
string warehouse_outstock_code = wmsErpWarehouserelaH.wms_warehousecode;
@@ -1107,7 +1107,7 @@ namespace Tnb.WarehouseMgr
wmsTransferOrderH.create_id = WmsWareHouseConst.ErpUserId;
wmsTransferOrderH.create_time = DateTime.Now;
wmsTransferOrderH.org_id = WmsWareHouseConst.AdministratorOrgId;
wmsTransferOrderH.erp_wh_type = input.erp_wh_type;
wmsTransferOrderH.erp_wh_type = input.warehouse_outstock;
var _erpExtendField = await db.Queryable<ErpExtendField>().InnerJoin<DictionaryDataEntity>((a, b) => a.table_id == b.Id)
.Where((a, b) => a.transaction_type_id == input.transaction_type).Select((a, b) => b).FirstAsync();
@@ -1176,7 +1176,7 @@ namespace Tnb.WarehouseMgr
wmsRawmatTransferoutstockH.issuance_status = "0";
wmsRawmatTransferoutstockH.transaction_type = _erpExtendField.EnCode;
wmsRawmatTransferoutstockH.org_id = WmsWareHouseConst.AdministratorOrgId;
wmsRawmatTransferoutstockH.erp_wh_type = input.erp_wh_type;
wmsRawmatTransferoutstockH.erp_wh_type = input.warehouse_outstock;
List<WmsRawmatTransferoutstockD> wmsRawmatTransferoutstockDs = new List <WmsRawmatTransferoutstockD>();
foreach (var detail in input.details)
{
@@ -1229,7 +1229,7 @@ namespace Tnb.WarehouseMgr
wmsTransferOutstockH.issuance_status = "0";
wmsTransferOutstockH.transaction_type = _erpExtendField.EnCode;
wmsTransferOutstockH.org_id = WmsWareHouseConst.AdministratorOrgId;
wmsTransferOutstockH.erp_wh_type = input.erp_wh_type;
wmsTransferOutstockH.erp_wh_type = input.warehouse_outstock;
List<WmsTransferOutstockD> wmsTransferOutstockDs = new List<WmsTransferOutstockD>();
foreach (var detail in input.details)
{