From cd3bbdfb0124e0a39f46f86bb90690337d8c2ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Fri, 13 Dec 2024 15:34:50 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=9B=9E=E5=BA=93?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssembleIssueJobAppService.cs | 156 ++++++++++++++++- .../CoatingIssueJobAppService.cs | 165 +++++++++++++++++- .../InjectionIssueJobAppService.cs | 152 ++++++++++++++++ .../KittingIssueJobAppService.cs | 155 ++++++++++++++++ .../SparePartIssueJobAppService.cs | 153 +++++++++++++++- .../UnplannedIssueJobAppService.cs | 157 ++++++++++++++++- .../UnplannedReceiptJobAppService.cs | 154 +++++++++++++++- 7 files changed, 1082 insertions(+), 10 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs index 942883be4..53b775616 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs @@ -62,6 +62,7 @@ public class AssembleIssueJobAppService private readonly IPostionLocationAppService _postionLocationAppService; private readonly ILocationDeliveryAppService _locationDeliveryAppService; private readonly IItemBasicAppService _itemBasicAppService; + private readonly ITransferNoteAppService _transferNoteAppService; public AssembleIssueJobAppService( ILogger logger, @@ -73,7 +74,10 @@ public class AssembleIssueJobAppService , IOptions options, ITransferLibRequestAppService transferLibRequestAppService, ICurrentUser currentUser, UnitOfWorkManager unitOfWorkManager , IOptions agvOptions - , IPostionLocationAppService postionLocationAppService, ILocationDeliveryAppService locationDeliveryAppService) : base( + , IPostionLocationAppService postionLocationAppService, ILocationDeliveryAppService locationDeliveryAppService + , ITransferNoteAppService transferNoteAppService + + ) : base( repository, assembleIssueJobManager @@ -94,6 +98,7 @@ public class AssembleIssueJobAppService _agvOptions = agvOptions; _itemBasicAppService = itemBasicAppService; + _transferNoteAppService = transferNoteAppService; } [HttpPost("get-by-number-2")] @@ -1057,6 +1062,155 @@ public class AssembleIssueJobAppService return ret; } + /// + /// Agv 回库 接口 + /// + /// + /// + [HttpPost("call-return-back-agv")] + public async Task CallReturnBackAgvAsync(AgvRequestDto request) + { + var json = JsonSerializer.Serialize(request); + var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); + _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); +#if DEBUG +#endif + var errors = new List(); + var ret = new AgvResultObject + { + Code = "0", + Message = "OK", + ReqCode = "", + }; + using var unitOfWork = _unitOfWorkManager.Begin(); + try + { + if (request.Data.Count > 0) + { + var notes = request.Data; + + foreach (var detail in notes) + { + TransferNoteEditInput transfer = new TransferNoteEditInput(); + transfer.CallJobNumber = detail.OrderNum; + transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Worker = "Agv"; + transfer.UseOnTheWayLocation = false; + List transferNoteDetailInputs = new List(); + TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); + var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); + if (fromloc == null) + { + errors.Add($"来源起始点{detail.BeginPosition}没查到"); + } + LocationDTO fromlocation = null; + if (fromloc != null) + { + fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).ConfigureAwait(false); + } + if (fromlocation == null) + { + errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); + } + var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) + .ConfigureAwait(false); + if (toloc == null) + { + errors.Add($"结束点{detail.EndPosition}没查到"); + } + LocationDTO tolocation = null; + if (toloc != null) + { + tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false); + } + if (tolocation == null) + { + errors.Add($"结束点{detail.EndPosition}库位没查到"); + } + var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); + if (item == null) + { + errors.Add($"零件号{detail.MatCode}的零件不存在!"); + } + else + { + detailInput.ItemCode = item.Code; + detailInput.Uom = item.BasicUom; + detailInput.ItemName = item.Name; + detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; + } + if (errors.Count > 0) + { + return ret = new AgvResultObject() + { + Code = "-1", + ReqCode = "", + Message = string.Join(",", errors.ToArray()) + }; + } + detailInput.ToLocationCode = tolocation.Code; + detailInput.ToLocationGroup = tolocation.LocationGroupCode; + detailInput.ToLocationArea = tolocation.AreaCode; + detailInput.ToLocationErpCode = tolocation.ErpLocationCode; + detailInput.ToWarehouseCode = tolocation.WarehouseCode; + detailInput.FromStatus = tolocation.DefaultInventoryStatus; + + + + detailInput.Qty = detail.MatQty; + detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.ToPackingCode = string.Empty; + detailInput.FromWarehouseCode = fromlocation.WarehouseCode; + detailInput.FromLocationCode = fromlocation.Code; + detailInput.FromLocationGroup = fromlocation.LocationGroupCode; + detailInput.FromLocationArea = fromlocation.AreaCode; + detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; + detailInput.ToStatus = fromlocation.DefaultInventoryStatus; + detailInput.Qty = detail.MatQty; + detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.FromPackingCode = string.Empty; + + transfer.Details.Add(detailInput); + + + await _transferNoteAppService.CreateAsync(transfer).ConfigureAwait(false); + } + } + else + { + errors.Add("Agv确认单据里无数据! \n"); + } + } + catch (Exception ex) + { + ret = new AgvResultObject + { + Code = "-1", + ReqCode = "", + Message = ex.Message + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + + } + + if (errors.Count > 0) + { + ret = new AgvResultObject + { + Code = "-1", + Message = string.Join(",", errors.ToArray()), + ReqCode = "" + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + } + return ret; + + + + + } + + /// /// 调用Agv接口实现 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs index bc2cd39f2..0eb936b68 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs @@ -54,7 +54,7 @@ public class CoatingIssueJobAppService private readonly IOptions _agvOptions; private readonly IPostionLocationAppService _postionLocationAppService; private readonly IItemBasicAppService _itemBasicAppService; - + private readonly ITransferNoteAppService _transferNoteAppService; protected ICoatingIssueRequestAppService CoatingIssueRequestAppService => LazyServiceProvider.LazyGetRequiredService(); @@ -68,7 +68,7 @@ public class CoatingIssueJobAppService , IHttpClientFactory httpClientFactory , IOptions options, ITransferLibRequestAppService transferLibRequestAppService, ICurrentUser currentUser, IOptions agvOptions , UnitOfWorkManager unitOfWorkManager - , IPostionLocationAppService postionLocationAppService, IItemBasicAppService _itemBasicAppService + , IPostionLocationAppService postionLocationAppService, IItemBasicAppService _itemBasicAppService, ITransferNoteAppService transferNoteAppService ) : base( repository, coatingIssueJobManager) { @@ -85,6 +85,7 @@ public class CoatingIssueJobAppService _unitOfWorkManager = unitOfWorkManager; _agvOptions = agvOptions; _postionLocationAppService = postionLocationAppService; + _transferLibRequestAppService= transferLibRequestAppService; } [HttpPost("get-by-number-2")] @@ -1034,11 +1035,165 @@ public class CoatingIssueJobAppService } /// - /// 调用Agv接口实现 + /// Agv 回库 接口 /// - /// + /// /// - private async Task SendInterFaceAsync(CoatingIssueJobDTO job) + [HttpPost("call-return-back-agv")] + public async Task CallReturnBackAgvAsync(AgvRequestDto request) + { + var json = JsonSerializer.Serialize(request); + var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); + _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); +#if DEBUG +#endif + var errors = new List(); + var ret = new AgvResultObject + { + Code = "0", + Message = "OK", + ReqCode = "", + }; + using var unitOfWork = _unitOfWorkManager.Begin(); + try + { + if (request.Data.Count > 0) + { + var notes = request.Data; + + foreach (var detail in notes) + { + TransferNoteEditInput transfer = new TransferNoteEditInput(); + transfer.CallJobNumber = detail.OrderNum; + transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Worker = "Agv"; + transfer.UseOnTheWayLocation = false; + List transferNoteDetailInputs = new List(); + TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); + var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); + if (fromloc == null) + { + errors.Add($"来源起始点{detail.BeginPosition}没查到"); + } + LocationDTO fromlocation = null; + if (fromloc != null) + { + fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).ConfigureAwait(false); + } + if (fromlocation == null) + { + errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); + } + var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) + .ConfigureAwait(false); + if (toloc == null) + { + errors.Add($"结束点{detail.EndPosition}没查到"); + } + LocationDTO tolocation = null; + if (toloc != null) + { + tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false); + } + if (tolocation == null) + { + errors.Add($"结束点{detail.EndPosition}库位没查到"); + } + var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); + if (item == null) + { + errors.Add($"零件号{detail.MatCode}的零件不存在!"); + } + else + { + detailInput.ItemCode = item.Code; + detailInput.Uom = item.BasicUom; + detailInput.ItemName = item.Name; + detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; + } + if (errors.Count > 0) + { + return ret = new AgvResultObject() + { + Code = "-1", + ReqCode = "", + Message = string.Join(",", errors.ToArray()) + }; + } + detailInput.ToLocationCode = tolocation.Code; + detailInput.ToLocationGroup = tolocation.LocationGroupCode; + detailInput.ToLocationArea = tolocation.AreaCode; + detailInput.ToLocationErpCode = tolocation.ErpLocationCode; + detailInput.ToWarehouseCode = tolocation.WarehouseCode; + detailInput.FromStatus = tolocation.DefaultInventoryStatus; + + + + detailInput.Qty = detail.MatQty; + detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.ToPackingCode = string.Empty; + detailInput.FromWarehouseCode = fromlocation.WarehouseCode; + detailInput.FromLocationCode = fromlocation.Code; + detailInput.FromLocationGroup = fromlocation.LocationGroupCode; + detailInput.FromLocationArea = fromlocation.AreaCode; + detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; + detailInput.ToStatus = fromlocation.DefaultInventoryStatus; + detailInput.Qty = detail.MatQty; + detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.FromPackingCode = string.Empty; + + transfer.Details.Add(detailInput); + + + await _transferNoteAppService.CreateAsync(transfer).ConfigureAwait(false); + } + } + else + { + errors.Add("Agv确认单据里无数据! \n"); + } + } + catch (Exception ex) + { + ret = new AgvResultObject + { + Code = "-1", + ReqCode = "", + Message = ex.Message + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + + } + + if (errors.Count > 0) + { + ret = new AgvResultObject + { + Code = "-1", + Message = string.Join(",", errors.ToArray()), + ReqCode = "" + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + } + return ret; + + + + + } + + + + + + + + /// + /// 调用Agv接口实现 + /// + /// + /// + private async Task SendInterFaceAsync(CoatingIssueJobDTO job) { #if DEBUG diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs index fa838c96a..9f3587345 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs @@ -52,6 +52,7 @@ public class InjectionIssueJobAppService private readonly IPostionLocationAppService _postionLocationAppService; private readonly ILogger _logger; private readonly IItemBasicAppService _itemBasicAppService; + private readonly ITransferNoteAppService _transferNoteAppService; protected IInjectionIssueRequestAppService InjectionIssueRequestAppService => @@ -971,6 +972,157 @@ public class InjectionIssueJobAppService } return ret; } + /// + /// Agv 回库 接口 + /// + /// + /// + [HttpPost("call-return-back-agv")] + public async Task CallReturnBackAgvAsync(AgvRequestDto request) + { + var json = JsonSerializer.Serialize(request); + var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); + _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); +#if DEBUG +#endif + var errors = new List(); + var ret = new AgvResultObject + { + Code = "0", + Message = "OK", + ReqCode = "", + }; + using var unitOfWork = _unitOfWorkManager.Begin(); + try + { + if (request.Data.Count > 0) + { + var notes = request.Data; + + foreach (var detail in notes) + { + TransferNoteEditInput transfer = new TransferNoteEditInput(); + transfer.CallJobNumber = detail.OrderNum; + transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Worker = "Agv"; + transfer.UseOnTheWayLocation = false; + List transferNoteDetailInputs = new List(); + TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); + var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); + if (fromloc == null) + { + errors.Add($"来源起始点{detail.BeginPosition}没查到"); + } + LocationDTO fromlocation = null; + if (fromloc != null) + { + fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).ConfigureAwait(false); + } + if (fromlocation == null) + { + errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); + } + var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) + .ConfigureAwait(false); + if (toloc == null) + { + errors.Add($"结束点{detail.EndPosition}没查到"); + } + LocationDTO tolocation = null; + if (toloc != null) + { + tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false); + } + if (tolocation == null) + { + errors.Add($"结束点{detail.EndPosition}库位没查到"); + } + var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); + if (item == null) + { + errors.Add($"零件号{detail.MatCode}的零件不存在!"); + } + else + { + detailInput.ItemCode = item.Code; + detailInput.Uom = item.BasicUom; + detailInput.ItemName = item.Name; + detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; + } + if (errors.Count > 0) + { + return ret = new AgvResultObject() + { + Code = "-1", + ReqCode = "", + Message = string.Join(",", errors.ToArray()) + }; + } + detailInput.ToLocationCode = tolocation.Code; + detailInput.ToLocationGroup = tolocation.LocationGroupCode; + detailInput.ToLocationArea = tolocation.AreaCode; + detailInput.ToLocationErpCode = tolocation.ErpLocationCode; + detailInput.ToWarehouseCode = tolocation.WarehouseCode; + detailInput.FromStatus = tolocation.DefaultInventoryStatus; + + + + detailInput.Qty = detail.MatQty; + detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.ToPackingCode = string.Empty; + detailInput.FromWarehouseCode = fromlocation.WarehouseCode; + detailInput.FromLocationCode = fromlocation.Code; + detailInput.FromLocationGroup = fromlocation.LocationGroupCode; + detailInput.FromLocationArea = fromlocation.AreaCode; + detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; + detailInput.ToStatus = fromlocation.DefaultInventoryStatus; + detailInput.Qty = detail.MatQty; + detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.FromPackingCode = string.Empty; + + transfer.Details.Add(detailInput); + + + await _transferNoteAppService.CreateAsync(transfer).ConfigureAwait(false); + } + } + else + { + errors.Add("Agv确认单据里无数据! \n"); + } + } + catch (Exception ex) + { + ret = new AgvResultObject + { + Code = "-1", + ReqCode = "", + Message = ex.Message + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + + } + + if (errors.Count > 0) + { + ret = new AgvResultObject + { + Code = "-1", + Message = string.Join(",", errors.ToArray()), + ReqCode = "" + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + } + return ret; + + + + + } + + + + /// /// 调用Agv接口实现 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs index 8de64741c..a08916f84 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs @@ -53,6 +53,7 @@ public class KittingIssueJobAppService private readonly IPostionLocationAppService _postionLocationAppService; private readonly ILogger _logger; private readonly IItemBasicAppService _itemBasicAppService; + private readonly ITransferNoteAppService _transferNoteAppService; protected IKittingIssueRequestAppService KittingIssueRequestAppService => LazyServiceProvider.LazyGetRequiredService(); @@ -979,6 +980,160 @@ public class KittingIssueJobAppService return ret; } + /// + /// Agv 回库 接口 + /// + /// + /// + [HttpPost("call-return-back-agv")] + public async Task CallReturnBackAgvAsync(AgvRequestDto request) + { + var json = JsonSerializer.Serialize(request); + var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); + _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); +#if DEBUG +#endif + var errors = new List(); + var ret = new AgvResultObject + { + Code = "0", + Message = "OK", + ReqCode = "", + }; + using var unitOfWork = _unitOfWorkManager.Begin(); + try + { + if (request.Data.Count > 0) + { + var notes = request.Data; + + foreach (var detail in notes) + { + TransferNoteEditInput transfer = new TransferNoteEditInput(); + transfer.CallJobNumber = detail.OrderNum; + transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Worker = "Agv"; + transfer.UseOnTheWayLocation = false; + List transferNoteDetailInputs = new List(); + TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); + var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); + if (fromloc == null) + { + errors.Add($"来源起始点{detail.BeginPosition}没查到"); + } + LocationDTO fromlocation = null; + if (fromloc != null) + { + fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).ConfigureAwait(false); + } + if (fromlocation == null) + { + errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); + } + var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) + .ConfigureAwait(false); + if (toloc == null) + { + errors.Add($"结束点{detail.EndPosition}没查到"); + } + LocationDTO tolocation = null; + if (toloc != null) + { + tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false); + } + if (tolocation == null) + { + errors.Add($"结束点{detail.EndPosition}库位没查到"); + } + var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); + if (item == null) + { + errors.Add($"零件号{detail.MatCode}的零件不存在!"); + } + else + { + detailInput.ItemCode = item.Code; + detailInput.Uom = item.BasicUom; + detailInput.ItemName = item.Name; + detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; + } + if (errors.Count > 0) + { + return ret = new AgvResultObject() + { + Code = "-1", + ReqCode = "", + Message = string.Join(",", errors.ToArray()) + }; + } + detailInput.ToLocationCode = tolocation.Code; + detailInput.ToLocationGroup = tolocation.LocationGroupCode; + detailInput.ToLocationArea = tolocation.AreaCode; + detailInput.ToLocationErpCode = tolocation.ErpLocationCode; + detailInput.ToWarehouseCode = tolocation.WarehouseCode; + detailInput.FromStatus = tolocation.DefaultInventoryStatus; + + + + detailInput.Qty = detail.MatQty; + detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.ToPackingCode = string.Empty; + detailInput.FromWarehouseCode = fromlocation.WarehouseCode; + detailInput.FromLocationCode = fromlocation.Code; + detailInput.FromLocationGroup = fromlocation.LocationGroupCode; + detailInput.FromLocationArea = fromlocation.AreaCode; + detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; + detailInput.ToStatus = fromlocation.DefaultInventoryStatus; + detailInput.Qty = detail.MatQty; + detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.FromPackingCode = string.Empty; + + transfer.Details.Add(detailInput); + + + await _transferNoteAppService.CreateAsync(transfer).ConfigureAwait(false); + } + } + else + { + errors.Add("Agv确认单据里无数据! \n"); + } + } + catch (Exception ex) + { + ret = new AgvResultObject + { + Code = "-1", + ReqCode = "", + Message = ex.Message + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + + } + + if (errors.Count > 0) + { + ret = new AgvResultObject + { + Code = "-1", + Message = string.Join(",", errors.ToArray()), + ReqCode = "" + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + } + return ret; + + + + + } + + + + + + + /// /// 调用Agv接口实现 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs index 0c0705a7c..80bf2ec58 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs @@ -52,6 +52,7 @@ public class SparePartIssueJobAppService private readonly IPostionLocationAppService _postionLocationAppService; private readonly ILogger _logger; private readonly IItemBasicAppService _itemBasicAppService; + private readonly ITransferNoteAppService _transferNoteAppService; protected ISparePartIssueRequestAppService SparePartIssueRequestAppService => LazyServiceProvider.LazyGetRequiredService(); @@ -63,7 +64,7 @@ public class SparePartIssueJobAppService ISparePartIssueNoteAppService sparePartIssueNoteAppService, IExpectOutAppService expectOutAppService , IHttpClientFactory httpClientFactory , IOptions options, ITransferLibRequestAppService transferLibRequestAppService, ICurrentUser currentUser, ILogger logger - , UnitOfWorkManager unitOfWorkManager, IOptions agvOptions, IItemBasicAppService itemBasicAppService + , UnitOfWorkManager unitOfWorkManager, IOptions agvOptions, IItemBasicAppService itemBasicAppService, ITransferNoteAppService transferNoteAppService ) : base( repository, sparePartIssueJobManager) { @@ -80,6 +81,7 @@ public class SparePartIssueJobAppService _agvOptions = agvOptions; _logger = logger; _itemBasicAppService = itemBasicAppService; + _transferNoteAppService = transferNoteAppService; } [HttpPost("get-by-number-2")] @@ -953,6 +955,155 @@ public class SparePartIssueJobAppService } return ret; } + /// + /// Agv 回库 接口 + /// + /// + /// + [HttpPost("call-return-back-agv")] + public async Task CallReturnBackAgvAsync(AgvRequestDto request) + { + var json = JsonSerializer.Serialize(request); + var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); + _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); +#if DEBUG +#endif + var errors = new List(); + var ret = new AgvResultObject + { + Code = "0", + Message = "OK", + ReqCode = "", + }; + using var unitOfWork = _unitOfWorkManager.Begin(); + try + { + if (request.Data.Count > 0) + { + var notes = request.Data; + + foreach (var detail in notes) + { + TransferNoteEditInput transfer = new TransferNoteEditInput(); + transfer.CallJobNumber = detail.OrderNum; + transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Worker = "Agv"; + transfer.UseOnTheWayLocation = false; + List transferNoteDetailInputs = new List(); + TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); + var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); + if (fromloc == null) + { + errors.Add($"来源起始点{detail.BeginPosition}没查到"); + } + LocationDTO fromlocation = null; + if (fromloc != null) + { + fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).ConfigureAwait(false); + } + if (fromlocation == null) + { + errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); + } + var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) + .ConfigureAwait(false); + if (toloc == null) + { + errors.Add($"结束点{detail.EndPosition}没查到"); + } + LocationDTO tolocation = null; + if (toloc != null) + { + tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false); + } + if (tolocation == null) + { + errors.Add($"结束点{detail.EndPosition}库位没查到"); + } + var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); + if (item == null) + { + errors.Add($"零件号{detail.MatCode}的零件不存在!"); + } + else + { + detailInput.ItemCode = item.Code; + detailInput.Uom = item.BasicUom; + detailInput.ItemName = item.Name; + detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; + } + if (errors.Count > 0) + { + return ret = new AgvResultObject() + { + Code = "-1", + ReqCode = "", + Message = string.Join(",", errors.ToArray()) + }; + } + detailInput.ToLocationCode = tolocation.Code; + detailInput.ToLocationGroup = tolocation.LocationGroupCode; + detailInput.ToLocationArea = tolocation.AreaCode; + detailInput.ToLocationErpCode = tolocation.ErpLocationCode; + detailInput.ToWarehouseCode = tolocation.WarehouseCode; + detailInput.FromStatus = tolocation.DefaultInventoryStatus; + + + + detailInput.Qty = detail.MatQty; + detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.ToPackingCode = string.Empty; + detailInput.FromWarehouseCode = fromlocation.WarehouseCode; + detailInput.FromLocationCode = fromlocation.Code; + detailInput.FromLocationGroup = fromlocation.LocationGroupCode; + detailInput.FromLocationArea = fromlocation.AreaCode; + detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; + detailInput.ToStatus = fromlocation.DefaultInventoryStatus; + detailInput.Qty = detail.MatQty; + detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.FromPackingCode = string.Empty; + + transfer.Details.Add(detailInput); + + + await _transferNoteAppService.CreateAsync(transfer).ConfigureAwait(false); + } + } + else + { + errors.Add("Agv确认单据里无数据! \n"); + } + } + catch (Exception ex) + { + ret = new AgvResultObject + { + Code = "-1", + ReqCode = "", + Message = ex.Message + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + + } + + if (errors.Count > 0) + { + ret = new AgvResultObject + { + Code = "-1", + Message = string.Join(",", errors.ToArray()), + ReqCode = "" + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + } + return ret; + + + + + } + + /// /// 调用Agv接口实现 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs index f96e2bdca..7799f9d21 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs @@ -50,7 +50,8 @@ public class UnplannedIssueJobAppService private readonly IOptions _agvOptions; private readonly IHttpClientFactory _httpClientFactory; private readonly IPostionLocationAppService _postionLocationAppService; - + private readonly ITransferNoteAppService _transferNoteAppService; + public UnplannedIssueJobAppService( IUnplannedIssueJobRepository repository, IUnplannedIssueJobManager unplannedIssueJobManager, @@ -58,7 +59,8 @@ public class UnplannedIssueJobAppService IBalanceAppService balanceAppService, IExpectOutAppService expectOutAppService, IUnitOfWorkManager unitOfWorkManager, ILogger logger, IItemBasicAppService itemBasicAppService, IOptions agvOptions, - IPostionLocationAppService postionLocationAppService + IPostionLocationAppService postionLocationAppService, + ITransferNoteAppService transferNoteAppService , IHttpClientFactory httpClientFactory ) : base(repository, unplannedIssueJobManager) @@ -72,6 +74,7 @@ public class UnplannedIssueJobAppService _itemBasicAppService = itemBasicAppService; _agvOptions = agvOptions; _httpClientFactory = httpClientFactory; + _transferNoteAppService= transferNoteAppService; _postionLocationAppService = postionLocationAppService; } @@ -860,6 +863,156 @@ public class UnplannedIssueJobAppService return ret; } + /// + /// Agv 回库 接口 + /// + /// + /// + [HttpPost("call-return-back-agv")] + public async Task CallReturnBackAgvAsync(AgvRequestDto request) + { + var json = JsonSerializer.Serialize(request); + var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); + _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); +#if DEBUG +#endif + var errors = new List(); + var ret = new AgvResultObject + { + Code = "0", + Message = "OK", + ReqCode = "", + }; + using var unitOfWork = _unitOfWorkManager.Begin(); + try + { + if (request.Data.Count > 0) + { + var notes = request.Data; + + foreach (var detail in notes) + { + TransferNoteEditInput transfer = new TransferNoteEditInput(); + transfer.CallJobNumber = detail.OrderNum; + transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Worker = "Agv"; + transfer.UseOnTheWayLocation = false; + List transferNoteDetailInputs = new List(); + TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); + var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); + if (fromloc == null) + { + errors.Add($"来源起始点{detail.BeginPosition}没查到"); + } + LocationDTO fromlocation = null; + if (fromloc != null) + { + fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).ConfigureAwait(false); + } + if (fromlocation == null) + { + errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); + } + var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) + .ConfigureAwait(false); + if (toloc == null) + { + errors.Add($"结束点{detail.EndPosition}没查到"); + } + LocationDTO tolocation = null; + if (toloc != null) + { + tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false); + } + if (tolocation == null) + { + errors.Add($"结束点{detail.EndPosition}库位没查到"); + } + var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); + if (item == null) + { + errors.Add($"零件号{detail.MatCode}的零件不存在!"); + } + else + { + detailInput.ItemCode = item.Code; + detailInput.Uom = item.BasicUom; + detailInput.ItemName = item.Name; + detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; + } + if (errors.Count > 0) + { + return ret = new AgvResultObject() + { + Code = "-1", + ReqCode = "", + Message = string.Join(",", errors.ToArray()) + }; + } + detailInput.ToLocationCode = tolocation.Code; + detailInput.ToLocationGroup = tolocation.LocationGroupCode; + detailInput.ToLocationArea = tolocation.AreaCode; + detailInput.ToLocationErpCode = tolocation.ErpLocationCode; + detailInput.ToWarehouseCode = tolocation.WarehouseCode; + detailInput.FromStatus = tolocation.DefaultInventoryStatus; + + + + detailInput.Qty = detail.MatQty; + detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.ToPackingCode = string.Empty; + detailInput.FromWarehouseCode = fromlocation.WarehouseCode; + detailInput.FromLocationCode = fromlocation.Code; + detailInput.FromLocationGroup = fromlocation.LocationGroupCode; + detailInput.FromLocationArea = fromlocation.AreaCode; + detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; + detailInput.ToStatus = fromlocation.DefaultInventoryStatus; + detailInput.Qty = detail.MatQty; + detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.FromPackingCode = string.Empty; + + transfer.Details.Add(detailInput); + + + await _transferNoteAppService.CreateAsync(transfer).ConfigureAwait(false); + } + } + else + { + errors.Add("Agv确认单据里无数据! \n"); + } + } + catch (Exception ex) + { + ret = new AgvResultObject + { + Code = "-1", + ReqCode = "", + Message = ex.Message + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + + } + + if (errors.Count > 0) + { + ret = new AgvResultObject + { + Code = "-1", + Message = string.Join(",", errors.ToArray()), + ReqCode = "" + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + } + return ret; + + + + + } + + + /// /// 调用Agv接口实现 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs index 46c0db919..172c90c0d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAppService.cs @@ -56,6 +56,7 @@ public class UnplannedReceiptJobAppService private readonly IUnitOfWorkManager _unitOfWorkManager; private readonly IPostionLocationAppService _postionLocationAppService; private readonly ILogger _logger; + private readonly ITransferNoteAppService _transferNoteAppService; public UnplannedReceiptJobAppService( @@ -66,7 +67,8 @@ public class UnplannedReceiptJobAppService IOptions agvOptions, IHttpClientFactory httpClientFactory, IUnitOfWorkManager unitOfWorkManager, - ILogger logger + ILogger logger, + ITransferNoteAppService transferNoteAppService ) : base(repository, UnplannedReceiptJobManager) @@ -81,6 +83,7 @@ public class UnplannedReceiptJobAppService _unitOfWorkManager = unitOfWorkManager; _logger = logger; _postionLocationAppService = postionLocationAppService; + _transferNoteAppService = transferNoteAppService; } @@ -521,6 +524,155 @@ public class UnplannedReceiptJobAppService } return ret; } + /// + /// Agv 回库 接口 + /// + /// + /// + [HttpPost("call-return-back-agv")] + public async Task CallReturnBackAgvAsync(AgvRequestDto request) + { + var json = JsonSerializer.Serialize(request); + var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); + _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); +#if DEBUG +#endif + var errors = new List(); + var ret = new AgvResultObject + { + Code = "0", + Message = "OK", + ReqCode = "", + }; + using var unitOfWork = _unitOfWorkManager.Begin(); + try + { + if (request.Data.Count > 0) + { + var notes = request.Data; + + foreach (var detail in notes) + { + TransferNoteEditInput transfer = new TransferNoteEditInput(); + transfer.CallJobNumber = detail.OrderNum; + transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Worker = "Agv"; + transfer.UseOnTheWayLocation = false; + List transferNoteDetailInputs = new List(); + TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); + var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); + if (fromloc == null) + { + errors.Add($"来源起始点{detail.BeginPosition}没查到"); + } + LocationDTO fromlocation = null; + if (fromloc != null) + { + fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).ConfigureAwait(false); + } + if (fromlocation == null) + { + errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); + } + var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) + .ConfigureAwait(false); + if (toloc == null) + { + errors.Add($"结束点{detail.EndPosition}没查到"); + } + LocationDTO tolocation = null; + if (toloc != null) + { + tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false); + } + if (tolocation == null) + { + errors.Add($"结束点{detail.EndPosition}库位没查到"); + } + var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); + if (item == null) + { + errors.Add($"零件号{detail.MatCode}的零件不存在!"); + } + else + { + detailInput.ItemCode = item.Code; + detailInput.Uom = item.BasicUom; + detailInput.ItemName = item.Name; + detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; + } + if (errors.Count > 0) + { + return ret = new AgvResultObject() + { + Code = "-1", + ReqCode = "", + Message = string.Join(",", errors.ToArray()) + }; + } + detailInput.ToLocationCode = tolocation.Code; + detailInput.ToLocationGroup = tolocation.LocationGroupCode; + detailInput.ToLocationArea = tolocation.AreaCode; + detailInput.ToLocationErpCode = tolocation.ErpLocationCode; + detailInput.ToWarehouseCode = tolocation.WarehouseCode; + detailInput.FromStatus = tolocation.DefaultInventoryStatus; + + + + detailInput.Qty = detail.MatQty; + detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.ToPackingCode = string.Empty; + detailInput.FromWarehouseCode = fromlocation.WarehouseCode; + detailInput.FromLocationCode = fromlocation.Code; + detailInput.FromLocationGroup = fromlocation.LocationGroupCode; + detailInput.FromLocationArea = fromlocation.AreaCode; + detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; + detailInput.ToStatus = fromlocation.DefaultInventoryStatus; + detailInput.Qty = detail.MatQty; + detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; + detailInput.FromPackingCode = string.Empty; + + transfer.Details.Add(detailInput); + + + await _transferNoteAppService.CreateAsync(transfer).ConfigureAwait(false); + } + } + else + { + errors.Add("Agv确认单据里无数据! \n"); + } + } + catch (Exception ex) + { + ret = new AgvResultObject + { + Code = "-1", + ReqCode = "", + Message = ex.Message + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + + } + + if (errors.Count > 0) + { + ret = new AgvResultObject + { + Code = "-1", + Message = string.Join(",", errors.ToArray()), + ReqCode = "" + }; + await unitOfWork.RollbackAsync().ConfigureAwait(false); + } + return ret; + + + + + } + + /// /// 调用Agv接口实现 From ab0281eb311d1448bf004a78555e990ceac7e0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Fri, 13 Dec 2024 17:22:49 +0800 Subject: [PATCH 2/7] up --- .../IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs | 4 ++-- .../IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs | 4 ++-- .../InjectionIssueJobs/InjectionIssueJobAppService.cs | 4 ++-- .../IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs | 4 ++-- .../SparePartIssueJobs/SparePartIssueJobAppService.cs | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs index 0bfcce7a7..062e34d33 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs @@ -1174,7 +1174,7 @@ public class AssembleIssueJobAppService detailInput.Qty = detail.MatQty; detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.ToPackingCode = string.Empty; + detailInput.ToPackingCode = detail.PakingCode; detailInput.FromWarehouseCode = fromlocation.WarehouseCode; detailInput.FromLocationCode = fromlocation.Code; detailInput.FromLocationGroup = fromlocation.LocationGroupCode; @@ -1183,7 +1183,7 @@ public class AssembleIssueJobAppService detailInput.ToStatus = fromlocation.DefaultInventoryStatus; detailInput.Qty = detail.MatQty; detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.FromPackingCode = string.Empty; + detailInput.FromPackingCode = detail.PakingCode; transfer.Details.Add(detailInput); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs index 0eb936b68..376ba26b1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs @@ -1131,7 +1131,7 @@ public class CoatingIssueJobAppService detailInput.Qty = detail.MatQty; detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.ToPackingCode = string.Empty; + detailInput.ToPackingCode = detail.PakingCode; detailInput.FromWarehouseCode = fromlocation.WarehouseCode; detailInput.FromLocationCode = fromlocation.Code; detailInput.FromLocationGroup = fromlocation.LocationGroupCode; @@ -1140,7 +1140,7 @@ public class CoatingIssueJobAppService detailInput.ToStatus = fromlocation.DefaultInventoryStatus; detailInput.Qty = detail.MatQty; detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.FromPackingCode = string.Empty; + detailInput.FromPackingCode = detail.PakingCode; transfer.Details.Add(detailInput); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs index 9f3587345..bc79039c1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs @@ -1069,7 +1069,7 @@ public class InjectionIssueJobAppService detailInput.Qty = detail.MatQty; detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.ToPackingCode = string.Empty; + detailInput.ToPackingCode = detail.PakingCode; detailInput.FromWarehouseCode = fromlocation.WarehouseCode; detailInput.FromLocationCode = fromlocation.Code; detailInput.FromLocationGroup = fromlocation.LocationGroupCode; @@ -1078,7 +1078,7 @@ public class InjectionIssueJobAppService detailInput.ToStatus = fromlocation.DefaultInventoryStatus; detailInput.Qty = detail.MatQty; detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.FromPackingCode = string.Empty; + detailInput.FromPackingCode = detail.PakingCode; transfer.Details.Add(detailInput); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs index a08916f84..04697dbf7 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs @@ -1077,7 +1077,7 @@ public class KittingIssueJobAppService detailInput.Qty = detail.MatQty; detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.ToPackingCode = string.Empty; + detailInput.ToPackingCode = detail.PakingCode; detailInput.FromWarehouseCode = fromlocation.WarehouseCode; detailInput.FromLocationCode = fromlocation.Code; detailInput.FromLocationGroup = fromlocation.LocationGroupCode; @@ -1086,7 +1086,7 @@ public class KittingIssueJobAppService detailInput.ToStatus = fromlocation.DefaultInventoryStatus; detailInput.Qty = detail.MatQty; detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.FromPackingCode = string.Empty; + detailInput.FromPackingCode = detail.PakingCode; transfer.Details.Add(detailInput); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs index 80bf2ec58..baba67194 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs @@ -1052,7 +1052,7 @@ public class SparePartIssueJobAppService detailInput.Qty = detail.MatQty; detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.ToPackingCode = string.Empty; + detailInput.ToPackingCode = detail.PakingCode; detailInput.FromWarehouseCode = fromlocation.WarehouseCode; detailInput.FromLocationCode = fromlocation.Code; detailInput.FromLocationGroup = fromlocation.LocationGroupCode; @@ -1061,7 +1061,7 @@ public class SparePartIssueJobAppService detailInput.ToStatus = fromlocation.DefaultInventoryStatus; detailInput.Qty = detail.MatQty; detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.FromPackingCode = string.Empty; + detailInput.FromPackingCode =detail.PakingCode; transfer.Details.Add(detailInput); From c80b0d3cbf373a8e26dabefa4ce355dd0115994c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 16 Dec 2024 09:06:53 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=B4=A0=E4=BB=B6?= =?UTF-8?q?=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoatingIssueJobAppService.cs | 69 +---------------- .../KittingIssueJobAppService.cs | 74 +------------------ 2 files changed, 2 insertions(+), 141 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs index 376ba26b1..9b34dde0c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs @@ -1271,73 +1271,6 @@ public class CoatingIssueJobAppService } return ret; } - /// - /// 回库调用 - /// - /// - /// - /// - private async Task ReturnBackAsync(CoatingIssueJobDTO job) - { - var ret = new AgvResultObject - { - Code = "0", - ReqCode = job.CoatingRequestNumber, - Message = "OK" - }; - using var unitOfWork = _unitOfWorkManager.Begin(); - try - { - var first = job.Details.FirstOrDefault(); - var request = new AgvRequestBack(); - request.MatCode = first.ItemCode; - request.ReturnQty = first.HandledToQty; - request.EndPosition = first.HandledToLocationCode; - - - var httpclient = _httpClientFactory.CreateClient(); - _agvOptions.Value.Address = string.IsNullOrEmpty(_agvOptions.Value.Address) - ? "http://7e42682n64.goho.co:21171/" - : _agvOptions.Value.Address; //测试地址 - _agvOptions.Value.Token = - string.IsNullOrEmpty(_agvOptions.Value.Token) ? string.Empty : _agvOptions.Value.Token; //测试token - _agvOptions.Value.UserName = - string.IsNullOrEmpty(_agvOptions.Value.UserName) ? "" : _agvOptions.Value.UserName; //测试用户名 - _agvOptions.Value.Password = - string.IsNullOrEmpty(_agvOptions.Value.Password) ? "" : _agvOptions.Value.Password; //测试密码 - _agvOptions.Value.Path = string.IsNullOrEmpty(_agvOptions.Value.Path) - ? "zozocnApi/custom/receiveProductionPlan" - : _agvOptions.Value.Path; //测试密码 - var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); - - if (!string.IsNullOrEmpty(_agvOptions.Value.Token)) - { - var token = _agvOptions.Value.Token; - httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - } - - if (!string.IsNullOrEmpty(_agvOptions.Value.UserName) && !string.IsNullOrEmpty(_agvOptions.Value.Password)) - { - var username = _agvOptions.Value.UserName; - var password = _agvOptions.Value.Password; - httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", - Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}"))); - } - - var client = new AgvJobClient(_agvOptions.Value.Address, httpclient, _agvOptions.Value.Path); - ret = await client.NotifyOutTaskBack4FWAsync(request).ConfigureAwait(false); - - } - catch (Exception e) - { - ret = new AgvResultObject(); - ret.Code = "1"; - ret.Message = e.Message; - ret.ReqCode = job.CoatingRequestNumber; - await unitOfWork.RollbackAsync().ConfigureAwait(false); - throw new UserFriendlyException($"接口报错 错误信息{e.Message}"); - } - return ret; - } + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs index 04697dbf7..2aaf93d24 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs @@ -1129,11 +1129,6 @@ public class KittingIssueJobAppService } - - - - - /// /// 调用Agv接口实现 /// @@ -1216,74 +1211,7 @@ public class KittingIssueJobAppService } return ret; } - /// - /// 回库调用 - /// - /// - /// - /// - private async Task ReturnBackAsync(KittingIssueJobDTO job) - { - var ret = new AgvResultObject - { - Code = "0", - ReqCode = job.KittingRequestNumber, - Message = "OK" - }; - using var unitOfWork = _unitOfWorkManager.Begin(); - try - { - var first = job.Details.FirstOrDefault(); - var request = new AgvRequestBack(); - request.MatCode = first.ItemCode; - request.ReturnQty = first.HandledToQty; - request.EndPosition = first.HandledToLocationCode; - - - var httpclient = _httpClientFactory.CreateClient(); - _agvOptions.Value.Address = string.IsNullOrEmpty(_agvOptions.Value.Address) - ? "http://7e42682n64.goho.co:21171/" - : _agvOptions.Value.Address; //测试地址 - _agvOptions.Value.Token = - string.IsNullOrEmpty(_agvOptions.Value.Token) ? string.Empty : _agvOptions.Value.Token; //测试token - _agvOptions.Value.UserName = - string.IsNullOrEmpty(_agvOptions.Value.UserName) ? "" : _agvOptions.Value.UserName; //测试用户名 - _agvOptions.Value.Password = - string.IsNullOrEmpty(_agvOptions.Value.Password) ? "" : _agvOptions.Value.Password; //测试密码 - _agvOptions.Value.Path = string.IsNullOrEmpty(_agvOptions.Value.Path) - ? "zozocnApi/custom/receiveProductionPlan" - : _agvOptions.Value.Path; //测试密码 - var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); - - if (!string.IsNullOrEmpty(_agvOptions.Value.Token)) - { - var token = _agvOptions.Value.Token; - httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - } - - if (!string.IsNullOrEmpty(_agvOptions.Value.UserName) && !string.IsNullOrEmpty(_agvOptions.Value.Password)) - { - var username = _agvOptions.Value.UserName; - var password = _agvOptions.Value.Password; - httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", - Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}"))); - } - - var client = new AgvJobClient(_agvOptions.Value.Address, httpclient, _agvOptions.Value.Path); - ret = await client.NotifyOutTaskBack4FWAsync(request).ConfigureAwait(false); - - } - catch (Exception e) - { - ret = new AgvResultObject(); - ret.Code = "1"; - ret.Message = e.Message; - ret.ReqCode = job.KittingRequestNumber; - await unitOfWork.RollbackAsync().ConfigureAwait(false); - throw new UserFriendlyException($"接口报错 错误信息{e.Message}"); - } - return ret; - } + #endregion From 87d635e38333cbaee60b3b40fe50820e7476aa36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 16 Dec 2024 10:14:41 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=96=B7=E6=B6=82?= =?UTF-8?q?=E5=9B=9E=E5=BA=93=E7=B1=BB=E5=9E=8B=E3=80=81Kitting=E5=9B=9E?= =?UTF-8?q?=E5=BA=93=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Enums/Inventory/EnumTransSubType.cs | 8 ++++---- .../CoatingIssueJobs/CoatingIssueJobAppService.cs | 2 +- .../KittingIssueJobs/KittingIssueJobAppService.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs index 1d6b1d6bc..936c810bc 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs @@ -245,13 +245,13 @@ public enum EnumTransSubType /// ///AGV冻结 /// - [Display(Name = "AGV冻结")] - Agv_Freezed = 1513, + [Display(Name = "AGV喷涂回库")] + Agv_Return_Coating = 1513, /// ///AGV冻结 /// - [Display(Name = "AGV解冻")] - Agv_UnFreezed = 1514 + [Display(Name = "AGVKitting回库")] + Agv_Return_Kitting = 1514 } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs index 9b34dde0c..8ef0aeed8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs @@ -1065,7 +1065,7 @@ public class CoatingIssueJobAppService { TransferNoteEditInput transfer = new TransferNoteEditInput(); transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Type = EnumTransSubType.Agv_Return_Coating.ToString(); transfer.Worker = "Agv"; transfer.UseOnTheWayLocation = false; List transferNoteDetailInputs = new List(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs index 2aaf93d24..261e9aed9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs @@ -1011,7 +1011,7 @@ public class KittingIssueJobAppService { TransferNoteEditInput transfer = new TransferNoteEditInput(); transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Type = EnumTransSubType.Agv_Return_Kitting.ToString(); transfer.Worker = "Agv"; transfer.UseOnTheWayLocation = false; List transferNoteDetailInputs = new List(); From eec8ede30f667b3f9268a95d81c3894ecc835958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 16 Dec 2024 10:42:21 +0800 Subject: [PATCH 5/7] up --- .../TransferNotes/TransferNoteAppService.cs | 137 +----------------- 1 file changed, 1 insertion(+), 136 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs index 3dd36c252..6a7ca2068 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs @@ -810,142 +810,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase } - [HttpPost("call-back-freezed-agv")] - public async Task CallFreezedAgvAsync(AgvRequestDto request) - { - var json = JsonSerializer.Serialize(request); - var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); - _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); -#if DEBUG -#endif - var errors = new List(); - var ret = new AgvResultObject - { - Code = "0", - Message = "OK", - ReqCode = "", - }; - using var unitOfWork = _unitOfWorkManager.Begin(); - try - { - if (request.Data.Count > 0) - { - var notes = request.Data; - - foreach (var detail in notes) - { - TransferNoteEditInput transfer = new TransferNoteEditInput(); - transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Freezed.ToString(); - transfer.Worker = "Agv"; - transfer.UseOnTheWayLocation = false; - List transferNoteDetailInputs = new List(); - TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); - var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); - if (fromloc == null) - { - errors.Add($"来源起始点{detail.BeginPosition}没查到"); - } - LocationDTO fromlocation = null; - if (fromloc != null) - { - fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).ConfigureAwait(false); - } - if (fromlocation == null) - { - errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); - } - var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) - .ConfigureAwait(false); - if (toloc == null) - { - errors.Add($"结束点{detail.EndPosition}没查到"); - } - LocationDTO tolocation = null; - if (toloc != null) - { - tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false); - } - if (tolocation == null) - { - errors.Add($"结束点{detail.EndPosition}库位没查到"); - } - var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); - if (item == null) - { - errors.Add($"零件号{detail.MatCode}的零件不存在!"); - } - else - { - detailInput.ItemCode = item.Code; - detailInput.Uom = item.BasicUom; - detailInput.ItemName = item.Name; - detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; - } - if (errors.Count > 0) - { - return ret = new AgvResultObject() - { - Code = "-1", - ReqCode = "", - Message = string.Join(",", errors.ToArray()) - }; - } - - - detailInput.ToLocationCode = tolocation.Code; - detailInput.ToLocationGroup = tolocation.LocationGroupCode; - detailInput.ToLocationArea = tolocation.AreaCode; - detailInput.ToLocationErpCode = tolocation.ErpLocationCode; - detailInput.ToWarehouseCode = tolocation.WarehouseCode; - detailInput.ToStatus = EnumInventoryStatus.FROZEN; - - detailInput.Qty = detail.MatQty; - //detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.ToPackingCode = string.Empty; - detailInput.FromWarehouseCode = fromlocation.WarehouseCode; - detailInput.FromLocationCode = fromlocation.Code; - detailInput.FromLocationGroup = fromlocation.LocationGroupCode; - detailInput.FromLocationArea = fromlocation.AreaCode; - detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; - detailInput.FromStatus = EnumInventoryStatus.OK; - detailInput.Qty = detail.MatQty; - //detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.FromPackingCode = string.Empty; - transfer.Details.Add(detailInput); - await CreateAsync(transfer).ConfigureAwait(false); - } - } - else - { - errors.Add("Agv确认单据里无数据! \n"); - } - } - catch (Exception ex) - { - ret = new AgvResultObject - { - Code = "-1", - ReqCode = "", - Message = ex.Message - }; - await unitOfWork.RollbackAsync().ConfigureAwait(false); - - } - - if (errors.Count > 0) - { - ret = new AgvResultObject - { - Code = "-1", - Message = string.Join(",", errors.ToArray()), - ReqCode = "" - }; - await unitOfWork.RollbackAsync().ConfigureAwait(false); - } - return ret; - } - + From ade1ef49939f0e632512f5f42152db46258ce60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 16 Dec 2024 10:43:41 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TransferNotes/TransferNoteAppService.cs | 139 ------------------ 1 file changed, 139 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs index 6a7ca2068..3cc60622d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs @@ -670,145 +670,6 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase } - [HttpPost("call-back-unfreezed-agv")] - public async Task CallUnFreezedAgvAsync(AgvRequestDto request) - { - var json = JsonSerializer.Serialize(request); - var flag = DateTime.Now.ToString("yyyyMMddHHmmss"); - _logger.LogInformation($"{flag}接收到AGV确认单据内容:" + json); -#if DEBUG -#endif - var errors = new List(); - var ret = new AgvResultObject - { - Code = "0", - Message = "OK", - ReqCode = "", - }; - using var unitOfWork = _unitOfWorkManager.Begin(); - try - { - if (request.Data.Count > 0) - { - var notes = request.Data; - - foreach (var detail in notes) - { - TransferNoteEditInput transfer = new TransferNoteEditInput(); - transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); - transfer.Worker = "Agv"; - transfer.UseOnTheWayLocation = false; - List transferNoteDetailInputs = new List(); - TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); - var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); - if (fromloc == null) - { - errors.Add($"来源起始点{detail.BeginPosition}没查到"); - } - LocationDTO fromlocation = null; - if (fromloc != null) - { - fromlocation = await _locationAppService.GetByCodeAsync(fromloc.LocationCode).ConfigureAwait(false); - } - if (fromlocation == null) - { - errors.Add($"来源起始点{detail.BeginPosition}库位没查到"); - } - var toloc = await _postionLocationAppService.GetByCodeAsync(detail.EndPosition) - .ConfigureAwait(false); - if (toloc == null) - { - errors.Add($"结束点{detail.EndPosition}没查到"); - } - LocationDTO tolocation = null; - if (toloc != null) - { - tolocation = await _locationAppService.GetByCodeAsync(toloc.LocationCode).ConfigureAwait(false); - } - if (tolocation == null) - { - errors.Add($"结束点{detail.EndPosition}库位没查到"); - } - var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); - if (item == null) - { - errors.Add($"零件号{detail.MatCode}的零件不存在!"); - } - else - { - detailInput.ItemCode = item.Code; - detailInput.Uom = item.BasicUom; - detailInput.ItemName = item.Name; - detailInput.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : string.Empty; - } - if (errors.Count > 0) - { - return ret = new AgvResultObject() - { - Code = "-1", - ReqCode = "", - Message = string.Join(",", errors.ToArray()) - }; - } - detailInput.ToLocationCode = tolocation.Code; - detailInput.ToLocationGroup = tolocation.LocationGroupCode; - detailInput.ToLocationArea = tolocation.AreaCode; - detailInput.ToLocationErpCode = tolocation.ErpLocationCode; - detailInput.ToWarehouseCode = tolocation.WarehouseCode; - detailInput.ToStatus = tolocation.DefaultInventoryStatus; - - - - detailInput.Qty = detail.MatQty; - //detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.ToPackingCode = string.Empty; - detailInput.FromWarehouseCode = fromlocation.WarehouseCode; - detailInput.FromLocationCode = fromlocation.Code; - detailInput.FromLocationGroup = fromlocation.LocationGroupCode; - detailInput.FromLocationArea = fromlocation.AreaCode; - detailInput.FromLocationErpCode = fromlocation.ErpLocationCode; - detailInput.FromStatus = EnumInventoryStatus.FROZEN; - detailInput.Qty = detail.MatQty; - //detailInput.FromLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; - detailInput.FromPackingCode = string.Empty; - - transfer.Details.Add(detailInput); - - - await CreateAsync(transfer).ConfigureAwait(false); - } - } - else - { - errors.Add("Agv确认单据里无数据! \n"); - } - } - catch (Exception ex) - { - ret = new AgvResultObject - { - Code = "-1", - ReqCode = "", - Message = ex.Message - }; - await unitOfWork.RollbackAsync().ConfigureAwait(false); - - } - - if (errors.Count > 0) - { - ret = new AgvResultObject - { - Code = "-1", - Message = string.Join(",", errors.ToArray()), - ReqCode = "" - }; - await unitOfWork.RollbackAsync().ConfigureAwait(false); - } - return ret; - } - From 0edce0d68d58d76ca991533e54a7725562ee223b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 16 Dec 2024 14:18:44 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=9E=E5=BA=93?= =?UTF-8?q?=E4=BA=8B=E5=8A=A1=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Enums/Inventory/EnumTransSubType.cs | 27 ++++++++++++++++--- .../AssembleIssueJobAppService.cs | 2 +- .../InjectionIssueJobAppService.cs | 2 +- .../SparePartIssueJobAppService.cs | 2 +- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs index 936c810bc..816d2795c 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs @@ -243,15 +243,36 @@ public enum EnumTransSubType /// - ///AGV冻结 + ///AGV喷涂回库 /// [Display(Name = "AGV喷涂回库")] Agv_Return_Coating = 1513, /// - ///AGV冻结 + ///AGVKitting回库 /// [Display(Name = "AGVKitting回库")] - Agv_Return_Kitting = 1514 + Agv_Return_Kitting = 1514, + + /// + ///AGV装配回库 + /// + [Display(Name = "AGV装配回库")] + Agv_Return_Assemble = 1515, + + /// + ///AGV注塑回库 + /// + [Display(Name = "AGV注塑回库")] + Agv_Return_Injection = 1516, + + /// + ///AGV备品回库 + /// + [Display(Name = "AGV备品回库")] + Agv_Return_SparePart = 1517, + + + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs index 062e34d33..a897b959b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs @@ -1108,7 +1108,7 @@ public class AssembleIssueJobAppService { TransferNoteEditInput transfer = new TransferNoteEditInput(); transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Type = EnumTransSubType.Agv_Return_Assemble.ToString(); transfer.Worker = "Agv"; transfer.UseOnTheWayLocation = false; List transferNoteDetailInputs = new List(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs index bc79039c1..1060b8209 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs @@ -1003,7 +1003,7 @@ public class InjectionIssueJobAppService { TransferNoteEditInput transfer = new TransferNoteEditInput(); transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Type = EnumTransSubType.Agv_Return_Injection.ToString(); transfer.Worker = "Agv"; transfer.UseOnTheWayLocation = false; List transferNoteDetailInputs = new List(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs index baba67194..590b08475 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs @@ -986,7 +986,7 @@ public class SparePartIssueJobAppService { TransferNoteEditInput transfer = new TransferNoteEditInput(); transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Type = EnumTransSubType.Agv_Return_SparePart.ToString(); transfer.Worker = "Agv"; transfer.UseOnTheWayLocation = false; List transferNoteDetailInputs = new List();