diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/SaleShippingInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/SaleShippingInput.cs index 524c7e8f..a38f4592 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/SaleShippingInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/SaleShippingInput.cs @@ -48,10 +48,6 @@ namespace Tnb.WarehouseMgr.Entities.Dto.ErpInputs /// public string erp_pk { get; set; } - /// - /// erp仓库类型 - /// - public string erp_wh_type { get; set; } public List details { get; set; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOrderInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOrderInput.cs index cd28e4b8..cead5fcd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOrderInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOrderInput.cs @@ -1,93 +1,92 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Transactions; - -namespace Tnb.WarehouseMgr.Entities.Dto.ErpInputs -{ - public class TransferOrderInput - { - /// - /// 单号 - /// - public string? transfer_order { get; set; } - - /// - /// 部门编码 - /// - public string? dept_code { get; set; } - - /// - /// 业务员编码 - /// +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Transactions; + +namespace Tnb.WarehouseMgr.Entities.Dto.ErpInputs +{ + public class TransferOrderInput + { + /// + /// 单号 + /// + public string? transfer_order { get; set; } + + /// + /// 部门编码 + /// + public string? dept_code { get; set; } + + /// + /// 业务员编码 + /// public string? biller { get; set; } - /// - /// 出库仓库 - /// + /// + /// 出库仓库 + /// public string? warehouse_outstock { get; set; } - /// - /// 入库组织编号 - /// - public string? instockorg_code { get; set; } - - /// - /// 供货日期 - /// + /// + /// 入库组织编号 + /// + public string? instockorg_code { get; set; } + + /// + /// 供货日期 + /// public DateTime? ship_date { get; set; } - - /// - /// 主表pk - /// + + /// + /// 主表pk + /// public string? erp_pk { get; set; } - - /// - /// 交易类型 - /// + + /// + /// 交易类型 + /// public string? transaction_type { get; set; } - /// /// erp仓库类型 /// public string erp_wh_type { get; set; } - public List details { get; set; } - } - public class TransferOrderInputDetail - { - /// - /// 行号 - /// - public string? lineno { get; set; } - - /// - /// 物品代码 - /// - public string? material_code { get; set; } - - /// - /// 单位代码 - /// - public string? unit_code { get; set; } - - /// - /// 采购数量 - /// + public List details { get; set; } + } + public class TransferOrderInputDetail + { + /// + /// 行号 + /// + public string? lineno { get; set; } + + /// + /// 物品代码 + /// + public string? material_code { get; set; } + + /// + /// 单位代码 + /// + public string? unit_code { get; set; } + + /// + /// 采购数量 + /// public decimal? qty { get; set; } - - /// - /// 批次 - /// - public string? code_batch { get; set; } - - /// - /// 交货日期 - /// - public DateTime? delivery_date { get; set; } - - /// - /// 子表主键 - /// - public string erp_line_pk { get; set; } - } -} + + /// + /// 批次 + /// + public string? code_batch { get; set; } + + /// + /// 交货日期 + /// + public DateTime? delivery_date { get; set; } + + /// + /// 子表主键 + /// + public string erp_line_pk { get; set; } + } +} diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOutstockInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOutstockInput.cs index ea37f9a5..4eea13b3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOutstockInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/ErpInputs/TransferOutstockInput.cs @@ -58,11 +58,6 @@ namespace Tnb.WarehouseMgr.Entities.Dto.ErpInputs /// public string? erp_pk { get; set; } - /// - /// erp仓库类型 - /// - public string? erp_wh_type { get; set; } - public List details { get; set; } } public class RawMatTransferInstockDetail diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutinStockDetail.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutinStockDetail.cs index 086723cc..b1a691d8 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutinStockDetail.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutinStockDetail.cs @@ -42,7 +42,7 @@ public partial class WmsOutinStockDetail : BaseEntity /// /// 源单单据类型 /// - public int? source_type { get; set; } + public string? source_type { get; set; } /// /// 来源单据行号 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs index 6c730d9d..8c95dbcc 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs @@ -760,7 +760,6 @@ namespace Tnb.WarehouseMgr s_eleUseStatusDic[elevator.device_id] = (int)EnumElevatorUseStatus.空闲; Logger.Information($"【TaskCallback】 {devName.Match(@"\d+")}#梯,设备名称:{devName},开始进入关门流程 {devName} 变更为空闲 {s_eleUseStatusDic.GetHashCode()} {s_eleUseStatusDic[elevator.device_id]}"); - int doorStatus = await _elevatorControlService.GetTagAsync(devName, ElevatorConsts.DoorStatus); Logger.Information($"【TaskCallback】 设备:{devName},门状态:{doorStatus.ToEnum().ToString()}"); if (doorStatus.ToEnum() != EnumDoorStatus.关门到位保持 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs b/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs index 030998c5..e35bf535 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs @@ -501,18 +501,18 @@ namespace Tnb.WarehouseMgr } var tasks = ParallelWriteTagAsync(input); var writeRes = await Task.WhenAll(tasks); - var timedTaskSvc = _backgudSvc as TimedTaskBackgroundService; - if (timedTaskSvc != null) - { - if (input.flag.Equals("close", StringComparison.OrdinalIgnoreCase)) - { - _ = timedTaskSvc.CloseAgvHeartbeat(input.devNames); - } - else - { - _ = timedTaskSvc.OpenAgvHeartbeat(input.devNames); - } - } + //var timedTaskSvc = _backgudSvc as TimedTaskBackgroundService; + //if (timedTaskSvc != null) + //{ + // if (input.flag.Equals("close", StringComparison.OrdinalIgnoreCase)) + // { + // _ = timedTaskSvc.CloseAgvHeartbeat(input.devNames); + // } + // else + // { + // _ = timedTaskSvc.OpenAgvHeartbeat(input.devNames); + // } + //} } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs index c3fb9c6d..2d86303f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/ErpToWmsService.cs @@ -751,11 +751,11 @@ namespace Tnb.WarehouseMgr throw new AppFriendlyException($@"表体存在物料和批号重复的明细!", 500); } - WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable().Where(r => r.erp_warehousecode == input.erp_wh_type).FirstAsync(); + WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable().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().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().Where(r => r.erp_warehousecode == input.erp_wh_type).FirstAsync(); + WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable().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 wmsTransferInstockDs = new List(); @@ -1079,11 +1079,11 @@ namespace Tnb.WarehouseMgr throw new AppFriendlyException($@"表体存在物料和批号重复的明细!", 500); } - WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable().Where(r => r.erp_warehousecode == input.erp_wh_type).FirstAsync(); + WmsErpWarehouserelaH wmsErpWarehouserelaH = await db.Queryable().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().InnerJoin((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 wmsRawmatTransferoutstockDs = new List (); 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 wmsTransferOutstockDs = new List(); foreach (var detail in input.details) { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutinStockDetailService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutinStockDetailService.cs index b5642724..15ca5715 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutinStockDetailService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutinStockDetailService.cs @@ -138,6 +138,16 @@ namespace Tnb.WarehouseMgr wmsOutinStockDetail.act_end_date = input.disTask.act_end_date; wmsOutinStockDetail.pretask_code = input.disTask.pretask_code; wmsOutinStockDetail.distask_code = input.disTask.bill_code; + wmsOutinStockDetail.create_time = DateTime.Now; + switch (input.disTask.biz_type) + { + case WmsWareHouseConst.BIZTYPE_WMSINSTOCK_ID: + { + wmsOutinStockDetail.source_detail_id = input.disTask.source_id; + wmsOutinStockDetail.source_type = WmsWareHouseConst.BIZTYPE_WMSINSTOCK_ID; + break; + } + } wmsOutinStockDetail.type = type; List mats = await db.Queryable().Where(r => wmsCarryCodes.Select(x => x.material_id).Distinct().Contains(r.id)).ToListAsync(); @@ -187,7 +197,14 @@ namespace Tnb.WarehouseMgr rows = await db.Insertable(wmsOutinStockCodes).ExecuteCommandAsync(); if (rows == 0) { - throw new Exception($"插入出入库明细条码失败!"); + if (wmsCarryCodes.Count == 0) + { + Logger.LogWarning("空载具无需插入出入库明细条码"); + } + else + { + throw new Exception($"插入出入库明细条码失败!"); + } } await db.Ado.CommitTranAsync(); } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs index 4b9d9d6e..0e09096f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs @@ -397,6 +397,7 @@ namespace Tnb.WarehouseMgr var billCode = input.data.ContainsKey(nameof(WmsPurchaseH.bill_code)) ? input.data[nameof(WmsPurchaseH.bill_code)] : null; string bill_type = ""; string required_type = (await _dbScanInStockByRedis.Queryable().FirstAsync(it => it.barcode == input.data["物料条码"])).required_type; + string source_id = (await _dbScanInStockByRedis.Queryable().FirstAsync(it => it.barcode == input.data["物料条码"])).require_id; switch (required_type) { case WmsWareHouseConst.BILLTYPE_PURCHASE_ID: @@ -581,6 +582,7 @@ namespace Tnb.WarehouseMgr area_code = it.Key, require_id = instock.id, require_code = instock.bill_code, + source_id = source_id, create_id = _userManager.User == null ? "" : _userManager.UserId!, create_time = DateTime.Now, priority = WmsWareHouseConst.priority_instock diff --git a/apihost/Tnb.API.Entry/Configurations/AgvRequestCfgUrl.json b/apihost/Tnb.API.Entry/Configurations/AgvRequestCfgUrl.json index 697ba175..a15fe34b 100644 --- a/apihost/Tnb.API.Entry/Configurations/AgvRequestCfgUrl.json +++ b/apihost/Tnb.API.Entry/Configurations/AgvRequestCfgUrl.json @@ -1,6 +1,6 @@ { "AgvRequestUrls": { - "CreateTaskChainUrl": "http://10.147.19.104:5013/api/task-chain/create", + "CreateTaskChainUrl": "http://192.168.11.104:1880/api/task-chain/create", "CancelTaskChainUrl": "http://192.168.11.104:1880/api/task-chain/cancel" } } \ No newline at end of file