diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/BaererToken.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/BaererToken.cs index f03e11afd..ae5876e3b 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/BaererToken.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/BaererToken.cs @@ -1,6 +1,6 @@ using System; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Authenticaitons; public class BaererToken { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/ITokenService.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/ITokenService.cs index 66c7736a7..72b519012 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/ITokenService.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/ITokenService.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Authenticaitons; public interface ITokenService : ITransientDependency { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/TokenService.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/TokenService.cs index eb1a54651..836c250c3 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/TokenService.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/TokenService.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Configuration; using Volo.Abp; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Authenticaitons; public class TokenService : ITokenService { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs index def81ffb7..3842deec2 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs @@ -8,7 +8,7 @@ using Microsoft.Extensions.Options; using StackExchange.Redis; using Volo.Abp.Application.Services; using Win_in.Sfs.Wms.DataExchange.Domain; -using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +using Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; using static Volo.Abp.Identity.Settings.IdentitySettingNames; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Client; diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/FawtygAutoMapperProfile.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/FawtygAutoMapperProfile.cs index 0f32b55f7..3b8406c0a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/FawtygAutoMapperProfile.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/FawtygAutoMapperProfile.cs @@ -9,7 +9,7 @@ using Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote; using Win_in.Sfs.Wms.DataExchange.WMS.ScrapNote; using Win_in.Sfs.Wms.Store.Application.Contracts; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; public class FawtygAutoMapperProfile : Profile { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/HttpAuthorizationHandler.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/HttpAuthorizationHandler.cs index 55ef3d385..f66ea4c4a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/HttpAuthorizationHandler.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/HttpAuthorizationHandler.cs @@ -1,9 +1,9 @@ using System; using Microsoft.Extensions.Configuration; using Volo.Abp.DependencyInjection; -using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons; +using Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Authenticaitons; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; public class HttpAuthorizationHandler : ISingletonDependency { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs index cc8fdbf53..a4cf337f7 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs @@ -18,8 +18,9 @@ using Win_in.Sfs.Wms.DataExchange.WMS.PCK; using Win_in.Sfs.Wms.Store.Application.Contracts; using System.Text.Json.Serialization; using System.IdentityModel.Tokens.Jwt; +using Volo.Abp; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming; public class InjectionMoldingRequestReader : IReader { @@ -27,21 +28,19 @@ public class InjectionMoldingRequestReader : IReader private readonly IInjectionRequestAppService _injectionRequest; private readonly IItemBasicAppService _itemService; private readonly ILocationAppService _locService; - private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly ILogger _logger; private readonly IOptions _options; private readonly IHttpClientFactory _httpClientFactory; - public InjectionMoldingRequestReader( IInjectionRequestAppService injectionRequest , IIncomingFromExternalManager incomingFromExternalManager , ILogger logger - ,IOptions options + , IOptions options , IHttpClientFactory httpClientFactory - ,IItemBasicAppService itemService - ,ILocationAppService locService + , IItemBasicAppService itemService + , ILocationAppService locService ) { @@ -63,9 +62,9 @@ public class InjectionMoldingRequestReader : IReader Filter filter = new Filter() { Action = "<>", - Column = "JobStatus", + Column = "RequestStatus", Logic = EnumFilterLogic.And.ToString(), - Value = ((int)EnumJobStatus.Done).ToString() + Value = ((int)EnumRequestStatus.Completed).ToString() }; jobCondition.Condition.Filters.Add(filter); var jobs = await _injectionRequest.GetAllListByFilterAsync(jobCondition).ConfigureAwait(false); @@ -81,12 +80,8 @@ public class InjectionMoldingRequestReader : IReader _logger.LogError($"没有读取到摄像头信息{DateTime.Now},请检查网络"); return new List(); } - - - cameraList = System.Text.Json.JsonSerializer.Deserialize>(camera);//camera转注塑叫料明细任务数据 - InjectionRequestEditInput input=new InjectionRequestEditInput(); List injectionRequestDetails = new List(); @@ -113,29 +108,37 @@ public class InjectionMoldingRequestReader : IReader await _injectionRequest.CreateAsync(input).ConfigureAwait(false); } } - catch (Exception ex) + catch (AbpException ex) { _logger.LogError(ex.Message); } + catch (JsonException ex) + { + _logger.LogError(ex.Message); + } + catch (Exception ex) + { + _logger.LogError(ex.Message); + } return new List(); } private async Task> BindAsync(List p_list) { List errors = new List(); - foreach (var request in p_list) { var itm =await _itemService.GetByCodeAsync(request.ItemCode).ConfigureAwait(false); - if(itm == null) { errors.Add($"编号:{request.ItemCode}零件表中没找到!" ); }else + if(itm == null) { errors.Add($"编号:{request.ItemCode}零件表中没找到!" ); } + else { request.ItemDesc1 = itm.Desc1; request.ItemDesc2 = itm.Desc2; request.ItemName = itm.Name; - } var loc = await _locService.GetByCodeAsync(request.ToLocationCode).ConfigureAwait(false); - if (loc == null) { errors.Add($"编号:{request.ToLocationCode}库位表中没找到!"); }else + if (loc == null) { errors.Add($"编号:{request.ToLocationCode}库位表中没找到!"); } + else { request.ToLocationCode = loc.Code; request.ToLocationGroup = loc.LocationGroupCode; @@ -143,18 +146,11 @@ public class InjectionMoldingRequestReader : IReader request.ToWarehouseCode= loc.WarehouseCode; } } - - return errors; - } - - - - /// - /// + /// 读取摄像头API /// /// /// @@ -168,7 +164,7 @@ public class InjectionMoldingRequestReader : IReader var client = _httpClientFactory.CreateClient(); var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")); client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials); - var response = await client.GetAsync("https://example.com/api/data").ConfigureAwait(false); + var response = await client.GetAsync(address).ConfigureAwait(false); if (response.IsSuccessStatusCode) { return await response.Content.ReadAsStringAsync().ConfigureAwait(false); @@ -180,7 +176,7 @@ public class InjectionMoldingRequestReader : IReader public class InjectionRequest { /// - /// 零件吗 + /// 零件M /// public string ItemCode { get; set; } /// @@ -200,10 +196,6 @@ public class InjectionMoldingRequestReader : IReader /// public decimal Qty { get; set; } - - - - } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs index 0c925031a..e9464cf25 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs @@ -6,10 +6,10 @@ using Microsoft.Extensions.Options; using Volo.Abp.BackgroundWorkers; using Volo.Abp.Threading; using Volo.Abp.Uow; -using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; +using Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming; using Win_in.Sfs.Wms.Store.Application.Contracts; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; public class InjectionMoldingTaskIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentHostedService.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentHostedService.cs index e74443d3b..a85952572 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentHostedService.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentHostedService.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Hosting; using Volo.Abp; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; public class InjectionMoldingTaskAgentHostedService : IHostedService { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentModule.cs index 15d305474..285b11d99 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentModule.cs @@ -24,7 +24,7 @@ using Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore; using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; [DependsOn( typeof(AbpAutofacModule), diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentService.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentService.cs index ca7ca6964..f40a2222b 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentService.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentService.cs @@ -1,7 +1,7 @@ using System; using Volo.Abp.DependencyInjection; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; public class InjectionMoldingTaskAgentService : ITransientDependency { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskOptions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskOptions.cs index 8a21a7193..5975a313e 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskOptions.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskOptions.cs @@ -1,6 +1,6 @@ using System.Net; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; public class InjectionMoldingTaskOptions { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Outgoing/InjectionMoldingTaskOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Outgoing/InjectionMoldingTaskOutgoingBackgroundWorker.cs index 65c92619e..3cc4e2ca2 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Outgoing/InjectionMoldingTaskOutgoingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Outgoing/InjectionMoldingTaskOutgoingBackgroundWorker.cs @@ -7,7 +7,7 @@ using Volo.Abp.Threading; using Volo.Abp.Uow; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; public class InjectionMoldingTaskOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Program.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Program.cs index 633c4d089..a5a7bd43c 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Program.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Program.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Serilog; -namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; public class Program { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs index 57c8c539d..5f10bc2ce 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs @@ -1,6 +1,9 @@ +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Entities; using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -51,4 +54,8 @@ public class CountJobDTO : SfsJobDTOBase [Display(Name = "库位代码")] public string LocationCode { get; set; } + /// + /// 任务从表明细(记录每次扫得明细) + /// + public List DepDetails { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs new file mode 100644 index 000000000..e98bf2708 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs @@ -0,0 +1,58 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class CountJobDependentDetailDTO : SfsJobDetailDTOBase, IHasCountResult +{ + + /// + /// 盘点标签 + /// + [Display(Name = "盘点标签")] + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string CountLabel { get; set; } + + /// + /// 计量单位 + /// + [Display(Name = "计量单位")] + public string Uom { get; set; } + + /// + /// 库存数量 + /// + [Display(Name = "库存数量")] + public decimal InventoryQty { get; set; } + + /// + /// 库存库位 + /// + [Display(Name = "库存库位")] + public string InventoryLocationCode { get; set; } + + /// + /// 盘点数量 + /// + [Display(Name = "盘点数量")] + public decimal CountQty { get; set; } + + /// + /// 盘点时间 + /// + [Display(Name = "盘点时间")] + public DateTime? CountTime { get; set; } + + /// + /// 盘点操作员 + /// + [Display(Name = "盘点操作员")] + public string CountOperator { get; set; } + + /// + /// 盘点描述 + /// + [Display(Name = "盘点描述")] + public string CountDescription { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/DTOs/TransferNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/DTOs/TransferNoteDTO.cs index 3dc2c2dde..5ce65e6eb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/DTOs/TransferNoteDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/DTOs/TransferNoteDTO.cs @@ -44,4 +44,30 @@ public class TransferNoteDTO : SfsStoreDTOBase, IHasNumbe [Display(Name = "确认时间")] public DateTime? ConfirmTime { get; set; } + #region 回调服务相关 + /// + /// 回调服务名称 + /// + [Display(Name = "回调服务名称")] + public string CallServerName { get; set; } + + /// + /// 回调业务类型 + /// + [Display(Name = "回调业务类型")] + public string CallBusinessType { get; set; } + + /// + /// 调用者传入申请单号 + /// + [Display(Name = "传入申请单号")] + public string CallRequestNumber { get; set; } + + /// + /// 调用者传入任务单号 + /// + [Display(Name = "传入任务单号")] + public string CallJobNumber { get; set; } + #endregion + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs index b1b084185..7e4075451 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs @@ -51,4 +51,31 @@ public class TransferNoteEditInput : SfsStoreCreateOrUpdateInputBase [Display(Name = "详情")] public List Details { get; set; } = new List(); + + #region 回调服务相关 + /// + /// 回调服务名称 + /// + [Display(Name = "回调服务名称")] + public string CallServerName { get; set; } + + /// + /// 回调业务类型 + /// + [Display(Name = "回调业务类型")] + public string CallBusinessType { get; set; } + + /// + /// 调用者传入申请单号 + /// + [Display(Name = "传入申请单号")] + public string CallRequestNumber { get; set; } + + /// + /// 调用者传入任务单号 + /// + [Display(Name = "传入任务单号")] + public string CallJobNumber { get; set; } + #endregion + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/Inputs/InjectionRequestEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/Inputs/InjectionRequestEditInput.cs index a95c5a489..7df467797 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/Inputs/InjectionRequestEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/Inputs/InjectionRequestEditInput.cs @@ -6,13 +6,7 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts; public class InjectionRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase { - #region Base - /// - /// 车间 - /// - [Display(Name = "车间")] - [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] - public string Workshop { get; set; } + #region Base /// /// 使用在途库 @@ -21,26 +15,13 @@ public class InjectionRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase public bool UseOnTheWayLocation { get; set; } #endregion - #region Create - /// - /// 要货单号 - /// - [Display(Name = "要货单号")] - [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] - public string Number { get; set; } + #region Create /// /// 叫料类型 /// [Display(Name = "叫料类型")] - public string Type { get; set; } - - /// - /// 备料计划单号 - /// - [Display(Name = "备料计划单号")] - [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] - public string PreparationPlanNumber { get; set; } + public string Type { get; set; } /// /// 明细列表 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs index 677d30d58..d80af81be 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs @@ -138,9 +138,9 @@ public class InjectionJobAppService } [HttpPost("Do-Call-Back")] - public async Task DoTransferLibCallbackAsync(string businessType, string requestNum, string jobNum) + public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto) { - var job = await _repository.FindAsync(p => p.Number == jobNum).ConfigureAwait(false); + var job = await _repository.FindAsync(p => p.Number == dto.JobNumber).ConfigureAwait(false); //todo 等云峰写好换成真实的 var transferLibJobDto= await _transferLibJobAppService.GetByNumberAsync("AAA").ConfigureAwait(false); @@ -181,8 +181,7 @@ public class InjectionJobAppService await _repository.UpdateAsync(job).ConfigureAwait(false); - //return new Tuple(true,"s"); - return new TransferLibJobDTO(); + return; } [HttpPost("test")] diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs index ec046020f..cd0f0bc26 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs @@ -34,7 +34,7 @@ public class PurchaseReceiptJobAppService : /// public PurchaseReceiptJobAppService(IPurchaseReceiptJobRepository repository, IPurchaseReceiptJobManager purchaseReceiptJobManager, - IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService, + //IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService, //lyf at 0415移库调用此处报错,提示注入错误,此处没有使用,所以删除 IFileAppService fileAppService) : base(repository, purchaseReceiptJobManager) { _purchaseReceiptJobManager = purchaseReceiptJobManager; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs index 788e3b817..7fbf30d55 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs @@ -38,7 +38,6 @@ public class TransferLibJobAppService [UnitOfWork] public override async Task CompleteAsync(Guid id, TransferLibJobDTO dto) { - //var str = "Win_in.Sfs.Wms.Store.Application.InjectionJobAppService"; string methodPrefix = "TransferLibJobAppService.CompleteAsync - "; if (dto.CallServerName.IsNullOrEmpty()) { @@ -57,6 +56,122 @@ public class TransferLibJobAppService throw new UserFriendlyException($"{methodPrefix}CallJobNumber 不能为空"); } + #region 校验 + foreach (var detailObj in dto.Details) + { + if (detailObj.IsPackingCodeFrom) + { + if (detailObj.RecommendFromPackingCode != detailObj.HandledFromPackingCode) + { + throw new UserFriendlyException($"触发校验:推荐From箱码必须等于实际From箱码"); + } + } + + if (detailObj.IsPackingCodeTo) + { + if (detailObj.RecommendToPackingCode != detailObj.HandledToPackingCode) + { + throw new UserFriendlyException($"触发校验:推荐To箱码必须等于实际To箱码"); + } + } + + if (detailObj.IsLotFrom) + { + if (detailObj.RecommendFromLot != detailObj.HandledFromLot) + { + throw new UserFriendlyException($"触发校验:推荐From批次必须等于实际From批次"); + } + } + + if (detailObj.IsLotTo) + { + if (detailObj.RecommendToLot != detailObj.HandledToLot) + { + throw new UserFriendlyException($"触发校验:推荐To批次必须等于实际To批次"); + } + } + //if (detailObj.IsItemCodeFrom) + //if (detailObj.IsItemCodeTo) + //if (detailObj.IsStatusFrom) + //if (detailObj.IsStatusTo) + if (detailObj.IsLocationCodeFrom) + { + if (detailObj.RecommendFromLocationCode != detailObj.HandledFromLocationCode) + { + throw new UserFriendlyException($"触发校验:推荐From库位必须等于实际From库位"); + } + } + + if (detailObj.IsLocationCodeTo) + { + if (detailObj.RecommendToLocationCode != detailObj.HandledToLocationCode) + { + throw new UserFriendlyException($"触发校验:推荐To库位必须等于实际To库位"); + } + } + + if (detailObj.IsLocationGroupFrom) + { + if (detailObj.RecommendFromLocationGroup != detailObj.HandledFromLocationGroup) + { + throw new UserFriendlyException($"触发校验:推荐From库位组必须等于实际From库位组"); + } + } + + if (detailObj.IsLocationGroupTo) + { + if (detailObj.RecommendToLocationGroup != detailObj.HandledToLocationGroup) + { + throw new UserFriendlyException($"触发校验:推荐To库位组必须等于实际To库位组"); + } + } + if (detailObj.IsLocationAreaFrom) + { + if (detailObj.RecommendFromLocationArea != detailObj.HandledFromLocationArea) + { + throw new UserFriendlyException($"触发校验:推荐From库区必须等于实际From库区"); + } + } + + if (detailObj.IsLocationAreaTo) + { + if (detailObj.RecommendToLocationArea != detailObj.HandledToLocationArea) + { + throw new UserFriendlyException($"触发校验:推荐To库区必须等于实际To库区"); + } + } + if (detailObj.IsLocationErpCodeFrom) + { + if (detailObj.RecommendFromLocationErpCode != detailObj.HandledFromLocationErpCode) + { + throw new UserFriendlyException($"触发校验:推荐From ERP库区必须等于实际From ERP库区"); + } + } + + if (detailObj.IsLocationErpCodeTo) + { + if (detailObj.RecommendToLocationErpCode != detailObj.HandledToLocationErpCode) + { + throw new UserFriendlyException($"触发校验:推荐To ERP库区必须等于实际To ERP库区"); + } + } + if (detailObj.IsQtyFrom) + { + if (detailObj.RecommendFromQty != detailObj.HandledFromQty) + { + throw new UserFriendlyException($"触发校验:推荐From数量必须等于实际From数量"); + } + } + if (detailObj.IsQtyTo) + { + if (detailObj.RecommendToQty != detailObj.HandledToQty) + { + throw new UserFriendlyException($"触发校验:推荐To数量必须等于实际To数量"); + } + } + } + #endregion + var ret = await base.CompleteAsync(id, dto).ConfigureAwait(false); if (ret != null) { @@ -70,37 +185,12 @@ public class TransferLibJobAppService { throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象创建失败"); } - ITransferLibCallback transferLibCallback = (Win_in.Sfs.Wms.Store.Notes.ITransferLibCallback)instance; + ITransferLibCallback transferLibCallback = (ITransferLibCallback)instance; if (transferLibCallback == null) { throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象没有实现ITransferLibCallback接口"); } - TransferLibJobDTO callbackRet = await transferLibCallback.DoTransferLibCallbackAsync(dto.CallServerName, dto.CallRequestNumber, dto.CallJobNumber).ConfigureAwait(false); - if (callbackRet == null || callbackRet.Number == null) - { - throw new UserFriendlyException($"{methodPrefix}执行回调服务{dto.CallServerName}出错,返回实体为空!"); - } - //var assembly = Assembly.GetExecutingAssembly(); - //var ty = assembly.GetType(dto.CallServerName); - //if (ty == null) - //{ - // throw new UserFriendlyException($"{methodPrefix}没有找到类型为{dto.CallServerName}的对象"); - //} - //var instance = Activator.CreateInstance(ty); - //if (instance == null) - //{ - // throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象创建失败"); - //} - //ITransferLibCallback transferLibCallback = (ITransferLibCallback)instance; - //if (transferLibCallback == null) - //{ - // throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象没有实现ITransferLibCallback接口"); - //} - //Tuple callbackRet = transferLibCallback.DoTransferLibCallback(dto.CallServerName, dto.CallRequestNumber, dto.CallJobNumber); - //if (callbackRet != null && callbackRet.Item1 == false) - //{ - // throw new UserFriendlyException($"{methodPrefix}执行回调服务{dto.CallServerName}出错,返回错误信息:{callbackRet.Item2}"); - //} + await transferLibCallback.DoTransferLibCallbackAsync(dto).ConfigureAwait(false); } return ret; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/ITransferLibCallback.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/ITransferLibCallback.cs index b0da0ac6d..de4c5b1b2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/ITransferLibCallback.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/ITransferLibCallback.cs @@ -9,7 +9,7 @@ using Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Notes; public interface ITransferLibCallback { - Task DoTransferLibCallbackAsync(string businessType, string requestNum, string jobNum); + Task DoTransferLibCallbackAsync(TransferLibJobDTO dto); } public class TestTransferLibCallback : ITransferLibCallback @@ -18,9 +18,8 @@ public class TestTransferLibCallback : ITransferLibCallback { } - public async Task DoTransferLibCallbackAsync(string businessType, string requestNum, - string jobNum) + public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto) { - return new TransferLibJobDTO(); + await Task.Run(() => { }).ConfigureAwait(false); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs index 4286f8906..d253e27db 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs @@ -99,6 +99,12 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase /// [IgnoreUpdate] public override List Details { get; set; } = new List(); + /// + /// 任务从表明细(记录每次扫得明细) + /// + [IgnoreUpdate] + public List DepDetails { get; set; } = new List(); /// /// 设置任务明细的实际库位和实际数量 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs new file mode 100644 index 000000000..1d79ddb41 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs @@ -0,0 +1,51 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public class CountJobDependentDetail : SfsJobDetailEntityBase, IHasCountResult, IHasInventoryQty +{ + + /// + /// 盘点标签 + /// + public string CountLabel { get; set; } + + /// + /// 库存数量 + /// + public decimal InventoryQty { get; set; } + + /// + /// 计量单位 + /// + [Display(Name = "计量单位")] + public string Uom { get; set; } + + /// + /// 库存库位 + /// + public string InventoryLocationCode { get; set; } + + /// + /// 盘点数量(每次扫得数量) + /// + public decimal CountQty { get; set; } + + /// + /// 盘点时间 + /// + public DateTime? CountTime { get; set; } + + /// + /// 盘点操作员 + /// + public string CountOperator { get; set; } + + /// + /// 盘点描述 + /// + public string CountDescription { get; set; } +} + diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs index 7222a0ccc..1a6333d90 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs @@ -29,6 +29,7 @@ public static class CountJobDbContextModelCreatingExtensions b.Property(q => q.LocationCode).HasMaxLength(SfsPropertyConst.CodeLength); //Relations b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); + b.HasMany(q => q.DepDetails).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); //Indexes b.HasIndex(q => new { q.Number }).IsUnique(); }); @@ -55,5 +56,29 @@ public static class CountJobDbContextModelCreatingExtensions //Indexes //b.HasIndex(q => new { q.PackingCode }).IsUnique(); }); + + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(CountJobDependentDetail), options.Schema); + //Configure ABP properties + b.ConfigureByConvention(); + //Configure Sfs base properties + b.ConfigureSfsBase(); + //Configure Job base properties + b.ConfigureJobDetail(); + //Properties + b.Property(q => q.CountLabel).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.InventoryLocationCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.CountOperator).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.CountDescription).HasMaxLength(SfsPropertyConst.CodeLength); + + //Relations + //None + + //Indexes + //b.HasIndex(q => new { q.PackingCode }).IsUnique(); + }); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs index 17d37a43e..3a820eef5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs @@ -337,7 +337,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule #region Jobs options.Entity(orderOptions => - orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); + orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details).Include(o => o.DepDetails)); options.Entity(orderOptions => orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); options.Entity(orderOptions => diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs index eb88b8826..7ee5dda80 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs @@ -99,6 +99,7 @@ public partial class StoreEventAutoMapperProfile : Profile .Ignore(x => x.CompleteUserId) .Ignore(x => x.CompleteUserName) .Ignore(x => x.CompleteTime) + .Ignore(x => x.DepDetails) ; CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs index b1a830590..72ea8c7cb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs @@ -53,7 +53,6 @@ public class TransferLibRequestEventHandler var entity = eventData.Entity; var enumTransSubType = Enum.Parse(entity.Type); - return; if (entity.DirectCreateNote) { @@ -88,133 +87,6 @@ public class TransferLibRequestEventHandler input.Details.ForEach(p => { p.OnTheWayLocationCode = locationDto.Code; }); - //校验 - foreach (var detailObj in input.Details) - { - if (detailObj.IsPackingCodeFrom) - { - if (detailObj.RecommendFromPackingCode != detailObj.HandledFromPackingCode) - { - throw new UserFriendlyException($"触发校验:推荐From箱码必须等于实际From箱码"); - } - } - - if (detailObj.IsPackingCodeTo) - { - if (detailObj.RecommendToPackingCode != detailObj.HandledToPackingCode) - { - throw new UserFriendlyException($"触发校验:推荐To箱码必须等于实际To箱码"); - } - } - - if (detailObj.IsLotFrom) - { - if (detailObj.RecommendFromLot != detailObj.HandledFromLot) - { - throw new UserFriendlyException($"触发校验:推荐From批次必须等于实际From批次"); - } - } - - if (detailObj.IsLotTo) - { - if (detailObj.RecommendToLot != detailObj.HandledToLot) - { - throw new UserFriendlyException($"触发校验:推荐To批次必须等于实际To批次"); - } - } - - //if (detailObj.IsItemCodeFrom) - //{ - //} - - //if (detailObj.IsItemCodeTo) - //{ - //} - - //if (detailObj.IsStatusFrom) - //{ - //} - - //if (detailObj.IsStatusTo) - //{ - //} - - if (detailObj.IsLocationCodeFrom) - { - if (detailObj.RecommendFromLocationCode != detailObj.HandledFromLocationCode) - { - throw new UserFriendlyException($"触发校验:推荐From库位必须等于实际From库位"); - } - } - - if (detailObj.IsLocationCodeTo) - { - if (detailObj.RecommendToLocationCode != detailObj.HandledToLocationCode) - { - throw new UserFriendlyException($"触发校验:推荐To库位必须等于实际To库位"); - } - } - - if (detailObj.IsLocationGroupFrom) - { - if (detailObj.RecommendFromLocationGroup != detailObj.HandledFromLocationGroup) - { - throw new UserFriendlyException($"触发校验:推荐From库位组必须等于实际From库位组"); - } - } - - if (detailObj.IsLocationGroupTo) - { - if (detailObj.RecommendToLocationGroup != detailObj.HandledToLocationGroup) - { - throw new UserFriendlyException($"触发校验:推荐To库位组必须等于实际To库位组"); - } - } - if (detailObj.IsLocationAreaFrom) - { - if (detailObj.RecommendFromLocationArea != detailObj.HandledFromLocationArea) - { - throw new UserFriendlyException($"触发校验:推荐From库区必须等于实际From库区"); - } - } - - if (detailObj.IsLocationAreaTo) - { - if (detailObj.RecommendToLocationArea != detailObj.HandledToLocationArea) - { - throw new UserFriendlyException($"触发校验:推荐To库区必须等于实际To库区"); - } - } - if (detailObj.IsLocationErpCodeFrom) - { - if (detailObj.RecommendFromLocationErpCode != detailObj.HandledFromLocationErpCode) - { - throw new UserFriendlyException($"触发校验:推荐From ERP库区必须等于实际From ERP库区"); - } - } - - if (detailObj.IsLocationErpCodeTo) - { - if (detailObj.RecommendToLocationErpCode != detailObj.HandledToLocationErpCode) - { - throw new UserFriendlyException($"触发校验:推荐To ERP库区必须等于实际To ERP库区"); - } - } - if (detailObj.IsQtyFrom) - { - if (detailObj.RecommendFromQty != detailObj.HandledFromQty) - { - throw new UserFriendlyException($"触发校验:推荐From数量必须等于实际From数量"); - } - } - if (detailObj.IsQtyTo) - { - if (detailObj.RecommendToQty != detailObj.HandledToQty) - { - throw new UserFriendlyException($"触发校验:推荐To数量必须等于实际To数量"); - } - } - } await _transferLibJobManager.AddAsync(input).ConfigureAwait(false); }