From 71aa3e096527adfc5ce942e2fcd2369ca6be4f78 Mon Sep 17 00:00:00 2001 From: "mingliang.tang" Date: Tue, 11 Apr 2023 14:23:10 +0800 Subject: [PATCH 01/41] =?UTF-8?q?mapp=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/东阳程序最新版/v17/.suo | Bin 0 -> 13312 bytes .../Boms/BomAutoMapperProfile.cs | 4 +++- .../Customers/CustomerAutoMapperProfile.cs | 4 +++- .../Items/ItemBasicAutoMapperProfile.cs | 3 +++ .../Suppliers/SupplierAutoMapperProfile.cs | 5 ++++- .../MaterialRequestAutoMapperProfile.cs | 4 ++++ 6 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .vs/东阳程序最新版/v17/.suo diff --git a/.vs/东阳程序最新版/v17/.suo b/.vs/东阳程序最新版/v17/.suo new file mode 100644 index 0000000000000000000000000000000000000000..c98002b470e30086c26fc0d31201745e57a57317 GIT binary patch literal 13312 zcmeHN-*Xd19N!dC5r6SRR79*;5rLHaxHM@6rj&v>L!pvFd2p2El9bS-$y`!E&>6>f z$2XmE#s_Ec#Ro_H59A*xull4uI?nLoE7Z?t?>4zy?$S#_1BHA$o7>&n-Oqi0?S6N+ zx0g2k`NPfae+dU27VE^ld`eaNrfp(#MKo>X?(p+ z4Ak%`_QtpFr9-HO`ASmw#4U>gzQ7P!q$FgKLdsh0ydFbhAYfOwS37(CeiY`diqm2d zCn+INwKIVHOV(Jd-irLwR{2>xpF?^c ziRz;aHzB=(#5sWa=W`pL8<5zakN^5f&Hu+Ap#L9)ZT9^iLI5etUD^}YP?eh^*7!*+M#+o3CuJkJ%>NWowHKny10l^MKx;i9P9vpAI77vk|v<< z5~9%}a1A{D#=T~5`t(46`#u%#srpt=YITp*U`9%RUYvyVE6{opoHGWm3SC;|N-|*l zyAETiwWbxWdKX8Aa~p|qKP}FH&81)q$MGEnDSNdu$l^no|f&3fwUy_^_fk~^M z1^$A_Kn7RDG=3{6SCQzOZn6l0f6mL)r(gS{@7NP-%-Z=Nd40iSZk*d;1gHv+3fGU@{H}cXC&D+APU0{tVD*i}Z!E%@g2% z0m_pxhF^T*D*Pn8Plu-pv1KL54S|1?k+@RxS>vC{PWxYvhNo};*Li>6 zANr6sq`69v9^$3qsP2f5Oq@{tEo#JTv47CJoQ!P&xv&v z7NzwVll$tT#Js#}_T%JJho{kFOi2qoSIcr0hSFvpzMFuQX+zg~hHBoQ&4cSQY|FIZ z)te!lJTqo4^qAwz&@Q!X06CB7l=A+pXYwYxf!UZlguL7h5`XpVn>Voq;N*Z?pE*>y z_sHh=^pfZ16%Ycy4-~LPPMr*=&JjB4%RY>MxOX(y)g7mz-)y}0^~YlFm+T3H@?D9# zjh}dK%-F@;5vtM7qRjjWZiDQ9!CI+x&fbT4PfCiRjdzdi`|7t7H~;u)Y0HnZxED=| zL~iS?d$)F;yzzbJ=Wlo3;f1{i@$7vHo@kzoFw)|B!+5J~ooZY{i$nNt9_~81^KT@c z12TplN^4m?t>;FA@mM?()MCh`6RA{C&*owyk&$#Pp24{(TFc{J4w4_|vFpTvN5gcGs2mQIhvKesx>WQXubCK4Hq1hdh2 zCa8t=OfVIS$Aj5)N>AyUp3rqobqKeM5NQ`7+GdByXuF?e^5BPQ?n|h#mFWBuEx2=1 zcVcc&o>8%$2#?bJA9?DNDS`g|&*OdnGlkRMvtkfyPUCs^pzS8C)$G#A{m(%R$ocJl zk=>W?*O={$vzGCl_fPKkU*6K#gY$3xD;L)a%E7y3{mouvhpeI#pZBr6d*D9K`_{8Q z7VNL>|G#_}-TA#FH+=Iy5O~s*k@v%`zK8d3n=#H7B)|OcL0d2U`u!_!+jv5fMQd-O z|M7n^8N>R;=Ux4myaWX~`LE;qzW x.ExtraProperties) // .Ignore(x => x.Remark) ; - + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Customers/CustomerAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Customers/CustomerAutoMapperProfile.cs index 5abc9cafb..64d0e843f 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Customers/CustomerAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Customers/CustomerAutoMapperProfile.cs @@ -23,6 +23,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile CreateMap() .Ignore(x => x.ReportStatus) .Ignore(x => x.ReportReason); - + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAutoMapperProfile.cs index 0e6942ab5..7a1df672e 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAutoMapperProfile.cs @@ -28,5 +28,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile CreateMap() .Ignore(x => x.ItemCategory) .Ignore(x => x.Color); + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Suppliers/SupplierAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Suppliers/SupplierAutoMapperProfile.cs index cddd6b278..27fc41d7b 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Suppliers/SupplierAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Suppliers/SupplierAutoMapperProfile.cs @@ -21,6 +21,9 @@ public partial class BasedataApplicationAutoMapperProfile : Profile CreateMap() .Ignore(x => x.ReportStatus) - .Ignore(x => x.ReportReason); + .Ignore(x => x.ReportReason); + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAutoMapperProfile.cs index 9cd37fa0f..6e957501f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAutoMapperProfile.cs @@ -67,5 +67,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Number) .Ignore(x => x.Id) .Ignore(x => x.Remark); + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.RequestStatus) + .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } From 29d65444407c05caa534b9fd2e1b4c9ecf6cd2fc Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Tue, 11 Apr 2023 14:39:47 +0800 Subject: [PATCH 02/41] =?UTF-8?q?EOS=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArriveDbContextModelCreatingExtensions.cs | 2 +- .../PlanDbContextModelCreatingExtensions.cs | 3 +- .../ReturnDbContextModelCreatingExtensions.cs | 2 +- .../ShipDbContextModelCreatingExtensions.cs | 2 +- .../EosAgentModule.cs | 18 +++++--- .../Incoming/EosIncomingBackgroundWorker.cs | 28 ++++++------ .../Incoming/PlanReader.cs | 13 ++++-- ...fs.Wms.DataExchange.Fawtyg.EosAgent.csproj | 7 +++ .../appsettings.json | 14 +++--- .../Incoming/TyrpIncomingBackgroundWorker.cs | 44 +++++++++---------- .../IncomingToWmsExtensions.cs | 11 +---- 11 files changed, 78 insertions(+), 66 deletions(-) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs index 8d9fcc468..3d0ad6793 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs @@ -16,7 +16,7 @@ public static class ArriveDbContextModelCreatingExtensions b.ConfigureByConvention(); //Properties - b.Property(q => q.Id).UseIdentityColumn(); + b.Property(q => q.Id); b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.ShipBillNo).HasMaxLength(255); b.Property(q => q.DocNo).HasMaxLength(255); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanDbContextModelCreatingExtensions.cs index 64611eba3..8b45a8e80 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanDbContextModelCreatingExtensions.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanDbContextModelCreatingExtensions.cs @@ -1,4 +1,5 @@ using Microsoft.EntityFrameworkCore; +using Volo.Abp.Domain.Entities; using Volo.Abp.EntityFrameworkCore.Modeling; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; @@ -16,7 +17,7 @@ public static class PlanDbContextModelCreatingExtensions b.ConfigureByConvention(); //Properties - b.Property(q => q.Id).UseIdentityColumn(); + b.Property(q => q.Id).IsRequired().HasColumnType("numeric(18,0)");//.HasPrecision(18, 0); b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.ERP).HasMaxLength(255); b.Property(q => q.Qty).HasPrecision(18, 5); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs index 1ab605ae4..b6855dde1 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs @@ -16,7 +16,7 @@ public static class ReturnDbContextModelCreatingExtensions b.ConfigureByConvention(); //Properties - b.Property(q => q.Id).UseIdentityColumn(); + b.Property(q => q.Id); b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.ShipBillNo).HasMaxLength(255); b.Property(q => q.DocNo).HasMaxLength(255); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Ships/ShipDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Ships/ShipDbContextModelCreatingExtensions.cs index 3994efa4f..6eff6d28d 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Ships/ShipDbContextModelCreatingExtensions.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Ships/ShipDbContextModelCreatingExtensions.cs @@ -16,7 +16,7 @@ public static class ShipDbContextModelCreatingExtensions b.ConfigureByConvention(); //Properties - b.Property(q => q.Id).UseIdentityColumn(); + b.Property(q => q.Id); b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.ShipBillNo).HasMaxLength(255); b.Property(q => q.DetailMatNo).HasMaxLength(255); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs index abe36c06a..ee6b2a09f 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Polly; using Volo.Abp; +using Volo.Abp.Account; using Volo.Abp.Autofac; using Volo.Abp.AutoMapper; using Volo.Abp.BackgroundJobs; @@ -39,7 +40,8 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; typeof(DataExchangeDomainModule), typeof(DataExchangeEntityFrameworkCoreModule), typeof(DataExchangeDomainFawtygEosModule), - typeof(DataExchangeEntityFrameworkCoreFawtygModule) + typeof(DataExchangeEntityFrameworkCoreFawtygModule), + typeof(AbpAccountApplicationContractsModule) )] public class EosAgentModule : AbpModule { @@ -144,6 +146,10 @@ public class EosAgentModule : AbpModule typeof(BasedataApplicationContractsModule).Assembly, "BaseData" ); + context.Services.AddHttpClientProxies( + typeof(AbpAccountApplicationContractsModule).Assembly, + "Auth" + ); context.Services.AddHttpClientProxies( typeof(StoreApplicationContractsModule).Assembly, "Store" @@ -154,11 +160,13 @@ public class EosAgentModule : AbpModule ); } - public override async Task OnApplicationInitializationAsync( - ApplicationInitializationContext context) + + public override void OnApplicationInitialization( + ApplicationInitializationContext context) { - await context.AddBackgroundWorkerAsync().ConfigureAwait(false); - await context.AddBackgroundWorkerAsync().ConfigureAwait(false); + + context.AddBackgroundWorkerAsync(); + // context.AddBackgroundWorker(); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs index acb6851bf..a02ce68b4 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs @@ -43,21 +43,21 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase //转换Plan await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false); - Logger.LogInformation($"Read Ship"); - var shipHandleService = workerContext.ServiceProvider.GetRequiredService(); - var shipConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保持Ship - var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false); - //转换Ship - await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); + //Logger.LogInformation($"Read Ship"); + //var shipHandleService = workerContext.ServiceProvider.GetRequiredService(); + //var shipConverter = workerContext.ServiceProvider.GetRequiredService(); + ////读取并保持Ship + //var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false); + ////转换Ship + //await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); - Logger.LogInformation($"Read Product"); - var productHandleService = workerContext.ServiceProvider.GetRequiredService(); - var productConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保持Product - var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); - //转换Product - await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); + //Logger.LogInformation($"Read Product"); + //var productHandleService = workerContext.ServiceProvider.GetRequiredService(); + //var productConverter = workerContext.ServiceProvider.GetRequiredService(); + ////读取并保持Product + //var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); + ////转换Product + //await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); Logger.LogInformation($"Completed: Handling {Incoming}"); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs index f321717ac..917e143f0 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text.Json; using System.Threading.Tasks; using Microsoft.Extensions.Logging; +using Volo.Abp.Guids; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; @@ -18,22 +19,26 @@ public class PlanReader : IReader private readonly IPlanManager _planManager; private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly ILogger _logger; - + private readonly IGuidGenerator _guidGenerator; public PlanReader( IPlanManager planManager , IIncomingFromExternalManager incomingFromExternalManager , ILogger logger + , IGuidGenerator guidGenerator ) { _planManager = planManager; _incomingFromExternalManager = incomingFromExternalManager; _logger = logger; + _guidGenerator = guidGenerator; + } public virtual async Task> ReadAsync() { //从EOS读取待处理Plan - var toBeProcessedPlans = await _planManager.GetToBeProcessedListAsync().ConfigureAwait(false); + var aa = await _planManager.GetToBeProcessedListAsync().ConfigureAwait(false); + var toBeProcessedPlans = aa.Take(100).ToList(); if (!toBeProcessedPlans.Any()) { _logger.LogInformation("no plans"); @@ -41,7 +46,7 @@ public class PlanReader : IReader } //Plan逐一转换为PurchaseOrder var incomingDataList = BuildIncomingFromExternalFromPlanAsync(toBeProcessedPlans); - await _incomingFromExternalManager.CreateManyAsync(incomingDataList).ConfigureAwait(false); + await _incomingFromExternalManager.CreateBulkAsync(incomingDataList).ConfigureAwait(false); //更新EOS数据状态 await _planManager.UpdateProcessedListAsync(toBeProcessedPlans).ConfigureAwait(false); return incomingDataList; @@ -55,7 +60,7 @@ public class PlanReader : IReader var incomingData = BuildIncomingFromExternal(plan); incomingData.SetEffectiveDate(plan.EosDate); - + incomingData.SetId(_guidGenerator.Create()); try { var po = BuildPurchaseOrderExchangeDto(plan); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.csproj b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.csproj index 7804b5368..effdaa13f 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.csproj +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.csproj @@ -15,6 +15,13 @@ + + + + + + + diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json index 27882d40c..83cadac0a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json @@ -1,12 +1,12 @@ { "ConnectionStrings": { - "Default": "Server=dev.ccwin-in.com,13319;Database=DyWmsAuth;uid=ccwin-in;pwd=Microsoft@2022;", - "DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;", - "EOS": "Server=dev.ccwin-in.com,13319;Database=EOS;Uid=ccwin-in;Pwd=Microsoft@2022;" + "Default": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", + "DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", + "EOS": "Server=61.139.155.47;Database=EOSCC;Uid=wms;Pwd=1;TrustServerCertificate=True" }, "AuthServer": { - "Authority": "http://dev.ccwin-in.com:59093/", + "Authority": "http://dev.ccwin-in.com:21293/", "RequireHttpsMetadata": "false", "SwaggerClientId": "admin", "SwaggerClientSecret": "1q2w3E*", @@ -25,13 +25,13 @@ "RemoteServices": { "BaseData": { - "BaseUrl": "http://dev.ccwin-in.com:59094/" + "BaseUrl": "http://dev.ccwin-in.com:21294/" }, "Store": { - "BaseUrl": "http://dev.ccwin-in.com:59095/" + "BaseUrl": "http://dev.ccwin-in.com:21295/" }, "Label": { - "BaseUrl": "http://dev.ccwin-in.com:59092/" + "BaseUrl": "http://dev.ccwin-in.com:21292/" } }, "EosOptions": { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs index e7227cd49..d439e1103 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs @@ -59,13 +59,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase common.updatedt = DateTime.Now; common.isupdate = false; - //Logger.LogInformation($"Read ItemBasic");//零件 - //var itemBasicReader = workerContext.ServiceProvider.GetRequiredService(); - //var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存itemBasic - //var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false); - ////转换itemBasic - //await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read ItemBasic");//零件 + var itemBasicReader = workerContext.ServiceProvider.GetRequiredService(); + var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存itemBasic + var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false); + //转换itemBasic + await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); //Logger.LogInformation($"Read User");//用户和部门 //var userReader = workerContext.ServiceProvider.GetRequiredService(); @@ -80,21 +80,21 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase ////转换department //await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false); - //Logger.LogInformation($"Read InterfaceCalendar");//账期 - //var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService(); - //var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存InterfaceCalendar - //var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync(); - ////转换InterfaceCalendar - //await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList); - - Logger.LogInformation($"Read Dict");//系统代码 - var dictReader = workerContext.ServiceProvider.GetRequiredService(); - var dictConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保存Dict - var dictOutsFromExternalList = await dictReader.ReadAsync().ConfigureAwait(false); - //转换Dict - await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read InterfaceCalendar");//账期 + var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService(); + var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存InterfaceCalendar + var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false); + //转换InterfaceCalendar + await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false); + + //Logger.LogInformation($"Read Dict");//系统代码 + //var dictReader = workerContext.ServiceProvider.GetRequiredService(); + //var dictConverter = workerContext.ServiceProvider.GetRequiredService(); + ////读取并保存Dict + //var dictOutsFromExternalList = await dictReader.ReadAsync().ConfigureAwait(false); + ////转换Dict + //await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); //Logger.LogInformation($"Read Bom"); //var BomReader = workerContext.ServiceProvider.GetRequiredService(); diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs index 0c7813de4..bc9666215 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs @@ -33,16 +33,7 @@ public static class IncomingToWmsExtensions { var Dict = JsonSerializer.Deserialize(incomingConverted.DataContent); var DictBasicAppService = workerContext.ServiceProvider.GetRequiredService(); - try - { - await DictBasicAppService.UpdateAsync(Dict).ConfigureAwait(false); - } - catch (System.Exception ex) - { - - throw; - } - + await DictBasicAppService.UpdateAsync(Dict).ConfigureAwait(false); } public static async Task HandleUsersAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext) { From 0833eacd58ccaa46ac3ac38ceae274565144f07a Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Tue, 11 Apr 2023 15:02:54 +0800 Subject: [PATCH 03/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StoreHttpApiHostModule.cs | 7 +++ .../Inventories/BalanceController.cs | 10 ++--- .../ItemPacks/ItemPackAutoMapperProfile.cs | 1 + .../Filters/FilterExtensions.cs | 43 ++++++++++--------- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs index cb6ae48c9..84e46d947 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Text.Json.Serialization; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -83,6 +84,12 @@ public class StoreHttpApiHostModule : ModuleBase { base.ConfigureServices(context); ConfigureVirtualFileSystem(); + + //将枚举返回时都变为字符串 + //context.Services.AddControllers().AddJsonOptions(options => + //{ + // options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); + //}); //ConfigureSwaggerServices(context, context.Services.GetConfiguration()); } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs index b4a4ed2a3..9adb5c110 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs @@ -280,11 +280,11 @@ public class BalanceController : AbpController } } - if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any()) - { - input.Condition.Filters.Add( - new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In")); - } + //if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any()) + //{ + // input.Condition.Filters.Add( + // new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In")); + //} var balanceDTOs = await _balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false); diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs index 3b5b405af..8de7a1e0d 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs @@ -22,6 +22,7 @@ public partial class BasedataApplicationAutoMapperProfile : Profile CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.TenantId) + .Ignore(x=>x.Id) .Ignore(x => x.ExtraProperties) .Ignore(x => x.ConcurrencyStamp) ; diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Filters/FilterExtensions.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Filters/FilterExtensions.cs index 3fc0120be..5fadcdde4 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Filters/FilterExtensions.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Filters/FilterExtensions.cs @@ -206,27 +206,28 @@ public static class FilterExtensions var parameterExpression = Expression.Parameter(typeof(T), "p"); Type lstType = typeof(List<>).MakeGenericType(propertyType); - if (propertyType.IsEnum) - { - var valueArrayStrings = JsonSerializer.Deserialize>(filter.Value); - List newValues = new List(); - - var enumValues = propertyType.GetEnumValues(); - - foreach (var valueArray in valueArrayStrings) - { - foreach (var enumValue in enumValues) - { - if (enumValue.ToString() == valueArray) - { - newValues.Add(enumValue); - break; - } - } - } - var newValue = JsonSerializer.Serialize(newValues); - filter.Value = newValue; - } + //转换枚举 + //if (propertyType.IsEnum) + //{ + // var valueArrayStrings = JsonSerializer.Deserialize>(filter.Value); + // List newValues = new List(); + + // var enumValues = propertyType.GetEnumValues(); + + // foreach (var valueArray in valueArrayStrings) + // { + // foreach (var enumValue in enumValues) + // { + // if (enumValue.ToString() == valueArray) + // { + // newValues.Add(enumValue); + // break; + // } + // } + // } + // var newValue = JsonSerializer.Serialize(newValues); + // filter.Value = newValue; + //} object propertyValue = JsonSerializer.Deserialize(filter.Value, lstType); if (propertyValue != null) From d74fdf70e1fbd28381e052819794cb4ccd04837a Mon Sep 17 00:00:00 2001 From: "mingliang.tang" Date: Tue, 11 Apr 2023 16:37:43 +0800 Subject: [PATCH 04/41] =?UTF-8?q?mapp=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Calendars/InterfaceCalendarAutoMapperProfile.cs | 3 +++ .../CustomerItems/CustomerItemAutoMapperProfile.cs | 5 ++++- .../ErpLocations/ErpLocationAutoMapperProfile.cs | 4 +++- .../ItemPacks/ItemPackAutoMapperProfile.cs | 4 +++- .../SupplierItems/SupplierItemAutoMapperProfile.cs | 5 +++++ .../Balances/BalanceAutoMapperProfile.cs | 1 + .../InventoryLabels/InventoryLabelAutoMapperProfile.cs | 9 +++++++++ .../BackFlushNotes/BackFlushNoteAutoMapperProfile.cs | 4 ++++ .../ProductReceiptNoteAutoMapperProfile.cs | 5 +++++ .../Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs | 3 +++ .../PurchaseOrders/PurchaseOrderAutoMapperProfile.cs | 2 ++ .../Orders/SaleOrders/SaleOrderAutoMapperProfile.cs | 4 ++++ 12 files changed, 46 insertions(+), 3 deletions(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Calendars/InterfaceCalendarAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Calendars/InterfaceCalendarAutoMapperProfile.cs index 97d14dffc..2c8c5aade 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Calendars/InterfaceCalendarAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Calendars/InterfaceCalendarAutoMapperProfile.cs @@ -12,5 +12,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile CreateMap() .IgnoreAuditedObjectProperties() .ReverseMap(); + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAutoMapperProfile.cs index 218505a3d..9e10e579c 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAutoMapperProfile.cs @@ -23,7 +23,10 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.ReportStatus) .Ignore(x => x.ReportReason) ; - + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Id); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ErpLocations/ErpLocationAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ErpLocations/ErpLocationAutoMapperProfile.cs index 3b9cb52fb..fdeb61c43 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ErpLocations/ErpLocationAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ErpLocations/ErpLocationAutoMapperProfile.cs @@ -18,6 +18,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.Remark) .Ignore(x => x.ExtraProperties) .Ignore(x => x.ConcurrencyStamp); - + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs index 3b5b405af..f79c194fe 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs @@ -25,6 +25,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.ExtraProperties) .Ignore(x => x.ConcurrencyStamp) ; - + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierItems/SupplierItemAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierItems/SupplierItemAutoMapperProfile.cs index 3031daabc..d56ab00e7 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierItems/SupplierItemAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierItems/SupplierItemAutoMapperProfile.cs @@ -24,5 +24,10 @@ public partial class BasedataApplicationAutoMapperProfile : Profile CreateMap() .Ignore(x => x.ReportStatus) .Ignore(x => x.ReportReason); + CreateMap() + .IgnoreAuditedObjectProperties() + //.ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => new UomQty(d.SupplierPackUom, d.SupplierPackQty))) + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Id); } } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs index 789d613d5..d48e72113 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs @@ -31,5 +31,6 @@ public partial class InventoryApplicationAutoMapperProfile : Profile CreateMap() .Ignore(x => x.JobNumber) .Ignore(x => x.Worker); + } } diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAutoMapperProfile.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAutoMapperProfile.cs index a9050e8f8..2cccbc882 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAutoMapperProfile.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAutoMapperProfile.cs @@ -51,5 +51,14 @@ public class InventoryLabelAutoMapperProfile : Profile .Ignore(x => x.Id) .Ignore(x => x.StdPackQty) .Ignore(x => x.Uom); + + CreateMap() + .IgnoreAuditedObjectProperties() + //.MapItemBatchQtyStdPackDto() + .MapPurchaseInfoDto() + .MapProductionInfoDto() + .MapQualityInfoDto() + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Id); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAutoMapperProfile.cs index b6084ec5f..0512e574e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAutoMapperProfile.cs @@ -22,5 +22,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + CreateMap() + .IgnoreAuditedObjectProperties(); + + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs index 22ccaef66..9cd37feef 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs @@ -23,5 +23,10 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.Shift) + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Id); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs index 7545e93a1..15eddc2f4 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs @@ -20,5 +20,8 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs index 8caa93937..2ef9b67b1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs @@ -55,5 +55,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.MasterID) .Ignore(x => x.Id); + CreateMap() + .IgnoreAuditedObjectProperties(); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs index 8b10bf925..7006bf3f2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs @@ -45,5 +45,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Number) .IgnoreAuditedObjectProperties() .Ignore(x => x.Id); + CreateMap() + .IgnoreAuditedObjectProperties(); + //.MapContactsDto() + //.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); } } From fc9410f484ffb064f1c730db2cefc6523445389e Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Wed, 12 Apr 2023 15:35:29 +0800 Subject: [PATCH 05/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=B8=9A=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inventories/BalanceController.cs | 57 +- .../Controllers/Jobs/CountJobController.cs | 6 +- .../Controllers/Jobs/DeliverJobController.cs | 4 +- .../Controllers/Jobs/InspectJobController.cs | 4 +- .../Controllers/Jobs/IssueJobController.cs | 6 +- .../Jobs/JisDeliverJobController.cs | 4 +- .../Controllers/Jobs/JobController.cs | 2 +- .../Jobs/ProductReceiveJobController.cs | 4 +- .../Jobs/ProductionReturnJobController.cs | 4 +- .../Jobs/PurchaseReceiptJobController.cs | 72 +- .../Jobs/PurchaseReturnJobController.cs | 4 +- .../Controllers/Jobs/PutawayJobController.cs | 4 +- .../Controllers/Stores/IssueNoteController.cs | 13 +- .../PurchaseReceiptRequestController.cs | 13 + .../Stores/PurchaseReturnNoteController.cs | 23 +- .../ExpectOuts/IExpectOutAppService.cs | 1 + .../ExpectOuts/ExpectOutAppService.cs | 8 + .../InventoryLabels/InventoryLabelDto.cs | 7 + .../InventoryLabelEditInput.cs | 7 + .../InventoryLabelImportInput.cs | 7 + .../InventoryLabelWithoutCodeCreateInput.cs | 7 + .../InventoryLabels/InventoryLabel.cs | 7 + .../ISfsCrudWithDetailsAppService.cs | 1 + .../SfsCrudWithDetailsAppServiceBase.cs | 9 +- .../Enums/Store/EnumMaterialRequestType.cs | 3 + .../IPurchaseReceiptJobAppService.cs | 8 + .../Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs | 7 + .../Inputs/DeliverNoteEditInput.cs | 8 + .../IPurchaseReceiptRequestAppService.cs | 9 + .../Jobs/InspectJobs/InspectJobAppService.cs | 1 + .../PurchaseReceiptJobAppService.cs | 14 + .../DeliverNotes/DeliverNoteAppService.cs | 21 +- .../DeliverNoteAutoMapperProfile.cs | 13 + .../IssueNotes/IssueNoteAutoMapperProfile.cs | 7 + .../PurchaseReturnNoteAutoMapperProfile.cs | 14 + .../Notes/ScrapNotes/ScrapNoteAppService.cs | 27 +- .../ScrapNotes/ScrapNoteAutoMapperProfile.cs | 14 + .../SupplierAsns/SupplierAsnAppService.cs | 1 + .../PurchaseReceiptRequestAppService.cs | 20 + .../ScrapRequests/ScrapRequestAppService.cs | 121 +- .../TransferRequestAppService.cs | 15 +- .../Jobs/InspectJobs/InspectJobManager.cs | 7 +- .../Notes/DeliverNotes/DeliverNote.cs | 9 + .../Notes/ScrapNotes/ScrapNoteManager.cs | 4 +- ...20230412072454_Store_AddColumn.Designer.cs | 20983 ++++++++++++++++ .../20230412072454_Store_AddColumn.cs | 68 + .../Migrations/StoreDbContextModelSnapshot.cs | 12 +- .../Jobs/IssueJobAutoMapperProfile.cs | 30 +- .../StoreDataExchangeEventHandlerBase.cs | 4 +- .../Jobs/IssueJobEventHandler.cs | 2 +- .../Orders/PurchaseOrderEventHandler.cs | 21 +- .../Requests/IssueNoteEventHandler.cs | 132 +- .../Requests/Note/ScrapNoteEventHandler.cs | 57 + .../Requests/ScrapRequestEventHandler.cs | 39 +- .../Transactions/DeliverNoteEventHandler.cs | 15 +- .../Transactions/IssueNoteEventHandler.cs | 255 +- .../Transactions/ScrapNoteEventHandler.cs | 18 +- .../settings/appsettings.Development.json | 6 +- 58 files changed, 21916 insertions(+), 323 deletions(-) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.Designer.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs index 9adb5c110..4c5488710 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs @@ -5,6 +5,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; using Win_in.Sfs.Basedata.Application.Contracts; @@ -29,6 +31,8 @@ public class BalanceController : AbpController private readonly ILocationAppService _locationAppService; + private readonly IExpectOutAppService _expectOutAppService; + /// /// /// @@ -38,10 +42,11 @@ public class BalanceController : AbpController public BalanceController( IBalanceAppService balanceAppService, IItemBasicAppService itemBasicAppService, - ILocationAppService locationAppService) + ILocationAppService locationAppService, IExpectOutAppService expectOutAppService) { this._balanceAppService = balanceAppService; this._locationAppService = locationAppService; + _expectOutAppService = expectOutAppService; this._itemBasicAppService = itemBasicAppService; } @@ -426,6 +431,56 @@ public class BalanceController : AbpController return balanceDTOs; } + /// + /// 查询库存余额 根据 物品 库位 库位类型 库存状态 批次 并且没有被预计出 占用 + /// + /// + /// + [HttpPost("by-balances-request-many-parameter-not-in-expect-out")] + public async Task> GetListByLocationTypeAndInventoryStatusAndNotExpectOutAsync( + BalanceListByIssueInputByInventoryStatusAndLocationType listInput) + { + var expectOut = await _expectOutAppService.GetListByPackingCodeAsync(listInput.packingCode); + + if (expectOut != null && expectOut.Any()) + { + throw new UserFriendlyException($"箱码为 {listInput.packingCode} 已被任务{expectOut[0].JobNumber}使用"); + } + + var input = new SfsInventoryRequestInputBase() + { + MaxResultCount = listInput.pageSize, + SkipCount = (listInput.pageIndex - 1) * listInput.pageSize, + Sorting = listInput.sortBy, + Condition = new Condition { Filters = new List() } + }; + if (!string.IsNullOrWhiteSpace(listInput.itemCode)) + input.Condition.Filters.Add(new Filter("ItemCode", listInput.itemCode)); + if (!string.IsNullOrWhiteSpace(listInput.locationCode)) + input.Condition.Filters.Add(new Filter("LocationCode", listInput.locationCode)); + if (!string.IsNullOrWhiteSpace(listInput.lot)) input.Condition.Filters.Add(new Filter("Lot", listInput.lot)); + if (!string.IsNullOrWhiteSpace(listInput.packingCode)) + input.Condition.Filters.Add(new Filter("PackingCode", listInput.packingCode)); + if (!string.IsNullOrWhiteSpace(listInput.containerCode)) + input.Condition.Filters.Add(new Filter("ContainerCode", listInput.containerCode)); + + if (listInput.locationTypes != null && listInput.locationTypes.Any()) + { + var locationCodes = (await this._locationAppService.GetListByTypesAsync(listInput.locationTypes).ConfigureAwait(false)) + .Select(t => t.Code).ToList(); + + if (locationCodes.Any()) + input.Condition.Filters.Add( + new Filter("LocationCode", JsonConvert.SerializeObject(locationCodes), "In")); + } + + if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any()) + input.Condition.Filters.Add( + new Filter("Status", JsonConvert.SerializeObject(listInput.inventoryStatuses), "In")); + + return await this._balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false); + } + /* /// /// 查询库余额 diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs index 7ed1b4d54..6c6a13d7b 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs @@ -75,7 +75,7 @@ public class CountJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -133,7 +133,7 @@ public class CountJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); - var status = new List() {EnumJobStatus.Open.ToString(),EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var requestInput = new SfsJobRequestInputBase @@ -165,7 +165,7 @@ public class CountJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs index 0b93cc8db..de127336d 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs @@ -75,7 +75,7 @@ public class DeliverJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); _ = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -132,7 +132,7 @@ public class DeliverJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs index aabb49b1c..c74c9ae7c 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs @@ -64,7 +64,7 @@ public class InspectJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -108,7 +108,7 @@ public class InspectJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs index c6763da04..2efe34c7d 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs @@ -65,7 +65,7 @@ public class IssueJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); - var status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -143,7 +143,7 @@ public class IssueJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); - var status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var requestInput = new SfsJobRequestInputBase @@ -175,7 +175,7 @@ public class IssueJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs index 420840bed..0b95984ee 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs @@ -74,7 +74,7 @@ public class JisDeliverJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -106,7 +106,7 @@ public class JisDeliverJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs index 4c88f25d3..ead6be2c7 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs @@ -76,7 +76,7 @@ public class JobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var list = new List(); diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs index cbbab2341..33ce064ff 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs @@ -62,7 +62,7 @@ public class ProductReceiveJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -106,7 +106,7 @@ public class ProductReceiveJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs index ca0f1946e..d448d69b2 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs @@ -69,7 +69,7 @@ public class ProductionReturnJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -113,7 +113,7 @@ public class ProductionReturnJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs index e24f784c4..dc0477c94 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs @@ -21,14 +21,10 @@ namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs; /// [ApiController] [Route($"{PdaHostConst.ROOT_ROUTE}job/purchase-receipt")] - public class PurchaseReceiptJobController : AbpController { private readonly ISupplierAppService _supplierAppService; - private readonly IPurchaseReceiptRequestAppService _purchaseReceiptRequestAppService; private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService; - private readonly IFileAppService _fileAppService; - private readonly IUserWorkGroupAppService _userWorkGroupAppService; /// @@ -42,15 +38,11 @@ public class PurchaseReceiptJobController : AbpController public PurchaseReceiptJobController( IPurchaseReceiptJobAppService purchaseReceiptJobAppService , IUserWorkGroupAppService userWorkGroupAppService - , IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService - , ISupplierAppService supplierAppService - , IFileAppService fileAppService) + , ISupplierAppService supplierAppService) { _userWorkGroupAppService = userWorkGroupAppService; _purchaseReceiptJobAppService = purchaseReceiptJobAppService; - _purchaseReceiptRequestAppService = purchaseReceiptRequestAppService; _supplierAppService = supplierAppService; - _fileAppService = fileAppService; } /// @@ -59,10 +51,9 @@ public class PurchaseReceiptJobController : AbpController /// /// [HttpGet("{id}")] - public virtual async Task> GetAsync(Guid id) { - var result = await _purchaseReceiptJobAppService.GetAsync(id).ConfigureAwait(false); + var result = await _purchaseReceiptJobAppService.GetNoCacheAsync(id).ConfigureAwait(false); var supplier = await _supplierAppService.GetByCodeAsync(result.SupplierCode).ConfigureAwait(false); result.SupplierName = supplier.Name; @@ -79,12 +70,13 @@ public class PurchaseReceiptJobController : AbpController /// 是否今天 /// [HttpGet("list")] - public virtual async Task> GetListAsync(int pageSize, int pageIndex, bool isTimeWindowSorting, bool isToday) + public virtual async Task> GetListAsync(int pageSize, int pageIndex, + bool isTimeWindowSorting, bool isToday) { var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -96,17 +88,19 @@ public class PurchaseReceiptJobController : AbpController { Filters = new List { - new(nameof(PurchaseReceiptJobDTO.WorkGroupCode),jsonCodes,"In"), - new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In") + new(nameof(PurchaseReceiptJobDTO.WorkGroupCode), jsonCodes, "In"), + new(nameof(PurchaseReceiptJobDTO.JobStatus), jsonStatus, "In") } } }; - if (isToday)//只看当日 + if (isToday) //只看当日 { - request.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.ToString("yyyy-MM-dd"), ">=", "And")); + request.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), + Clock.Now.ToString("yyyy-MM-dd"), ">=", "And")); } - if (isTimeWindowSorting)//窗口时间排序 + + if (isTimeWindowSorting) //窗口时间排序 { request.Sorting = $"{nameof(PurchaseReceiptJobDTO.TimeWindow)} ASC"; } @@ -131,7 +125,8 @@ public class PurchaseReceiptJobController : AbpController [HttpPost("list")] public virtual async Task> GetListAsync(SfsJobRequestInputBase sfsRequestDTO) { - var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(sfsRequestDTO, true).ConfigureAwait(false); + var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(sfsRequestDTO, true) + .ConfigureAwait(false); return list; } @@ -155,22 +150,27 @@ public class PurchaseReceiptJobController : AbpController { return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}"); } + if (!wlgCodes.Any(r => r == jobDto.WorkGroupCode)) { return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}"); } + if (jobDto.JobStatus == EnumJobStatus.Doing && jobDto.AcceptUserId != CurrentUser.Id) { return new NotFoundObjectResult($"任务正在被 {jobDto.AcceptUserName} 处理"); } - if (isToday)//只看当日 + + if (isToday) //只看当日 { if (jobDto.PlanArriveDate.ToString("yyyy-MM-dd") == Clock.Now.ToString("yyyy-MM-dd")) { return jobDto; } + return new NotFoundObjectResult($"不是当天的收货任务"); } + return jobDto; } @@ -181,12 +181,13 @@ public class PurchaseReceiptJobController : AbpController /// /// [HttpGet("list/by-asn")] - public virtual async Task> GetListByAsnNumberAsync(string asnNumber, bool isToday) + public virtual async Task> GetListByAsnNumberAsync(string asnNumber, + bool isToday) { var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var requestInput = new SfsJobRequestInputBase @@ -198,17 +199,20 @@ public class PurchaseReceiptJobController : AbpController { Filters = new List { - new(nameof(PurchaseReceiptJobDTO.AsnNumber),asnNumber), - new(nameof(IssueJobDTO.WorkGroupCode),jsonWlgCodes,"In"), - new(nameof(IssueJobDTO.JobStatus),jsonStatus,"In"), + new(nameof(PurchaseReceiptJobDTO.AsnNumber), asnNumber), + new(nameof(IssueJobDTO.WorkGroupCode), jsonWlgCodes, "In"), + new(nameof(IssueJobDTO.JobStatus), jsonStatus, "In"), } } }; - if (isToday)//只看当日 + if (isToday) //只看当日 { - requestInput.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.ToString("yyyy-MM-dd"), ">=", "And")); + requestInput.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), + Clock.Now.ToString("yyyy-MM-dd"), ">=", "And")); } - var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(requestInput, true).ConfigureAwait(false); + + var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(requestInput, true) + .ConfigureAwait(false); return list; } @@ -222,7 +226,7 @@ public class PurchaseReceiptJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -232,8 +236,8 @@ public class PurchaseReceiptJobController : AbpController { Filters = new List { - new(nameof(PurchaseReceiptJobDTO.WorkGroupCode),jsonCodes,"In"), - new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In") + new(nameof(PurchaseReceiptJobDTO.WorkGroupCode), jsonCodes, "In"), + new(nameof(PurchaseReceiptJobDTO.JobStatus), jsonStatus, "In") } } }; @@ -292,9 +296,11 @@ public class PurchaseReceiptJobController : AbpController /// /// [HttpPost("save-detail-inspect/{id}")] - public virtual async Task SaveDetailAsync(Guid id, PurchaseReceiptJobDetailSaveInput purchaseReceiptJobDetailSaveInput) + public virtual async Task SaveDetailAsync(Guid id, + PurchaseReceiptJobDetailSaveInput purchaseReceiptJobDetailSaveInput) { - return await _purchaseReceiptJobAppService.SaveDetailInspectAsync(id, purchaseReceiptJobDetailSaveInput).ConfigureAwait(false); + return await _purchaseReceiptJobAppService.SaveDetailInspectAsync(id, purchaseReceiptJobDetailSaveInput) + .ConfigureAwait(false); } /// diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs index c6a071cce..490fd4a44 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs @@ -63,7 +63,7 @@ public class PurchaseReturnJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -132,7 +132,7 @@ public class PurchaseReturnJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs index 88cb5d770..3c7227ccd 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs @@ -62,7 +62,7 @@ public class PutawayJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -106,7 +106,7 @@ public class PutawayJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; + var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs index 57ae6fad1..450e9326c 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs @@ -2,6 +2,7 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; +using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Pda.Controllers.Stores; @@ -29,9 +30,17 @@ public class IssueNoteController : AbpController /// 创建发料记录 /// /// - [HttpPost("{input}")] - public virtual async Task CreateAsync(IssueNoteEditInput input) + [HttpPost("")] + public virtual async Task CreateAsync([FromBody] IssueNoteEditInput input) { + input.RequestType = EnumMaterialRequestType.Direct_Issue.ToString(); + + input.Details.ForEach(p => + { + p.ToLot = string.Empty; + p.ToPackingCode = string.Empty; + }); + await _issueNoteAppService.CreateAsync(input).ConfigureAwait(false); } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs index dfcbbf219..b7cdd062a 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs @@ -35,4 +35,17 @@ public class PurchaseReceiptRequestController : AbpController var result = await _purchaseReceiptRequestAppService.GetByNumberAsync(number).ConfigureAwait(false); return Ok(result); } + + /// + /// 根据 物品 箱 获取收货记录 + /// + /// + /// + /// + [HttpGet("detail-by-item-and-packing")] + public virtual async Task GetDetailByItemAndPackingAsync(string itemCode, + string packingCode) + { + return await _purchaseReceiptRequestAppService.GetDetailByItemAndPackingAsync(itemCode, packingCode).ConfigureAwait(false); + } } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs index 459ea3fe8..0dde430e2 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Domain.Entities.Auditing; using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Label.Domain; using Win_in.Sfs.Shared.Domain.Shared; @@ -109,33 +110,34 @@ public class PurchaseReturnNoteController : AbpController { var poNumber = poNumberItem.Key; - var createInput = new PurchaseReturnNoteEditInput() { Details = new List() }; + var returnNoteEditInput = new PurchaseReturnNoteEditInput() { Details = new List() }; - createInput.PoNumber = poNumber; + returnNoteEditInput.PoNumber = poNumber; foreach (var poNumberDetail in poNumberItem) { var packingCode = poNumberDetail.PackingCode; - await SetFromInventoryLabelAsync(packingCode, createInput).ConfigureAwait(false); + await SetFromInventoryLabelAsync(packingCode, returnNoteEditInput).ConfigureAwait(false); - await SetFormPurchaseOrderAsync(poNumber, createInput).ConfigureAwait(false); + await SetFormPurchaseOrderAsync(poNumber, returnNoteEditInput).ConfigureAwait(false); - createInput.ReturnType = returnType; - createInput.ReturnTime = returnTime; - createInput.ReturnReason = returnReason; + returnNoteEditInput.ReturnType = returnType; + returnNoteEditInput.ReturnTime = returnTime; + returnNoteEditInput.ReturnReason = returnReason; var createInputDetail = new PurchaseReturnNoteDetailInput(); createInputDetail.PoNumber = poNumber; createInputDetail.Reason = returnReason; + //createInputDetail.WarehouseCode= poNumberItem. await SetDetailByBalanceAsync(packingCode, createInputDetail).ConfigureAwait(false); - createInput.Details.Add(createInputDetail); + returnNoteEditInput.Details.Add(createInputDetail); } - createInputs.Add(createInput); + createInputs.Add(returnNoteEditInput); } return createInputs; @@ -149,6 +151,9 @@ public class PurchaseReturnNoteController : AbpController createInputDetail.LocationCode = balance.LocationCode; createInputDetail.LocationErpCode = balance.LocationErpCode; + createInputDetail.LocationArea = balance.LocationArea; + createInputDetail.LocationGroup= balance.LocationGroup; + createInputDetail.WarehouseCode= balance.WarehouseCode; createInputDetail.PackingCode = balance.PackingCode; createInputDetail.ContainerCode = balance.ContainerCode; createInputDetail.Uom = balance.Uom; diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs index a936326b9..509c60744 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs @@ -13,4 +13,5 @@ public interface IExpectOutAppService Task> GetListByJobAsync(string jobNumber); Task> GetListByItemAsync(string itemCode); Task> GetListByLocationAsync(string locationCode); + Task> GetListByPackingCodeAsync(string packingCode); } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs index fddb1bbff..cc04a325d 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs @@ -146,4 +146,12 @@ public class ExpectOutAppService //TODO throw new UserFriendlyException(""); } + + [HttpGet("list/by-packing/{packingCode}")] + public virtual async Task> GetListByPackingCodeAsync(string packingCode) + { + var entitys = await _repository.GetListAsync(p => p.PackingCode == packingCode).ConfigureAwait(false); + + return ObjectMapper.Map, List>(entitys); + } } diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelDto.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelDto.cs index 8e3ccfbe0..ffda20f6b 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelDto.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelDto.cs @@ -214,4 +214,11 @@ public class InventoryLabelDto : SfsBasicDTOBase /// [Display(Name = "供应商零件名")] public string SupplierItemName { get; set; } + + /// + /// 计划到货时间 + /// + [Display(Name = "要求到货时间")] + [Required(ErrorMessage = "{0}是必填项")] + public DateTime PlanArriveDate { get; set; } } diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelEditInput.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelEditInput.cs index a6330a941..facf0ad7a 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelEditInput.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelEditInput.cs @@ -221,5 +221,12 @@ public class InventoryLabelEditInput : SfsLabelCreateOrUpdateInputBase [Required(ErrorMessage = "{0}是必填项")] public EnumLabelType LabelType { get; set; } + /// + /// 要求到货时间 + /// + [Display(Name = "要求到货时间")] + [Required(ErrorMessage = "{0}是必填项")] + public DateTime PlanArriveDate { get; set; } + #endregion } diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelImportInput.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelImportInput.cs index 11c00f68f..78e0282ae 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelImportInput.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelImportInput.cs @@ -74,6 +74,13 @@ public class InventoryLabelImportInput : SfsImportInputBase [Display(Name = "规格")] public string Specifications { get; set; } + /// + /// 要求到货时间 + /// + [Display(Name = "要求到货时间")] + [Required(ErrorMessage = "{0}是必填项")] + public DateTime PlanArriveDate { get; set; } + #region PurchaseInfo /// diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs index 2b07f178d..d2dc012b1 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs @@ -200,4 +200,11 @@ public class InventoryLabelWithoutCodeCreateInput [Display(Name = "标签类型")] [Required(ErrorMessage = "{0}是必填项")] public EnumLabelType LabelType { get; set; } + + /// + /// 要求到货时间 + /// + [Display(Name = "要求到货时间")] + [Required(ErrorMessage = "{0}是必填项")] + public DateTime PlanArriveDate { get; set; } } diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Domain/InventoryLabels/InventoryLabel.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Domain/InventoryLabels/InventoryLabel.cs index a14dd8a51..3fc352575 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Domain/InventoryLabels/InventoryLabel.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Domain/InventoryLabels/InventoryLabel.cs @@ -166,4 +166,11 @@ public class InventoryLabel : SfsAggregateRootBase /// [Display(Name = "供应商零件名")] public string SupplierItemName { get; set; } + + /// + /// 要求到货时间 + /// + [Display(Name = "要求到货时间")] + [Required(ErrorMessage = "{0}是必填项")] + public DateTime PlanArriveDate { get; set; } } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application.Contracts/ISfsCrudWithDetailsAppService.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application.Contracts/ISfsCrudWithDetailsAppService.cs index b40d08de4..6be45cee7 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application.Contracts/ISfsCrudWithDetailsAppService.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application.Contracts/ISfsCrudWithDetailsAppService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Services; namespace Win_in.Sfs.Shared.Application.Contracts; diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs index e7643873e..2c022d8d3 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs @@ -188,10 +188,11 @@ public abstract class SfsCrudWithDetailsAppServiceBase GetAsync(Guid id) { - var dto = await Cache.GetOrAddItemAsync( - id.ToString(), - async () => await base.GetAsync(id).ConfigureAwait(false), - SfsCacheConst.SeveralMinutes).ConfigureAwait(false); + //var dto = await Cache.GetOrAddItemAsync( + // id.ToString(), + // async () => await base.GetAsync(id).ConfigureAwait(false), + // SfsCacheConst.SeveralMinutes).ConfigureAwait(false); + var dto=await base.GetAsync(id).ConfigureAwait(false); return dto; } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs index b653ddd6b..245c1f9e8 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs @@ -26,4 +26,7 @@ public enum EnumMaterialRequestType ///// //[Display(Name = "安全库存拉动")] //Issue_SfaetyStock = 1504, + + [Display(Name = "直接发料")] + Direct_Issue = 1505 } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs index dc4e8ffe1..1b26733b8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs @@ -40,4 +40,12 @@ public interface IPurchaseReceiptJobAppService /// /// Task> SetInspectWithNotInspectAsync(Guid id); + + /// + /// 按Id获取实体 不走缓存 + /// + /// 实体Id + /// + /// + Task GetNoCacheAsync(Guid id); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs index d44b88d24..0bc9f5a03 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs @@ -48,6 +48,13 @@ public class DeliverNoteDTO : SfsStoreDTOBase [Display(Name = "发货申请单号")] public string DeliverRequestNumber { get; set; } + /// + /// 打印次数 + /// + /// + [Display(Name = "打印次数")] + public int CountPrint { get; set; } + /// /// 发货类型 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs index 1985d4213..38c0e9206 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs @@ -63,5 +63,13 @@ public class DeliverNoteEditInput : SfsStoreCreateOrUpdateInputBase /// [Display(Name = "明细列表")] public List Details { get; set; } + + /// + /// 打印次数 + /// + /// + [Display(Name = "打印次数")] + public int CountPrint { get; set; } + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs index d08927f6e..07a28912f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs @@ -20,4 +20,13 @@ public interface IPurchaseReceiptRequestAppService /// /// Task> CreateManyAsync(List inputs); + + /// + /// 【获取】【收货记录详情】根据 物品 箱码 + /// + /// + /// + /// + Task GetDetailByItemAndPackingAsync(string itemCode, + string packingCode); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs index 81b97e990..c7090612f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs @@ -4,6 +4,7 @@ using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.ObjectMapping; using Win_in.Sfs.FileStorage.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; 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 0b43b47f6..22b45c3bf 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 @@ -5,6 +5,7 @@ using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.ObjectMapping; using Win_in.Sfs.FileStorage.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -177,6 +178,19 @@ public class PurchaseReceiptJobAppService : entity.Details.Find(p => p.Id == input.DetailId)); } + /// + /// 按Id获取实体 不走缓存 + /// + /// 实体Id + /// + /// + [HttpGet("no-cache/{id}")] + public virtual async Task GetNoCacheAsync(Guid id) + { + var entity= await _repository.GetAsync(id).ConfigureAwait(false); + return ObjectMapper.Map(entity); + } + #endregion /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAppService.cs index b1922fd4b..c50a174bb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAppService.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -72,7 +73,7 @@ public class DeliverNoteAppService : CancellationToken cancellationToken = default) { sfsRequestDTO.Condition.Filters.Add( - new Filter(nameof(DeliverRequest.DeliverRequestType), "2")); + new Filter(nameof(DeliverRequest.DeliverRequestType), EnumDeliverRequestType.FIS.ToString())); return await base.GetPagedListByFilterAsync(sfsRequestDTO, includeDetails, cancellationToken) .ConfigureAwait(false); @@ -85,7 +86,7 @@ public class DeliverNoteAppService : CancellationToken cancellationToken = default) { sfsRequestDTO.Condition.Filters.Add( - new Filter(nameof(DeliverRequest.DeliverRequestType), "1")); + new Filter(nameof(DeliverRequest.DeliverRequestType), EnumDeliverRequestType.Normal.ToString())); return await base.GetPagedListByFilterAsync(sfsRequestDTO, includeDetails, cancellationToken) .ConfigureAwait(false); @@ -98,7 +99,7 @@ public class DeliverNoteAppService : CancellationToken cancellationToken = default) { sfsRequestDTO.Condition.Filters.Add( - new Filter(nameof(DeliverRequest.DeliverRequestType), "3")); + new Filter(nameof(DeliverRequest.DeliverRequestType), EnumDeliverRequestType.RAW.ToString())); return await base.GetPagedListByFilterAsync(sfsRequestDTO, includeDetails, cancellationToken) .ConfigureAwait(false); @@ -132,4 +133,18 @@ public class DeliverNoteAppService : var list = ObjectMapper.Map, List>(entities); return ExportImportService.Export(list, true, "Details"); } + + /// + /// 调取打印 + /// + /// + [HttpPost("sum-print/{number}")] + public virtual async Task SumPrintAsync(string number) + { + var entity = await _repository.GetAsync(p => p.Number == number).ConfigureAwait(false); + + entity.CountPrint++; + + await _repository.UpdateAsync(entity).ConfigureAwait(false); + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAutoMapperProfile.cs index 81f3769ea..90aaa4d91 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAutoMapperProfile.cs @@ -19,5 +19,18 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap() + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id) + .Ignore(x=>x.CountPrint) + ; + CreateMap() + .Ignore(x => x.MasterID) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAutoMapperProfile.cs index d59cc23ff..7ddb54704 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAutoMapperProfile.cs @@ -20,5 +20,12 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs index ca75b6d5d..bc12055ab 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs @@ -22,5 +22,19 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id) + ; + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id) + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs index f0f21e83b..9407d0b7e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs @@ -2,9 +2,11 @@ using System; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; +using DocumentFormat.OpenXml.Bibliography; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; +using Volo.Abp.EventBus; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -12,7 +14,11 @@ using Win_in.Sfs.Wms.Store.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application; using System.Linq; +using IdentityModel; +using Volo.Abp.Domain.Entities; +using Volo.Abp.ObjectMapping; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Event; [Authorize] [Route($"{StoreConsts.RootPath}scrap-note")] @@ -21,28 +27,31 @@ public class ScrapNoteAppService : ScrapNoteDetail, ScrapNoteDetailDTO, SfsStoreRequestInputBase, ScrapNoteImportInput>, IScrapNoteAppService { - private readonly IScrapNoteManager _scrapNoteManager; - public ScrapNoteAppService( - IScrapNoteRepository repository - , IScrapNoteManager scrapNoteManager - ) : base(repository) + IScrapNoteRepository repository) : base(repository) { - _scrapNoteManager = scrapNoteManager; } [HttpPost("")] - //[Authorize(ScrapNotePermissions.Create)] public override async Task CreateAsync(ScrapNoteEditInput input) { var entity = ObjectMapper.Map(input); - await _scrapNoteManager.CreateAsync(entity).ConfigureAwait(false); + var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(nameof(ScrapNote), entity.ActiveDate).ConfigureAwait(false) : entity.Number; + entity.SetIdAndNumberWithDetails(GuidGenerator, number); + + foreach (var detail in entity.Details) + { + detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number); + } + + entity = await _repository.InsertAsync(entity).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsCreatedEntityEventData(entity), false).ConfigureAwait(false); var dto = ObjectMapper.Map(entity); return dto; } - + [HttpPost("by-type/{type}")] public virtual async Task> GetListByTypeAsync( SfsStoreRequestInputBase requestInput, diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs index 7545e93a1..6488a5f26 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs @@ -20,5 +20,19 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + ; + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.MasterID) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs index f232b2a60..b57a4890e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs @@ -64,6 +64,7 @@ public class SupplierAsnAppService : { var inputEntity = ObjectMapper.Map(input); + inputEntity.Number = input.Number; var resultEntity = await _supplierAsnManager.CreateAsync(inputEntity).ConfigureAwait(false); return ObjectMapper.Map(resultEntity); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs index e1b1a4477..ded767df5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -54,6 +55,25 @@ public class PurchaseReceiptRequestAppService : return ObjectMapper.Map(resultEntity); } + /// + /// 【获取】【收货记录详情】根据 物品 箱码 + /// + /// + /// + /// + [HttpGet("detail-by-item-and-packing")] + public virtual async Task GetDetailByItemAndPackingAsync(string itemCode, + string packingCode) + { + var entity = (await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode && y.PackingCode == packingCode), true).ConfigureAwait(false)).FirstOrDefault(); + + var detail = entity.Details.FirstOrDefault(y => y.ItemCode == itemCode && y.PackingCode == packingCode); + + var dto = ObjectMapper.Map(detail); + + return dto; + } + #endregion diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs index b8a8ebb34..2c81b848c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Users; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; @@ -17,26 +18,85 @@ using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Domain.Acl.Dict; using Win_in.Sfs.Wms.Store.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application; [Authorize] [Route($"{StoreConsts.RootPath}scrap-request")] -public class ScrapRequestAppService : - SfsStoreRequestAppServiceBase - +public class ScrapRequestAppService : SfsStoreRequestAppServiceBase + { - private readonly IScrapRequestManager _scrapRequestManager; - private const string ReasonItemCode = "Reason"; + private readonly IScrapRequestManager _scrapRequestManager; + private readonly IDictAclService _dictAclService; + private readonly ITransactionTypeAppService _transactionTypeAppService; + private readonly IItemBasicAppService _itemBasicAppService; public ScrapRequestAppService( - IScrapRequestRepository repository, - IScrapRequestManager scrapRequestManager) + IScrapRequestRepository repository, + IScrapRequestManager scrapRequestManager, + IDictAclService dictAclService, + ITransactionTypeAppService transactionTypeAppService, + IItemBasicAppService itemBasicAppService) : base(repository, scrapRequestManager) { _scrapRequestManager = scrapRequestManager; + _dictAclService = dictAclService; + _transactionTypeAppService = transactionTypeAppService; + _itemBasicAppService = itemBasicAppService; + } + + #region 东阳使用 + + protected override async Task> ImportProcessingEntityAsync( + Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var scrapRequest in addList) + { + scrapRequest.CreatorId = CurrentUser.Id; + scrapRequest.Worker = CurrentUser.Name; + + scrapRequest.Type = EnumTransSubType.Scrap_WIP.ToString(); + scrapRequest.ActiveDate = DateTime.Now; + + await SetEntityPropertiesAsync(scrapRequest, EnumTransSubType.Scrap_WIP).ConfigureAwait(false); + + foreach (var detail in scrapRequest.Details) + { + var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + detail.ItemName = itemBasicDto.Name; + detail.ItemDesc1 = itemBasicDto.Desc1; + detail.ItemDesc2 = itemBasicDto.Desc2; + + detail.Uom = itemBasicDto.BasicUom; + } + } + + return dictionary; + } + + private async Task SetEntityPropertiesAsync(ScrapRequest entity, EnumTransSubType subType) + { + var tranType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.Scrap, subType) + .ConfigureAwait(false); + entity.Worker = CurrentUser.GetUserName(); + + entity.AutoCompleteJob = tranType.AutoCompleteJob; + entity.AutoSubmit = tranType.AutoSubmitRequest; + entity.AutoAgree = tranType.AutoAgreeRequest; + entity.AutoHandle = tranType.AutoHandleRequest; + entity.DirectCreateNote = tranType.DirectCreateNote; } [HttpPost("by-type/{type}")] @@ -53,9 +113,11 @@ public class ScrapRequestAppService : } return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount, - requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false); + requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false); } + #endregion + [HttpPost("export-by-type")] public virtual async Task ExportByTypeAsync(SfsExportRequestInput requestInput, string type) { @@ -65,16 +127,19 @@ public class ScrapRequestAppService : expression = expression.And(requestInput.Condition.Filters.ToLambda()); } - var entities = await _repository.GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount, requestInput.Sorting, true).ConfigureAwait(false); + var entities = await _repository + .GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount, requestInput.Sorting, + true).ConfigureAwait(false); var list = ObjectMapper.Map, List>(entities); return ExportImportService.Export(list, true, "Details"); } - #region import + #region 校验 - protected override async Task ValidateImportModelAsync(ScrapRequestImportInput model, List validationRresult) + protected override async Task ValidateImportModelAsync(ScrapRequestImportInput model, + List validationRresult) { _ = await CheckItemBasicAsync(model, validationRresult).ConfigureAwait(false); _ = await CheckLocationAsync(model, validationRresult).ConfigureAwait(false); @@ -82,33 +147,38 @@ public class ScrapRequestAppService : await CheckDicAsync(model, validationRresult).ConfigureAwait(false); } - protected async Task CheckItemBasicAsync(ScrapRequestImportInput importInput, List validationRresul) + protected async Task CheckItemBasicAsync(ScrapRequestImportInput importInput, + List validationRresul) { var item = await ItemBasicAclService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false); if (item == null) { validationRresul.Add(new ValidationResult($"物品代码{importInput.ItemCode}不存在", new string[] { "物品代码" })); } + if (importInput.Qty <= 0) { validationRresul.Add(new ValidationResult($"数量{importInput.Qty}需要大于0", new string[] { "数量" })); } + return item; } - protected async Task CheckLocationAsync(ScrapRequestImportInput importInput, List validationRresul) + protected async Task CheckLocationAsync(ScrapRequestImportInput importInput, + List validationRresul) { var location = await LocationAclService.GetByCodeAsync(importInput.LocationCode).ConfigureAwait(false); if (location == null) { validationRresul.Add(new ValidationResult($"库位代码{importInput.LocationCode}不存在", new string[] { "库位代码" })); } + return location; } protected async Task CheckDicAsync(ScrapRequestImportInput importInput, List validationRresul) { - var dicItem = await DictAclService.GetByCodeAsync(ReasonItemCode).ConfigureAwait(false); + var dicItem = await _dictAclService.GetByCodeAsync(ReasonItemCode).ConfigureAwait(false); if (dicItem == null) { validationRresul.Add(new ValidationResult($"字典编号{ReasonItemCode}不存在", new string[] { "字典编号" })); @@ -116,26 +186,28 @@ public class ScrapRequestAppService : if (!dicItem.Items.Any(r => r.Code == importInput.ReasonCode)) { - validationRresul.Add(new ValidationResult($"报废原因代码{importInput.ReasonCode}在线边仓报废原因中不存在", new string[] { "报废原因代码" })); + validationRresul.Add(new ValidationResult($"报废原因代码{importInput.ReasonCode}在线边仓报废原因中不存在", + new string[] { "报废原因代码" })); } } protected async Task CheckTransactionTypeAsync(List validationRresul) { - - var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Scrap, EnumTransSubType.None).ConfigureAwait(false); + var transactionType = await TransactionTypeAclService + .GetByTransTypeAsync(EnumTransType.Scrap, EnumTransSubType.Scrap_WIP).ConfigureAwait(false); Check.NotNull(transactionType, "事务类型", "事务类型报废不存在"); return transactionType; } - protected async Task CheckBalanceAsync(ScrapRequestImportInput importInput, List validationRresul) + protected async Task CheckBalanceAsync(ScrapRequestImportInput importInput, + List validationRresul) { var balance = await BalanceAclService.GetByItemLocationAndPackingAsync( - string.Empty, - importInput.ItemCode, - importInput.LocationCode).ConfigureAwait(false); + string.Empty, + importInput.ItemCode, + importInput.LocationCode).ConfigureAwait(false); //var balance = await this._balanceApp.GetByItemLocationAndPackingAsync( // string.Empty, // itemBasic.Code, @@ -145,6 +217,7 @@ public class ScrapRequestAppService : { throw new ArgumentException($"物品代码 {importInput.ItemCode}的库存余额数量{balance.Qty}小于导入数量{importInput.Qty}。"); } + return balance; } @@ -157,7 +230,9 @@ public class ScrapRequestAppService : { foreach (var entity in dict.Keys) { - var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Scrap, Enum.Parse(entity.Type)).ConfigureAwait(false); + var tranType = await TransactionTypeAclService + .GetByTransTypeAsync(EnumTransType.Scrap, EnumTransSubType.Scrap_WIP) + .ConfigureAwait(false); Check.NotNull(tranType, "事务类型", "事务类型不存在"); entity.AutoCompleteJob = tranType.AutoCompleteJob; entity.AutoSubmit = tranType.AutoSubmitRequest; @@ -165,6 +240,7 @@ public class ScrapRequestAppService : entity.AutoHandle = tranType.AutoHandleRequest; entity.DirectCreateNote = tranType.DirectCreateNote; } + return await base.ValidateImportEntities(dict).ConfigureAwait(false); } @@ -193,6 +269,7 @@ public class ScrapRequestAppService : } } } + await base.SaveImportAsync(dict).ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs index c842b5b93..409de9b89 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs @@ -25,8 +25,14 @@ namespace Win_in.Sfs.Wms.Store.Application; [Authorize] [Route($"{StoreConsts.RootPath}transfer-request")] public class TransferRequestAppService : SfsStoreRequestAppServiceBase - , + , ITransferRequestAppService { private readonly ITransferRequestManager _transferRequestManager; @@ -69,7 +75,7 @@ public class TransferRequestAppService : SfsStoreRequestAppServiceBase detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false); var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode) .ConfigureAwait(false); - + detail.ItemCode = balanceDto.ItemCode; detail.ArriveDate = balanceDto.ArriveDate; detail.ItemDesc1 = balanceDto.ItemDesc1; @@ -103,7 +109,8 @@ public class TransferRequestAppService : SfsStoreRequestAppServiceBase detail.ToLot = balanceDto.Lot; } - await SetEntityPropertiesAsync(transferRequest, EnumTransSubType.Transfer_Customer).ConfigureAwait(false); + await SetEntityPropertiesAsync(transferRequest, EnumTransSubType.Transfer_Customer) + .ConfigureAwait(false); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs index 9930d91b2..68e6f5e97 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs @@ -138,8 +138,11 @@ public class InspectJobManager : SfsJobManagerBase { var jobEntity = await Repository.FindAsync(id); - jobEntity.Details.Where(p => p.DetailInspectStatus == EnumDetailInspectStatus.DefaultOK || - p.DetailInspectStatus == EnumDetailInspectStatus.OK).ToList().ForEach(p => + jobEntity.Details.Where(p => (p.DetailInspectStatus == EnumDetailInspectStatus.DefaultOK || + p.DetailInspectStatus == EnumDetailInspectStatus.OK)&& + p.ItemCode== input.ItemCode&& + p.Lot==input.Lot + ).ToList().ForEach(p => { p.GoodQty = p.ReceiveQty; }); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs index 15b096b4a..6a60d8f74 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using DocumentFormat.OpenXml.Wordprocessing; +using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Domain.Entities; using Win_in.Sfs.Shared.Domain.Shared; @@ -52,6 +54,13 @@ public class DeliverNote : SfsStoreAggregateRootBase, IHasJob [IgnoreUpdate] public EnumDeliverRequestType DeliverRequestType { get; set; } + /// + /// 打印次数 + /// + /// + [Display(Name = "打印次数")] + public int CountPrint { get; set; } + /// /// 明细列表 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ScrapNotes/ScrapNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ScrapNotes/ScrapNoteManager.cs index 467ad4e9d..56c0ffb49 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ScrapNotes/ScrapNoteManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ScrapNotes/ScrapNoteManager.cs @@ -1,3 +1,5 @@ +using System.Threading.Tasks; + namespace Win_in.Sfs.Wms.Store.Domain; public class ScrapNoteManager : SfsStoreManagerBase, IScrapNoteManager @@ -7,6 +9,6 @@ public class ScrapNoteManager : SfsStoreManagerBase, IScrapNoteRepository repository ) : base(repository) { + } - } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.Designer.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.Designer.cs new file mode 100644 index 000000000..72ce9d5e6 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.Designer.cs @@ -0,0 +1,20983 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Wms.Store.EntityFrameworkCore; + +#nullable disable + +namespace Win_in.Sfs.Wms.Store.Migrations +{ + [DbContext(typeof(StoreDbContext))] + [Migration("20230412072454_Store_AddColumn")] + partial class Store_AddColumn + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "6.0.13") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.BackFlushNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("JobNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProdLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ProductReceiptNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductRecycleNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductionPlanNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Shift") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_BackFlushNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.BackFlushNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("BomVersion") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("IsOffLine") + .HasColumnType("bit"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "Lot") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_BackFlushNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CheckJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeliverNoteNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_CheckJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CheckJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerItemCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Order") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_CheckJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ContainerBindNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("BindTime") + .HasColumnType("datetime2"); + + b.Property("BindType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContainerCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ContainerBindNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ContainerBindNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode") + .IsUnique(); + + b.ToTable("Store_ContainerBindNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountAdjustNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CountAdjustRequestNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("CountNoteNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("CountPlanNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAdjusted") + .HasColumnType("bit"); + + b.Property("JobNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_CountAdjustNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountAdjustNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AdjustQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CountLabel") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CountQty") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("InventoryQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ReasonCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TransInOut") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "CountLabel", "ItemCode", "LocationCode", "Lot", "Status", "PackingCode") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_CountAdjustNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountAdjustRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CountNoteNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CountPlanNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_CountAdjustRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountAdjustRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CountQty") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("InventoryQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReasonCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "LocationCode", "Lot", "Status", "PackingCode") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_CountAdjustRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CountMethod") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CountPlanNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CountStage") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_CountJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CountDescription") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CountLabel") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CountOperator") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CountQty") + .HasColumnType("decimal(18,6)"); + + b.Property("CountTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("InventoryLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("InventoryQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_CountJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("Adjusted") + .HasColumnType("bit"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CountPlanNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Stage") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_CountNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Adjusted") + .HasColumnType("bit"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("AuditCountDescription") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AuditCountOperator") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AuditCountQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("AuditCountTime") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CountLabel") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CountPlanNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DetailStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FinalCountQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("FirstCountDescription") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FirstCountOperator") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FirstCountQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("FirstCountTime") + .HasColumnType("datetime2"); + + b.Property("InventoryQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RepeatCountDescription") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RepeatCountOperator") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RepeatCountQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("RepeatCountTime") + .HasColumnType("datetime2"); + + b.Property("Stage") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "CountLabel") + .IsUnique(); + + b.ToTable("Store_CountNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CountMethod") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JsonInventoryStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("JsonItemCodes") + .HasColumnType("nvarchar(max)"); + + b.Property("JsonLocationCodes") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PlanTime") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RequestType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Stage") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_CountPlan", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountPlanDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("AuditCountDescription") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AuditCountOperator") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AuditCountQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("AuditCountTime") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CountLabel") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DetailStatus") + .HasColumnType("int"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FinalCountQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("FirstCountDescription") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FirstCountOperator") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FirstCountQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("FirstCountTime") + .HasColumnType("datetime2"); + + b.Property("InventoryQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RepeatCountDescription") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RepeatCountOperator") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RepeatCountQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("RepeatCountTime") + .HasColumnType("datetime2"); + + b.Property("Stage") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "CountLabel") + .IsUnique(); + + b.ToTable("Store_CountPlanDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CustomerAsn", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactEmail") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactPhone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DockCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SoNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_CustomerAsn", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CustomerAsnDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode") + .IsUnique(); + + b.ToTable("Store_CustomerAsnDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CustomerReturnNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Customer") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("ReturnTime") + .HasColumnType("datetime2"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_CustomerReturnNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CustomerReturnNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromLocationCode", "ToLocationCode") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL"); + + b.ToTable("Store_CustomerReturnNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerAddressCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeliverPlanNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeliverTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_DeliverJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationArea"); + + b.Property("HandledFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationCode"); + + b.Property("HandledFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationErpCode"); + + b.Property("HandledFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationGroup"); + + b.Property("HandledFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromWarehouseCode"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("OnTheWayLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationArea"); + + b.Property("RecommendFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationCode"); + + b.Property("RecommendFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationErpCode"); + + b.Property("RecommendFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationGroup"); + + b.Property("RecommendFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromWarehouseCode"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToLocationArea") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationGroup") + .HasColumnType("nvarchar(max)"); + + b.Property("ToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_DeliverJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CountPrint") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerAddressCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeliverPlanNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverRequestNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverRequestType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeliverTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_DeliverNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromPackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationArea"); + + b.Property("HandledFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationCode"); + + b.Property("HandledFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationErpCode"); + + b.Property("HandledFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationGroup"); + + b.Property("HandledFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromWarehouseCode"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationArea"); + + b.Property("RecommendFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationCode"); + + b.Property("RecommendFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationErpCode"); + + b.Property("RecommendFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationGroup"); + + b.Property("RecommendFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromWarehouseCode"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToPackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "FromPackingCode", "FromLot", "FromLocationCode", "ToLocationCode") + .IsUnique(); + + b.ToTable("Store_DeliverNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerAddressCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PlanDate") + .HasColumnType("datetime2"); + + b.Property("PlanTime") + .HasColumnType("datetime2"); + + b.Property("Project") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SoNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_DeliverPlan", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverPlanDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "SoNumber", "SoLine") + .IsUnique() + .HasFilter("[SoNumber] IS NOT NULL AND [SoLine] IS NOT NULL"); + + b.ToTable("Store_DeliverPlanDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerAddressCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CustomerCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeliverPlanNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeliverRequestType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeliverTime") + .HasColumnType("datetime2"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_DeliverRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AreaCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode") + .IsUnique(); + + b.ToTable("Store_DeliverRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ExchangeData", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DataAction") + .HasColumnType("int"); + + b.Property("DataContent") + .HasColumnType("nvarchar(max)"); + + b.Property("DataIdentityCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DataType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DestinationSystem") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EffectiveDate") + .HasColumnType("datetime2"); + + b.Property("ErrorCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ErrorMessage") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .HasColumnType("bigint"); + + b.Property("ReadTime") + .HasColumnType("datetime2"); + + b.Property("Reader") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RetryTimes") + .HasColumnType("int"); + + b.Property("SourceSystem") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("WriteTime") + .HasColumnType("datetime2"); + + b.Property("Writer") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Store_ExchangeData", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectAbnormalNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InspectNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ReceiptNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_InspectAbnormalNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectAbnormalNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbnormalType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("Photos") + .HasColumnType("nvarchar(max)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode") + .IsUnique(); + + b.ToTable("Store_InspectAbnormalNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InspectNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("NextAction") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PurchaseReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiptNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_InspectJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbcClass") + .HasColumnType("nvarchar(max)"); + + b.Property("Appearance") + .HasColumnType("nvarchar(max)"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CrackQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DetailInspectStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FailedQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("FailedReason") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("GoodQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("InspectQty") + .HasColumnType("decimal(18,6)"); + + b.Property("InspectType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("InspectUser") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("NotPassedQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("OtherPropertyJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SamplePercent") + .HasColumnType("decimal(18,6)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Volume") + .HasColumnType("nvarchar(max)"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.Property("Weight") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_InspectJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectJobSummaryDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbcClass") + .HasColumnType("nvarchar(max)"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CrackQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FailedQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("FailedReason") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("GoodQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("InspectQty") + .HasColumnType("decimal(18,6)"); + + b.Property("InspectReport") + .HasColumnType("nvarchar(max)"); + + b.Property("InspectType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("InspectUser") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("NotPassedQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SamplePercent") + .HasColumnType("decimal(18,6)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SummaryInspectStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_InspectJobSummaryDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InspectNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("NextAction") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PurchaseReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiptNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_InspectNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbcClass") + .HasColumnType("nvarchar(max)"); + + b.Property("Appearance") + .HasColumnType("nvarchar(max)"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CrackQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DetailInspectStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FailedQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("FailedReason") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("GoodQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("InspectQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("InspectType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("InspectUser") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("NotPassedQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("OtherPropertyJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("Photos") + .HasColumnType("nvarchar(max)"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SamplePercent") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Volume") + .HasColumnType("nvarchar(max)"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.Property("Weight") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode") + .IsUnique(); + + b.ToTable("Store_InspectNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectNoteSummaryDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbcClass") + .HasColumnType("nvarchar(max)"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CrackQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FailedQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("FailedReason") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("GoodQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("InspectQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("InspectType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("InspectUser") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("NotPassedQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SamplePercent") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SummaryInspectStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode") + .IsUnique(); + + b.ToTable("Store_InspectNoteSummaryDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PurchaseReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiptNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_InspectRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbcClass") + .HasColumnType("nvarchar(max)"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("Attributes") + .HasColumnType("nvarchar(max)"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DetailInspectStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("InspectQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("InspectType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SamplePercent") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode") + .IsUnique(); + + b.ToTable("Store_InspectRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectRequestSummaryDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbcClass") + .HasColumnType("nvarchar(max)"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CrackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FailedQty") + .HasColumnType("decimal(18,6)"); + + b.Property("GoodQty") + .HasColumnType("decimal(18,6)"); + + b.Property("InspectQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("InspectReport") + .HasColumnType("nvarchar(max)"); + + b.Property("InspectType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("NotPassedQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SamplePercent") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SummaryInspectStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "Lot") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_InspectRequestSummaryDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InventoryInitialNote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_InventoryInitialNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InventoryInitialNoteDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode", "ItemCode", "Lot", "Status") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_InventoryInitialNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InventoryTransferNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SupplierCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TransferType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_InventoryTransferNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InventoryTransferNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Reason") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromLocationCode", "ToLocationCode") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL"); + + b.ToTable("Store_InventoryTransferNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IsolationNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_IsolationNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IsolationNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("FromPackingCode"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromLocationCode", "ToLocationCode") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL"); + + b.ToTable("Store_IsolationNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IssueJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ProdLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestType") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UseOnTheWayLocation") + .HasColumnType("bit"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_IssueJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IssueJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeliveryQty") + .HasColumnType("decimal(18,6)"); + + b.Property("DistributionType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExpiredTime") + .HasColumnType("datetime2"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationArea"); + + b.Property("HandledFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationCode"); + + b.Property("HandledFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationErpCode"); + + b.Property("HandledFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationGroup"); + + b.Property("HandledFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromWarehouseCode"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("OnTheWayLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Operation") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PlanBeginTime") + .HasColumnType("datetime2"); + + b.Property("PlannedSplitRule") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProdLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationArea"); + + b.Property("RecommendFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationCode"); + + b.Property("RecommendFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationErpCode"); + + b.Property("RecommendFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationGroup"); + + b.Property("RecommendFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromWarehouseCode"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RoundedQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TruncType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkStation") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_IssueJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IssueNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConfirmTime") + .HasColumnType("datetime2"); + + b.Property("Confirmed") + .HasColumnType("bit"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RequestType") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UseOnTheWayLocation") + .HasColumnType("bit"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_IssueNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IssueNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ExpiredTime") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationArea"); + + b.Property("HandledFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationCode"); + + b.Property("HandledFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationErpCode"); + + b.Property("HandledFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationGroup"); + + b.Property("HandledFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromWarehouseCode"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("IssueTime") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("OnTheWayLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProdLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationArea"); + + b.Property("RecommendFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationCode"); + + b.Property("RecommendFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationErpCode"); + + b.Property("RecommendFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationGroup"); + + b.Property("RecommendFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromWarehouseCode"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WorkStation") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("FromPackingCode"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromLocationCode", "ToLocationCode") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL"); + + b.ToTable("Store_IssueNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ItemTransformNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ItemTransformNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ItemTransformNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("FromArriveDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromProduceDate") + .HasColumnType("datetime2"); + + b.Property("FromQty") + .HasColumnType("decimal(18,6)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ReasonCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToArriveDate") + .HasColumnType("datetime2"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToExpireDate") + .HasColumnType("datetime2"); + + b.Property("ToItemCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ToProduceDate") + .HasColumnType("datetime2"); + + b.Property("ToQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromStatus", "ToPackingCode", "ToStatus") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL AND [ToPackingCode] IS NOT NULL"); + + b.ToTable("Store_ItemTransformNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ItemTransformRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ItemTransformRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ItemTransformRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("FromArriveDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromProduceDate") + .HasColumnType("datetime2"); + + b.Property("FromQty") + .HasColumnType("decimal(18,6)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ReasonCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToArriveDate") + .HasColumnType("datetime2"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToExpireDate") + .HasColumnType("datetime2"); + + b.Property("ToItemCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ToProduceDate") + .HasColumnType("datetime2"); + + b.Property("ToQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromStatus", "ToPackingCode", "ToStatus") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL AND [ToPackingCode] IS NOT NULL"); + + b.ToTable("Store_ItemTransformRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisDeliverJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContainerQty") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Customer") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerAddressCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerLocationCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerWarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemQty") + .HasColumnType("decimal(18,6)"); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PlanTime") + .HasColumnType("datetime2"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ProjectCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_JisDeliverJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisDeliverJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ContainerDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ContainerName") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ItemQty") + .HasColumnType("decimal(18,6)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_JisDeliverJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisDeliverNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ArrivalTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContainerQty") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Customer") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CustomerAddressCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeliverTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ItemQty") + .HasColumnType("decimal(18,6)"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProjectCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TotalPackCapacity") + .HasColumnType("nvarchar(max)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_JisDeliverNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisDeliverNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeliverTime") + .HasColumnType("datetime2"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ExpiredTime") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("OnlineType") + .HasColumnType("nvarchar(max)"); + + b.Property("PackCapacity") + .HasColumnType("nvarchar(max)"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ProductNo") + .HasColumnType("nvarchar(max)"); + + b.Property("ProjectCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SeqNo") + .HasColumnType("nvarchar(max)"); + + b.Property("Stage") + .HasColumnType("nvarchar(max)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("UsedFor") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromLocationCode", "ToLocationCode") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL"); + + b.ToTable("Store_JisDeliverNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisProductReceiptNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContainerQty") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ItemQty") + .HasColumnType("decimal(18,6)"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProdLine") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductionPlanNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RawLocationCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReceiptType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Shift") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SourceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkShop") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_JisProductReceiptNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisProductReceiptNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("BomVersion") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("ProdLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ProductNo") + .HasColumnType("nvarchar(max)"); + + b.Property("ProjectCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RawLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SeqNo") + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode") + .IsUnique(); + + b.ToTable("Store_JisProductReceiptNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.MaterialRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PreparationPlanNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProdLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UseOnTheWayLocation") + .HasColumnType("bit"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_MaterialRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.MaterialRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpiredTime") + .HasColumnType("datetime2"); + + b.Property("FromLocationArea") + .HasColumnType("nvarchar(max)"); + + b.Property("IssuedQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProdLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReceivedQty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToLocationArea") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationGroup") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WorkStation") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("ItemCode"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "ToLocationCode") + .IsUnique(); + + b.ToTable("Store_MaterialRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.NoOkConvertOkNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_NoOkConvertOkNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.NoOkConvertOkNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromLocationCode", "ToLocationCode") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL"); + + b.ToTable("Store_NoOkConvertOkNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.OfflineSettlementNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProductReceiptNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_OfflineSettlementNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.OfflineSettlementNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_OfflineSettlementNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PreparationPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PlanDate") + .HasColumnType("datetime2"); + + b.Property("PlanTime") + .HasColumnType("datetime2"); + + b.Property("ProdLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProductionPlanNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Shift") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Team") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_PreparationPlan", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PreparationPlanDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LatestTime") + .HasColumnType("datetime2"); + + b.Property("LineStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WorkStation") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode") + .IsUnique(); + + b.ToTable("Store_PreparationPlanDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PlanDate") + .HasColumnType("datetime2"); + + b.Property("PlanTime") + .HasColumnType("datetime2"); + + b.Property("ProdLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Shift") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Team") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ProductionPlan", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionPlanDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("BomVersion") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("GoodQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(1m); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineStatus") + .HasColumnType("int"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("NoGoodQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(1m); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PlanQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode") + .IsUnique(); + + b.ToTable("Store_ProductionPlanDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ProductionReturnRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_ProductionReturnJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_ProductionReturnJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProductionReturnRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("ReturnTime") + .HasColumnType("datetime2"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ProductionReturnNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "FromPackingCode", "ToPackingCode", "FromLocationCode", "ToLocationCode") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL AND [ToPackingCode] IS NOT NULL"); + + b.ToTable("Store_ProductionReturnNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ProductionReturnRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("ItemCode"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "FromLocationCode") + .IsUnique(); + + b.ToTable("Store_ProductionReturnRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductL7PartsNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Configuration") + .HasColumnType("nvarchar(max)"); + + b.Property("ContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("CreateDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FATA") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductNo") + .HasColumnType("nvarchar(max)"); + + b.Property("Program") + .HasColumnType("nvarchar(max)"); + + b.Property("ReceiptNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ProductL7PartsNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductL7PartsNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CanBuy") + .HasColumnType("bit"); + + b.Property("CanMake") + .HasColumnType("bit"); + + b.Property("Configuration") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreateDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("FATA") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("L7Part") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationCode") + .HasColumnType("nvarchar(max)"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Position") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProdLine") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductNo") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Program") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("int"); + + b.Property("RawLocationCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RowID") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ProductNo", "Position", "Configuration", "L7Part") + .IsUnique() + .HasFilter("[ProductNo] IS NOT NULL AND [Position] IS NOT NULL AND [Configuration] IS NOT NULL AND [L7Part] IS NOT NULL"); + + b.ToTable("Store_ProductL7PartsNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiptNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProductReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProductionPlanNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiptType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Shift") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SourceNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkShop") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ProductReceiptNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiptNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("BomVersion") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProdLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RawArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RawLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("ReturnQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "PackingCode", "Lot", "Status") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_ProductReceiptNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiptRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PlanDate") + .HasColumnType("datetime2"); + + b.Property("ProdLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProductionPlanNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Shift") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Team") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ProductReceiptRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiptRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("BomVersion") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RawArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("ReturnQty") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "LocationCode") + .IsUnique(); + + b.ToTable("Store_ProductReceiptRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiveJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ProductionPlanNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Shift") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_ProductReceiveJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiveJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProdLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RawLocationCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_ProductReceiveJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleMaterialDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("BomVersion") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ProductItemCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProductItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProductItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProductItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProductLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProductPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ProductItemCode", "ItemCode"); + + b.ToTable("Store_ProductRecycleMaterialDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("RecycleTime") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Shift") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ProductRecycleNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReasonCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode") + .IsUnique(); + + b.ToTable("Store_ProductRecycleNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Shift") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.Property("Workshop") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ProductRecycleRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BomVersion") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RawLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RawLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RawLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RawLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RawWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode") + .IsUnique(); + + b.ToTable("Store_ProductRecycleRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseOrder", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactEmail") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactPhone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsConsignment") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("OrderStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoType") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SupplierAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierName") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxRate") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_PurchaseOrder", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseOrderDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConvertRate") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(1m); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Ctype") + .HasColumnType("nvarchar(max)"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("IsConsignment") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Lot") + .HasColumnType("nvarchar(max)"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("OrderRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("PlanArriveDate") + .HasColumnType("datetime2"); + + b.Property("PlanUserCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ProjectCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PutAwayQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReceivedQty") + .HasColumnType("decimal(18,6)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("ReturnedQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ShippedQty") + .HasColumnType("decimal(18,6)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierPackUom") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("ItemCode", "Number", "PoLine") + .IsUnique() + .HasFilter("[PoLine] IS NOT NULL"); + + b.ToTable("Store_PurchaseOrderDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PlanArriveDate") + .HasColumnType("datetime2"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PurchaseReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TimeWindow") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_PurchaseReceiptJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("FailedReason") + .HasColumnType("nvarchar(max)"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("InspectPhotoJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MassDefect") + .HasColumnType("nvarchar(max)"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PurchaseReceiptInspectStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierPackUom") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_PurchaseReceiptJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PurchaseReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierName") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.HasIndex("SupplierCode"); + + b.ToTable("Store_PurchaseReceiptNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FailedReason") + .HasColumnType("nvarchar(max)"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("InspectPhotoJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MassDefect") + .HasColumnType("nvarchar(max)"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("PurchaseReceiptInspectStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierPackUom") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Store_PurchaseReceiptNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("DockCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PlanArriveDate") + .HasColumnType("datetime2"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TimeWindow") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TruckNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.HasIndex("SupplierCode"); + + b.ToTable("Store_PurchaseReceiptRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("ConvertRate") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RecommendErpCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierPackUom") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode") + .IsUnique(); + + b.ToTable("Store_PurchaseReceiptRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PurchaseReturnRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("ReturnReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnTime") + .HasColumnType("datetime2"); + + b.Property("ReturnType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_PurchaseReturnJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationArea"); + + b.Property("HandledFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationCode"); + + b.Property("HandledFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationErpCode"); + + b.Property("HandledFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationGroup"); + + b.Property("HandledFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromWarehouseCode"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Reason") + .HasColumnType("nvarchar(max)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationArea"); + + b.Property("RecommendFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationCode"); + + b.Property("RecommendFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationErpCode"); + + b.Property("RecommendFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationGroup"); + + b.Property("RecommendFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromWarehouseCode"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_PurchaseReturnJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PurchaseReturnRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("ReturnReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnTime") + .HasColumnType("datetime2"); + + b.Property("ReturnType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_PurchaseReturnNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationArea"); + + b.Property("HandledFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationCode"); + + b.Property("HandledFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationErpCode"); + + b.Property("HandledFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationGroup"); + + b.Property("HandledFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromWarehouseCode"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Reason") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationArea"); + + b.Property("RecommendFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationCode"); + + b.Property("RecommendFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationErpCode"); + + b.Property("RecommendFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationGroup"); + + b.Property("RecommendFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromWarehouseCode"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode") + .IsUnique(); + + b.ToTable("Store_PurchaseReturnNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReturnTime") + .HasColumnType("datetime2"); + + b.Property("ReturnType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_PurchaseReturnRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode") + .IsUnique(); + + b.ToTable("Store_PurchaseReturnRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InspectNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ProductReceiptNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PurchaseReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PutawayMode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiptNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_PutawayJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_PutawayJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AsnNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InspectNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProductReceiptNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PurchaseReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiptNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RpNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_PutawayNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromLocationCode", "ToLocationCode", "ToPackingCode") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL AND [ToPackingCode] IS NOT NULL"); + + b.ToTable("Store_PutawayNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AsnNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InspectNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductReceiptNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseReceiptRequestNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PutawayMode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiptNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RpNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_PutawayRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("InventoryQty") + .HasColumnType("decimal(18,6)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Store_PutawayRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ReceiptAbnormalNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AsnNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ReceiptNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("SupplierCode"); + + b.HasIndex("AsnNumber", "Number", "SupplierCode", "ReceiptNumber") + .IsUnique(); + + b.ToTable("Store_ReceiptAbnormalNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ReceiptAbnormalNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AbnormalType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("Photos") + .HasColumnType("nvarchar(max)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReceiptNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode", "ReceiptNumber") + .IsUnique(); + + b.ToTable("Store_ReceiptAbnormalNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.RecycledMaterialReceiptNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_RecycledMaterialReceiptNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.RecycledMaterialReceiptNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReasonCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode") + .IsUnique(); + + b.ToTable("Store_RecycledMaterialReceiptNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.SaleOrder", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactEmail") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactPhone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SoStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SoType") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TaxRate") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(0m); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CustomerCode"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_SaleOrder", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.SaleOrderDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConvertRate") + .ValueGeneratedOnAdd() + .HasColumnType("decimal(18,6)") + .HasDefaultValue(1m); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("CustomerPackUom") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SoLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "SoLine", "ItemCode") + .IsUnique(); + + b.ToTable("Store_SaleOrderDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ScrapNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("ScrapRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ScrapNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ScrapNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(450)"); + + b.Property("FromPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReasonCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "FromPackingCode", "FromLocationCode", "ToLocationCode", "FromLot", "FromStatus") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL AND [FromLot] IS NOT NULL"); + + b.ToTable("Store_ScrapNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ScrapRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_ScrapRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ScrapRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReasonCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "LocationCode") + .IsUnique(); + + b.ToTable("Store_ScrapRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.SupplierAsn", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactEmail") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactPhone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreateType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Ctype") + .HasColumnType("nvarchar(max)"); + + b.Property("DockCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PlanArriveDate") + .HasColumnType("datetime2"); + + b.Property("PlanUserCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RpNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ShipDate") + .HasColumnType("datetime2"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierAddress") + .HasColumnType("nvarchar(max)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierName") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TimeWindow") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TruckNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.HasIndex("SupplierCode"); + + b.ToTable("Store_SupplierAsn", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.SupplierAsnDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("ConvertRate") + .HasColumnType("decimal(18,6)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Ctype") + .HasColumnType("nvarchar(max)"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("PlanUserCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PoLine") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoLine"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PoNumber"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("ProjectCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("RecommendErpCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierPackUom") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode", "PackingCode") + .IsUnique(); + + b.ToTable("Store_SupplierAsnDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.TransferNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConfirmTime") + .HasColumnType("datetime2"); + + b.Property("Confirmed") + .HasColumnType("bit"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UseOnTheWayLocation") + .HasColumnType("bit"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_TransferNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.TransferNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("OnTheWayLocationCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Reason") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromLocationCode", "ToLocationCode", "FromStatus", "ToStatus") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL"); + + b.ToTable("Store_TransferNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.TransferRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UseOnTheWayLocation") + .HasColumnType("bit"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_TransferRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.TransferRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Reason") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Store_TransferRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("BuildDate") + .HasColumnType("datetime2"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeptCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeptName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UnplannedIssueRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_UnplannedIssueJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationArea"); + + b.Property("HandledFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationCode"); + + b.Property("HandledFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationErpCode"); + + b.Property("HandledFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationGroup"); + + b.Property("HandledFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromWarehouseCode"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReasonCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationArea"); + + b.Property("RecommendFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationCode"); + + b.Property("RecommendFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationErpCode"); + + b.Property("RecommendFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationGroup"); + + b.Property("RecommendFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromWarehouseCode"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_UnplannedIssueJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("BuildDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeptCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeptName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UnplannedIssueRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_UnplannedIssueNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationArea"); + + b.Property("HandledFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationCode"); + + b.Property("HandledFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationErpCode"); + + b.Property("HandledFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromLocationGroup"); + + b.Property("HandledFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledFromWarehouseCode"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReasonCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendFromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationArea"); + + b.Property("RecommendFromLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationCode"); + + b.Property("RecommendFromLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationErpCode"); + + b.Property("RecommendFromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromLocationGroup"); + + b.Property("RecommendFromWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendFromWarehouseCode"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode", "ItemCode", "Lot", "Status") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_UnplannedIssueNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("BuildDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeptCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeptName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_UnplannedIssueRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode", "ItemCode", "Lot", "Status") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_UnplannedIssueRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptJob", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptTime") + .HasColumnType("datetime2"); + + b.Property("AcceptUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcceptUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("BuildDate") + .HasColumnType("datetime2"); + + b.Property("CompleteTime") + .HasColumnType("datetime2"); + + b.Property("CompleteUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompleteUserName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeptCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeptName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAutoComplete") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobDescription") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("JobStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("PriorityIncrement") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UnplannedReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UpStreamJobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkGroupCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Job_UnplannedReceiptJob", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptJobDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReasonCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.ToTable("Job_UnplannedReceiptJobDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("BuildDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeptCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeptName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UnplannedReceiptRequestNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_UnplannedReceiptNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HandledArriveDate") + .HasColumnType("datetime2"); + + b.Property("HandledContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledContainerCode"); + + b.Property("HandledExpireDate") + .HasColumnType("datetime2"); + + b.Property("HandledLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledLot"); + + b.Property("HandledPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledPackingCode"); + + b.Property("HandledProduceDate") + .HasColumnType("datetime2"); + + b.Property("HandledQty") + .HasColumnType("decimal(18,6)"); + + b.Property("HandledSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledSupplierBatch"); + + b.Property("HandledToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationArea"); + + b.Property("HandledToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationCode"); + + b.Property("HandledToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationErpCode"); + + b.Property("HandledToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToLocationGroup"); + + b.Property("HandledToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("HandledToWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("ReasonCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RecommendArriveDate") + .HasColumnType("datetime2"); + + b.Property("RecommendContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendContainerCode"); + + b.Property("RecommendExpireDate") + .HasColumnType("datetime2"); + + b.Property("RecommendLot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendLot"); + + b.Property("RecommendPackingCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendPackingCode"); + + b.Property("RecommendProduceDate") + .HasColumnType("datetime2"); + + b.Property("RecommendQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RecommendSupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendSupplierBatch"); + + b.Property("RecommendToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationArea"); + + b.Property("RecommendToLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationCode"); + + b.Property("RecommendToLocationErpCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationErpCode"); + + b.Property("RecommendToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToLocationGroup"); + + b.Property("RecommendToWarehouseCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("RecommendToWarehouseCode"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode", "ItemCode", "Lot", "Status") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_UnplannedReceiptNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptRequest", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("AutoAgree") + .HasColumnType("bit"); + + b.Property("AutoCompleteJob") + .HasColumnType("bit"); + + b.Property("AutoHandle") + .HasColumnType("bit"); + + b.Property("AutoSubmit") + .HasColumnType("bit"); + + b.Property("BuildDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeptCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeptName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DirectCreateNote") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("RequestStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_UnplannedReceiptRequest", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptRequestDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("ContainerCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ContainerCode"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationArea"); + + b.Property("LocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationCode"); + + b.Property("LocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationErpCode"); + + b.Property("LocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("LocationGroup"); + + b.Property("Lot") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Lot"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("PackingCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PackingCode"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("WarehouseCode"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "PackingCode", "ItemCode", "Lot", "Status") + .IsUnique() + .HasFilter("[Lot] IS NOT NULL"); + + b.ToTable("Store_UnplannedReceiptRequestDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.WarehouseTransferNote", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("JobNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("JobNumber"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("SupplierCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_WarehouseTransferNote", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.WarehouseTransferNoteDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArriveDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("FromContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationArea"); + + b.Property("FromLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationCode"); + + b.Property("FromLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationErpCode"); + + b.Property("FromLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromLocationGroup"); + + b.Property("FromLot") + .HasColumnType("nvarchar(max)"); + + b.Property("FromPackingCode") + .HasColumnType("nvarchar(450)"); + + b.Property("FromStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FromWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("FromWarehouseCode"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Reason") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,6)"); + + b.Property("SupplierBatch") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("SupplierBatch"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("ToContainerCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocationArea") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationArea"); + + b.Property("ToLocationCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationCode"); + + b.Property("ToLocationErpCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationErpCode"); + + b.Property("ToLocationGroup") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToLocationGroup"); + + b.Property("ToLot") + .HasColumnType("nvarchar(max)"); + + b.Property("ToPackingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ToWarehouseCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ToWarehouseCode"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "FromPackingCode", "FromLocationCode", "ToLocationCode") + .IsUnique() + .HasFilter("[FromPackingCode] IS NOT NULL"); + + b.ToTable("Store_WarehouseTransferNoteDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.WorkOrder", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ActiveDate") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EffectiveDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Op") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Qty") + .HasPrecision(18, 6) + .HasColumnType("decimal(18,6)") + .HasColumnName("Qty"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Uom"); + + b.Property("WoStatus") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WorkOrderId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WorkStation") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Worker") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Store_WorkOrder", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.WorkOrderDetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EffectiveDate") + .HasColumnType("datetime2"); + + b.Property("ItemCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemCode"); + + b.Property("ItemDesc1") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc1"); + + b.Property("ItemDesc2") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemDesc2"); + + b.Property("ItemName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ItemName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MasterID") + .HasColumnType("uniqueidentifier"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Number"); + + b.Property("Op") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RawLocationCode") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RawQty") + .HasColumnType("decimal(18,6)"); + + b.Property("RawUom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(3072) + .HasColumnType("nvarchar(3072)") + .HasColumnName("Remark"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("MasterID"); + + b.HasIndex("Number", "ItemCode") + .IsUnique(); + + b.ToTable("Store_WorkOrderDetail", (string)null); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.BackFlushNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.BackFlushNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CheckJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.CheckJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ContainerBindNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ContainerBindNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountAdjustNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.CountAdjustNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountAdjustRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.CountAdjustRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.CountJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.CountNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountPlanDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.CountPlan", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CustomerAsnDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.CustomerAsn", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CustomerReturnNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.CustomerReturnNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.DeliverJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.DeliverNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverPlanDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.DeliverPlan", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.DeliverRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectAbnormalNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.InspectAbnormalNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.InspectJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectJobSummaryDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.InspectJob", null) + .WithMany("SummaryDetails") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.InspectNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectNoteSummaryDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.InspectNote", null) + .WithMany("SummaryDetails") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.InspectRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectRequestSummaryDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.InspectRequest", null) + .WithMany("SummaryDetails") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InventoryInitialNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.InventoryInitialNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InventoryTransferNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.InventoryTransferNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IsolationNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.IsolationNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IssueJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.IssueJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IssueNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.IssueNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ItemTransformNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ItemTransformNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ItemTransformRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ItemTransformRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisDeliverJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.JisDeliverJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisDeliverNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.JisDeliverNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisProductReceiptNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.JisProductReceiptNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.MaterialRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.MaterialRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.NoOkConvertOkNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.NoOkConvertOkNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.OfflineSettlementNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.OfflineSettlementNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PreparationPlanDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PreparationPlan", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionPlanDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductionPlan", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductionReturnJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductionReturnNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductionReturnRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductL7PartsNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductL7PartsNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiptNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductReceiptNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiptRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductReceiptRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiveJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductReceiveJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleMaterialDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductRecycleNote", null) + .WithMany("MaterialDetails") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductRecycleNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ProductRecycleRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseOrderDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PurchaseOrder", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PutawayJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PutawayNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.PutawayRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ReceiptAbnormalNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ReceiptAbnormalNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.RecycledMaterialReceiptNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.RecycledMaterialReceiptNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.SaleOrderDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.SaleOrder", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ScrapNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ScrapNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ScrapRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.ScrapRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.SupplierAsnDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.SupplierAsn", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.TransferNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.TransferNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.TransferRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.TransferRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptJobDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptJob", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptRequestDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptRequest", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.WarehouseTransferNoteDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.WarehouseTransferNote", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.WorkOrderDetail", b => + { + b.HasOne("Win_in.Sfs.Wms.Store.Domain.WorkOrder", null) + .WithMany("Details") + .HasForeignKey("MasterID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.BackFlushNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CheckJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ContainerBindNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountAdjustNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountAdjustRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CountPlan", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CustomerAsn", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.CustomerReturnNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverPlan", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.DeliverRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectAbnormalNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectJob", b => + { + b.Navigation("Details"); + + b.Navigation("SummaryDetails"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectNote", b => + { + b.Navigation("Details"); + + b.Navigation("SummaryDetails"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InspectRequest", b => + { + b.Navigation("Details"); + + b.Navigation("SummaryDetails"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InventoryInitialNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.InventoryTransferNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IsolationNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IssueJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.IssueNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ItemTransformNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ItemTransformRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisDeliverJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisDeliverNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.JisProductReceiptNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.MaterialRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.NoOkConvertOkNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.OfflineSettlementNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PreparationPlan", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionPlan", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductionReturnRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductL7PartsNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiptNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiptRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductReceiveJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleNote", b => + { + b.Navigation("Details"); + + b.Navigation("MaterialDetails"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ProductRecycleRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseOrder", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReceiptRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PurchaseReturnRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.PutawayRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ReceiptAbnormalNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.RecycledMaterialReceiptNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.SaleOrder", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ScrapNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.ScrapRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.SupplierAsn", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.TransferNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.TransferRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedIssueRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptJob", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.UnplannedReceiptRequest", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.WarehouseTransferNote", b => + { + b.Navigation("Details"); + }); + + modelBuilder.Entity("Win_in.Sfs.Wms.Store.Domain.WorkOrder", b => + { + b.Navigation("Details"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.cs new file mode 100644 index 000000000..93eaf0024 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.cs @@ -0,0 +1,68 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Win_in.Sfs.Wms.Store.Migrations +{ + public partial class Store_AddColumn : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Type", + table: "Store_TransferNote", + type: "nvarchar(64)", + maxLength: 64, + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "nvarchar(64)", + oldMaxLength: 64, + oldNullable: true); + + migrationBuilder.AddColumn( + name: "WarehouseCode", + table: "Store_PurchaseReceiptNote", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "WarehouseCode", + table: "Store_InspectRequest", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "CountPrint", + table: "Store_DeliverNote", + type: "int", + nullable: false, + defaultValue: 0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "WarehouseCode", + table: "Store_PurchaseReceiptNote"); + + migrationBuilder.DropColumn( + name: "WarehouseCode", + table: "Store_InspectRequest"); + + migrationBuilder.DropColumn( + name: "CountPrint", + table: "Store_DeliverNote"); + + migrationBuilder.AlterColumn( + name: "Type", + table: "Store_TransferNote", + type: "nvarchar(64)", + maxLength: 64, + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(64)", + oldMaxLength: 64); + } + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs index c92a6a644..6a513c945 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs @@ -1,4 +1,4 @@ -// +// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; @@ -3051,6 +3051,9 @@ namespace Win_in.Sfs.Wms.Store.Migrations .HasColumnType("nvarchar(40)") .HasColumnName("ConcurrencyStamp"); + b.Property("CountPrint") + .HasColumnType("int"); + b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -5202,6 +5205,9 @@ namespace Win_in.Sfs.Wms.Store.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + b.Property("Worker") .HasColumnType("nvarchar(max)"); @@ -13083,6 +13089,9 @@ namespace Win_in.Sfs.Wms.Store.Migrations .HasMaxLength(64) .HasColumnType("nvarchar(64)"); + b.Property("WarehouseCode") + .HasColumnType("nvarchar(max)"); + b.Property("Worker") .HasColumnType("nvarchar(max)"); @@ -17189,6 +17198,7 @@ namespace Win_in.Sfs.Wms.Store.Migrations .HasColumnName("TenantId"); b.Property("Type") + .IsRequired() .HasMaxLength(64) .HasColumnType("nvarchar(64)"); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs index 22713c44a..d78170183 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs @@ -48,8 +48,7 @@ public partial class StoreEventAutoMapperProfile : Profile .Ignore(x => x.ToLocationErpCode) ; - CreateMap< - IssueJobDetail, ExpectInEditInput>() + CreateMap() .MapExpectInOutFrom() .Ignore(x => x.Worker) .Ignore(x => x.SerialNumber) @@ -62,5 +61,32 @@ public partial class StoreEventAutoMapperProfile : Profile .Ignore(x => x.SerialNumber) .Ignore(x => x.ExtraProperties); + CreateMap() + .Ignore(x => x.Confirmed) + .Ignore(x => x.JobNumber) + .Ignore(x => x.RequestNumber) + .Ignore(x => x.ActiveDate) + ; + CreateMap() + .Ignore(x => x.IssueTime) + .Ignore(x => x.FromPackingCode) + .Ignore(x => x.ToPackingCode) + .Ignore(x => x.FromContainerCode) + .Ignore(x => x.ToContainerCode) + .Ignore(x => x.FromLot) + .Ignore(x => x.ToLot) + .Ignore(x => x.SupplierBatch) + .Ignore(x => x.ArriveDate) + .Ignore(x => x.ProduceDate) + .Ignore(x => x.ExpireDate) + .Ignore(x => x.FromLocationCode) + .Ignore(x => x.FromLocationArea) + .Ignore(x => x.FromLocationGroup) + .Ignore(x => x.FromLocationErpCode) + .Ignore(x => x.FromWarehouseCode) + .Ignore(x => x.FromStatus) + .Ignore(x => x.ToStatus) + .Ignore(x => x.Qty) + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Bases/StoreDataExchangeEventHandlerBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Bases/StoreDataExchangeEventHandlerBase.cs index 92fc4956d..c0675f55b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Bases/StoreDataExchangeEventHandlerBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Bases/StoreDataExchangeEventHandlerBase.cs @@ -13,8 +13,8 @@ namespace Win_in.Sfs.Wms.Store.Event.DataExchanges; public abstract class StoreDataExchangeEventHandlerBase : StoreEventHandlerBase { - // protected IDataExchangeHelperManager DataExchangeHelperManager => - // LazyServiceProvider.LazyGetRequiredService(); + protected IDataExchangeHelperManager DataExchangeHelperManager => + LazyServiceProvider.LazyGetRequiredService(); protected IExchangeDataManager ExchangeDataManager => LazyServiceProvider.LazyGetRequiredService(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs index d2b597995..d5e645fb5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs @@ -51,6 +51,7 @@ public class IssueJobEventHandler : private async Task BuildIssueNoteAsync(IssueJob entity) { var issueNoteCreateInput = ObjectMapper.Map(entity); + issueNoteCreateInput.JobNumber = entity.Number; var locationCodes = issueNoteCreateInput.Details.Select(p => p.ToLocationCode).Distinct().ToList(); var locations = await _locationAppService.GetByCodesAsync(locationCodes).ConfigureAwait(false); @@ -61,7 +62,6 @@ public class IssueJobEventHandler : var location = locations.First(p => p.Code == detail.ToLocationCode); await RemovePackingCodeAndContainerCodeAndLotAsync(detail, location.Type); //去箱 去托 去批 - detail.ToLocationArea = location.AreaCode; detail.ToLocationGroup = location.LocationGroupCode; detail.ToLocationErpCode = location.ErpLocationCode; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs index ab126994f..5b8074599 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs @@ -176,10 +176,17 @@ public class PurchaseOrderEventHandler var itemPackDto=ItemPacks.First(p => p.ItemCode == purchaseOrderDetaildetail.ItemCode); //总箱数 - var itemPackQty = (int)(itemQty / itemPackDto.Qty); - if (itemQty % itemPackQty!= 0) + var itemPackingCount = (int)(itemQty / itemPackDto.Qty); + if (itemQty > itemPackDto.Qty) { - itemPackQty++; + if (itemQty % itemPackDto.Qty != 0) + { + itemPackingCount++; + } + } + else + { + itemPackingCount = 1; } //添加物品信息 @@ -192,9 +199,9 @@ public class PurchaseOrderEventHandler //一次性返回所有箱码 var generateManyAsync = await _labelDefinitionAppService .GenerateManyAsync(EnumLabelType.PurchaseLabel.ToString(), Clock.Now.ToString(SharedConst.TimeFormat), - itemPackQty).ConfigureAwait(false); + itemPackingCount).ConfigureAwait(false); - for (var i = 0; i < itemPackQty; i++) + for (var i = 0; i < itemPackingCount; i++) { var supplierAsnDetailInput = ObjectMapper.Map(purchaseOrderDetaildetail); //添加箱码 @@ -257,9 +264,6 @@ public class PurchaseOrderEventHandler ItemPackDTO itemPackDto) { if (itemBasicDto == null) - { - throw new UserFriendlyException($"{supplierAsnDetail.ItemCode}零件信息为空"); - } if (supplierDto == null) { @@ -288,6 +292,7 @@ public class PurchaseOrderEventHandler inputLabel.RecommendLocationCode = supplierAsnDetail.RecommendErpCode; inputLabel.Remark = supplierAsnDetail.Remark; inputLabel.Code = supplierAsnDetail.PackingCode; + inputLabel.PlanArriveDate=supplierAsn.PlanArriveDate; inputLabel.Qty = supplierAsnDetail.Qty; inputLabel.Uom = supplierAsnDetail.Uom; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs index 6bec71c5f..5305923a6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs @@ -1,78 +1,78 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.EventBus; -using Volo.Abp.Uow; -using Win_in.Sfs.Shared.Event; -using Win_in.Sfs.Wms.Store.Domain; +//using System.Collections.Generic; +//using System.Linq; +//using System.Threading.Tasks; +//using Volo.Abp.EventBus; +//using Volo.Abp.Uow; +//using Win_in.Sfs.Shared.Event; +//using Win_in.Sfs.Wms.Store.Domain; -namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; +//namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; -public class IssueNoteEventHandler - : StoreEventHandlerBase - , ILocalEventHandler> - , ILocalEventHandler>> - , ILocalEventHandler> -{ - private readonly IMaterialRequestManager _materialRequestManager; +//public class IssueNoteEventHandler +// : StoreEventHandlerBase +// , ILocalEventHandler> +// , ILocalEventHandler>> +// , ILocalEventHandler> +//{ +// private readonly IMaterialRequestManager _materialRequestManager; - public IssueNoteEventHandler( - IMaterialRequestManager materialRequestManager - ) - { - _materialRequestManager = materialRequestManager; - } +// public IssueNoteEventHandler( +// IMaterialRequestManager materialRequestManager +// ) +// { +// _materialRequestManager = materialRequestManager; +// } - [UnitOfWork] - public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData eventData) - { - var entity = eventData.Entity; +// [UnitOfWork] +// public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData eventData) +// { +// var entity = eventData.Entity; - await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); - } +// await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); +// } - private async Task UpdateReceivedQtyMaterialRequestAsync(IssueNote entity) - { - var receiveQtyGroup = entity.Details - .GroupBy(p => new { p.ItemCode, p.ToLocationCode }) - .Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) }) - .ToList(); +// private async Task UpdateReceivedQtyMaterialRequestAsync(IssueNote entity) +// { +// var receiveQtyGroup = entity.Details +// .GroupBy(p => new { p.ItemCode, p.ToLocationCode }) +// .Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) }) +// .ToList(); - var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); +// var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); - //更新叫料请求的已收数量 - foreach (var materialRequestDetail in materialRequest.Details) - { - var receiveQty = receiveQtyGroup.FirstOrDefault(p => - p.ItemCode == materialRequestDetail.ItemCode && - p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty; - if (receiveQty != null) - { - materialRequestDetail.ReceivedQty += receiveQty.Value; - } - } +// //更新叫料请求的已收数量 +// foreach (var materialRequestDetail in materialRequest.Details) +// { +// var receiveQty = receiveQtyGroup.FirstOrDefault(p => +// p.ItemCode == materialRequestDetail.ItemCode && +// p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty; +// if (receiveQty != null) +// { +// materialRequestDetail.ReceivedQty += receiveQty.Value; +// } +// } - await _materialRequestManager.UpdateDetailsAsync(materialRequest).ConfigureAwait(false); - } +// await _materialRequestManager.UpdateDetailsAsync(materialRequest).ConfigureAwait(false); +// } - [UnitOfWork] - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) - { - var entity = eventData.Entity; - if (!entity.UseOnTheWayLocation) - { - await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); - } +// [UnitOfWork] +// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) +// { +// var entity = eventData.Entity; +// if (!entity.UseOnTheWayLocation) +// { +// await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); +// } - } +// } - [UnitOfWork] - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) - { - var entities = eventData.Entity; - foreach (var entity in entities.Where(entity => !entity.UseOnTheWayLocation)) - { - await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); - } - } -} +// [UnitOfWork] +// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) +// { +// var entities = eventData.Entity; +// foreach (var entity in entities.Where(entity => !entity.UseOnTheWayLocation)) +// { +// await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); +// } +// } +//} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs new file mode 100644 index 000000000..f9270b9be --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Inventory.Application.Contracts; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Domain.Shared; +using Win_in.Sfs.Wms.Store.Event.Transaction; + +namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; + +public class ScrapNoteEventHandler + : StoreInventoryEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> +{ + private readonly IScrapRequestManager _scrapRequestManager; + + public ScrapNoteEventHandler(IScrapRequestManager scrapRequestManager) + { + _scrapRequestManager = scrapRequestManager; + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + if (!string.IsNullOrEmpty(entity.ScrapRequestNumber)) + { + var scrapRequest = await _scrapRequestManager.GetByNumberAsync(entity.ScrapRequestNumber) + .ConfigureAwait(false); + + await _scrapRequestManager.CompleteAsync(scrapRequest).ConfigureAwait(false); + } + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + foreach (var entity in entitys) + { + if (string.IsNullOrEmpty(entity.ScrapRequestNumber)) + { + var scrapRequest = await _scrapRequestManager.GetByNumberAsync(entity.ScrapRequestNumber) + .ConfigureAwait(false); + + await _scrapRequestManager.CompleteAsync(scrapRequest).ConfigureAwait(false); + } + } + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ScrapRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ScrapRequestEventHandler.cs index dcd3511ae..4f75f7e83 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ScrapRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ScrapRequestEventHandler.cs @@ -14,16 +14,51 @@ using Win_in.Sfs.Wms.Store.Application.Contracts; public class ScrapRequestEventHandler : StoreEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> , ILocalEventHandler> { private readonly IScrapNoteAppService _scrapNoteApp; + private readonly IScrapRequestManager _scrapRequestManager; public ScrapRequestEventHandler( - IScrapNoteAppService scrapNoteApp - ) + IScrapNoteAppService scrapNoteApp, + IScrapRequestManager scrapRequestManager) { _scrapNoteApp = scrapNoteApp; + _scrapRequestManager = scrapRequestManager; + } + + /// + /// 库移创建后 + /// + /// Event data + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + if (entity.AutoSubmit) + { + await _scrapRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + + /// + /// 库移批量创建后 + /// + /// Event data + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + foreach (var entity in entitys) + { + if (entity.AutoSubmit) + { + await _scrapRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } } [UnitOfWork] diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/DeliverNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/DeliverNoteEventHandler.cs index 10cf80868..d08b6cd95 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/DeliverNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/DeliverNoteEventHandler.cs @@ -12,13 +12,14 @@ using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Event.Transaction; + // using Win_in.Sfs.Wms.Job.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Event.Transactions; public class DeliverNoteEventHandler : StoreInventoryEventHandlerBase - , ILocalEventHandler> + , ILocalEventHandler> { private const EnumTransType TransType = EnumTransType.Deliver; private readonly IDeliverRequestAppService _deliverRequestApp; @@ -34,6 +35,11 @@ public class DeliverNoteEventHandler RedisDB = redisConnection.GetDatabase(); } + /// + /// 创建后 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { @@ -44,19 +50,18 @@ public class DeliverNoteEventHandler await SetRequestStatusAsync(entity).ConfigureAwait(false); } + #region 私有 + private async Task AddTransactionsAsync(DeliverNote deliverNote) { //如果WMS管理客户寄售库,生成库存转移 if (await SettingManager.IsTrueAsync(StoreSettings.Common.EnableCustomerLocation).ConfigureAwait(false)) { - var transferLogs = BuildTransferLogs(deliverNote); await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); - } else //如果WMS不管理客户寄售库,生成出库 { - var transactions = BuildTransactions(deliverNote); await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false); } @@ -151,4 +156,6 @@ public class DeliverNoteEventHandler return EnumTransSubType.None; } } + + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs index b27cf8c57..f43b6e406 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs @@ -4,119 +4,156 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.EventBus; using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; -using Win_in.Sfs.Wms.Store.Event.Transaction; +using Win_in.Sfs.Wms.Store.Event.Transactions; -namespace Win_in.Sfs.Wms.Store.Event.Transactions; - -public class IssueNoteEventHandler - : StoreInventoryEventHandlerBase - , ILocalEventHandler> - , ILocalEventHandler>> - , ILocalEventHandler> +namespace Win_in.Sfs.Wms.Store.Event.BusinessNote { - private const EnumTransType TransType = EnumTransType.Issue; - - [UnitOfWork] - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) - { - var entity = eventData.Entity; - var transferLogs = new List(); - var route = entity.UseOnTheWayLocation - ? EnumTransferRoute.SourceToOnTheWay - : EnumTransferRoute.SourceToDestination; - transferLogs.AddRange(await BuildTransferLogsAsync(entity, route).ConfigureAwait(false)); - - await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); - } - - [UnitOfWork] - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) - { - var entities = eventData.Entity; - var transferLogs = new List(); - //如果要做库存事务汇总,可以修改此处 - foreach (var issueNote in entities) - { - var route = issueNote.UseOnTheWayLocation - ? EnumTransferRoute.SourceToOnTheWay - : EnumTransferRoute.SourceToDestination; - transferLogs.AddRange(await BuildTransferLogsAsync(issueNote, route).ConfigureAwait(false)); - } - - await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); - } - - [UnitOfWork] - - public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData eventData) - { - var entity = eventData.Entity; - - var inputList = await BuildTransferLogsAsync(entity, EnumTransferRoute.OnTheWayToDestination).ConfigureAwait(false); - await AddTransferLogsAsync(inputList).ConfigureAwait(false); - } - - private async Task AddTransferLogsAsync(List inputList) - { - var transferLogs = new List(); - - transferLogs.AddRange(inputList); - - await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); - - } - - private async Task> BuildTransferLogsAsync(IssueNote issueNote, EnumTransferRoute route) - { - var transferLogs = new List(); - foreach (var detail in issueNote.Details.Where(detail => detail.Qty != 0)) - { - var transferLog = ObjectMapper.Map(detail); - - if (issueNote.UseOnTheWayLocation) - { - var location = await LocationAclService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); - switch (route) - { - case EnumTransferRoute.SourceToOnTheWay: - detail.ToLocationCode = detail.OnTheWayLocationCode; - detail.ToLocationErpCode = location.ErpLocationCode; - detail.ToWarehouseCode = location.WarehouseCode; - break; - case EnumTransferRoute.OnTheWayToDestination: - detail.FromLocationCode = detail.OnTheWayLocationCode; - detail.FromLocationErpCode = location.ErpLocationCode; - detail.FromWarehouseCode = location.WarehouseCode; - break; - case EnumTransferRoute.SourceToDestination: - default: - throw new ArgumentOutOfRangeException(nameof(route), route, null); - } - } - - if (issueNote.UseOnTheWayLocation) - { - transferLog.FromLocationCode = detail.OnTheWayLocationCode; - var location = await LocationAclService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); - transferLog.FromLocationGroup = location.LocationGroupCode; - transferLog.FromLocationArea = location.AreaCode; - transferLog.FromLocationErpCode = location.ErpLocationCode; - } - - transferLog.TransType = TransType; - transferLog.TransSubType = Enum.Parse(issueNote.RequestType); - transferLog.Worker = issueNote.Worker; - transferLog.DocNumber = issueNote.Number; - transferLog.JobNumber = issueNote.JobNumber; - - transferLogs.Add(transferLog); - } - - return transferLogs; - } - + //public class IssueNoteEventHandler + // : StoreEventHandlerBase + // , ILocalEventHandler> + // , ILocalEventHandler>> + // , ILocalEventHandler> + //{ + // private const EnumTransType TransType = EnumTransType.Issue; + // private readonly Itranlog + + + // [UnitOfWork] + // public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + // { + // var entity = eventData.Entity; + // var transferLogs = new List(); + // var route = entity.UseOnTheWayLocation + // ? EnumTransferRoute.SourceToOnTheWay + // : EnumTransferRoute.SourceToDestination; + + // //如果是mes拉动 先发到在途 + // if (entity.RequestType == EnumMaterialRequestType.Issue_WIP.ToString()) + // { + // route = EnumTransferRoute.SourceToOnTheWay; + // } + + // transferLogs.AddRange(await BuildTransferLogsAsync(entity, route)); + + // await TransferLogAppService.AddManyAsync(transferLogs); + // } + + + // [UnitOfWork] + // public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + // { + // var entities = eventData.Entity; + // var transferLogs = new List(); + // //如果要做库存事务汇总,可以修改此处 + // foreach (var issueNote in entities) + // { + // var route = issueNote.UseOnTheWayLocation + // ? EnumTransferRoute.SourceToOnTheWay + // : EnumTransferRoute.SourceToDestination; + // transferLogs.AddRange(await BuildTransferLogsAsync(issueNote, route)); + // } + + // await TransferLogAppService.AddManyAsync(transferLogs); + // } + + + // [UnitOfWork] + + // public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData eventData) + // { + // var entity = eventData.Entity; + + // var inputList = await BuildTransferLogsAsync(entity, EnumTransferRoute.OnTheWayToDestination); + // await AddTransferLogsAsync(inputList); + // } + + // private async Task AddTransferLogsAsync(List inputList) + // { + // var transferLogs = new List(); + + // transferLogs.AddRange(inputList); + + // await TransferLogAppService.AddManyAsync(transferLogs); + + // } + + // private async Task> BuildTransferLogsAsync(IssueNote issueNote, EnumTransferRoute route) + // { + // var transferLogs = new List(); + // foreach (var detail in issueNote.Details.Where(detail => detail.Qty.Qty != 0)) + // { + // var transferLog = ObjectMapper.Map(detail); + + // LocationDTO fromLocationDTO = null; + // LocationDTO toLocationDTO = null; + + // if (issueNote.UseOnTheWayLocation) + // { + // var location = await LocationAppService.GetByCodeAsync(detail.OnTheWayLocationCode); + // switch (route) + // { + // case EnumTransferRoute.SourceToOnTheWay: + // fromLocationDTO = await LocationAppService.GetByCodeAsync(detail.FromLocationCode); + + // toLocationDTO = await LocationAppService.GetByCodeAsync(detail.OnTheWayLocationCode); + // break; + // case EnumTransferRoute.OnTheWayToDestination: + // fromLocationDTO = await LocationAppService.GetByCodeAsync(detail.OnTheWayLocationCode); + + // toLocationDTO = await LocationAppService.GetByCodeAsync(detail.ToLocationCode); + + // await RemovePackingCodeAndContainerCodeAndLotAsync(transferLog); + // break; + // case EnumTransferRoute.SourceToDestination: + // default: + // throw new ArgumentOutOfRangeException(nameof(route), route, null); + // } + // } + // else + // { + // fromLocationDTO = await LocationAppService.GetByCodeAsync(detail.FromLocationCode); + // toLocationDTO = await LocationAppService.GetByCodeAsync(detail.ToLocationCode); + // } + + // transferLog.FromLocationCode = fromLocationDTO.Code; + // transferLog.FromLocationArea = fromLocationDTO.AreaCode; + // transferLog.FromLocationErpCode = fromLocationDTO.ErpLocationCode; + // transferLog.FromLocationGroup = fromLocationDTO.LocationGroupCode; + + // transferLog.ToLocationCode = toLocationDTO.Code; + // transferLog.ToLocationArea = toLocationDTO.AreaCode; + // transferLog.ToLocationErpCode = toLocationDTO.ErpLocationCode; + // transferLog.ToLocationGroup = toLocationDTO.LocationGroupCode; + + // transferLog.TransType = TransType; + // transferLog.TransSubType = Enum.Parse(issueNote.RequestType); + // transferLog.Company = issueNote.Company; + // transferLog.Worker = issueNote.Worker; + // transferLog.DocNumber = issueNote.Number; + // transferLog.JobNumber = issueNote.JobNumber; + + // transferLogs.Add(transferLog); + // } + + // return transferLogs; + // } + // private async Task RemovePackingCodeAndContainerCodeAndLotAsync(TransferLogCreateInput transferLogCreateInput) + // { + // transferLogCreateInput.ToPackingCode = ""; + // transferLogCreateInput.ToLot = ""; + // transferLogCreateInput.ToContainerCode = ""; + + // transferLogCreateInput.FromPackingCode = ""; + // transferLogCreateInput.FromLot = ""; + // transferLogCreateInput.FromContainerCode = ""; + + + // } + //} } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs index 2e4289476..da4d933d9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs @@ -17,37 +17,26 @@ namespace Win_in.Sfs.Wms.Store.Event.Transactions; public class ScrapNoteEventHandler : StoreInventoryEventHandlerBase , ILocalEventHandler> - , ILocalEventHandler>> + , ILocalEventHandler>> { private const EnumTransType TransType = EnumTransType.Scrap; - private readonly IScrapRequestAppService _scrapRequestApp; - - public ScrapNoteEventHandler(IScrapRequestAppService scrapRequestApp) - { - _scrapRequestApp = scrapRequestApp; - } - [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { var entity = eventData.Entity; await AddTransactionsAsync(new List() { entity }).ConfigureAwait(false); - - if (!string.IsNullOrEmpty(entity.ScrapRequestNumber)) - { - await _scrapRequestApp.CompleteByNumberAsync(entity.ScrapRequestNumber).ConfigureAwait(false); - } } [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) { - var entities = eventData.Entity; await AddTransactionsAsync(entities).ConfigureAwait(false); } + #region 私有 + private async Task AddTransactionsAsync(List scrapNotes) { @@ -112,4 +101,5 @@ public class ScrapNoteEventHandler return transactions; } + #endregion } diff --git a/build/src/docker/publish/conf/settings/appsettings.Development.json b/build/src/docker/publish/conf/settings/appsettings.Development.json index d7703852e..38d969c76 100644 --- a/build/src/docker/publish/conf/settings/appsettings.Development.json +++ b/build/src/docker/publish/conf/settings/appsettings.Development.json @@ -122,10 +122,10 @@ "BaseUrl": "http://dev.ccwin-in.com:21292/" }, "Inventory": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://localhost:59095/" }, "Job": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://localhost:59095/" }, "Label": { "BaseUrl": "http://dev.ccwin-in.com:21292/" @@ -134,7 +134,7 @@ "BaseUrl": "http://dev.ccwin-in.com:21292/" }, "Store": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://localhost:59095/" } }, "Serilog": { From 6ef67c6910574407c04c78c53befbc69f29a7896 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Wed, 12 Apr 2023 16:46:43 +0800 Subject: [PATCH 06/41] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArriveDbContextModelCreatingExtensions.cs | 4 +- .../ReturnDbContextModelCreatingExtensions.cs | 2 +- ...nge.EntityFrameworkCore.Fawtyg.Tyrp.csproj | 2 +- .../EosAgentModule.cs | 6 +-- .../Incoming/EosIncomingBackgroundWorker.cs | 28 ++++++------- .../Incoming/PlanConverter.cs | 8 +++- .../Incoming/PlanReader.cs | 3 +- .../Incoming/ProductConverter.cs | 8 +++- .../Incoming/ShipConverter.cs | 7 +++- .../Incoming/ShipReader.cs | 3 +- .../Outgoing/ArriveConverter.cs | 2 +- .../Outgoing/ReturnConverter.cs | 2 +- .../Incoming/BomReader.cs | 5 ++- .../Incoming/TyrpIncomingBackgroundWorker.cs | 42 +++++++++---------- .../Outgoing/ScontrolWriter.cs | 6 ++- .../Outgoing/WmsoutmWriter.cs | 4 +- .../TyrpAgentModule.cs | 2 +- .../appsettings.json | 6 +-- .../AgentModule.cs | 2 +- .../Enums/EnumSystemType.cs | 1 + 20 files changed, 80 insertions(+), 63 deletions(-) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs index 3d0ad6793..42e9b6f56 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs @@ -11,12 +11,12 @@ public static class ArriveDbContextModelCreatingExtensions builder.Entity(b => { //Configure table & schema Name - b.ToTable(options.TablePrefix + "Sync_arrive", options.Schema); + b.ToTable(options.TablePrefix + "Sync_arrrive", options.Schema); //Configure ABP properties b.ConfigureByConvention(); //Properties - b.Property(q => q.Id); + b.Property(q => q.Id).ValueGeneratedOnAdd(); b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.ShipBillNo).HasMaxLength(255); b.Property(q => q.DocNo).HasMaxLength(255); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs index b6855dde1..2ecea7856 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs @@ -16,7 +16,7 @@ public static class ReturnDbContextModelCreatingExtensions b.ConfigureByConvention(); //Properties - b.Property(q => q.Id); + b.Property(q => q.Id).ValueGeneratedOnAdd(); b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.ShipBillNo).HasMaxLength(255); b.Property(q => q.DocNo).HasMaxLength(255); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp.csproj b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp.csproj index e3376708a..ed9e12e59 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp.csproj +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp.csproj @@ -1,4 +1,4 @@ - + net6.0 diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs index ee6b2a09f..6dc625d8e 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs @@ -41,7 +41,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; typeof(DataExchangeEntityFrameworkCoreModule), typeof(DataExchangeDomainFawtygEosModule), typeof(DataExchangeEntityFrameworkCoreFawtygModule), - typeof(AbpAccountApplicationContractsModule) + typeof(AbpAccountApplicationContractsModule) )] public class EosAgentModule : AbpModule { @@ -165,8 +165,8 @@ public class EosAgentModule : AbpModule ApplicationInitializationContext context) { - context.AddBackgroundWorkerAsync(); - // context.AddBackgroundWorker(); + //context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs index a02ce68b4..acb6851bf 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs @@ -43,21 +43,21 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase //转换Plan await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false); - //Logger.LogInformation($"Read Ship"); - //var shipHandleService = workerContext.ServiceProvider.GetRequiredService(); - //var shipConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保持Ship - //var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false); - ////转换Ship - //await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read Ship"); + var shipHandleService = workerContext.ServiceProvider.GetRequiredService(); + var shipConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保持Ship + var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false); + //转换Ship + await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); - //Logger.LogInformation($"Read Product"); - //var productHandleService = workerContext.ServiceProvider.GetRequiredService(); - //var productConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保持Product - //var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); - ////转换Product - //await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read Product"); + var productHandleService = workerContext.ServiceProvider.GetRequiredService(); + var productConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保持Product + var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); + //转换Product + await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); Logger.LogInformation($"Completed: Handling {Incoming}"); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanConverter.cs index 83107d1f9..92ddb645a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanConverter.cs @@ -14,6 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; public class PlanConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemPackAppService _itemPackAppService; @@ -27,10 +28,12 @@ public class PlanConverter : IIncomingConverter IItemPackAppService itemPackAppService, IObjectMapper objectMapper, ILogger logger, - IConfiguration configuration + IConfiguration configuration, + IIncomingFromExternalManager incomingFromExternalManager ) { + _incomingFromExternalManager = incomingFromExternalManager; _incomingToWmsManager = incomingToWmsManager; _itemBasicAppService = itemBasicAppService; _itemPackAppService = itemPackAppService; @@ -48,7 +51,8 @@ public class PlanConverter : IIncomingConverter //按PlanBillNo合并PurchaseOrder var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false); - + //归档 + await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfPurchaseOrderAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs index 917e143f0..57156aedf 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs @@ -37,8 +37,7 @@ public class PlanReader : IReader public virtual async Task> ReadAsync() { //从EOS读取待处理Plan - var aa = await _planManager.GetToBeProcessedListAsync().ConfigureAwait(false); - var toBeProcessedPlans = aa.Take(100).ToList(); + var toBeProcessedPlans = await _planManager.GetToBeProcessedListAsync().ConfigureAwait(false); if (!toBeProcessedPlans.Any()) { _logger.LogInformation("no plans"); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs index cd43b789d..945ffc6a1 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs @@ -15,6 +15,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.Incoming; public class ProductConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly ISupplierAppService _supplierAppService; private readonly IObjectMapper _objectMapper; @@ -27,9 +28,11 @@ public class ProductConverter : IIncomingConverter IObjectMapper objectMapper, ILogger logger, IGuidGenerator guidGenerator, - IConfiguration configuration + IConfiguration configuration, + IIncomingFromExternalManager incomingFromExternalManager ) { + _incomingFromExternalManager = incomingFromExternalManager; _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; _supplierAppService = supplierAppService; @@ -53,7 +56,8 @@ public class ProductConverter : IIncomingConverter incomingToWmsDataList.AddRange(supplierItemIncomingToWmsDataList); //添加IncomingToWms await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false); - + //归档 + await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildItemPackIncomingToWmsOfProductAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs index 9514b5410..433898ac7 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs @@ -17,6 +17,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; public class ShipConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IObjectMapper _objectMapper; private readonly IItemBasicAppService _itemBasicAppService; @@ -29,9 +30,11 @@ public class ShipConverter : IIncomingConverter , IItemBasicAppService itemBasicAppService , IItemPackAppService itemPackAppService , ILogger logger, - IConfiguration configuration + IConfiguration configuration, + IIncomingFromExternalManager incomingFromExternalManager ) { + _incomingFromExternalManager = incomingFromExternalManager; _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; _itemBasicAppService = itemBasicAppService; @@ -54,6 +57,8 @@ public class ShipConverter : IIncomingConverter var purchaseLabelList = BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList); await _incomingToWmsManager.CreateManyAsync(purchaseLabelList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); } private List BuildIncomingToWmsOfPurchaseLabelAsync(List incomingFromExternalList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs index 2d022b184..08f4dcb13 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs @@ -32,7 +32,8 @@ public class ShipReader : IReader public virtual async Task> ReadAsync() { //从EOS读取待处理Ship - var toBeProcessedShips = await _shipManager.GetToBeProcessedListAsync().ConfigureAwait(false); + var aa = await _shipManager.GetToBeProcessedListAsync().ConfigureAwait(false); + var toBeProcessedShips = aa.Take(5).ToList(); if (!toBeProcessedShips.Any()) { _logger.LogInformation("no ships"); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs index fa3c734ab..791c8ae4f 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs @@ -35,7 +35,7 @@ public class ArriveConverter : IOutgoingConverter { var outgoingToExternalList = new List(); - var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReceipt, EnumSystemType.SCP).ConfigureAwait(false); + var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReceipt, EnumSystemType.EOS).ConfigureAwait(false); foreach (var outgoingFromWms in outgoingFromWmsList) { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs index 3d762fccf..cef94089a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs @@ -35,7 +35,7 @@ public class ReturnConverter : IOutgoingConverter { var outgoingToExternalList = new List(); - var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReturn, EnumSystemType.SCP).ConfigureAwait(false); + var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReturn, EnumSystemType.EOS).ConfigureAwait(false); foreach (var outgoingFromWms in outgoingFromWmsList) { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomReader.cs index 244367485..d5e6072ef 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomReader.cs @@ -99,6 +99,7 @@ public class BomReader : IReader SourceSystem = EnumSystemType.ERP.ToString(), SourceDataId = bom.mes_bom_assy.ToString(), SourceDataDetailCode = bom.mes_bom_part.ToString(), + SourceDataGroupCode = bom.mes_bom_part.ToString(), SourceDataContent = JsonSerializer.Serialize(bom), WriteTime = DateTime.Now, Writer = nameof(TyrpIncomingBackgroundWorker), @@ -114,8 +115,8 @@ public class BomReader : IReader { Product = bom.mes_bom_assy, Component = bom.mes_bom_part, - BeginTime = DateTime.ParseExact(bom.mes_bom_chg_e, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture), - EndTime = DateTime.ParseExact(bom.mes_bom_chg_b, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture), + BeginTime = DateTime.ParseExact(bom.mes_bom_chg_b, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture), + EndTime = DateTime.ParseExact(bom.mes_bom_chg_e, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture), ComponentQty = bom.mes_bom_qty }; diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs index d439e1103..86e20cdf5 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs @@ -59,13 +59,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase common.updatedt = DateTime.Now; common.isupdate = false; - Logger.LogInformation($"Read ItemBasic");//零件 - var itemBasicReader = workerContext.ServiceProvider.GetRequiredService(); - var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保存itemBasic - var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false); - //转换itemBasic - await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); + //Logger.LogInformation($"Read ItemBasic");//零件 + //var itemBasicReader = workerContext.ServiceProvider.GetRequiredService(); + //var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService(); + ////读取并保存itemBasic + //var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false); + ////转换itemBasic + //await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); //Logger.LogInformation($"Read User");//用户和部门 //var userReader = workerContext.ServiceProvider.GetRequiredService(); @@ -80,13 +80,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase ////转换department //await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false); - Logger.LogInformation($"Read InterfaceCalendar");//账期 - var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService(); - var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保存InterfaceCalendar - var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false); - //转换InterfaceCalendar - await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false); + //Logger.LogInformation($"Read InterfaceCalendar");//账期 + //var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService(); + //var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService(); + ////读取并保存InterfaceCalendar + //var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false); + ////转换InterfaceCalendar + //await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false); //Logger.LogInformation($"Read Dict");//系统代码 //var dictReader = workerContext.ServiceProvider.GetRequiredService(); @@ -96,13 +96,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase ////转换Dict //await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); - //Logger.LogInformation($"Read Bom"); - //var BomReader = workerContext.ServiceProvider.GetRequiredService(); - //var BomConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存Bom - //var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false); - ////转换Bom - //await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read Bom"); + var BomReader = workerContext.ServiceProvider.GetRequiredService(); + var BomConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存Bom + var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false); + //转换Bom + await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false); //Logger.LogInformation($"Read Supplier");//供应商 //var SupplierReader = workerContext.ServiceProvider.GetRequiredService(); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs index a03c11235..6ed8f0f61 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text.Json; using System.Threading.Tasks; +using Volo.Abp.Uow; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; using Win_in.Sfs.Wms.DataExchange.Domain.Shared; @@ -25,11 +26,12 @@ public class ScontrolWriter : IWriter /// public virtual async Task WriteAsync(List outgoingDataList) { - var dataInterfaceList = new List(); - var dataInterfaceDetailList = new List(); + var groups = outgoingDataList.GroupBy(r => r.SourceDataGroupCode); foreach (var group in groups) { + var dataInterfaceList = new List(); + var dataInterfaceDetailList = new List(); var entitys = group.ToList(); foreach (var entity in entitys) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs index c6203238d..12fc07dd8 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs @@ -27,11 +27,11 @@ public class WmsoutmWriter : IWriter /// public virtual async Task WriteAsync(List outgoingDataList) { - var dataInterfaceList = new List(); - var dataInterfaceDetailList = new List(); var groups = outgoingDataList.GroupBy(r => r.SourceDataGroupCode); foreach (var group in groups) { + var dataInterfaceList = new List(); + var dataInterfaceDetailList = new List(); var entitys = group.ToList(); foreach (var entity in entitys) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs index b982f9002..3679cc757 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs @@ -173,7 +173,7 @@ public class TyrpAgentModule : AbpModule { context.AddBackgroundWorkerAsync(); - // context.AddBackgroundWorker(); + //context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json index 39797ae0f..5ae655400 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json @@ -26,13 +26,13 @@ "RemoteServices": { "BaseData": { - "BaseUrl": "http://dev.ccwin-in.com:59094/" + "BaseUrl": "http://dev.ccwin-in.com:21294/" }, "Store": { - "BaseUrl": "http://dev.ccwin-in.com:59095/" + "BaseUrl": "http://dev.ccwin-in.com:21295/" }, "Label": { - "BaseUrl": "http://dev.ccwin-in.com:59092/" + "BaseUrl": "http://dev.ccwin-in.com:21292/" }, "Auth": { "BaseUrl": "http://dev.ccwin-in.com:21293/" diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs index a4efd96ae..c61e2db2d 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs @@ -150,6 +150,6 @@ public class AgentModule : AbpModule ApplicationInitializationContext context) { context.AddBackgroundWorkerAsync(); - // context.AddBackgroundWorker(); + // context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumSystemType.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumSystemType.cs index 0915e430b..e658b46b2 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumSystemType.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumSystemType.cs @@ -12,5 +12,6 @@ public enum EnumSystemType MES = 3, JIS = 4, QMS = 5, + EOS= 6, } From ee94377aa76134e533bd00933c15386e07bbcfa6 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Wed, 12 Apr 2023 20:21:47 +0800 Subject: [PATCH 07/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=8A=A5=E5=BA=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...FrameworkCore.SqlServer.StoreDbContext.sql | 1 + .../Enums/Inventory/EnumTransSubType.cs | 6 + .../Enums/Store/EnumScrapType.cs | 10 +- .../DTOs/SfsJobRecommendFromDetailDTOBase.cs | 7 +- .../Inputs/ScrapRequestImportInput.cs | 15 +- .../PurchaseReturnRequestAppService.cs | 270 +++++++----------- .../ScrapRequests/ScrapRequestAppService.cs | 22 +- .../PurchaseReturnJobs/PurchaseReturnJob.cs | 6 +- .../PurchaseReturnJobManager.cs | 8 +- .../Jobs/DeliverJobAutoMapperProfile.cs | 1 + .../Requests/DeliverRequestMapperProfile.cs | 1 + .../PurchaseReturnRequestAutoMapperProfile.cs | 2 +- .../PurchaseReturnRequestEventHandler.cs | 63 +++- 13 files changed, 229 insertions(+), 183 deletions(-) diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql index 97de80e01..a817dc41d 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql @@ -700,6 +700,7 @@ CREATE TABLE [Store_DeliverNote] ( [DeliverTime] datetime2 NOT NULL, [DeliverRequestNumber] nvarchar(max) NULL, [DeliverRequestType] nvarchar(64) NOT NULL, + [CountPrint] int NOT NULL, [ExtraProperties] nvarchar(max) NULL, [ConcurrencyStamp] nvarchar(40) NULL, [CreationTime] datetime2 NOT NULL, 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 c28220728..f99e6672e 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 @@ -85,6 +85,12 @@ public enum EnumTransSubType [Display(Name = "人工报废")] Scrap_Manual = 3601, + /// + /// 完工报废 + /// + [Display(Name = "完工报废")] + Scrap_Product = 3604, + /// /// 线边调整 /// diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumScrapType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumScrapType.cs index 28e91741f..87dfc09eb 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumScrapType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumScrapType.cs @@ -5,9 +5,9 @@ namespace Win_in.Sfs.Shared.Domain.Shared; public enum EnumScrapType { /// - /// 人工报废 + /// 人工报废(原料报废) /// - [Display(Name = "人工报废")] + [Display(Name = "人工报废(原料报废)")] Scrap_Manual = 3601, /// @@ -15,4 +15,10 @@ public enum EnumScrapType /// [Display(Name = "线边报废")] Scrap_WIP = 3603, + + /// + /// 完工报废 + /// + [Display(Name = "完工报废")] + Scrap_Product = 3604, } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsJobRecommendFromDetailDTOBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsJobRecommendFromDetailDTOBase.cs index e53cb5aee..e2161239f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsJobRecommendFromDetailDTOBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsJobRecommendFromDetailDTOBase.cs @@ -220,10 +220,13 @@ public abstract class SfsJobRecommendFromDetailDTOBase HandledProduceDate = RecommendProduceDate; HandledExpireDate = RecommendExpireDate; HandledLot = RecommendLot; + HandledQty = RecommendQty; + HandledFromLocationCode = RecommendFromLocationCode; HandledFromLocationErpCode = RecommendFromLocationErpCode; - - HandledQty = RecommendQty; + HandledFromLocationArea= RecommendFromLocationArea; + HandledFromWarehouseCode= RecommendFromWarehouseCode; + HandledFromLocationGroup = RecommendFromLocationGroup; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ScrapRequests/Inputs/ScrapRequestImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ScrapRequests/Inputs/ScrapRequestImportInput.cs index e2331a47f..85191a64c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ScrapRequests/Inputs/ScrapRequestImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ScrapRequests/Inputs/ScrapRequestImportInput.cs @@ -1,4 +1,6 @@ using System.ComponentModel.DataAnnotations; +using DocumentFormat.OpenXml.Wordprocessing; +using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -7,11 +9,16 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts; public class ScrapRequestImportInput : SfsStoreImportInputBase { /// - /// 类型 + /// 报废类型 /// - [Display(Name = "类型")] - [Required] - public EnumScrapType Type { get; set; } + [Display(Name = "报废类型")] + [Required(ErrorMessage = "{0}是必填项")] + [ImporterHeader(Name = "报废类型")] + [ExporterHeader(DisplayName = "报废类型")] + [ValueMapping("线边报废", EnumTransSubType.Scrap_WIP)] + [ValueMapping("原料报废", EnumTransSubType.Scrap_Manual)] + [ValueMapping("完工报废", EnumTransSubType.Scrap_Product)] + public string Type { get; set; } /// /// 物料代码 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs index 1f997794c..11691171d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs @@ -6,7 +6,9 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; +using Volo.Abp.Domain.Entities; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Label.Domain; @@ -14,6 +16,7 @@ using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Inventory.Application.Contracts; +using Win_in.Sfs.Wms.Inventory.Domain; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -30,18 +33,22 @@ public class PurchaseReturnRequestAppService : SfsStoreRequestAppServiceBase , IPurchaseReturnRequestAppService { - private readonly IPurchaseReturnRequestManager _purchaseReturnRequestManager; - private readonly IInventoryLabelAppService _inventoryLabelApp; + private readonly ILocationAppService _locationAppService; + private readonly ITransactionTypeAppService _transactionTypeAppService; + private readonly IPurchaseReturnRequestManager _purchaseReturnRequestManager; public PurchaseReturnRequestAppService( IPurchaseReturnRequestRepository repository, IPurchaseReturnRequestManager purchaseReturnRequestManager, - IInventoryLabelAppService inventoryLabelApp - ) : base(repository, purchaseReturnRequestManager) + IInventoryLabelAppService inventoryLabelApp, + ILocationAppService locationAppService, + ITransactionTypeAppService transactionTypeAppService) : base(repository, purchaseReturnRequestManager) { _purchaseReturnRequestManager = purchaseReturnRequestManager; - this._inventoryLabelApp = inventoryLabelApp; + _inventoryLabelApp = inventoryLabelApp; + _locationAppService = locationAppService; + _transactionTypeAppService = transactionTypeAppService; base.CreatePolicyName = PurchaseReturnRequestPermissions.Create; base.UpdatePolicyName = PurchaseReturnRequestPermissions.Update; @@ -55,6 +62,102 @@ public class PurchaseReturnRequestAppService : throw new NotImplementedException(); } + #region 东阳 + + protected override async Task> ImportProcessingEntityAsync(Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var purchaseReturnRequest in addList) + { + await SetRequestAutoPropertiesAsync(purchaseReturnRequest).ConfigureAwait(false); + purchaseReturnRequest.Worker = CurrentUser.GetUserName(); + purchaseReturnRequest.CreatorId = CurrentUser.Id; + + foreach (var detail in purchaseReturnRequest.Details) + { + //通过箱标签 查找标签服务 构造其他字段 + var labelDto = await _inventoryLabelApp.GetByCodeAsync(detail.PackingCode).ConfigureAwait(false); + var balanceDto = await BalanceAclService.GetByPackingCodeAsync(detail.PackingCode).ConfigureAwait(false); + var locationDto= await _locationAppService.GetByCodeAsync(balanceDto.LocationCode).ConfigureAwait(false); + purchaseReturnRequest.AsnNumber = labelDto.AsnNumber; + purchaseReturnRequest.RpNumber = labelDto.RpNumber; + purchaseReturnRequest.ReturnTime=DateTime.Now; + purchaseReturnRequest.SupplierCode= labelDto.SupplierCode; + purchaseReturnRequest.ReturnType = EnumPurchaseReturnType.AfterPuton; + purchaseReturnRequest.PoNumber = labelDto.PoNumber; + await SetDetailPropertiesAsync(detail, labelDto, balanceDto,locationDto).ConfigureAwait(false); + } + } + + return dictionary; + } + + /// + /// 赋值Request业务属性 + /// + /// + /// + private async Task SetRequestAutoPropertiesAsync(PurchaseReturnRequest entity) + { + var tranType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.PurchaseReturn, EnumTransSubType.None).ConfigureAwait(false); + + Check.NotNull(tranType, "事务类型", "事务类型不存在"); + + entity.AutoCompleteJob = tranType.AutoCompleteJob; + entity.AutoSubmit = tranType.AutoSubmitRequest; + entity.AutoAgree = tranType.AutoAgreeRequest; + entity.AutoHandle = tranType.AutoHandleRequest; + entity.DirectCreateNote = tranType.DirectCreateNote; + } + + /// + /// 赋值详情 + /// + /// + /// + /// + private async Task SetDetailPropertiesAsync( + PurchaseReturnRequestDetail detail, + InventoryLabelDto labelDto, + BalanceDTO balanceDto, + LocationDTO locationDto) + { + if (labelDto != null) + { + detail.PoNumber = labelDto.PoNumber; + } + + if (balanceDto != null) + { + detail.PackingCode = balanceDto.PackingCode; + detail.ContainerCode = balanceDto.ContainerCode; + + detail.WarehouseCode = locationDto.WarehouseCode; + detail.LocationCode = balanceDto.LocationCode; + detail.LocationErpCode = locationDto.ErpLocationCode; + detail.LocationArea = locationDto.AreaCode; + detail.LocationGroup = locationDto.LocationGroupCode; + + detail.Status = balanceDto.Status; + detail.Lot = balanceDto.Lot; + detail.SupplierBatch = balanceDto.SupplierBatch; + detail.Uom = balanceDto.Uom; + detail.ArriveDate = balanceDto.ArriveDate; + detail.ProduceDate = balanceDto.ProduceDate; + detail.ExpireDate = balanceDto.ExpireDate; + detail.ItemName = balanceDto.ItemName; + detail.ItemDesc1 = balanceDto.ItemDesc1; + detail.ItemDesc2 = balanceDto.ItemDesc2; + detail.StdPackQty = balanceDto.StdPackQty; + detail.Qty = balanceDto.Qty; + } + } + + #endregion + + #region 校验 + protected virtual async Task CheckImportInputBusinessAsync(PurchaseReturnRequestImportInput importInput, EnumImportMethod importMethod, List validationRresult) { //await base.CheckImportInputBusinessAsync(importInput, importMethod); @@ -140,162 +243,6 @@ public class PurchaseReturnRequestAppService : return transactionType; } - protected virtual async Task ImportDataAsync(List entites, List deleteEntities) - { - await _purchaseReturnRequestManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); - } - - protected override Func GetEntityExpression() - { - return p => (1); - } - - protected virtual async Task<(List entites, List deleteEntities)> BuildImportDataAsync(ImportResult importResult, EnumImportMethod importMethod = EnumImportMethod.Update, bool isAllowPartImport = false) - { - if (importResult.Data.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) - { - if (!isAllowPartImport) - { - return (null, null); - } - } - - var entites = new List(); - - var details = new List(); - - var deleteEntites = new List(); - - var entityExpression = GetEntityExpression(); - - var groupList = importResult.Data.ToList().GroupBy(entityExpression).Distinct().ToList(); - - foreach (var group in groupList) - { - var input = group.FirstOrDefault(); - - var inputDetails = group.ToList(); - - if (!inputDetails.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) - { - var exist = await GetEntityAsync(input).ConfigureAwait(false); - - var entity = ObjectMapper.Map(input); - - await SetEntityPropertiesAsync(entity, input).ConfigureAwait(false); - - switch (importMethod) - { - case EnumImportMethod.Update: - if (exist != null) - { - entity.SetId(exist.Id); - } - break; - case EnumImportMethod.Replace: - if (exist != null) - { - deleteEntites.Add(exist); - } - break; - } - - foreach (var inputDetail in inputDetails) - { - var detail = ObjectMapper.Map(inputDetail); - - detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number); - - await SetDetailPropertiesAsync(detail, inputDetail).ConfigureAwait(false); - entity.AddDetail(detail); - } - - entites.Add(entity); - } - } - - return (entites, deleteEntites); - } - - private async Task SetDetailPropertiesAsync( - PurchaseReturnRequestDetail detail, - PurchaseReturnRequestImportInput input) - { - //通过箱标签 查找标签服务 构造其他字段 - - var label = await _inventoryLabelApp.GetByCodeAsync(input.PackingCode).ConfigureAwait(false); - - if (label != null) - { - detail.PoNumber = label.PoNumber; - } - - var balance = await BalanceAclService.GetByPackingCodeAsync(input.PackingCode).ConfigureAwait(false); - - if (balance != null) - { - detail.PackingCode = balance.PackingCode; - detail.ContainerCode = balance.ContainerCode; - detail.LocationCode = balance.LocationCode; - detail.LocationErpCode = balance.LocationErpCode; - detail.WarehouseCode = balance.WarehouseCode; - detail.Status = balance.Status; - detail.Lot = balance.Lot; - detail.SupplierBatch = balance.SupplierBatch; - detail.ArriveDate = balance.ArriveDate; - detail.ProduceDate = balance.ProduceDate; - detail.ExpireDate = balance.ExpireDate; - detail.ItemName = balance.ItemName; - detail.ItemDesc1 = balance.ItemDesc1; - detail.ItemDesc2 = balance.ItemDesc2; - detail.StdPackQty = balance.StdPackQty; - - detail.Qty = balance.Qty; - } - } - - private async Task SetEntityPropertiesAsync(PurchaseReturnRequest entity, PurchaseReturnRequestImportInput input) - { - entity.Worker = CurrentUser.GetUserName(); - - //通过箱标签 查找标签服务 构造其他字段 - - var label = await _inventoryLabelApp.GetByCodeAsync(input.PackingCode).ConfigureAwait(false); - - Check.NotNull(label, nameof(InventoryLabel)); - - entity.RpNumber = label.RpNumber; - entity.AsnNumber = label.AsnNumber; - entity.PoNumber = label.PoNumber; - - var balance = await BalanceAclService.GetByPackingCodeAsync(input.PackingCode).ConfigureAwait(false); - - Check.NotNull(balance, nameof(BalanceDTO)); - - //var order = await this._orderAppService.GetByNumberAsync(label.PoNumber); - - //Check.NotNull(order, nameof(PurchaseOrder)); - - entity.SupplierCode = label.SupplierCode; - - entity.ReturnTime = DateTime.Now; - - await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false); - } - - private async Task SetRequestAutoPropertiesAsync(PurchaseReturnRequest entity) - { - var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.PurchaseReturn, EnumTransSubType.None).ConfigureAwait(false); - - Check.NotNull(tranType, "事务类型", "事务类型不存在"); - - entity.AutoCompleteJob = tranType.AutoCompleteJob; - entity.AutoSubmit = tranType.AutoSubmitRequest; - entity.AutoAgree = tranType.AutoAgreeRequest; - entity.AutoHandle = tranType.AutoHandleRequest; - entity.DirectCreateNote = tranType.DirectCreateNote; - } - /// /// 被 TransactionTypeHelper.CheckTransactionType()取代 /// @@ -375,4 +322,5 @@ public class PurchaseReturnRequestAppService : } + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs index 2c81b848c..be7623764 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs @@ -66,11 +66,27 @@ public class ScrapRequestAppService : SfsStoreRequestAppServiceBase { scrapRequest.CreatorId = CurrentUser.Id; scrapRequest.Worker = CurrentUser.Name; - - scrapRequest.Type = EnumTransSubType.Scrap_WIP.ToString(); scrapRequest.ActiveDate = DateTime.Now; + scrapRequest.Type = scrapRequest.Type; + + EnumTransSubType enumTransSubType = 0; + + if (scrapRequest.Type == "原料报废") + { + enumTransSubType = EnumTransSubType.Scrap_Manual; + } + + if (scrapRequest.Type== "线边报废") + { + enumTransSubType = EnumTransSubType.Scrap_WIP; + } + + if (scrapRequest.Type == "完工报废") + { + enumTransSubType = EnumTransSubType.Scrap_Product; + } - await SetEntityPropertiesAsync(scrapRequest, EnumTransSubType.Scrap_WIP).ConfigureAwait(false); + await SetEntityPropertiesAsync(scrapRequest, enumTransSubType).ConfigureAwait(false); foreach (var detail in scrapRequest.Details) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReturnJobs/PurchaseReturnJob.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReturnJobs/PurchaseReturnJob.cs index 8749782e5..03978c7a8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReturnJobs/PurchaseReturnJob.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReturnJobs/PurchaseReturnJob.cs @@ -78,14 +78,18 @@ public class PurchaseReturnJob : SfsJobAggregateRootBase /// /// - public virtual async Task SetDetail(Guid id, string handledLocationCode, string handledLocationErpCode, string handledWarehouseCode, decimal handledQty, + public virtual async Task SetDetail(Guid id, string handledLocationCode, string handledLocationErpCode, string handledWarehouseCode,string handledFromLocationArea,string handledFromLocationGroup, decimal handledQty, string handledSupplierBatch, DateTime handledArriveDate, DateTime handledProduceDate, DateTime handledExpireDate, string handledContainerCode, string handledLot, string handledPackingCode, string reason) { var detail = GetDetail(id); detail.HandledFromLocationCode = handledLocationCode; detail.HandledFromLocationErpCode = handledLocationErpCode; + detail.HandledFromLocationArea = handledFromLocationArea; detail.HandledFromWarehouseCode = handledWarehouseCode; + detail.HandledFromLocationGroup = handledFromLocationGroup; + detail.HandledQty = handledQty; + detail.HandledSupplierBatch = handledSupplierBatch; detail.HandledArriveDate = handledArriveDate; detail.HandledProduceDate = handledProduceDate; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReturnJobs/PurchaseReturnJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReturnJobs/PurchaseReturnJobManager.cs index 081df3087..c375cbcfd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReturnJobs/PurchaseReturnJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReturnJobs/PurchaseReturnJobManager.cs @@ -35,13 +35,19 @@ public class PurchaseReturnJobManager : SfsJobManagerBase p.Id == detail.Id); await entity.SetDetail( detail.Id, detail.HandledFromLocationCode, detail.HandledFromLocationErpCode, detail.HandledFromWarehouseCode, + detail.HandledFromLocationArea, + detail.HandledFromLocationGroup, detail.HandledQty, - detail.HandledSupplierBatch, detail.HandledArriveDate, detail.HandledProduceDate, detail.HandledExpireDate, + detail.HandledSupplierBatch, + detail.HandledArriveDate, + detail.HandledProduceDate, + detail.HandledExpireDate, detail.HandledContainerCode, detail.HandledLot, detail.HandledPackingCode, diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/DeliverJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/DeliverJobAutoMapperProfile.cs index 0622a13c0..065cc9c81 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/DeliverJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/DeliverJobAutoMapperProfile.cs @@ -18,6 +18,7 @@ public partial class StoreEventAutoMapperProfile : Profile .ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number)) .ForMember(x => x.ActiveDate, y => y.MapFrom(d => DateTime.Now)) .ForMember(x => x.Worker, y => y.MapFrom(d => d.CompleteUserName)) + .Ignore(x=>x.CountPrint) ; CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/DeliverRequestMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/DeliverRequestMapperProfile.cs index 8cc67eb37..5dbb2df1b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/DeliverRequestMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/DeliverRequestMapperProfile.cs @@ -72,6 +72,7 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .ForMember(x => x.DeliverRequestNumber, y => y.MapFrom(d => d.Number)).Ignore(x => x.JobNumber) + .Ignore(x=>x.CountPrint) .Ignore(x => x.Details); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/PurchaseReturnRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/PurchaseReturnRequestAutoMapperProfile.cs index bbe21a42e..19215afb5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/PurchaseReturnRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/PurchaseReturnRequestAutoMapperProfile.cs @@ -15,7 +15,7 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .ForMember(x => x.PurchaseReturnRequestNumber, y => y.MapFrom(d => d.Number)) - .Ignore(x => x.WarehouseCode) + .Ignore(x=>x.WarehouseCode) .Ignore(x => x.IsAutoComplete) .Ignore(x => x.JobType) .Ignore(x => x.JobDescription) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/PurchaseReturnRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/PurchaseReturnRequestEventHandler.cs index 00d4f1c96..59d9a65cd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/PurchaseReturnRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/PurchaseReturnRequestEventHandler.cs @@ -13,25 +13,57 @@ public class PurchaseReturnRequestEventHandler : StoreEventHandlerBase , ILocalEventHandler> , ILocalEventHandler> + , ILocalEventHandler> + , ILocalEventHandler>> { private readonly IPurchaseReturnJobAppService _purchaseReturnJobAppService; + private readonly IPurchaseReturnRequestManager _purchaseReturnRequestManager; public PurchaseReturnRequestEventHandler( - IPurchaseReturnJobAppService purchaseReturnJobAppService - ) + IPurchaseReturnJobAppService purchaseReturnJobAppService, + IPurchaseReturnRequestManager purchaseReturnRequestManager) { _purchaseReturnJobAppService = purchaseReturnJobAppService; + _purchaseReturnRequestManager = purchaseReturnRequestManager; } - public virtual async Task HandleEventAsync(SfsHandledEntityEventData eventData) - { - var request = eventData.Entity; - var jobCreateInputs = await BuildPurchaseReturnJobDetailAsync(request).ConfigureAwait(false); + /// + /// 创建后 + /// + /// + /// + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + if (entity.AutoSubmit) + { + await _purchaseReturnRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } - await _purchaseReturnJobAppService.CreateManyAsync(jobCreateInputs).ConfigureAwait(false); + /// + /// 批量创建后 + /// + /// + /// + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + foreach (var entity in entitys) + { + if (entity.AutoSubmit) + { + await _purchaseReturnRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } } + /// + /// 审批后 + /// + /// + /// public virtual async Task HandleEventAsync(SfsAbortedEntityEventData eventData) { var request = eventData.Entity; @@ -39,6 +71,20 @@ public class PurchaseReturnRequestEventHandler await _purchaseReturnJobAppService.CancelByPurchaseReturnRequestAsync(request.Number).ConfigureAwait(false); } + /// + /// 执行后 + /// + /// + /// + public virtual async Task HandleEventAsync(SfsHandledEntityEventData eventData) + { + var request = eventData.Entity; + + var jobCreateInputs = await BuildPurchaseReturnJobDetailAsync(request).ConfigureAwait(false); + + await _purchaseReturnJobAppService.CreateManyAsync(jobCreateInputs).ConfigureAwait(false); + } + #region 私有 private async Task> BuildPurchaseReturnJobDetailAsync(PurchaseReturnRequest request) @@ -50,11 +96,11 @@ public class PurchaseReturnRequestEventHandler foreach (var item in groupBy) { var location = await LocationAclService.GetByCodeAsync(item.Key).ConfigureAwait(false); - if (location != null) { //初始化 var job = ObjectMapper.Map(request); + job.WarehouseCode = location.WarehouseCode; job.JobType = EnumJobType.PurchaseReturnJob; job.JobStatus = EnumJobStatus.Open; @@ -79,4 +125,5 @@ public class PurchaseReturnRequestEventHandler } #endregion + } From 0548f722fb3dbd520c044de71f7a656dd7d52952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Wed, 12 Apr 2023 23:36:55 +0800 Subject: [PATCH 08/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...FrameworkCore.SqlServer.LabelDbContext.sql | 1 + .../MessageApplicationAutoMapperProfile.cs | 7 +- .../MessageTypeSubscribeAutoMapperProfile.cs | 4 +- .../MessageTypeAutoMapperProfile.cs | 4 +- .../UserNotifyMessageAutoMapperProfile.cs | 4 +- .../DTOs/ProductReceiptRequestDTO.cs | 3 +- .../Inputs/ProductReceiptRequestEditInput.cs | 2 +- .../ProductReceiptRequestAppService.cs | 106 ++++++++++++------ .../ProductReceiptRequest.cs | 3 +- 9 files changed, 88 insertions(+), 46 deletions(-) diff --git a/be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.LabelDbContext.sql b/be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.LabelDbContext.sql index 62cc74b72..77c90ba24 100644 --- a/be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.LabelDbContext.sql +++ b/be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.LabelDbContext.sql @@ -49,6 +49,7 @@ CREATE TABLE [Label_InventoryLabel] ( [SupplierSimpleName] nvarchar(max) NULL, [SupplierItemCode] nvarchar(max) NULL, [SupplierItemName] nvarchar(max) NULL, + [PlanArriveDate] datetime2 NOT NULL, [ExtraProperties] nvarchar(max) NULL, [ConcurrencyStamp] nvarchar(40) NULL, [CreationTime] datetime2 NOT NULL, diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs index 2d5b76e71..284277277 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs @@ -2,7 +2,7 @@ using AutoMapper; namespace Win_in.Sfs.Message.Application; -public class MessageApplicationAutoMapperProfile : Profile +public partial class MessageApplicationAutoMapperProfile : Profile { public MessageApplicationAutoMapperProfile() { @@ -10,7 +10,8 @@ public class MessageApplicationAutoMapperProfile : Profile * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - new MessageTypeAutoMapperProfile().MessageTypeAutoMapperProfileConfig(); - new NotifyMessageAutoMapperProfile().NotifyMessageAutoMapperProfileConfig(); + UserNotifyAutoMapperProfile(); + MessageTypeAutoMapperProfile(); + MessageTypeSubscribesAutoMapperProfile(); } } diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs index 6946cb987..d8776f6ae 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs @@ -5,9 +5,9 @@ using Win_in.Sfs.Message.Domain; namespace Win_in.Sfs.Message.Application; -public class MessageTypeSubscribeAutoMapperProfile : Profile +public partial class MessageApplicationAutoMapperProfile : Profile { - public MessageTypeSubscribeAutoMapperProfile() + public void MessageTypeSubscribesAutoMapperProfile() { CreateMap() .IgnoreAuditedObjectProperties() diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs index f0f24b3d9..d602c2108 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs @@ -5,9 +5,9 @@ using Win_in.Sfs.Message.Domain; namespace Win_in.Sfs.Message.Application; -public class MessageTypeAutoMapperProfile : Profile +public partial class MessageApplicationAutoMapperProfile : Profile { - public void MessageTypeAutoMapperProfileConfig() + public void MessageTypeAutoMapperProfile() { CreateMap() .IgnoreAuditedObjectProperties() diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs index 6695cb221..c86fc455e 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs @@ -6,9 +6,9 @@ using Win_in.Sfs.Message.Domain; namespace Win_in.Sfs.Message.Application; -public class UserNotifyMessageAutoMapperProfile : Profile +public partial class MessageApplicationAutoMapperProfile : Profile { - public UserNotifyMessageAutoMapperProfile() + public void UserNotifyAutoMapperProfile() { CreateMap() .IgnoreAuditedObjectProperties() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/DTOs/ProductReceiptRequestDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/DTOs/ProductReceiptRequestDTO.cs index 62ad7ba0b..265f55e52 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/DTOs/ProductReceiptRequestDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/DTOs/ProductReceiptRequestDTO.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -54,6 +55,6 @@ public class ProductReceiptRequestDTO : SfsStoreRequestDTOBase [Display(Name = "类型")] - public string Type { get; set; } + public EnumProductReceiptType Type { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs index f4dd44438..09f948138 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs @@ -70,7 +70,7 @@ public class ProductReceiptRequestEditInput : SfsStoreRequestCreateOrUpdateInput /// 类型 /// [Display(Name = "类型")] - public string Type { get; set; } + public string EnumProductReceiptType { get; set; } /// /// 明细列表 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs index c1aee21d2..46e1e6d0a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp; @@ -25,9 +24,10 @@ namespace Win_in.Sfs.Wms.Store.Application; /// [Authorize] [Route($"{StoreConsts.RootPath}product-receipt-request")] - public class ProductReceiptRequestAppService : - SfsStoreRequestAppServiceBase + SfsStoreRequestAppServiceBase { private readonly IProductReceiptRequestManager _productReceiptRequestManager; @@ -39,14 +39,50 @@ public class ProductReceiptRequestAppService : , IAreaAppService areaApp ) : base(repository, productReceiptRequestManager) { - - this._areaApp = areaApp; + _areaApp = areaApp; _productReceiptRequestManager = productReceiptRequestManager; base.CreatePolicyName = ProductReceiptRequestPermissions.Create; base.UpdatePolicyName = ProductReceiptRequestPermissions.Update; base.DeletePolicyName = ProductReceiptRequestPermissions.Delete; } + #region 东阳 + + /// + /// 设置事务类型 + /// + /// + /// + private async Task SetRequestAutoPropertiesAsync(ProductReceiptRequest entity) + { + var enumTransSubType=EnumTransSubType.None; + switch (entity.Type) + { + case EnumProductReceiptType.ProductReceipt_Manual: + enumTransSubType = EnumTransSubType.ProductReceipt_Manual; + break; + case EnumProductReceiptType.ProductReceipt_WIP: + enumTransSubType = EnumTransSubType.ProductReceipt_WIP; + break; + default: + throw new UserFriendlyException("缴库类型错误"); + } + + var tranType = await TransactionTypeAclService + .GetByTransTypeAsync(EnumTransType.ProductReceipt, enumTransSubType) + .ConfigureAwait(false); + + Check.NotNull(tranType, "事务类型", "事务类型不存在"); + + entity.AutoCompleteJob = tranType.AutoCompleteJob; + entity.AutoSubmit = tranType.AutoSubmitRequest; + entity.AutoAgree = tranType.AutoAgreeRequest; + entity.AutoHandle = tranType.AutoHandleRequest; + entity.DirectCreateNote = tranType.DirectCreateNote; + } + + #endregion + /// /// 新增实体 /// @@ -56,7 +92,6 @@ public class ProductReceiptRequestAppService : //[Authorize(ProductReceiptRequestPermissions.Create)] public override async Task CreateAsync(ProductReceiptRequestEditInput input) { - var entity = ObjectMapper.Map(input); await _productReceiptRequestManager.CreateAsync(entity).ConfigureAwait(false); @@ -79,35 +114,37 @@ public class ProductReceiptRequestAppService : bool includeDetails = false, CancellationToken cancellationToken = default) { - Expression> expression = p => p.Type == type; + Expression> expression = p => p.Type.ToString() == type; if (requestInput.Condition.Filters?.Count > 0) { expression = expression.And(requestInput.Condition.Filters.ToLambda()); } return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount, - requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false); + requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false); } [HttpPost("export-by-type")] public virtual async Task ExportByTypeAsync(SfsExportRequestInput requestInput, string type) { - - Expression> expression = p => p.Type == type; + Expression> expression = p => p.Type.ToString() == type; if (requestInput.Condition.Filters?.Count > 0) { expression = expression.And(requestInput.Condition.Filters.ToLambda()); } - var entities = await _repository.GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount, requestInput.Sorting, true).ConfigureAwait(false); + var entities = await _repository + .GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount, requestInput.Sorting, + true).ConfigureAwait(false); var list = ObjectMapper.Map, List>(entities); return ExportImportService.Export(list, true, "Details"); } - #region Import + #region 校验 - protected virtual async Task CheckImportInputBusinessAsync(ProductReceiptRequestImportInput importInput, EnumImportMethod importMethod, List validationRresult) + protected virtual async Task CheckImportInputBusinessAsync(ProductReceiptRequestImportInput importInput, + EnumImportMethod importMethod, List validationRresult) { //await base.CheckImportInputBusinessAsync(importInput, importMethod); @@ -124,7 +161,8 @@ public class ProductReceiptRequestAppService : //CheckTransactionType(EnumTransInOut.In, transactionType.InInventoryStatuses.FirstOrDefault(), transactionType, itemBasic, location); } - protected async Task CheckItemBasicAsync(ProductReceiptRequestImportInput importInput, List validationRresult) + protected async Task CheckItemBasicAsync(ProductReceiptRequestImportInput importInput, + List validationRresult) { var item = await ItemBasicAclService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false); @@ -132,25 +170,30 @@ public class ProductReceiptRequestAppService : { validationRresult.Add("物品代码", $"物品代码{importInput.ItemCode}不存在"); } + //可以缴入负数 if (importInput.Qty == 0) { validationRresult.Add("数量", $"数量不能等于0"); } + return item; } - protected async Task CheckLocationAsync(ProductReceiptRequestImportInput importInput, List validationRresult) + protected async Task CheckLocationAsync(ProductReceiptRequestImportInput importInput, + List validationRresult) { var location = await LocationAclService.GetByCodeAsync(importInput.LocationCode).ConfigureAwait(false); if (location == null) { validationRresult.Add("调入库位", $"调入库位{importInput.LocationCode}不存在"); } + return location; } - protected async Task CheckAreaAsync(ProductReceiptRequestImportInput importInput, List validationRresult) + protected async Task CheckAreaAsync(ProductReceiptRequestImportInput importInput, + List validationRresult) { var location = await _areaApp.GetByCodeAsync(importInput.RawArea).ConfigureAwait(false); if (location == null) @@ -161,15 +204,18 @@ public class ProductReceiptRequestAppService : protected async Task CheckTransactionTypeAsync(List validationRresult) { - var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.ProductReceipt, EnumTransSubType.None).ConfigureAwait(false); + var transactionType = await TransactionTypeAclService + .GetByTransTypeAsync(EnumTransType.ProductReceipt, EnumTransSubType.None).ConfigureAwait(false); if (transactionType == null) { validationRresult.Add("事务类型", $"{EnumTransType.ProductReceipt.GetDisplayName()}事务类型不存在"); } + return transactionType; } - protected virtual async Task ImportDataAsync(List entites, List deleteEntities) + protected virtual async Task ImportDataAsync(List entites, + List deleteEntities) { await _productReceiptRequestManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); } @@ -179,7 +225,9 @@ public class ProductReceiptRequestAppService : return p => p.Type; } - protected virtual async Task<(List entites, List deleteEntities)> BuildImportDataAsync(ImportResult importResult, EnumImportMethod importMethod = EnumImportMethod.Update, bool isAllowPartImport = false) + protected virtual async Task<(List entites, List deleteEntities)> + BuildImportDataAsync(ImportResult importResult, + EnumImportMethod importMethod = EnumImportMethod.Update, bool isAllowPartImport = false) { if (importResult.Data.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) { @@ -222,6 +270,7 @@ public class ProductReceiptRequestAppService : { entity.SetId(exist.Id); } + break; case EnumImportMethod.Replace: if (exist != null) @@ -235,7 +284,8 @@ public class ProductReceiptRequestAppService : foreach (var inputDetail in inputDetails) { - var detail = ObjectMapper.Map(inputDetail); + var detail = + ObjectMapper.Map(inputDetail); detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number); @@ -250,7 +300,8 @@ public class ProductReceiptRequestAppService : return (entites, deleteEntites); } - private async Task SetDetailPropertiesAsync(ProductReceiptRequestDetail detail, ProductReceiptRequestImportInput input) + private async Task SetDetailPropertiesAsync(ProductReceiptRequestDetail detail, + ProductReceiptRequestImportInput input) { var itemBasic = await ItemBasicAclService.GetByCodeAsync(input.ItemCode).ConfigureAwait(false); @@ -279,18 +330,5 @@ public class ProductReceiptRequestAppService : await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false); } - private async Task SetRequestAutoPropertiesAsync(ProductReceiptRequest entity) - { - var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.ProductReceipt, Enum.Parse(entity.Type)).ConfigureAwait(false); - - Check.NotNull(tranType, "事务类型", "事务类型不存在"); - - entity.AutoCompleteJob = tranType.AutoCompleteJob; - entity.AutoSubmit = tranType.AutoSubmitRequest; - entity.AutoAgree = tranType.AutoAgreeRequest; - entity.AutoHandle = tranType.AutoHandleRequest; - entity.DirectCreateNote = tranType.DirectCreateNote; - } - #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ProductReceiptRequests/ProductReceiptRequest.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ProductReceiptRequests/ProductReceiptRequest.cs index e81b58839..7d9b25646 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ProductReceiptRequests/ProductReceiptRequest.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ProductReceiptRequests/ProductReceiptRequest.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Win_in.Sfs.Shared.Domain.Entities; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Domain; @@ -43,7 +44,7 @@ public class ProductReceiptRequest : SfsStoreRequestAggregateRootBase [IgnoreUpdate] - public string Type { get; set; } + public EnumProductReceiptType Type { get; set; } /// /// 明细列表 From 6afde1379dd11d12cf85a128ccf8eb3ea982bd0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Thu, 13 Apr 2023 01:16:18 +0800 Subject: [PATCH 09/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=AE=8C=E5=B7=A5?= =?UTF-8?q?=E7=BC=B4=E5=BA=93=20=E7=BA=BF=E8=BE=B9=E7=BC=B4=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...FrameworkCore.SqlServer.StoreDbContext.sql | 2 +- .../Enums/Store/EnumProductReceiptType.cs | 4 +- .../ProductReceiptRequestAppService.cs | 226 ++++++++++-------- .../ProductReceiptNoteManager.cs | 75 +++--- ...RequestDbContextModelCreatingExtensions.cs | 2 +- ...RequestDbContextModelCreatingExtensions.cs | 1 - .../Requests/InspectRequestEventHandler.cs | 4 + .../ProductReceiptNoteEventHandler.cs | 18 +- .../ProductReceiptRequestEventHandler.cs | 50 +++- 9 files changed, 243 insertions(+), 139 deletions(-) rename be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/{ => Note}/ProductReceiptNoteEventHandler.cs (70%) diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql index a817dc41d..8cbecdc09 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql @@ -1281,7 +1281,7 @@ CREATE TABLE [Store_ProductReceiptRequest] ( [Shift] nvarchar(64) NULL, [Team] nvarchar(64) NULL, [PlanDate] datetime2 NOT NULL, - [Type] nvarchar(64) NULL, + [Type] nvarchar(64) NOT NULL, [ExtraProperties] nvarchar(max) NULL, [ConcurrencyStamp] nvarchar(40) NULL, [CreationTime] datetime2 NOT NULL, diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumProductReceiptType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumProductReceiptType.cs index da81aec1e..b6c96841d 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumProductReceiptType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumProductReceiptType.cs @@ -5,9 +5,9 @@ namespace Win_in.Sfs.Shared.Domain.Shared; public enum EnumProductReceiptType { /// - /// 人工缴库 + /// 人工缴库(完工缴库) /// - [Display(Name = "人工缴库")] + [Display(Name = "人工缴库(完工缴库)")] ProductReceipt_Manual = 2101, /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs index 46e1e6d0a..5a388cefe 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs @@ -5,10 +5,13 @@ using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; +using DocumentFormat.OpenXml.Office.CustomUI; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; @@ -30,16 +33,20 @@ public class ProductReceiptRequestAppService : SfsStoreRequestInputBase, ProductReceiptRequestImportInput> { private readonly IProductReceiptRequestManager _productReceiptRequestManager; - private readonly IAreaAppService _areaApp; + private readonly IItemBasicAppService _itemBasicAppService; + private readonly ILocationAppService _locationAppService; public ProductReceiptRequestAppService( IProductReceiptRequestRepository repository , IProductReceiptRequestManager productReceiptRequestManager - , IAreaAppService areaApp - ) : base(repository, productReceiptRequestManager) + , IAreaAppService areaApp, + IItemBasicAppService itemBasicAppService, + ILocationAppService locationAppService) : base(repository, productReceiptRequestManager) { _areaApp = areaApp; + _itemBasicAppService = itemBasicAppService; + _locationAppService = locationAppService; _productReceiptRequestManager = productReceiptRequestManager; base.CreatePolicyName = ProductReceiptRequestPermissions.Create; base.UpdatePolicyName = ProductReceiptRequestPermissions.Update; @@ -48,6 +55,61 @@ public class ProductReceiptRequestAppService : #region 东阳 + /// + /// 用来重写 导入数据时可以加工数据 + /// + /// + /// + protected override async Task> ImportProcessingEntityAsync( + Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var productReceiptRequest in addList) + { + productReceiptRequest.Worker = CurrentUser.GetUserName(); + productReceiptRequest.CreatorId = CurrentUser.Id; + + await SetRequestAutoPropertiesAsync(productReceiptRequest).ConfigureAwait(false); + foreach (var detail in productReceiptRequest.Details) + { + await SetDetailPropertiesAsync(detail).ConfigureAwait(false); + } + } + + return dictionary; + } + + /// + /// 赋值详情 + /// + /// + /// + /// + private async Task SetDetailPropertiesAsync(ProductReceiptRequestDetail detail) + { + var itemBasic = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + + if (itemBasic != null) + { + detail.ItemName = itemBasic.Name; + detail.ItemDesc1 = itemBasic.Desc1; + detail.ItemDesc2 = itemBasic.Desc2; + detail.StdPackQty = itemBasic.StdPackQty; + detail.Uom = itemBasic.BasicUom; + } + + var location = await _locationAppService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); + + if (location != null) + { + detail.LocationErpCode = location.ErpLocationCode; + detail.WarehouseCode = location.WarehouseCode; + detail.LocationArea = location.AreaCode; + detail.LocationGroup = location.LocationGroupCode; + } + } + /// /// 设置事务类型 /// @@ -55,7 +117,7 @@ public class ProductReceiptRequestAppService : /// private async Task SetRequestAutoPropertiesAsync(ProductReceiptRequest entity) { - var enumTransSubType=EnumTransSubType.None; + var enumTransSubType = EnumTransSubType.None; switch (entity.Type) { case EnumProductReceiptType.ProductReceipt_Manual: @@ -214,121 +276,97 @@ public class ProductReceiptRequestAppService : return transactionType; } - protected virtual async Task ImportDataAsync(List entites, - List deleteEntities) - { - await _productReceiptRequestManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); - } - protected override Func GetEntityExpression() { return p => p.Type; } - protected virtual async Task<(List entites, List deleteEntities)> - BuildImportDataAsync(ImportResult importResult, - EnumImportMethod importMethod = EnumImportMethod.Update, bool isAllowPartImport = false) - { - if (importResult.Data.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) - { - if (!isAllowPartImport) - { - return (null, null); - } - } + #endregion - var entites = new List(); + //protected virtual async Task ImportDataAsync(List entites, + // List deleteEntities) + //{ + // await _productReceiptRequestManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); + //} + //protected virtual async Task<(List entites, List deleteEntities)> + // BuildImportDataAsync(ImportResult importResult, + // EnumImportMethod importMethod = EnumImportMethod.Update, bool isAllowPartImport = false) + //{ + // if (importResult.Data.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) + // { + // if (!isAllowPartImport) + // { + // return (null, null); + // } + // } - var details = new List(); + // var entites = new List(); - var deleteEntites = new List(); + // var details = new List(); - var entityExpression = GetEntityExpression(); + // var deleteEntites = new List(); - var groupList = importResult.Data.ToList().GroupBy(entityExpression).Distinct().ToList(); + // var entityExpression = GetEntityExpression(); - foreach (var group in groupList) - { - var input = group.FirstOrDefault(); + // var groupList = importResult.Data.ToList().GroupBy(entityExpression).Distinct().ToList(); - var inputDetails = group.ToList(); + // foreach (var group in groupList) + // { + // var input = group.FirstOrDefault(); - if (!inputDetails.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) - { - var exist = await GetEntityAsync(input).ConfigureAwait(false); + // var inputDetails = group.ToList(); - var entity = ObjectMapper.Map(input); + // if (!inputDetails.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) + // { + // var exist = await GetEntityAsync(input).ConfigureAwait(false); - await SetEntityPropertiesAsync(entity, input).ConfigureAwait(false); + // var entity = ObjectMapper.Map(input); - switch (importMethod) - { - case EnumImportMethod.Update: - entity.SetId(exist != null ? exist.Id : GuidGenerator.Create()); + // await SetEntityPropertiesAsync(entity, input).ConfigureAwait(false); - if (exist != null) - { - entity.SetId(exist.Id); - } + // switch (importMethod) + // { + // case EnumImportMethod.Update: + // entity.SetId(exist != null ? exist.Id : GuidGenerator.Create()); - break; - case EnumImportMethod.Replace: - if (exist != null) - { - deleteEntites.Add(exist); - } + // if (exist != null) + // { + // entity.SetId(exist.Id); + // } - entity.SetId(GuidGenerator.Create()); - break; - } + // break; + // case EnumImportMethod.Replace: + // if (exist != null) + // { + // deleteEntites.Add(exist); + // } - foreach (var inputDetail in inputDetails) - { - var detail = - ObjectMapper.Map(inputDetail); + // entity.SetId(GuidGenerator.Create()); + // break; + // } - detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number); + // foreach (var inputDetail in inputDetails) + // { + // var detail = + // ObjectMapper.Map(inputDetail); - await SetDetailPropertiesAsync(detail, input).ConfigureAwait(false); - entity.AddDetail(detail); - } + // detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number); - entites.Add(entity); - } - } + // await SetDetailPropertiesAsync(detail, input).ConfigureAwait(false); + // entity.AddDetail(detail); + // } - return (entites, deleteEntites); - } + // entites.Add(entity); + // } + // } - private async Task SetDetailPropertiesAsync(ProductReceiptRequestDetail detail, - ProductReceiptRequestImportInput input) - { - var itemBasic = await ItemBasicAclService.GetByCodeAsync(input.ItemCode).ConfigureAwait(false); + // return (entites, deleteEntites); + //} - if (itemBasic != null) - { - detail.ItemName = itemBasic.Name; - detail.ItemDesc1 = itemBasic.Desc1; - detail.ItemDesc2 = itemBasic.Desc2; - detail.Qty = input.Qty; - detail.StdPackQty = itemBasic.StdPackQty; - } - - var location = await LocationAclService.GetByCodeAsync(input.LocationCode).ConfigureAwait(false); + //private async Task SetEntityPropertiesAsync(ProductReceiptRequest entity, ProductReceiptRequestImportInput input) + //{ + // entity.Worker = CurrentUser.GetUserName(); - if (location != null) - { - detail.LocationErpCode = location.ErpLocationCode; - detail.WarehouseCode = location.WarehouseCode; - } - } - - private async Task SetEntityPropertiesAsync(ProductReceiptRequest entity, ProductReceiptRequestImportInput input) - { - entity.Worker = CurrentUser.GetUserName(); - - await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false); - } - - #endregion + // await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false); + //} } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs index be4733302..5b6caa107 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs @@ -12,9 +12,12 @@ public class ProductReceiptNoteManager : SfsStoreManagerBase private async Task BackFlushAsync(ProductReceiptNote productReceiptNote) { - //生成【MES】回冲接口 TODO #region 【判断】是否需要记录回冲记录 及下线结算接口 - //【判断】是否需要记录回冲记录 TODO - //【是】 完工收货时,创建回冲记录 + //【是】 完工收货时,创建回冲记录 //var isBackFlush = await SettingManager.IsTrueAsync(StoreSettings.ProductionReceipt.AutoCreateBackFlush); ; //扣原材料 //var isOffLine = await _settingProvider.IsTrueAsync(StoreSettings.ProductionReceipt.AutoCreateOfflineSettlement); ; //下线结算 + + //是否需要下线结算 - //获取所有成品的零件号 - //一次性获得所有BOM信息避免每个明细都查询一遍;false 为bom不展开,便于测试 - var totalBomList = await GetBomListAsync(productReceiptNote).ConfigureAwait(false); + if (isBackFlush || isOffLine) + { + //获取所有成品的零件号 + //一次性获得所有BOM信息避免每个明细都查询一遍;false 为bom不展开,便于测试 + var totalBomList = await GetBomListAsync(productReceiptNote); - //取不到bom信息要报错,不能进行下去 + //取不到bom信息要报错,不能进行下去 - //根据回冲记录获取成品零件种类和数量,并获取相关要消耗的原材料库存 - var productSumList = productReceiptNote.Details.GroupBy(p => new { p.ItemCode, p.RawLocationCode, p.Qty }) - .Select(s => new BackFlushInventoryTotal - { - ItemCode = s.Key.ItemCode, - RawLocationCode = s.Key.RawLocationCode, - Qty = s.Key.Qty, - TotalQty = s.Sum(n => n.Qty), - }).ToList(); - //根据父级零件汇总的数量,获取BOM子表明细原材料的数量 - var subInventoryTotalList = new List(); + //根据回冲记录获取成品零件种类和数量,并获取相关要消耗的原材料库存 + var productSumList = productReceiptNote.Details.GroupBy(p => new { p.ItemCode, p.RawLocationCode, p.Qty }) + .Select(s => new BackFlushInventoryTotal + { + ItemCode = s.Key.ItemCode, + RawLocationCode = s.Key.RawLocationCode, + Qty = s.Key.Qty, + TotalQty = s.Sum(n => n.Qty), + }).ToList(); - foreach (var productSumItem in productSumList) - { - var subBomList = totalBomList.Where(p => p.Product == productSumItem.ItemCode).ToList(); - //根据bom和父级零件总数获取子零件总数,然后将子零件总数汇总进 总零件数量 - await GetSubBackFlushInventoryList(productSumItem, subBomList, subInventoryTotalList).ConfigureAwait(false); - } + //根据父级零件汇总的数量,获取BOM子表明细原材料的数量 + var subInventoryTotalList = new List(); - await _backFlushNoteManager.CreateByProductReceiptNoteAsync(productReceiptNote, subInventoryTotalList) - .ConfigureAwait(false); + foreach (var productSumItem in productSumList) + { + var subBomList = totalBomList.Where(p => p.Product == productSumItem.ItemCode).ToList(); - //【判断】是否需要下线结算 - if (subInventoryTotalList.Any(p => p.IsOffLine == true)) - { - //【是】 创建【下线结算记录】 - await _offlineSettlementNoteManager - .CreateByProductReceiptNoteAsync(productReceiptNote, subInventoryTotalList).ConfigureAwait(false); + //根据bom和父级零件总数获取子零件总数,然后将子零件总数汇总进 总零件数量 + await GetSubBackFlushInventoryList(productSumItem, subBomList, subInventoryTotalList).ConfigureAwait(false); + } + + if (isBackFlush) + { + await _backFlushNoteManager.CreateByProductReceiptNoteAsync(productReceiptNote, subInventoryTotalList).ConfigureAwait(false); + } + //【判断】是否需要下线结算 + if (isOffLine && subInventoryTotalList.Any(p => p.IsOffLine == true)) + { + //【是】 创建【下线结算记录】 + await _offlineSettlementNoteManager.CreateByProductReceiptNoteAsync(productReceiptNote, subInventoryTotalList).ConfigureAwait(false); + + } } #endregion diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ProductReceiptRequests/ProductReceiptRequestDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ProductReceiptRequests/ProductReceiptRequestDbContextModelCreatingExtensions.cs index 366dd9158..9e3184751 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ProductReceiptRequests/ProductReceiptRequestDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ProductReceiptRequests/ProductReceiptRequestDbContextModelCreatingExtensions.cs @@ -23,8 +23,8 @@ public static class ProductReceiptRequestDbContextModelCreatingExtensions b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.NameLength); b.Property(q => q.Shift).HasMaxLength(SfsPropertyConst.NameLength); b.Property(q => q.Team).HasMaxLength(SfsPropertyConst.NameLength); - b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.NameLength); b.Property(q => q.PlanDate); + b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); //Relations diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestDbContextModelCreatingExtensions.cs index 8178b4c88..6ee78be44 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestDbContextModelCreatingExtensions.cs @@ -24,7 +24,6 @@ public static class PurchaseReceiptRequestDbContextModelCreatingExtensions b.Property(q => q.PlanArriveDate).IsRequired(); b.Property(q => q.Number).IsRequired(); b.Property(q => q.TimeWindow).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); - b.Property(q => q.SupplierName).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.AsnNumber).HasMaxLength(SfsPropertyConst.NameLength); b.Property(q => q.RpNumber).HasMaxLength(SfsPropertyConst.NameLength); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/InspectRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/InspectRequestEventHandler.cs index 427044073..0855510ab 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/InspectRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/InspectRequestEventHandler.cs @@ -1,6 +1,7 @@ using System; using System.Threading.Tasks; using Volo.Abp.EventBus; +using Volo.Abp.Uow; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -28,6 +29,7 @@ public class InspectRequestEventHandler : StoreEventHandlerBase /// /// /// + [UnitOfWork] public virtual async Task HandleEventAsync(SfsCancelledEntityEventData eventData) { var entity = eventData.Entity; @@ -39,6 +41,7 @@ public class InspectRequestEventHandler : StoreEventHandlerBase /// /// /// + [UnitOfWork] public virtual async Task HandleEventAsync(SfsAgreedEntityEventData eventData) { await Task.CompletedTask.ConfigureAwait(false); @@ -50,6 +53,7 @@ public class InspectRequestEventHandler : StoreEventHandlerBase /// /// /// + [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { var entity = eventData.Entity; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ProductReceiptNoteEventHandler.cs similarity index 70% rename from be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductReceiptNoteEventHandler.cs rename to be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ProductReceiptNoteEventHandler.cs index 27e909f60..a0af46225 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ProductReceiptNoteEventHandler.cs @@ -18,15 +18,17 @@ public class ProductReceiptNoteEventHandler { private readonly IPutawayJobAppService _putawayJobAppService; - private readonly IProductReceiptRequestAppService _productReceiptRequestApp; + //private readonly IProductReceiptRequestAppService _productReceiptRequestApp; + private readonly IProductReceiptRequestManager _productReceiptRequestManager; public ProductReceiptNoteEventHandler( IPutawayJobAppService putawayJobAppService - , IProductReceiptRequestAppService productReceiptRequestApp - ) + //, IProductReceiptRequestAppService productReceiptRequestApp + , IProductReceiptRequestManager productReceiptRequestManager) { _putawayJobAppService = putawayJobAppService; - _productReceiptRequestApp = productReceiptRequestApp; + //_productReceiptRequestApp = productReceiptRequestApp; + _productReceiptRequestManager = productReceiptRequestManager; } public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) @@ -41,7 +43,9 @@ public class ProductReceiptNoteEventHandler if (!string.IsNullOrEmpty(entity.ProductReceiptRequestNumber)) { - await _productReceiptRequestApp.CompleteByNumberAsync(entity.ProductReceiptRequestNumber).ConfigureAwait(false); + //await _productReceiptRequestApp.CompleteByNumberAsync(entity.ProductReceiptRequestNumber).ConfigureAwait(false); + var productReceiptRequest=await _productReceiptRequestManager.GetByNumberAsync(entity.ProductReceiptRequestNumber).ConfigureAwait(false); + await _productReceiptRequestManager.CompleteAsync(productReceiptRequest).ConfigureAwait(false); } } @@ -64,7 +68,9 @@ public class ProductReceiptNoteEventHandler { if (!string.IsNullOrEmpty(entity.ProductReceiptRequestNumber)) { - await _productReceiptRequestApp.CompleteByNumberAsync(entity.ProductReceiptRequestNumber).ConfigureAwait(false); + //await _productReceiptRequestApp.CompleteByNumberAsync(entity.ProductReceiptRequestNumber).ConfigureAwait(false); + var productReceiptRequest = await _productReceiptRequestManager.GetByNumberAsync(entity.ProductReceiptRequestNumber).ConfigureAwait(false); + await _productReceiptRequestManager.CompleteAsync(productReceiptRequest).ConfigureAwait(false); } } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductReceiptRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductReceiptRequestEventHandler.cs index 1bca59154..e59b18222 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductReceiptRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductReceiptRequestEventHandler.cs @@ -19,22 +19,62 @@ public class ProductReceiptRequestEventHandler : StoreEventHandlerBase , ILocalEventHandler> , ILocalEventHandler> + ,ILocalEventHandler> + , ILocalEventHandler>> { private readonly IProductReceiveJobAppService _productReceiveJobAppService; private readonly IProductionLineAppService _productionLineAppService; private readonly IProductReceiptNoteAppService _productReceiptNoteApp; + private readonly IProductReceiptRequestManager _productReceiptRequestManager; public ProductReceiptRequestEventHandler( IProductReceiveJobAppService productReceiveJobAppService , IProductionLineAppService productionLineAppService , IProductReceiptNoteAppService productReceiptNoteApp - ) + , IProductReceiptRequestManager productReceiptRequestManager) { _productReceiveJobAppService = productReceiveJobAppService; _productionLineAppService = productionLineAppService; this._productReceiptNoteApp = productReceiptNoteApp; + _productReceiptRequestManager = productReceiptRequestManager; } + /// + /// 创建后 + /// + /// Event data + [UnitOfWork] + public async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + if (entity.AutoSubmit) + { + await _productReceiptRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + + /// + /// 批量创建后 + /// + /// Event data + [UnitOfWork] + public async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + foreach (var entity in entitys) + { + if (entity.AutoSubmit) + { + await _productReceiptRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + } + + /// + /// 审批后 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsHandledEntityEventData eventData) { @@ -53,6 +93,11 @@ public class ProductReceiptRequestEventHandler } } + /// + /// 取消后 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsCancelledEntityEventData eventData) { @@ -60,6 +105,7 @@ public class ProductReceiptRequestEventHandler await _productReceiveJobAppService.CancelByProductionPlanAsync(entity.Number).ConfigureAwait(false); } + #region 私有 private async Task> BuildProductReceiveJobsAsync( ProductReceiptRequest productionPlan) { @@ -160,4 +206,6 @@ public class ProductReceiptRequestEventHandler return note; } + + #endregion } From 70e481048f77595297761a260e40c970a5cdad82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Thu, 13 Apr 2023 01:37:55 +0800 Subject: [PATCH 10/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MessageApplicationAutoMapperProfile.cs | 1 + .../MessageTypeSubscribeAutoMapperProfile.cs | 8 ++++++++ .../NotifyMessages/NotifyMessageAutoMapperProfile.cs | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs index 284277277..737aa0ae5 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageApplicationAutoMapperProfile.cs @@ -13,5 +13,6 @@ public partial class MessageApplicationAutoMapperProfile : Profile UserNotifyAutoMapperProfile(); MessageTypeAutoMapperProfile(); MessageTypeSubscribesAutoMapperProfile(); + NotifyMessageAutoMapperProfileConfig(); } } diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs index d8776f6ae..7fedb3bf6 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs @@ -12,5 +12,13 @@ public partial class MessageApplicationAutoMapperProfile : Profile CreateMap() .IgnoreAuditedObjectProperties() .ReverseMap(); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x=>x.Id) + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.TenantId) + .Ignore(x => x.ExtraProperties) + ; } } diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs index 8df3f3732..cfbf6da69 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs @@ -6,7 +6,7 @@ using Win_in.Sfs.Shared.Event; namespace Win_in.Sfs.Message.Application; -public class NotifyMessageAutoMapperProfile : Profile +public partial class MessageApplicationAutoMapperProfile : Profile { public void NotifyMessageAutoMapperProfileConfig() { @@ -30,6 +30,7 @@ public class NotifyMessageAutoMapperProfile : Profile .Ignore(x => x.LastModifierId) .Ignore(x => x.CreationTime) .Ignore(x => x.CreatorId) + .Ignore(x=>x.Id) ; } } From f0772501b19f66834bc0fed278af7f9eebb39d8d Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Thu, 13 Apr 2023 15:11:04 +0800 Subject: [PATCH 11/41] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Plans/IPlanRepository.cs | 6 + .../Plans/PlanManager.cs | 5 +- .../Plans/PlanEfCoreRepository.cs | 27 ++++ .../EosAgentModule.cs | 4 +- .../FawtygAutoMapperProfile.cs | 8 ++ .../Incoming/EosIncomingBackgroundWorker.cs | 28 ++--- .../Incoming/ProductConverter.cs | 1 + .../Incoming/ShipReader.cs | 3 +- .../Incoming/IssueConverter.cs | 8 +- .../Incoming/MesOutConverter.cs | 7 +- .../Incoming/PullTaskConverter.cs | 7 +- .../Incoming/ScrapConverter.cs | 9 +- .../Incoming/BackFluConverter.cs | 6 + .../Incoming/BomConverter.cs | 8 +- .../Incoming/CustomerConverter.cs | 8 ++ .../Incoming/DepartmentConverter.cs | 7 +- .../Incoming/DictConverter.cs | 7 +- .../Incoming/DictpjReader.cs | 5 + .../Incoming/InterfaceCalendarConverter.cs | 7 +- .../Incoming/ItemBasicConverter.cs | 7 +- .../Incoming/SupplierConverter.cs | 7 +- .../Incoming/TyrpIncomingBackgroundWorker.cs | 118 +++++++++--------- .../Incoming/UserConverter.cs | 7 +- .../Outgoing/TyrpOutgoingBackgroundWorker.cs | 8 +- .../TyrpAgentModule.cs | 2 +- .../AgentModule.cs | 4 +- ...IArchivedIncomingFromExternalRepository.cs | 3 +- .../IIncomingFromExternalManager.cs | 1 + .../IncomingFromExternalManager.cs | 8 ++ .../Repositories/ISfsBulkRepositoryBase.cs | 1 + .../SfsEfCoreRepositoryBase.cs | 18 +++ 31 files changed, 244 insertions(+), 101 deletions(-) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/IPlanRepository.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/IPlanRepository.cs index 9ae8c6722..07a12a26e 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/IPlanRepository.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/IPlanRepository.cs @@ -1,7 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using EFCore.BulkExtensions; using Volo.Abp.Domain.Repositories; namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; public interface IPlanRepository : IRepository { + Task BulkUpdateAsync(IList entities, BulkConfig bulkConfig = null, Action progress = null, Type type = null, CancellationToken cancellationToken = default); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/PlanManager.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/PlanManager.cs index 5218f8d7f..eaceb8c69 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/PlanManager.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/PlanManager.cs @@ -1,6 +1,8 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Services; namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; @@ -16,6 +18,7 @@ public class PlanManager : DomainService, IPlanManager public virtual async Task> GetToBeProcessedListAsync() { var plans = await _repository.GetListAsync(p => p.WmsState == 0).ConfigureAwait(false); + return plans; } @@ -29,6 +32,6 @@ public class PlanManager : DomainService, IPlanManager p.WmsState = 1; p.WmsDate = Clock.Now; }); - await _repository.UpdateManyAsync(plans).ConfigureAwait(false); + await _repository.BulkUpdateAsync(plans).ConfigureAwait(false); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanEfCoreRepository.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanEfCoreRepository.cs index bf94069f8..1de1f27a4 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanEfCoreRepository.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanEfCoreRepository.cs @@ -1,5 +1,12 @@ +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; +using System.Collections.Generic; +using System.Threading.Tasks; +using System.Threading; +using System; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos.EOS; @@ -9,5 +16,25 @@ public class PlanEfCoreRepository : EfCoreRepository dbContextProvider) : base(dbContextProvider) { + + } + + /// + /// 批量更新数据 + /// + /// + /// + /// + /// + /// + /// + public virtual async Task BulkUpdateAsync(IList entities, BulkConfig bulkConfig = null, Action progress = null, Type type = null, CancellationToken cancellationToken = default(CancellationToken)) + { + var context = (await GetDbContextAsync().ConfigureAwait(false)) as DbContext; + + if (entities != null && entities.Count > 0) + { + await context.BulkUpdateAsync(entities, bulkConfig, progress, type, cancellationToken).ConfigureAwait(false); + } } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs index 6dc625d8e..86d84862a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs @@ -165,8 +165,8 @@ public class EosAgentModule : AbpModule ApplicationInitializationContext context) { - //context.AddBackgroundWorkerAsync(); - context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); + // context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs index e8d82e3fa..5cdb32ef2 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs @@ -1,6 +1,7 @@ using AutoMapper; using Volo.Abp.AutoMapper; using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Label.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain; @@ -102,5 +103,12 @@ public class FawtygAutoMapperProfile : Profile .ForMember(x => x.Version, y => y.MapFrom(d => d.Remark)) .ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => d.PackQty)) .ForMember(x => x.SupplierPackUom, y => y.MapFrom(d => d.PackUom)); + + + CreateMap() + .IgnoreAuditedObjectProperties() + //.ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => new UomQty(d.SupplierPackUom, d.SupplierPackQty))) + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Id); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs index acb6851bf..fb385c471 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs @@ -43,21 +43,21 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase //转换Plan await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false); - Logger.LogInformation($"Read Ship"); - var shipHandleService = workerContext.ServiceProvider.GetRequiredService(); - var shipConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保持Ship - var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false); - //转换Ship - await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); + // Logger.LogInformation($"Read Ship"); + // var shipHandleService = workerContext.ServiceProvider.GetRequiredService(); + // var shipConverter = workerContext.ServiceProvider.GetRequiredService(); + // //读取并保持Ship + // var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false); + // //转换Ship + // await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); - Logger.LogInformation($"Read Product"); - var productHandleService = workerContext.ServiceProvider.GetRequiredService(); - var productConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保持Product - var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); - //转换Product - await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); + // Logger.LogInformation($"Read Product"); + // var productHandleService = workerContext.ServiceProvider.GetRequiredService(); + // var productConverter = workerContext.ServiceProvider.GetRequiredService(); + // //读取并保持Product + // var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); + //// 转换Product + // await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); Logger.LogInformation($"Completed: Handling {Incoming}"); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs index 945ffc6a1..3b4079e6f 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.Logging; using Volo.Abp.Guids; using Volo.Abp.ObjectMapping; using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.WMS.ItemPack; diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs index 08f4dcb13..2d022b184 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs @@ -32,8 +32,7 @@ public class ShipReader : IReader public virtual async Task> ReadAsync() { //从EOS读取待处理Ship - var aa = await _shipManager.GetToBeProcessedListAsync().ConfigureAwait(false); - var toBeProcessedShips = aa.Take(5).ToList(); + var toBeProcessedShips = await _shipManager.GetToBeProcessedListAsync().ConfigureAwait(false); if (!toBeProcessedShips.Any()) { _logger.LogInformation("no ships"); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/IssueConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/IssueConverter.cs index 12c1a7db1..0dc01d766 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/IssueConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/IssueConverter.cs @@ -14,6 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; public class IssueConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IItemBasicAppService _itemBasicAppService; private readonly IObjectMapper _objectMapper; @@ -25,10 +26,12 @@ public class IssueConverter : IIncomingConverter IItemBasicAppService itemBasicAppService, IObjectMapper objectMapper, ILogger logger, - IConfiguration configuration + IConfiguration configuration, + IIncomingFromExternalManager incomingFromExternalManager ) { + _incomingFromExternalManager = incomingFromExternalManager; _incomingToWmsManager = incomingToWmsManager; _itemBasicAppService = itemBasicAppService; _objectMapper = objectMapper; @@ -44,7 +47,8 @@ public class IssueConverter : IIncomingConverter } var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false); - + //归档 + await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfPurchaseOrderAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs index 42bd7e5c8..ea92dcf1d 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs @@ -16,6 +16,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; public class MesOutConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IObjectMapper _objectMapper; private readonly IItemBasicAppService _itemBasicAppService; @@ -29,7 +30,8 @@ public class MesOutConverter : IIncomingConverter , IItemBasicAppService itemBasicAppService , ILogger logger, IConfiguration configuration, - ILocationAppService locationAppService) + ILocationAppService locationAppService, + IIncomingFromExternalManager incomingFromExternalManager) { _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; @@ -37,6 +39,7 @@ public class MesOutConverter : IIncomingConverter _logger = logger; _configuration = configuration; _locationAppService = locationAppService; + _incomingFromExternalManager = incomingFromExternalManager; } public virtual async Task ConvertAsync(List incomingFromExternalList) @@ -49,6 +52,8 @@ public class MesOutConverter : IIncomingConverter var productReceiptNoteList = await BuildIncomingToWmsOfProductReceiptNoteAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(productReceiptNoteList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfProductReceiptNoteAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs index 46c86ae65..9c452e010 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs @@ -16,6 +16,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; public class PullTaskConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IObjectMapper _objectMapper; private readonly IItemBasicAppService _itemBasicAppService; @@ -27,13 +28,15 @@ public class PullTaskConverter : IIncomingConverter , IObjectMapper objectMapper , IItemBasicAppService itemBasicAppService , ILogger logger - , IConfiguration configuration) + , IConfiguration configuration, + IIncomingFromExternalManager incomingFromExternalManager) { _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; _itemBasicAppService = itemBasicAppService; _logger = logger; _configuration = configuration; + _incomingFromExternalManager = incomingFromExternalManager; } public virtual async Task ConvertAsync(List incomingFromExternalList) @@ -47,6 +50,8 @@ public class PullTaskConverter : IIncomingConverter //按Number合并MaterialRequest单据 var materialRequestList = await BuildIncomingToWmsOfMaterialRequestAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfMaterialRequestAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs index 7f8b6a911..11d70263a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs @@ -16,6 +16,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; public class ScrapConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IItemBasicAppService _itemBasicAppService; private readonly IObjectMapper _objectMapper; @@ -27,6 +28,10 @@ public class ScrapConverter : IIncomingConverter IObjectMapper objectMapper, ILogger logger, IConfiguration configuration +, + IIncomingFromExternalManager incomingFromExternalManager + + ) { @@ -35,6 +40,7 @@ public class ScrapConverter : IIncomingConverter _objectMapper = objectMapper; _logger = logger; _configuration = configuration; + _incomingFromExternalManager = incomingFromExternalManager; } public virtual async Task ConvertAsync(List incomingFromExternalList) { @@ -46,7 +52,8 @@ public class ScrapConverter : IIncomingConverter //按PlanBillNo合并PurchaseOrder var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false); - + //归档 + await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfPurchaseOrderAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluConverter.cs index 672cc23e2..8565defb2 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluConverter.cs @@ -13,6 +13,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming; public class BackFluConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IItemBasicAppService _itemBasicAppService; private readonly IObjectMapper _objectMapper; @@ -22,6 +23,8 @@ public class BackFluConverter : IIncomingConverter IItemBasicAppService itemBasicAppService, IObjectMapper objectMapper, ILogger logger +, + IIncomingFromExternalManager incomingFromExternalManager ) { @@ -29,6 +32,7 @@ public class BackFluConverter : IIncomingConverter _itemBasicAppService = itemBasicAppService; _objectMapper = objectMapper; _logger = logger; + _incomingFromExternalManager = incomingFromExternalManager; } public virtual async Task ConvertAsync(List incomingFromExternalList) { @@ -39,6 +43,8 @@ public class BackFluConverter : IIncomingConverter } var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomConverter.cs index 2c4e75c32..50b34ebde 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomConverter.cs @@ -13,6 +13,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming; public class BomConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IItemBasicAppService _itemBasicAppService; private readonly IObjectMapper _objectMapper; @@ -25,7 +26,8 @@ public class BomConverter : IIncomingConverter IObjectMapper objectMapper, ILogger logger, IGuidGenerator guidGenerator, - IConfiguration configuration) + IConfiguration configuration, + IIncomingFromExternalManager incomingFromExternalManager) { _incomingToWmsManager = incomingToWmsManager; @@ -34,6 +36,7 @@ public class BomConverter : IIncomingConverter _logger = logger; _guidGenerator = guidGenerator; _configuration = configuration; + _incomingFromExternalManager = incomingFromExternalManager; } public virtual async Task ConvertAsync(List incomingFromExternalList) { @@ -44,7 +47,8 @@ public class BomConverter : IIncomingConverter } var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false); - + //归档 + await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfPurchaseOrderAsync(List incomingDataList) { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/CustomerConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/CustomerConverter.cs index 4326f80ee..bed551158 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/CustomerConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/CustomerConverter.cs @@ -17,17 +17,23 @@ public class CustomerConverter : IIncomingConverter private readonly IObjectMapper _objectMapper; private readonly ILogger _logger; private readonly IGuidGenerator _guidGenerator; + private readonly IIncomingFromExternalManager _incomingFromExternalManager; + public CustomerConverter( IIncomingToWmsManager incomingToWmsManager, IObjectMapper objectMapper, ILogger logger, IGuidGenerator guidGenerator +, + IIncomingFromExternalManager incomingFromExternalManager + ) { _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; _logger = logger; _guidGenerator = guidGenerator; + _incomingFromExternalManager = incomingFromExternalManager; } public virtual async Task ConvertAsync(List incomingFromExternalList) { @@ -38,6 +44,8 @@ public class CustomerConverter : IIncomingConverter } var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfPurchaseOrderAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DepartmentConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DepartmentConverter.cs index 519a1fb7d..364680786 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DepartmentConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DepartmentConverter.cs @@ -15,15 +15,18 @@ public class DepartmentConverter : IIncomingConverter private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IObjectMapper _objectMapper; private readonly ILogger _logger; + private readonly IIncomingFromExternalManager _incomingFromExternalManager; public DepartmentConverter( IIncomingToWmsManager incomingToWmsManager , IObjectMapper objectMapper - , ILogger logger) + , ILogger logger, +IIncomingFromExternalManager incomingFromExternalManager) { _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; _logger = logger; + _incomingFromExternalManager = incomingFromExternalManager; } public virtual async Task ConvertAsync(List incomingFromExternalList) @@ -37,6 +40,8 @@ public class DepartmentConverter : IIncomingConverter //按流水号创建单据 var materialRequestList = await BuildIncomingToWmsOfDepartmentRequestAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfDepartmentRequestAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs index c772be73d..be7906816 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs @@ -17,17 +17,20 @@ public class DictConverter : IIncomingConverter private readonly IObjectMapper _objectMapper; private readonly ILogger _logger; private readonly IGuidGenerator _guidGenerator; + private readonly IIncomingFromExternalManager _incomingFromExternalManager; public DictConverter( IIncomingToWmsManager incomingToWmsManager , IObjectMapper objectMapper , ILogger logger, - IGuidGenerator guidGenerator) + IGuidGenerator guidGenerator, + IIncomingFromExternalManager incomingFromExternalManager) { _guidGenerator = guidGenerator; _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; _objectMapper = objectMapper; _logger = logger; + _incomingFromExternalManager = incomingFromExternalManager; } public virtual async Task ConvertAsync(List incomingFromExternalList) @@ -41,6 +44,8 @@ public class DictConverter : IIncomingConverter //按流水号创建单据 var materialRequestList = await BuildIncomingToWmsOfDictRequestAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfDictRequestAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictpjReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictpjReader.cs index 810797292..9065f9ee2 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictpjReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictpjReader.cs @@ -5,6 +5,7 @@ using System.Text.Json; using System.Threading.Tasks; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; +using Volo.Abp.Guids; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; @@ -20,13 +21,16 @@ public class DictpjReader : IReader private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly ILogger _logger; private readonly IConfiguration _configuration; + private readonly IGuidGenerator _guidGenerator; public DictpjReader( IDictpjManager dictpjManager , IIncomingFromExternalManager incomingFromExternalManager , ILogger logger , IConfiguration configuration + , IGuidGenerator guidGenerator ) { + _guidGenerator = guidGenerator; _configuration = configuration; _dictpjManager = dictpjManager; _incomingFromExternalManager = incomingFromExternalManager; @@ -55,6 +59,7 @@ public class DictpjReader : IReader var incomingData = BuildIncomingFromExternal(dict); incomingData.SetEffectiveDate(DateTime.Now); incomingData.SetSuccess(); + incomingData.SetId(_guidGenerator.Create()); try { var DictRequest = BuildDictRequestCreateInput(dict); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/InterfaceCalendarConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/InterfaceCalendarConverter.cs index 8e76c884c..d1e99dbf7 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/InterfaceCalendarConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/InterfaceCalendarConverter.cs @@ -15,15 +15,18 @@ public class InterfaceCalendarConverter : IIncomingConverter private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IObjectMapper _objectMapper; private readonly ILogger _logger; + private readonly IIncomingFromExternalManager _incomingFromExternalManager; public InterfaceCalendarConverter( IIncomingToWmsManager incomingToWmsManager , IObjectMapper objectMapper - , ILogger logger) + , ILogger logger, + IIncomingFromExternalManager incomingFromExternalManager) { _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; _logger = logger; + _incomingFromExternalManager = incomingFromExternalManager; } public virtual async Task ConvertAsync(List incomingFromExternalList) @@ -37,6 +40,8 @@ public class InterfaceCalendarConverter : IIncomingConverter //按流水号创建单据 var materialRequestList = await BuildIncomingToWmsOfInterfaceCalendarRequestAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfInterfaceCalendarRequestAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs index 299dca8ca..e489620b7 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs @@ -14,6 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming; public class ItemBasicConverter : IIncomingConverter { + private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IObjectMapper _objectMapper; private readonly ILogger _logger; @@ -25,8 +26,10 @@ public class ItemBasicConverter : IIncomingConverter , IObjectMapper objectMapper , ILogger logger, IGuidGenerator guidGenerator, - IConfiguration configuration) + IConfiguration configuration, + IIncomingFromExternalManager incomingFromExternalManager) { + _incomingFromExternalManager = incomingFromExternalManager; _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; _logger = logger; @@ -45,6 +48,8 @@ public class ItemBasicConverter : IIncomingConverter //按流水号创建单据 var materialRequestList = await BuildIncomingToWmsOfItemBasicRequestAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList); } private async Task> BuildIncomingToWmsOfItemBasicRequestAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/SupplierConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/SupplierConverter.cs index ca1564423..49bbf2cc4 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/SupplierConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/SupplierConverter.cs @@ -17,11 +17,13 @@ public class SupplierConverter : IIncomingConverter private readonly IObjectMapper _objectMapper; private readonly ILogger _logger; private readonly IGuidGenerator _guidGenerator; + private readonly IIncomingFromExternalManager _incomingFromExternalManager; public SupplierConverter( IIncomingToWmsManager incomingToWmsManager, IObjectMapper objectMapper, ILogger logger, - IGuidGenerator guidGenerator + IGuidGenerator guidGenerator, + IIncomingFromExternalManager incomingFromExternalManage ) { @@ -39,7 +41,8 @@ public class SupplierConverter : IIncomingConverter } var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false); - + //归档 + await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfPurchaseOrderAsync(List incomingDataList) { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs index 86e20cdf5..f2b44243d 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs @@ -67,65 +67,65 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase ////转换itemBasic //await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); - //Logger.LogInformation($"Read User");//用户和部门 - //var userReader = workerContext.ServiceProvider.GetRequiredService(); - //var userConverter = workerContext.ServiceProvider.GetRequiredService(); - //var departmentConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存user - //var outsFromExternalList = await userReader.ReadAsync().ConfigureAwait(false); - //var userOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.User.ToString()).ToList(); - //var departmentOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.Department.ToString()).ToList(); - ////转换user - //await userConverter.ConvertAsync(userOutsFromExternalList).ConfigureAwait(false); - ////转换department - //await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false); - - //Logger.LogInformation($"Read InterfaceCalendar");//账期 - //var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService(); - //var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存InterfaceCalendar - //var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false); - ////转换InterfaceCalendar - //await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false); - - //Logger.LogInformation($"Read Dict");//系统代码 - //var dictReader = workerContext.ServiceProvider.GetRequiredService(); - //var dictConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存Dict - //var dictOutsFromExternalList = await dictReader.ReadAsync().ConfigureAwait(false); - ////转换Dict - //await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); - - Logger.LogInformation($"Read Bom"); - var BomReader = workerContext.ServiceProvider.GetRequiredService(); - var BomConverter = workerContext.ServiceProvider.GetRequiredService(); - //读取并保存Bom - var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false); - //转换Bom - await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false); - - //Logger.LogInformation($"Read Supplier");//供应商 - //var SupplierReader = workerContext.ServiceProvider.GetRequiredService(); - //var SupplierConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存Supplier - //var suppliersFromExternalList = await SupplierReader.ReadAsync().ConfigureAwait(false); - ////转换Supplier - //await SupplierConverter.ConvertAsync(suppliersFromExternalList).ConfigureAwait(false); - - //Logger.LogInformation($"Read Dictpj");//专案代码 - //var DictpjReader = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存Dictpj - //var dictpjOutsFromExternalList = await DictpjReader.ReadAsync().ConfigureAwait(false); - ////转换Dictpj - //await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); - - //Logger.LogInformation($"Read Customer");//客户资料 - //var CustomerReader = workerContext.ServiceProvider.GetRequiredService(); - //var CustomerConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存Customer - //var customersFromExternalList = await CustomerReader.ReadAsync().ConfigureAwait(false); - ////转换Customer - //await CustomerConverter.ConvertAsync(customersFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read User");//用户和部门 + var userReader = workerContext.ServiceProvider.GetRequiredService(); + var userConverter = workerContext.ServiceProvider.GetRequiredService(); + var departmentConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存user + var outsFromExternalList = await userReader.ReadAsync().ConfigureAwait(false); + var userOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.User.ToString()).ToList(); + var departmentOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.Department.ToString()).ToList(); + //转换user + await userConverter.ConvertAsync(userOutsFromExternalList).ConfigureAwait(false); + //转换department + await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false); + + Logger.LogInformation($"Read InterfaceCalendar");//账期 + var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService(); + var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存InterfaceCalendar + var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false); + //转换InterfaceCalendar + await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false); + + Logger.LogInformation($"Read Dict");//系统代码 + var dictReader = workerContext.ServiceProvider.GetRequiredService(); + var dictConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存Dict + var dictOutsFromExternalList = await dictReader.ReadAsync().ConfigureAwait(false); + //转换Dict + await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); + + //Logger.LogInformation($"Read Bom"); + //var BomReader = workerContext.ServiceProvider.GetRequiredService(); + //var BomConverter = workerContext.ServiceProvider.GetRequiredService(); + ////读取并保存Bom + //var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false); + ////转换Bom + //await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false); + + Logger.LogInformation($"Read Supplier");//供应商 + var SupplierReader = workerContext.ServiceProvider.GetRequiredService(); + var SupplierConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存Supplier + var suppliersFromExternalList = await SupplierReader.ReadAsync().ConfigureAwait(false); + //转换Supplier + await SupplierConverter.ConvertAsync(suppliersFromExternalList).ConfigureAwait(false); + + Logger.LogInformation($"Read Dictpj");//专案代码 + var DictpjReader = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存Dictpj + var dictpjOutsFromExternalList = await DictpjReader.ReadAsync().ConfigureAwait(false); + //转换Dictpj + await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); + + Logger.LogInformation($"Read Customer");//客户资料 + var CustomerReader = workerContext.ServiceProvider.GetRequiredService(); + var CustomerConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存Customer + var customersFromExternalList = await CustomerReader.ReadAsync().ConfigureAwait(false); + //转换Customer + await CustomerConverter.ConvertAsync(customersFromExternalList).ConfigureAwait(false); } else { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/UserConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/UserConverter.cs index cde28e652..281e72901 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/UserConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/UserConverter.cs @@ -15,12 +15,13 @@ public class UserConverter : IIncomingConverter private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IObjectMapper _objectMapper; private readonly ILogger _logger; - + private readonly IIncomingFromExternalManager _incomingFromExternalManager; public UserConverter( IIncomingToWmsManager incomingToWmsManager , IObjectMapper objectMapper - , ILogger logger) + , ILogger logger, IIncomingFromExternalManager incomingFromExternalManager) { + _incomingFromExternalManager = incomingFromExternalManager; _incomingToWmsManager = incomingToWmsManager; _objectMapper = objectMapper; _logger = logger; @@ -37,6 +38,8 @@ public class UserConverter : IIncomingConverter //按流水号创建单据 var materialRequestList = await BuildIncomingToWmsOfIdentityUserRequestAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false); + //归档 + await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false); } private async Task> BuildIncomingToWmsOfIdentityUserRequestAsync(List incomingDataList) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs index 586a81b4c..0344a59ed 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs @@ -94,10 +94,10 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase var unplannedIssueNoteNoteList = await unplannedIssueNoteConvert.ConvertAsync().ConfigureAwait(false); await wmsoutmWriter.WriteAsync(unplannedIssueNoteNoteList).ConfigureAwait(false); - //Logger.LogInformation($"Write UnplannedReceiptNote");//非生产退料 - //var unplannedReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService(); - //var unplannedReceiptNoteList = await unplannedReceiptNoteConvert.ConvertAsync(); - //await wmsoutmWriter.WriteAsync(unplannedReceiptNoteList); + Logger.LogInformation($"Write UnplannedReceiptNote");//非生产退料 + var unplannedReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService(); + var unplannedReceiptNoteList = await unplannedReceiptNoteConvert.ConvertAsync().ConfigureAwait(false); + await wmsoutmWriter.WriteAsync(unplannedReceiptNoteList).ConfigureAwait(false); Logger.LogInformation($"Write RecycledMaterialReceiptNote");//回收料入库单 var recycledMaterialReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService(); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs index 3679cc757..7b996e278 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs @@ -173,7 +173,7 @@ public class TyrpAgentModule : AbpModule { context.AddBackgroundWorkerAsync(); - //context.AddBackgroundWorkerAsync(); + // context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs index c61e2db2d..de009e0fb 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs @@ -149,7 +149,7 @@ public class AgentModule : AbpModule public override void OnApplicationInitialization( ApplicationInitializationContext context) { - context.AddBackgroundWorkerAsync(); - // context.AddBackgroundWorkerAsync(); + // context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/ArchivedIncomingFromExternal/IArchivedIncomingFromExternalRepository.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/ArchivedIncomingFromExternal/IArchivedIncomingFromExternalRepository.cs index 83377c064..469ac6216 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/ArchivedIncomingFromExternal/IArchivedIncomingFromExternalRepository.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/ArchivedIncomingFromExternal/IArchivedIncomingFromExternalRepository.cs @@ -1,7 +1,8 @@ +using System; using Win_in.Sfs.Shared.Domain; namespace Win_in.Sfs.Wms.DataExchange.Domain; -public interface IArchivedIncomingFromExternalRepository : ISfsRepositoryBase +public interface IArchivedIncomingFromExternalRepository : ISfsRepositoryBase, ISfsBulkRepositoryBase { } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IIncomingFromExternalManager.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IIncomingFromExternalManager.cs index 6f2898cac..c09e12920 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IIncomingFromExternalManager.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IIncomingFromExternalManager.cs @@ -12,4 +12,5 @@ public interface IIncomingFromExternalManager : IDomainService Task ArchiveManyAsync(List entities); Task> CreateBulkAsync(List entities); Task GetDataByMaxEffectiveDate(string dataType); + Task ArchiveBulkAsync(List entities); } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IncomingFromExternalManager.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IncomingFromExternalManager.cs index df210ec60..dcd54ef5c 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IncomingFromExternalManager.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IncomingFromExternalManager.cs @@ -62,7 +62,15 @@ public class IncomingFromExternalManager : DomainService, IIncomingFromExternalM await _historyRepository.InsertAsync(archivedEntity).ConfigureAwait(false); } + [UnitOfWork] + public virtual async Task ArchiveBulkAsync(List entities) + { + await _repository.BulkDeleteAsync(entities).ConfigureAwait(false); + var archivedEntities = _objectMapper.Map, List>(entities); + + await _historyRepository.BulkInsertAsync(archivedEntities).ConfigureAwait(false); + } [UnitOfWork] public virtual async Task ArchiveManyAsync(List entities) { diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Repositories/ISfsBulkRepositoryBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Repositories/ISfsBulkRepositoryBase.cs index 75fe0bb4a..e431626f3 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Repositories/ISfsBulkRepositoryBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Repositories/ISfsBulkRepositoryBase.cs @@ -43,4 +43,5 @@ public interface ISfsBulkRepositoryBase /// Task BulkInsertAsync(IList details, BulkConfig bulkConfig = null, Action progress = null, Type type = null, CancellationToken cancellationToken = default(CancellationToken)) where TDetail : class, new(); + Task BulkUpdateAsync(IList entities, BulkConfig bulkConfig = null, Action progress = null, Type type = null, CancellationToken cancellationToken = default); } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.EntityFrameworkCore/SfsEfCoreRepositoryBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.EntityFrameworkCore/SfsEfCoreRepositoryBase.cs index 39bbfe624..589fd5744 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.EntityFrameworkCore/SfsEfCoreRepositoryBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.EntityFrameworkCore/SfsEfCoreRepositoryBase.cs @@ -76,4 +76,22 @@ public abstract class SfsEfCoreRepositoryBase await context.BulkDeleteAsync(entities, bulkConfig, progress, type, cancellationToken).ConfigureAwait(false); } } + /// + /// 批量更新数据 + /// + /// + /// + /// + /// + /// + /// + public virtual async Task BulkUpdateAsync(IList entities, BulkConfig bulkConfig = null, Action progress = null, Type type = null, CancellationToken cancellationToken = default(CancellationToken)) + { + var context = (await GetDbContextAsync().ConfigureAwait(false)) as DbContext; + + if (entities != null && entities.Count > 0) + { + await context.BulkUpdateAsync(entities, bulkConfig, progress, type, cancellationToken).ConfigureAwait(false); + } + } } From ddc03472ff7b5e04e7f492bbeb3bd238e796bc17 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Thu, 13 Apr 2023 19:10:28 +0800 Subject: [PATCH 12/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=8F=91=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductionReturnNoteAutoMapperProfile.cs | 8 + .../Requests/IssueNoteEventHandler.cs | 78 ------ .../Requests/MaterialRequestEventHandler.cs | 5 +- .../Requests/Note/IssueNoteEventHandler.cs | 82 ++++++ .../Requests/Note/ScrapNoteEventHandler.cs | 6 - .../Transactions/IssueNoteEventHandler.cs | 264 ++++++++---------- 6 files changed, 212 insertions(+), 231 deletions(-) delete mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAutoMapperProfile.cs index 313efa987..497df3542 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAutoMapperProfile.cs @@ -20,5 +20,13 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id) + .Ignore(x=>x.Remark) + .Ignore(x=>x.ExtraProperties) + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs deleted file mode 100644 index 5305923a6..000000000 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs +++ /dev/null @@ -1,78 +0,0 @@ -//using System.Collections.Generic; -//using System.Linq; -//using System.Threading.Tasks; -//using Volo.Abp.EventBus; -//using Volo.Abp.Uow; -//using Win_in.Sfs.Shared.Event; -//using Win_in.Sfs.Wms.Store.Domain; - -//namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; - -//public class IssueNoteEventHandler -// : StoreEventHandlerBase -// , ILocalEventHandler> -// , ILocalEventHandler>> -// , ILocalEventHandler> -//{ -// private readonly IMaterialRequestManager _materialRequestManager; - -// public IssueNoteEventHandler( -// IMaterialRequestManager materialRequestManager -// ) -// { -// _materialRequestManager = materialRequestManager; -// } - -// [UnitOfWork] -// public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData eventData) -// { -// var entity = eventData.Entity; - -// await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); -// } - -// private async Task UpdateReceivedQtyMaterialRequestAsync(IssueNote entity) -// { -// var receiveQtyGroup = entity.Details -// .GroupBy(p => new { p.ItemCode, p.ToLocationCode }) -// .Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) }) -// .ToList(); - -// var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); - -// //更新叫料请求的已收数量 -// foreach (var materialRequestDetail in materialRequest.Details) -// { -// var receiveQty = receiveQtyGroup.FirstOrDefault(p => -// p.ItemCode == materialRequestDetail.ItemCode && -// p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty; -// if (receiveQty != null) -// { -// materialRequestDetail.ReceivedQty += receiveQty.Value; -// } -// } - -// await _materialRequestManager.UpdateDetailsAsync(materialRequest).ConfigureAwait(false); -// } - -// [UnitOfWork] -// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) -// { -// var entity = eventData.Entity; -// if (!entity.UseOnTheWayLocation) -// { -// await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); -// } - -// } - -// [UnitOfWork] -// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) -// { -// var entities = eventData.Entity; -// foreach (var entity in entities.Where(entity => !entity.UseOnTheWayLocation)) -// { -// await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); -// } -// } -//} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs index 830bba2b0..897d7af99 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs @@ -110,7 +110,8 @@ public class MaterialRequestEventHandler await Task.CompletedTask.ConfigureAwait(false); } - private async Task> BuildIssueJobAsync(MaterialRequest materialRequest) + private async Task> BuildIssueJobAsync + (MaterialRequest materialRequest) { var jobs = new List(); @@ -239,6 +240,8 @@ public class MaterialRequestEventHandler detail.RecommendFromLocationErpCode= balance.LocationErpCode; detail.RecommendFromLocationGroup= balance.LocationGroup; detail.RecommendFromWarehouseCode= balance.WarehouseCode; + detail.RecommendQty = balance.Qty; + detail.Uom = balance.Uom; detail.ToLocationCode = materialRequestDetail.ToLocationCode; detail.ToLocationErpCode = materialRequestDetail.ToLocationErpCode; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs new file mode 100644 index 000000000..8d28b137e --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs @@ -0,0 +1,82 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; + +public class IssueNoteEventHandler + : StoreEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> + , ILocalEventHandler> +{ + private readonly IMaterialRequestManager _materialRequestManager; + + public IssueNoteEventHandler( + IMaterialRequestManager materialRequestManager + ) + { + _materialRequestManager = materialRequestManager; + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData eventData) + { + var entity = eventData.Entity; + + await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); + } + + private async Task UpdateReceivedQtyMaterialRequestAsync(IssueNote entity) + { + var receiveQtyGroup = entity.Details + .GroupBy(p => new { p.ItemCode, p.ToLocationCode }) + .Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) }) + .ToList(); + + var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); + + if (entity.RequestType != EnumMaterialRequestType.Direct_Issue.ToString()) + { + //更新叫料请求的已收数量 + foreach (var materialRequestDetail in materialRequest.Details) + { + var receiveQty = receiveQtyGroup.FirstOrDefault(p => + p.ItemCode == materialRequestDetail.ItemCode && + p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty; + if (receiveQty != null) + { + materialRequestDetail.ReceivedQty += receiveQty.Value; + } + } + + await _materialRequestManager.UpdateDetailsAsync(materialRequest).ConfigureAwait(false); + } + } + + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + if (!entity.UseOnTheWayLocation) + { + await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); + } + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + foreach (var entity in entities.Where(entity => !entity.UseOnTheWayLocation)) + { + await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); + } + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs index f9270b9be..6b4ed7381 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs @@ -1,15 +1,9 @@ -using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Volo.Abp.EventBus; using Volo.Abp.Uow; -using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; -using Win_in.Sfs.Wms.Inventory.Application.Contracts; -using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; -using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Event.Transaction; namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs index f43b6e406..1ec0f954a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs @@ -4,156 +4,128 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.EventBus; using Volo.Abp.Uow; -using Win_in.Sfs.Basedata.Application.Contracts; -using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; -using Win_in.Sfs.Wms.Store.Event.Transactions; +using Win_in.Sfs.Wms.Store.Event.Transaction; -namespace Win_in.Sfs.Wms.Store.Event.BusinessNote +namespace Win_in.Sfs.Wms.Store.Event.Transactions; + +public class IssueNoteEventHandler + : StoreInventoryEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> + , ILocalEventHandler> { - //public class IssueNoteEventHandler - // : StoreEventHandlerBase - // , ILocalEventHandler> - // , ILocalEventHandler>> - // , ILocalEventHandler> - //{ - // private const EnumTransType TransType = EnumTransType.Issue; - // private readonly Itranlog - - - // [UnitOfWork] - // public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) - // { - // var entity = eventData.Entity; - // var transferLogs = new List(); - // var route = entity.UseOnTheWayLocation - // ? EnumTransferRoute.SourceToOnTheWay - // : EnumTransferRoute.SourceToDestination; - - // //如果是mes拉动 先发到在途 - // if (entity.RequestType == EnumMaterialRequestType.Issue_WIP.ToString()) - // { - // route = EnumTransferRoute.SourceToOnTheWay; - // } - - // transferLogs.AddRange(await BuildTransferLogsAsync(entity, route)); - - // await TransferLogAppService.AddManyAsync(transferLogs); - // } - - - // [UnitOfWork] - // public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) - // { - // var entities = eventData.Entity; - // var transferLogs = new List(); - // //如果要做库存事务汇总,可以修改此处 - // foreach (var issueNote in entities) - // { - // var route = issueNote.UseOnTheWayLocation - // ? EnumTransferRoute.SourceToOnTheWay - // : EnumTransferRoute.SourceToDestination; - // transferLogs.AddRange(await BuildTransferLogsAsync(issueNote, route)); - // } - - // await TransferLogAppService.AddManyAsync(transferLogs); - // } - - - // [UnitOfWork] - - // public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData eventData) - // { - // var entity = eventData.Entity; - - // var inputList = await BuildTransferLogsAsync(entity, EnumTransferRoute.OnTheWayToDestination); - // await AddTransferLogsAsync(inputList); - // } - - // private async Task AddTransferLogsAsync(List inputList) - // { - // var transferLogs = new List(); - - // transferLogs.AddRange(inputList); - - // await TransferLogAppService.AddManyAsync(transferLogs); - - // } - - // private async Task> BuildTransferLogsAsync(IssueNote issueNote, EnumTransferRoute route) - // { - // var transferLogs = new List(); - // foreach (var detail in issueNote.Details.Where(detail => detail.Qty.Qty != 0)) - // { - // var transferLog = ObjectMapper.Map(detail); - - // LocationDTO fromLocationDTO = null; - // LocationDTO toLocationDTO = null; - - // if (issueNote.UseOnTheWayLocation) - // { - // var location = await LocationAppService.GetByCodeAsync(detail.OnTheWayLocationCode); - // switch (route) - // { - // case EnumTransferRoute.SourceToOnTheWay: - // fromLocationDTO = await LocationAppService.GetByCodeAsync(detail.FromLocationCode); - - // toLocationDTO = await LocationAppService.GetByCodeAsync(detail.OnTheWayLocationCode); - // break; - // case EnumTransferRoute.OnTheWayToDestination: - // fromLocationDTO = await LocationAppService.GetByCodeAsync(detail.OnTheWayLocationCode); - - // toLocationDTO = await LocationAppService.GetByCodeAsync(detail.ToLocationCode); - - // await RemovePackingCodeAndContainerCodeAndLotAsync(transferLog); - // break; - // case EnumTransferRoute.SourceToDestination: - // default: - // throw new ArgumentOutOfRangeException(nameof(route), route, null); - // } - // } - // else - // { - // fromLocationDTO = await LocationAppService.GetByCodeAsync(detail.FromLocationCode); - // toLocationDTO = await LocationAppService.GetByCodeAsync(detail.ToLocationCode); - // } - - // transferLog.FromLocationCode = fromLocationDTO.Code; - // transferLog.FromLocationArea = fromLocationDTO.AreaCode; - // transferLog.FromLocationErpCode = fromLocationDTO.ErpLocationCode; - // transferLog.FromLocationGroup = fromLocationDTO.LocationGroupCode; - - // transferLog.ToLocationCode = toLocationDTO.Code; - // transferLog.ToLocationArea = toLocationDTO.AreaCode; - // transferLog.ToLocationErpCode = toLocationDTO.ErpLocationCode; - // transferLog.ToLocationGroup = toLocationDTO.LocationGroupCode; - - // transferLog.TransType = TransType; - // transferLog.TransSubType = Enum.Parse(issueNote.RequestType); - // transferLog.Company = issueNote.Company; - // transferLog.Worker = issueNote.Worker; - // transferLog.DocNumber = issueNote.Number; - // transferLog.JobNumber = issueNote.JobNumber; - - // transferLogs.Add(transferLog); - // } - - // return transferLogs; - // } - // private async Task RemovePackingCodeAndContainerCodeAndLotAsync(TransferLogCreateInput transferLogCreateInput) - // { - // transferLogCreateInput.ToPackingCode = ""; - // transferLogCreateInput.ToLot = ""; - // transferLogCreateInput.ToContainerCode = ""; - - // transferLogCreateInput.FromPackingCode = ""; - // transferLogCreateInput.FromLot = ""; - // transferLogCreateInput.FromContainerCode = ""; - - - // } - //} + private const EnumTransType TransType = EnumTransType.Issue; + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + var transferLogs = new List(); + var route = entity.UseOnTheWayLocation + ? EnumTransferRoute.SourceToOnTheWay + : EnumTransferRoute.SourceToDestination; + transferLogs.AddRange(await BuildTransferLogsAsync(entity, route).ConfigureAwait(false)); + + //如果是mes拉动 先发到在途 + if (entity.RequestType == EnumMaterialRequestType.Issue_WIP.ToString()) + { + route = EnumTransferRoute.SourceToOnTheWay; + } + + await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + var transferLogs = new List(); + //如果要做库存事务汇总,可以修改此处 + foreach (var issueNote in entities) + { + var route = issueNote.UseOnTheWayLocation + ? EnumTransferRoute.SourceToOnTheWay + : EnumTransferRoute.SourceToDestination; + transferLogs.AddRange(await BuildTransferLogsAsync(issueNote, route).ConfigureAwait(false)); + } + + await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); + } + + [UnitOfWork] + + public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData eventData) + { + var entity = eventData.Entity; + + var inputList = await BuildTransferLogsAsync(entity, EnumTransferRoute.OnTheWayToDestination).ConfigureAwait(false); + await AddTransferLogsAsync(inputList).ConfigureAwait(false); + } + + private async Task AddTransferLogsAsync(List inputList) + { + var transferLogs = new List(); + + transferLogs.AddRange(inputList); + + await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); + + } + + private async Task> BuildTransferLogsAsync(IssueNote issueNote, EnumTransferRoute route) + { + var transferLogs = new List(); + foreach (var detail in issueNote.Details.Where(detail => detail.Qty != 0)) + { + var transferLog = ObjectMapper.Map(detail); + + if (issueNote.UseOnTheWayLocation) + { + var location = await LocationAclService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); + switch (route) + { + case EnumTransferRoute.SourceToOnTheWay: + detail.ToLocationCode = detail.OnTheWayLocationCode; + detail.ToLocationErpCode = location.ErpLocationCode; + detail.ToWarehouseCode = location.WarehouseCode; + detail.ToLocationArea = location.AreaCode; + break; + case EnumTransferRoute.OnTheWayToDestination: + detail.FromLocationCode = detail.OnTheWayLocationCode; + detail.FromLocationErpCode = location.ErpLocationCode; + detail.FromWarehouseCode = location.WarehouseCode; + detail.FromLocationArea = location.AreaCode; + break; + case EnumTransferRoute.SourceToDestination: + default: + throw new ArgumentOutOfRangeException(nameof(route), route, null); + } + } + + if (issueNote.UseOnTheWayLocation) + { + transferLog.FromLocationCode = detail.OnTheWayLocationCode; + var location = await LocationAclService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); + transferLog.FromLocationGroup = location.LocationGroupCode; + transferLog.FromLocationArea = location.AreaCode; + transferLog.FromLocationErpCode = location.ErpLocationCode; + transferLog.FromWarehouseCode=location.WarehouseCode; + } + + transferLog.TransType = TransType; + transferLog.TransSubType = Enum.Parse(issueNote.RequestType); + transferLog.Worker = issueNote.Worker; + transferLog.DocNumber = issueNote.Number; + transferLog.JobNumber = issueNote.JobNumber; + + transferLogs.Add(transferLog); + } + + return transferLogs; + } + } From ea9632d8b54cf00231ef166d7ae7b6d6e004f474 Mon Sep 17 00:00:00 2001 From: "rongguo.jia" Date: Fri, 14 Apr 2023 09:33:44 +0800 Subject: [PATCH 13/41] =?UTF-8?q?[fix]=E4=B8=BA=E8=BF=9C=E7=A8=8B=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?try,catch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs index 5319f16a2..189e69c1d 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs @@ -45,6 +45,7 @@ public static class HostBuilderExtensions AddJsonByUrl(cb, $"{configUrl}appsettings.{builder.Environment.EnvironmentName}.json"); if (builder.Environment.IsDevelopment()) { + cb.AddJsonFile(Path.Combine(Directory.GetCurrentDirectory(), "appsettings.json")); cb.AddJsonFile(Path.Combine(Directory.GetCurrentDirectory(), $"appsettings.{builder.Environment.EnvironmentName}.json")); } }); @@ -79,7 +80,14 @@ public static class HostBuilderExtensions private static void AddJsonByUrl(IConfigurationBuilder configurationBuilder, string url) { Console.WriteLine($"load config form:{url}"); - var stream = new HttpClient().GetStreamAsync(url).Result; - configurationBuilder.AddJsonStream(stream); + try + { + var stream = new HttpClient().GetStreamAsync(url).Result; + configurationBuilder.AddJsonStream(stream); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } } } From b789f7df1164979838d08af5842e3758d42d7050 Mon Sep 17 00:00:00 2001 From: "rongguo.jia" Date: Fri, 14 Apr 2023 09:34:26 +0800 Subject: [PATCH 14/41] =?UTF-8?q?[fix]Job,Label=E5=9F=BA=E7=B1=BB=E4=B8=AD?= =?UTF-8?q?=E7=9A=84GetByCode,GetByCodes=E4=B8=8D=E5=86=8D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/SfsLabelAppServiceWithCodeBase.cs | 39 +++++++++++-------- .../Bases/SfsJobWithCodeAppServiceBase.cs | 39 +++++++++++-------- 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/Bases/SfsLabelAppServiceWithCodeBase.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/Bases/SfsLabelAppServiceWithCodeBase.cs index 312404b9c..033bb43b3 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/Bases/SfsLabelAppServiceWithCodeBase.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/Bases/SfsLabelAppServiceWithCodeBase.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -38,10 +39,12 @@ public class SfsLabelAppServiceWithCodeBase GetByCodeAsync(string code) { - var dto = await Cache.GetOrAddItemAsync( - $"{typeof(TEntityDto).Name}:{code}".ToString(), - async () => await GetFromRepositoryAsync(code).ConfigureAwait(false), - SfsCacheConst.SeveralMinutes).ConfigureAwait(false); + // var dto = await Cache.GetOrAddItemAsync( + // $"{typeof(TEntityDto).Name}:{code}".ToString(), + // async () => await GetFromRepositoryAsync(code).ConfigureAwait(false), + // SfsCacheConst.SeveralMinutes).ConfigureAwait(false); + + var dto = await GetFromRepositoryAsync(code).ConfigureAwait(false); return dto; } @@ -50,18 +53,22 @@ public class SfsLabelAppServiceWithCodeBase> GetByCodesAsync(IEnumerable codes) { - var dtoList = new List(); - foreach (var code in codes) - { - var dto = await Cache.GetOrAddItemAsync( - $"{typeof(TEntityDto).Name}:{code}".ToString(), - async () => await GetFromRepositoryAsync(code).ConfigureAwait(false), - SfsCacheConst.SeveralMinutes).ConfigureAwait(false); - if (dto != null) - { - dtoList.Add(dto); - } - } + // var dtoList = new List(); + // foreach (var code in codes) + // { + // var dto = await Cache.GetOrAddItemAsync( + // $"{typeof(TEntityDto).Name}:{code}".ToString(), + // async () => await GetFromRepositoryAsync(code).ConfigureAwait(false), + // SfsCacheConst.SeveralMinutes).ConfigureAwait(false); + // if (dto != null) + // { + // dtoList.Add(dto); + // } + // } + // return dtoList; + + var entities = await _repository.GetListAsync(p => codes.Contains(p.Code)).ConfigureAwait(false); + var dtoList = ObjectMapper.Map, List>(entities); return dtoList; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobWithCodeAppServiceBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobWithCodeAppServiceBase.cs index d1493e856..6102ed5d2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobWithCodeAppServiceBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobWithCodeAppServiceBase.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; @@ -37,10 +38,12 @@ public abstract class SfsJobWithCodeAppServiceBase GetByCodeAsync(string code) { - var dto = await Cache.GetOrAddItemAsync( - $"{typeof(TEntityDto).Name}:{code}".ToString(), - async () => await GetFromRepositoryAsync(code).ConfigureAwait(false), - SfsCacheConst.SeveralMinutes).ConfigureAwait(false); + // var dto = await Cache.GetOrAddItemAsync( + // $"{typeof(TEntityDto).Name}:{code}".ToString(), + // async () => await GetFromRepositoryAsync(code).ConfigureAwait(false), + // SfsCacheConst.SeveralMinutes).ConfigureAwait(false); + + var dto = await GetFromRepositoryAsync(code).ConfigureAwait(false); return dto; @@ -51,18 +54,22 @@ public abstract class SfsJobWithCodeAppServiceBase> GetByCodesAsync(IEnumerable codes) { - var dtoList = new List(); - foreach (var code in codes) - { - var dto = await Cache.GetOrAddItemAsync( - $"{typeof(TEntityDto).Name}:{code}".ToString(), - async () => await GetFromRepositoryAsync(code).ConfigureAwait(false), - SfsCacheConst.SeveralMinutes).ConfigureAwait(false); - if (dto != null) - { - dtoList.Add(dto); - } - } + // var dtoList = new List(); + // foreach (var code in codes) + // { + // var dto = await Cache.GetOrAddItemAsync( + // $"{typeof(TEntityDto).Name}:{code}".ToString(), + // async () => await GetFromRepositoryAsync(code).ConfigureAwait(false), + // SfsCacheConst.SeveralMinutes).ConfigureAwait(false); + // if (dto != null) + // { + // dtoList.Add(dto); + // } + // } + // return dtoList; + + var entities = await _repository.GetListAsync(p => codes.Contains(p.Code)).ConfigureAwait(false); + var dtoList = ObjectMapper.Map, List>(entities); return dtoList; } From eec72826155eae44b235538bd9b3e6e367bb52cf Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Fri, 14 Apr 2023 09:42:32 +0800 Subject: [PATCH 15/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=AB=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaterialRequestAppService.cs | 12 ++++++++++++ .../Requests/MaterialRequestEventHandler.cs | 11 ++++++++--- .../Requests/Note/IssueNoteEventHandler.cs | 16 +++++++++++++++- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs index 6f80a9d45..d7f3a3545 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs @@ -5,14 +5,19 @@ using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; +using IdentityModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.ObjectMapping; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -91,6 +96,13 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase HandleAsync(Guid id) + { + var entity=await _repository.GetAsync(id).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsHandledEntityEventData(entity), false).ConfigureAwait(false); + return ObjectMapper.Map(entity); + } + #endregion [HttpPost("")] diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs index 897d7af99..89d439cfb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs @@ -68,6 +68,10 @@ public class MaterialRequestEventHandler { await _materialRequestManager.SubmitAsync(entity).ConfigureAwait(false); } + if (entity.Type == EnumMaterialRequestType.Issue_WIP.ToString()) + { + await _materialRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } } } @@ -110,6 +114,8 @@ public class MaterialRequestEventHandler await Task.CompletedTask.ConfigureAwait(false); } + #region 私有 + private async Task> BuildIssueJobAsync (MaterialRequest materialRequest) { @@ -119,7 +125,7 @@ public class MaterialRequestEventHandler var toLocationCodes = materialRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList(); var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false); - foreach (var materialRequestDetail in materialRequest.Details.Where(p => p.ToBeIssuedQty > 0)) + foreach (var materialRequestDetail in materialRequest.Details.Where(p => p.ToBeIssuedQty > 0))//如果有还有剩余未叫料的数量 则创建新的任务 { var toLocation = toLocations.FirstOrDefault(p => p.Code == materialRequestDetail.ToLocationCode); Check.NotNull(toLocation, "库位代码", $"库位 {materialRequestDetail.ToLocationCode} 不存在"); @@ -240,7 +246,6 @@ public class MaterialRequestEventHandler detail.RecommendFromLocationErpCode= balance.LocationErpCode; detail.RecommendFromLocationGroup= balance.LocationGroup; detail.RecommendFromWarehouseCode= balance.WarehouseCode; - detail.RecommendQty = balance.Qty; detail.Uom = balance.Uom; detail.ToLocationCode = materialRequestDetail.ToLocationCode; @@ -279,5 +284,5 @@ public class MaterialRequestEventHandler } - + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs index 8d28b137e..e113d92e4 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs @@ -24,6 +24,11 @@ public class IssueNoteEventHandler _materialRequestManager = materialRequestManager; } + /// + /// 当叫料记录创建后 修改请求的值 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData eventData) { @@ -59,7 +64,11 @@ public class IssueNoteEventHandler } } - + /// + /// 当叫料记录创建后 修改请求的值 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { @@ -70,6 +79,11 @@ public class IssueNoteEventHandler } } + /// + /// 当叫料记录创建后 修改请求的值 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) { From ff167a94d7a06d66f7c97d29271699b30528d803 Mon Sep 17 00:00:00 2001 From: "rongguo.jia" Date: Fri, 14 Apr 2023 10:24:44 +0800 Subject: [PATCH 16/41] =?UTF-8?q?[fix]=E8=A1=A5=E5=85=A8=E9=83=A8=E5=88=86?= =?UTF-8?q?=20EditInput=20->=20Entity=E7=9A=84Mapper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/DTOs/SfsStoreRequestDTOBase.cs | 4 ++-- .../Bases/Inputs/SfsStoreCreateOrUpdateInputBase.cs | 2 +- .../Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs | 2 +- .../Bases/Inputs/SfsStoreImportInputBase.cs | 4 ++-- .../SfsStoreRecommendFromDetailWithFromToInputBase.cs | 2 +- .../Inputs/SfsStoreRecommendToDetailWithFromToInputBase.cs | 2 +- .../Bases/Inputs/SfsStoreRequestCreateOrUpdateInputBase.cs | 4 ++-- .../Inputs/ProductionReturnRequestDetailInput.cs | 6 ++++++ .../Inputs/ProductionReturnRequestEditInput.cs | 2 +- .../Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs | 2 ++ .../ProductionReturnJobAutoMapperProfile.cs | 2 ++ .../ProductReceiptNoteAutoMapperProfile.cs | 2 ++ .../ProductRecycleNoteAutoMapperProfile.cs | 3 +++ .../ProductionReturnNoteAutoMapperProfile.cs | 2 ++ .../DeliverRequests/DeliverRequestAutoMapperProfile.cs | 3 +++ .../ProductReceiptRequestAutoMapperProfile.cs | 3 +++ .../ProductRecycleRequestAutoMapperProfile.cs | 3 +++ .../ProductionReturnRequestAutoMapperProfile.cs | 4 +++- 18 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductionReturnRequests/Inputs/ProductionReturnRequestDetailInput.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRequestDTOBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRequestDTOBase.cs index b0b98b116..ef7d69ea2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRequestDTOBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRequestDTOBase.cs @@ -3,7 +3,7 @@ using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public class SfsStoreRequestDTOBase : SfsStoreDTOBase +public abstract class SfsStoreRequestDTOBase : SfsStoreDTOBase { /// /// 自动提交审批 @@ -18,7 +18,7 @@ public class SfsStoreRequestDTOBase : SfsStoreDTOBase public bool AutoAgree { get; set; } /// - /// 自动执行 + /// 自动执行 /// [Display(Name = "自动执行")] public bool AutoHandle { get; set; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreCreateOrUpdateInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreCreateOrUpdateInputBase.cs index b2d51a740..6e5d4644f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreCreateOrUpdateInputBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreCreateOrUpdateInputBase.cs @@ -5,7 +5,7 @@ using Win_in.Sfs.Shared.Domain; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public class SfsStoreCreateOrUpdateInputBase : SfsCreateOrUpdateInputBase +public abstract class SfsStoreCreateOrUpdateInputBase : SfsCreateOrUpdateInputBase { /// /// 操作员 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs index 2fac6fbd8..0994791e5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs @@ -5,7 +5,7 @@ using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public class SfsStoreDetailWithFromToInputBase +public abstract class SfsStoreDetailWithFromToInputBase : SfsStoreDetailWithQtyInputBase , IHasFromToPacking , IHasFromToLot diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreImportInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreImportInputBase.cs index 5773575ac..4918540e4 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreImportInputBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreImportInputBase.cs @@ -3,7 +3,7 @@ using Win_in.Sfs.Shared.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public class SfsStoreImportInputBase : SfsImportInputBase +public abstract class SfsStoreImportInputBase : SfsImportInputBase { //[Display(Name = "单号")] @@ -35,7 +35,7 @@ public class SfsStoreImportInputBase : SfsImportInputBase public bool AutoAgree { get; set; } = true; /// - /// 自动执行 + /// 自动执行 /// [Display(Name = "自动执行")] [ImporterHeader(IsIgnore = true)] diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithFromToInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithFromToInputBase.cs index 9f0990c48..7c0a2e9f0 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithFromToInputBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithFromToInputBase.cs @@ -4,7 +4,7 @@ using Win_in.Sfs.Shared.Domain; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public class SfsStoreRecommendFromDetailWithFromToInputBase : SfsStoreDetailWithFromToInputBase, IHasRecommendAndHandledFrom +public abstract class SfsStoreRecommendFromDetailWithFromToInputBase : SfsStoreDetailWithFromToInputBase, IHasRecommendAndHandledFrom { #region IHasRecommendFrom /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithFromToInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithFromToInputBase.cs index fe80cb038..b3e0870be 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithFromToInputBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithFromToInputBase.cs @@ -4,7 +4,7 @@ using Win_in.Sfs.Shared.Domain; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public class SfsStoreRecommendToDetailWithFromToInputBase : SfsStoreDetailWithFromToInputBase, IHasRecommendAndHandledTo +public abstract class SfsStoreRecommendToDetailWithFromToInputBase : SfsStoreDetailWithFromToInputBase, IHasRecommendAndHandledTo { #region IHasRecommendTo /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRequestCreateOrUpdateInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRequestCreateOrUpdateInputBase.cs index 19703dfd1..264637389 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRequestCreateOrUpdateInputBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRequestCreateOrUpdateInputBase.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public class SfsStoreRequestCreateOrUpdateInputBase : SfsStoreCreateOrUpdateInputBase +public abstract class SfsStoreRequestCreateOrUpdateInputBase : SfsStoreCreateOrUpdateInputBase { /// /// 自动提交审批 @@ -17,7 +17,7 @@ public class SfsStoreRequestCreateOrUpdateInputBase : SfsStoreCreateOrUpdateInpu public bool AutoAgree { get; set; } = true; /// - /// 自动执行 + /// 自动执行 /// [Display(Name = "自动执行")] public bool AutoHandle { get; set; } = true; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductionReturnRequests/Inputs/ProductionReturnRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductionReturnRequests/Inputs/ProductionReturnRequestDetailInput.cs new file mode 100644 index 000000000..d2919af98 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductionReturnRequests/Inputs/ProductionReturnRequestDetailInput.cs @@ -0,0 +1,6 @@ +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class ProductionReturnRequestDetailInput : SfsStoreDetailWithFromToInputBase +{ + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductionReturnRequests/Inputs/ProductionReturnRequestEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductionReturnRequests/Inputs/ProductionReturnRequestEditInput.cs index eb1000854..e2151cd8e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductionReturnRequests/Inputs/ProductionReturnRequestEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductionReturnRequests/Inputs/ProductionReturnRequestEditInput.cs @@ -24,6 +24,6 @@ public class ProductionReturnRequestEditInput : SfsStoreRequestCreateOrUpdateInp /// 明细列表 /// [Display(Name = "明细列表")] - public List Details { get; set; } = new List(); + public List Details { get; set; } = new List(); #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs index 8457dfc62..f8bccdeb5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs @@ -18,6 +18,8 @@ public partial class StoreApplicationAutoMapperProfile : Profile CreateMap() .IgnoreAuditedObjectProperties(); + CreateMap(); + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.MasterID) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs index a0a6528a9..6eead08ba 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs @@ -16,6 +16,8 @@ public partial class StoreApplicationAutoMapperProfile : Profile .IgnoreAuditedObjectProperties() ; + CreateMap(); + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.MasterID) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs index 9cd37feef..63469e1e2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs @@ -17,6 +17,8 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.ProdLine) .ReverseMap(); + CreateMap(); + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.MasterID) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAutoMapperProfile.cs index a0f5bbb51..bed3ee5c7 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAutoMapperProfile.cs @@ -13,6 +13,8 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.NoteAndBackFlushDetails) .ReverseMap(); + CreateMap(); + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.MasterID) @@ -26,6 +28,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ForMember(x => x.ProductItemDesc2, y => y.MapFrom(d => d.ItemDesc2)) .ReverseMap(); + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.MasterID) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAutoMapperProfile.cs index 497df3542..c6731932e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAutoMapperProfile.cs @@ -14,6 +14,8 @@ public partial class StoreApplicationAutoMapperProfile : Profile CreateMap(); + CreateMap(); + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.MasterID) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs index 63ee8239c..4b0e04202 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs @@ -17,6 +17,8 @@ public partial class StoreApplicationAutoMapperProfile : Profile CreateMap() .ReverseMap(); + CreateMap(); + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.MasterID) @@ -24,6 +26,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Number) .Ignore(x => x.Id); + CreateMap() .ForMember(x => x.DeliverRequestType, y => y.MapFrom(t => EnumDeliverRequestType.Normal)) .Ignore(x => x.CustomerAddressCode) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAutoMapperProfile.cs index 1aa818d21..c68a16c19 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAutoMapperProfile.cs @@ -15,6 +15,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile CreateMap() .ReverseMap(); + CreateMap(); + + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.MasterID) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAutoMapperProfile.cs index 35735aaff..5f5d91fbe 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAutoMapperProfile.cs @@ -23,6 +23,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Number) .Ignore(x => x.Id); + CreateMap(); + + CreateMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs index 8f26ca256..1f074962d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs @@ -16,7 +16,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile .IgnoreAuditedObjectProperties() .ReverseMap(); - CreateMap() + CreateMap(); + + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.ToWarehouseCode) .Ignore(x => x.MasterID) From 8b237f68733a234149a47bfef39de35a492cc05a Mon Sep 17 00:00:00 2001 From: "mingliang.tang" Date: Fri, 14 Apr 2023 10:59:21 +0800 Subject: [PATCH 17/41] =?UTF-8?q?MES=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/VSWorkspaceState.json | 7 ++ .../PullTask/PullTask.cs | 2 +- ...ullTaskDbContextModelCreatingExtensions.cs | 2 +- .../Incoming/MesOutConverter.cs | 14 ++- .../Incoming/PullTaskConverter.cs | 9 +- .../Incoming/PullTaskReader.cs | 3 +- .../Incoming/ScrapConverter.cs | 14 +-- .../MesAgentModule.cs | 18 ++-- ...fs.Wms.DataExchange.Fawtyg.MesAgent.csproj | 1 + ...FrameworkCore.SqlServer.StoreDbContext.sql | 94 +------------------ .../SfsStoreDetailWithFromToInputBase.cs | 1 + .../ProductReceiptNoteAutoMapperProfile.cs | 2 +- .../IHasLocationDtoExtensions.cs | 2 +- .../Transactions/ScrapNoteEventHandler.cs | 2 +- 14 files changed, 49 insertions(+), 122 deletions(-) create mode 100644 .vs/VSWorkspaceState.json diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 000000000..8d5c24c89 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,7 @@ +{ + "ExpandedNodes": [ + "" + ], + "SelectedNode": "\\WZC2.sln", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs index a00d40b80..0fc592abd 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs @@ -19,7 +19,7 @@ public class PullTask : Entity /// /// 数量 /// - public decimal Planqty { get; set; } + public string Planqty { get; set; } /// /// 单号 /// diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs index 0c955f22e..77c9c9330 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs @@ -20,7 +20,7 @@ public static class PullTaskDbContextModelCreatingExtensions b.Property(q => q.no).HasMaxLength(255); b.Property(q => q.Itemno).HasMaxLength(255); b.Property(q => q.Plant).HasMaxLength(255); - b.Property(q => q.Planqty).HasPrecision(18, 2); + b.Property(q => q.Planqty).HasMaxLength(255); b.Property(q => q.Yl1); }); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs index 42bd7e5c8..2902e9ef6 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs @@ -5,6 +5,7 @@ using System.Text.Json; using System.Threading.Tasks; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; +using Org.BouncyCastle.Asn1.Pkcs; using Volo.Abp.ObjectMapping; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; @@ -72,6 +73,7 @@ public class MesOutConverter : IIncomingConverter wmsProductReceiptNote.WorkShop = "";//车间 wmsProductReceiptNote.Worker = _configuration["Authentication:username"];//操作人 wmsProductReceiptNote.ReceiptType = EnumReceiptType.MesScanReceipt;//完工收货方式 + wmsProductReceiptNote.WarehouseCode = ""; wmsProductReceiptNote.Details = new List(); foreach (var incomingFromExternal in group.ToList()) @@ -81,20 +83,24 @@ public class MesOutConverter : IIncomingConverter wmsProductReceiptNoteDetail.Lot = ""; //排序批次 wmsProductReceiptNoteDetail.PackingCode = "";//箱标签 wmsProductReceiptNoteDetail.Status = EnumInventoryStatus.OK; + wmsProductReceiptNoteDetail.WarehouseCode = ""; + wmsProductReceiptNoteDetail.LocationArea = ""; + wmsProductReceiptNoteDetail.LocationGroup = ""; var loc = await _locationAppService.GetListByTypesAndErpCodeAsync(types, wmsProductReceiptNoteDetail.LocationErpCode).ConfigureAwait(false); if (loc != null) { wmsProductReceiptNoteDetail.LocationCode = loc[0].Code; } -; try + try { var item = await _itemBasicAppService.GetByCodeAsync(wmsProductReceiptNoteDetail.ItemCode).ConfigureAwait(false); if (item != null) { wmsProductReceiptNoteDetail.ItemName = item.Name; - wmsProductReceiptNoteDetail.ItemDesc1 = item.Desc1; - wmsProductReceiptNoteDetail.ItemDesc2 = item.Desc2; - wmsProductReceiptNoteDetail.Uom = item.BasicUom; + wmsProductReceiptNoteDetail.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : ""; + wmsProductReceiptNoteDetail.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : ""; + wmsProductReceiptNoteDetail.Uom = !string.IsNullOrEmpty(item.BasicUom) ? item.BasicUom : ""; + } } catch (Exception) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs index 46c86ae65..9a4464f05 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs @@ -11,6 +11,7 @@ using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.WMS.MaterialRequest; using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; @@ -72,16 +73,16 @@ public class PullTaskConverter : IIncomingConverter foreach (var incomingFromExternal in group.ToList()) { var materialRequest = JsonSerializer.Deserialize(incomingFromExternal.DestinationDataContent); - var wmsMaterialRequestDetail = _objectMapper.Map(materialRequest.Detail); + var wmsMaterialRequestDetail = _objectMapper.Map(materialRequest.Detail); var item = await _itemBasicAppService.GetByCodeAsync(wmsMaterialRequestDetail.ItemCode).ConfigureAwait(false); try { if (item != null) { wmsMaterialRequestDetail.ItemName = item.Name; - wmsMaterialRequestDetail.ItemDesc1 = item.Desc1; - wmsMaterialRequestDetail.ItemDesc2 = item.Desc2; - wmsMaterialRequestDetail.Uom = item.BasicUom; + wmsMaterialRequestDetail.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : ""; + wmsMaterialRequestDetail.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : ""; + wmsMaterialRequestDetail.Uom = !string.IsNullOrEmpty(item.BasicUom) ? item.BasicUom : ""; } } catch (Exception) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs index 1faa0b6f8..5996e66ef 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs @@ -29,6 +29,7 @@ public class PullTaskReader : IReader } public virtual async Task> ReadAsync() + { //从MES读取待处理PullTask var toBeProcessedPillTasks = await _pullTaskManager.GetToBeProcessedListAsync().ConfigureAwait(false); @@ -101,7 +102,7 @@ public class PullTaskReader : IReader var materialRequestDetail = new MaterialRequestDetailExchangeDto() { ItemCode = pullTask.Itemno, - Qty = pullTask.Planqty, + Qty = decimal.Parse(pullTask.Planqty), ToLocationCode = pullTask.Plant, }; diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs index 7f8b6a911..878761171 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs @@ -78,15 +78,15 @@ public class ScrapConverter : IIncomingConverter wmsScrapDetail.FromPackingCode = ""; wmsScrapDetail.FromLot = ""; wmsScrapDetail.FromWarehouseCode = ""; - wmsScrapDetail.ToWarehouseCode = ""; - wmsScrapDetail.Uom = ""; - wmsScrapDetail.FromStatus = EnumInventoryStatus.OK; - var item = await _itemBasicAppService.GetByCodeAsync(wmsScrapDetail.ItemCode).ConfigureAwait(false); + wmsScrapDetail.ToWarehouseCode = ""; + wmsScrapDetail.FromStatus = EnumInventoryStatus.OK; + var item = await _itemBasicAppService.GetByCodeAsync(wmsScrapDetail.ItemCode).ConfigureAwait(false); if (item != null) { - wmsScrapDetail.ItemName = item.Name; - wmsScrapDetail.ItemDesc1 = item.Desc1; - wmsScrapDetail.ItemDesc2 = item.Desc2; + wmsScrapDetail.ItemName = item.Name; + wmsScrapDetail.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : ""; + wmsScrapDetail.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : ""; + wmsScrapDetail.Uom = !string.IsNullOrEmpty(item.BasicUom) ? item.BasicUom : ""; } wmsScarp.Details.Add(wmsScrapDetail); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs index 388c48ee8..2a845ffc5 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Polly; using Volo.Abp; +using Volo.Abp.Account; using Volo.Abp.Autofac; using Volo.Abp.AutoMapper; using Volo.Abp.BackgroundJobs; @@ -39,7 +40,8 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; typeof(DataExchangeDomainModule), typeof(DataExchangeEntityFrameworkCoreModule), typeof(DataExchangeDomainFawtygMesModule), - typeof(DataExchangeEntityFrameworkCoreFawtygModule) + typeof(DataExchangeEntityFrameworkCoreFawtygModule), + typeof(AbpAccountApplicationContractsModule) )] public class MesAgentModule : AbpModule { @@ -153,13 +155,13 @@ public class MesAgentModule : AbpModule typeof(LabelApplicationContractsModule).Assembly, "Label" ); - } - - public override async Task OnApplicationInitializationAsync( - ApplicationInitializationContext context) + } + public override void OnApplicationInitialization( + ApplicationInitializationContext context) { - await context.AddBackgroundWorkerAsync().ConfigureAwait(false); - await context.AddBackgroundWorkerAsync().ConfigureAwait(false); - } + context.AddBackgroundWorkerAsync(); + //context.AddBackgroundWorkerAsync(); + } } + diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj index 464b89db6..47d6bcd34 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj @@ -11,6 +11,7 @@ + diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql index 97de80e01..a1c552b2c 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql @@ -5613,96 +5613,4 @@ CREATE UNIQUE INDEX [IX_Store_ScrapNote_Number] ON [Store_ScrapNote] ([Number]) CREATE INDEX [IX_Store_ScrapNoteDetail_MasterID] ON [Store_ScrapNoteDetail] ([MasterID]) -CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromLot], [FromStatus]) WHERE [FromPackingCode] IS NOT NULL AND [FromLot] IS NOT NULL - - -CREATE UNIQUE INDEX [IX_Store_ScrapRequest_Number] ON [Store_ScrapRequest] ([Number]) - - -CREATE INDEX [IX_Store_ScrapRequestDetail_MasterID] ON [Store_ScrapRequestDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_ScrapRequestDetail_Number_ItemCode_LocationCode] ON [Store_ScrapRequestDetail] ([Number], [ItemCode], [LocationCode]) - - -CREATE UNIQUE INDEX [IX_Store_SupplierAsn_Number] ON [Store_SupplierAsn] ([Number]) - - -CREATE INDEX [IX_Store_SupplierAsn_SupplierCode] ON [Store_SupplierAsn] ([SupplierCode]) - - -CREATE INDEX [IX_Store_SupplierAsnDetail_MasterID] ON [Store_SupplierAsnDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_SupplierAsnDetail_Number_ItemCode_PackingCode] ON [Store_SupplierAsnDetail] ([Number], [ItemCode], [PackingCode]) - - -CREATE UNIQUE INDEX [IX_Store_TransferNote_Number] ON [Store_TransferNote] ([Number]) - - -CREATE INDEX [IX_Store_TransferNoteDetail_MasterID] ON [Store_TransferNoteDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_TransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode_FromStatus_ToStatus] ON [Store_TransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromStatus], [ToStatus]) WHERE [FromPackingCode] IS NOT NULL - - -CREATE UNIQUE INDEX [IX_Store_TransferRequest_Number] ON [Store_TransferRequest] ([Number]) - - -CREATE INDEX [IX_Store_TransferRequestDetail_MasterID] ON [Store_TransferRequestDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNote_Number] ON [Store_UnplannedIssueNote] ([Number]) - - -CREATE INDEX [IX_Store_UnplannedIssueNoteDetail_MasterID] ON [Store_UnplannedIssueNoteDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL - - -CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequest_Number] ON [Store_UnplannedIssueRequest] ([Number]) - - -CREATE INDEX [IX_Store_UnplannedIssueRequestDetail_MasterID] ON [Store_UnplannedIssueRequestDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL - - -CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNote_Number] ON [Store_UnplannedReceiptNote] ([Number]) - - -CREATE INDEX [IX_Store_UnplannedReceiptNoteDetail_MasterID] ON [Store_UnplannedReceiptNoteDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL - - -CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequest_Number] ON [Store_UnplannedReceiptRequest] ([Number]) - - -CREATE INDEX [IX_Store_UnplannedReceiptRequestDetail_MasterID] ON [Store_UnplannedReceiptRequestDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL - - -CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNote_Number] ON [Store_WarehouseTransferNote] ([Number]) - - -CREATE INDEX [IX_Store_WarehouseTransferNoteDetail_MasterID] ON [Store_WarehouseTransferNoteDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode] ON [Store_WarehouseTransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode]) WHERE [FromPackingCode] IS NOT NULL - - -CREATE UNIQUE INDEX [IX_Store_WorkOrder_Number] ON [Store_WorkOrder] ([Number]) - - -CREATE INDEX [IX_Store_WorkOrderDetail_MasterID] ON [Store_WorkOrderDetail] ([MasterID]) - - -CREATE UNIQUE INDEX [IX_Store_WorkOrderDetail_Number_ItemCode] ON [Store_WorkOrderDetail] ([Number], [ItemCode]) - - +CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [ \ No newline at end of file diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs index 2fac6fbd8..d357be05b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs @@ -149,5 +149,6 @@ public class SfsStoreDetailWithFromToInputBase /// [Display(Name = "目标库存状态")] public EnumInventoryStatus ToStatus { get; set; } + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs index 9cd37feef..8639da53f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs @@ -11,7 +11,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile { CreateMap() .ReverseMap(); - + CreateMap() .IgnoreAuditedObjectProperties() .Ignore(x => x.ProdLine) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs index 388c601e5..8bfaac66e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs @@ -26,7 +26,7 @@ public static class IHasLocationExtensions { var location = await locationAclService.GetByCodeAsync(hasFromTolocation.FromLocationCode).ConfigureAwait(false); if (location != null) - { + { hasFromTolocation.FromLocationErpCode = location.ErpLocationCode; if (string.IsNullOrEmpty(hasFromTolocation.FromWarehouseCode)) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs index 2e4289476..a5aa5fcbf 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs @@ -85,7 +85,7 @@ public class ScrapNoteEventHandler transferLog.Worker = scrapNote.Worker; transferLog.DocNumber = scrapNote.Number; transferLog.JobNumber = scrapNote.JobNumber; - + transferLogs.Add(transferLog); } From 1f1985da5d270713cee42f39b620d9ed27ad94e7 Mon Sep 17 00:00:00 2001 From: "rongguo.jia" Date: Fri, 14 Apr 2023 11:02:04 +0800 Subject: [PATCH 18/41] =?UTF-8?q?[fix]DelvierRequest=E7=9A=84create,list?= =?UTF-8?q?=E7=AD=89=E8=B0=83=E8=AF=95=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CountAdjustRequestAppService.cs | 26 ++++++++++++++++--- .../DeliverRequestAppService.cs | 18 +++++++++++++ .../ProductionReturnRequestAppService.cs | 17 ++++++++++++ .../PurchaseReturnRequestAppService.cs | 17 ++++++++++++ .../UnplannedIssueRequestAppService.cs | 18 +++++++++++++ .../UnplannedReceiptRequestAppService.cs | 18 +++++++++++++ 6 files changed, 110 insertions(+), 4 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/CountAdjustRequests/CountAdjustRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/CountAdjustRequests/CountAdjustRequestAppService.cs index b843bf578..c0a9e3222 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/CountAdjustRequests/CountAdjustRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/CountAdjustRequests/CountAdjustRequestAppService.cs @@ -1,3 +1,4 @@ +using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -14,15 +15,32 @@ public abstract class CountAdjustRequestAppService : , ICountAdjustRequestAppService { - private readonly ICountAdjustRequestManager _CountAdjustRequestManager; + private readonly ICountAdjustRequestManager _countAdjustRequestManager; public CountAdjustRequestAppService( ICountAdjustRequestRepository repository, - ICountAdjustRequestManager CountAdjustRequestManager + ICountAdjustRequestManager countAdjustRequestManager - ) : base(repository, CountAdjustRequestManager) + ) : base(repository, countAdjustRequestManager) { - _CountAdjustRequestManager = CountAdjustRequestManager; + _countAdjustRequestManager = countAdjustRequestManager; + } + + /// + /// 【创建】盘点调整申请 + /// + /// + /// + [HttpPost("")] + //[Authorize(CountAdjustRequestPermissions.Create)] + public override async Task CreateAsync(CountAdjustRequestEditInput input) + { + var entity = ObjectMapper.Map(input); + + await _countAdjustRequestManager.CreateAsync(entity).ConfigureAwait(false); + + var dto = ObjectMapper.Map(entity); + return dto; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs index 1f2a8185c..439657791 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs @@ -46,6 +46,7 @@ public class DeliverRequestAppService : _customerApp = customerApp; _customerAddressApp = customerAddressApp; } + [HttpPost("list")] public override Task> GetPagedListByFilterAsync( SfsStoreRequestInputBase sfsRequestInput, @@ -58,6 +59,23 @@ public class DeliverRequestAppService : return base.GetPagedListByFilterAsync(sfsRequestInput, includeDetails, cancellationToken); } + /// + /// 【创建】发货申请 + /// + /// + /// + [HttpPost("")] + //[Authorize(DeliverRequestPermissions.Create)] + public override async Task CreateAsync(DeliverRequestEditInput input) + { + var entity = ObjectMapper.Map(input); + + await _deliverRequestManager.CreateAsync(entity).ConfigureAwait(false); + + var dto = ObjectMapper.Map(entity); + return dto; + } + #region import protected virtual async Task CheckImportInputBusinessAsync( DeliverRequestImportInput importInput diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs index a45dc5677..c180d8e1b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs @@ -45,6 +45,23 @@ public class ProductionReturnRequestAppService : _purchaseOrderApp = purchaseOrderApp; } + /// + /// 【创建】生成退料申请 + /// + /// + /// + [HttpPost("")] + //[Authorize(ProductionReturnRequestPermissions.Create)] + public override async Task CreateAsync(ProductionReturnRequestEditInput input) + { + var entity = ObjectMapper.Map(input); + + await _productionReturnRequestManager.CreateAsync(entity).ConfigureAwait(false); + + var dto = ObjectMapper.Map(entity); + return dto; + } + #region import protected virtual async Task CheckImportInputBusinessAsync(ProductionReturnRequestImportInput importInput, EnumImportMethod importMethod, List validationRresult) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs index 11691171d..c5b6388e9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs @@ -55,6 +55,23 @@ public class PurchaseReturnRequestAppService : base.DeletePolicyName = PurchaseReturnRequestPermissions.Delete; } + /// + /// 【创建】采购退货申请 + /// + /// + /// + [HttpPost("")] + //[Authorize(PurchaseReturnRequestPermissions.Create)] + public override async Task CreateAsync(PurchaseReturnRequestEditInput input) + { + var entity = ObjectMapper.Map(input); + + await _purchaseReturnRequestManager.CreateAsync(entity).ConfigureAwait(false); + + var dto = ObjectMapper.Map(entity); + return dto; + } + [HttpPost("check-status")] public virtual async Task CheckStatusAsync(string number) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestAppService.cs index 7fadffaf6..34086c0b9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestAppService.cs @@ -1,3 +1,4 @@ +using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -25,4 +26,21 @@ public abstract class UnplannedIssueRequestAppService : _unplannedIssueRequestManager = unplannedIssueRequestManager; } + /// + /// 【创建】计划外出库申请 + /// + /// + /// + [HttpPost("")] + //[Authorize(UnplannedIssueRequestPermissions.Create)] + public override async Task CreateAsync(UnplannedIssueRequestEditInput input) + { + var entity = ObjectMapper.Map(input); + + await _unplannedIssueRequestManager.CreateAsync(entity).ConfigureAwait(false); + + var dto = ObjectMapper.Map(entity); + return dto; + } + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAppService.cs index 09a40d0b4..bd52a2e00 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAppService.cs @@ -1,3 +1,4 @@ +using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -23,4 +24,21 @@ public abstract class UnplannedReceiptRequestAppService : _unplannedReceiptRequestManager = unplannedReceiptRequestManager; } + /// + /// 【创建】计划外入库申请 + /// + /// + /// + [HttpPost("")] + //[Authorize(UnplannedReceiptRequestPermissions.Create)] + public override async Task CreateAsync(UnplannedReceiptRequestEditInput input) + { + var entity = ObjectMapper.Map(input); + + await _unplannedReceiptRequestManager.CreateAsync(entity).ConfigureAwait(false); + + var dto = ObjectMapper.Map(entity); + return dto; + } + } From 6f12e0770cef61a07854a6acc52e86d0436c8ff0 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Fri, 14 Apr 2023 11:58:55 +0800 Subject: [PATCH 19/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TransferLogs/TransferLogAppService.cs | 5 +- .../Jobs/IssueJobAutoMapperProfile.cs | 42 ++++++------ .../Requests/MaterialRequestEventHandler.cs | 1 + .../Transactions/IssueNoteEventHandler.cs | 67 +++++++++++++------ 4 files changed, 73 insertions(+), 42 deletions(-) diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs index e30d65560..68b010434 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Wms.Inventory.Application.Contracts; @@ -23,15 +24,17 @@ public class TransferLogAppService { private readonly ITransferLogManager _transferLogManager; private readonly IInterfaceCalendarAclService _interfaceCalendarAclService; + private readonly ILocationAppService _locationAppService; public TransferLogAppService( ITransferLogRepository repository , ITransferLogManager transferLogManager , IInterfaceCalendarAclService interfaceCalendarAclService - ) : base(repository) + , ILocationAppService locationAppService) : base(repository) { _transferLogManager = transferLogManager; _interfaceCalendarAclService = interfaceCalendarAclService; + _locationAppService = locationAppService; } [HttpPost("add")] diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs index d78170183..9075447bc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs @@ -56,37 +56,37 @@ public partial class StoreEventAutoMapperProfile : Profile ; CreateMap() - .MapExpectInOutFrom() + .MapExpectInOutFrom() .Ignore(x => x.Worker) .Ignore(x => x.SerialNumber) .Ignore(x => x.ExtraProperties); CreateMap() + .ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.MaterialRequestNumber)) .Ignore(x => x.Confirmed) .Ignore(x => x.JobNumber) - .Ignore(x => x.RequestNumber) .Ignore(x => x.ActiveDate) ; CreateMap() - .Ignore(x => x.IssueTime) - .Ignore(x => x.FromPackingCode) - .Ignore(x => x.ToPackingCode) - .Ignore(x => x.FromContainerCode) - .Ignore(x => x.ToContainerCode) - .Ignore(x => x.FromLot) - .Ignore(x => x.ToLot) - .Ignore(x => x.SupplierBatch) - .Ignore(x => x.ArriveDate) - .Ignore(x => x.ProduceDate) - .Ignore(x => x.ExpireDate) - .Ignore(x => x.FromLocationCode) - .Ignore(x => x.FromLocationArea) - .Ignore(x => x.FromLocationGroup) - .Ignore(x => x.FromLocationErpCode) - .Ignore(x => x.FromWarehouseCode) - .Ignore(x => x.FromStatus) - .Ignore(x => x.ToStatus) - .Ignore(x => x.Qty) + .ForMember(x => x.Qty, y => y.MapFrom(d => d.HandledQty)) + .ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now)) + .ForMember(x => x.FromPackingCode, y => y.MapFrom(d =>d.HandledPackingCode)) + .ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.HandledPackingCode)) + .ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.HandledContainerCode)) + .ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.HandledContainerCode)) + .ForMember(x => x.FromLot, y => y.MapFrom(d => d.HandledLot)) + .ForMember(x => x.ToLot, y => y.MapFrom(d => d.HandledLot)) + .ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.HandledSupplierBatch)) + .ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.HandledArriveDate)) + .ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.HandledProduceDate)) + .ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.ExpiredTime)) + .ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.HandledFromLocationCode)) + .ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.HandledFromLocationArea)) + .ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.HandledFromLocationGroup)) + .ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.HandledFromLocationErpCode)) + .ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.HandledFromWarehouseCode)) + .ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status)) + .ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status)) ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs index 89d439cfb..845a07a72 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs @@ -187,6 +187,7 @@ public class MaterialRequestEventHandler job.WarehouseCode = fromLocation.WarehouseCode; job.ProdLine = fromLocation.LocationGroupCode; job.Worker = materialRequest.Worker; + job.MaterialRequestNumber = materialRequest.Number; return job; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs index 1ec0f954a..e77ff9309 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.EventBus; using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; @@ -20,6 +21,13 @@ public class IssueNoteEventHandler { private const EnumTransType TransType = EnumTransType.Issue; + private readonly ILocationAppService _locationAppService; + + public IssueNoteEventHandler(ILocationAppService locationAppService) + { + _locationAppService = locationAppService; + } + [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { @@ -68,7 +76,7 @@ public class IssueNoteEventHandler private async Task AddTransferLogsAsync(List inputList) { - var transferLogs = new List(); + var transferLogs = new List(); transferLogs.AddRange(inputList); @@ -83,42 +91,48 @@ public class IssueNoteEventHandler { var transferLog = ObjectMapper.Map(detail); + LocationDTO fromLocationDTO = null; + LocationDTO toLocationDTO = null; + if (issueNote.UseOnTheWayLocation) { - var location = await LocationAclService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); + var location = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); switch (route) { case EnumTransferRoute.SourceToOnTheWay: - detail.ToLocationCode = detail.OnTheWayLocationCode; - detail.ToLocationErpCode = location.ErpLocationCode; - detail.ToWarehouseCode = location.WarehouseCode; - detail.ToLocationArea = location.AreaCode; + fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); + + toLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); break; case EnumTransferRoute.OnTheWayToDestination: - detail.FromLocationCode = detail.OnTheWayLocationCode; - detail.FromLocationErpCode = location.ErpLocationCode; - detail.FromWarehouseCode = location.WarehouseCode; - detail.FromLocationArea = location.AreaCode; + fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); + + toLocationDTO = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + + await RemovePackingCodeAndContainerCodeAndLotAsync(transferLog).ConfigureAwait(false); break; case EnumTransferRoute.SourceToDestination: default: throw new ArgumentOutOfRangeException(nameof(route), route, null); } } - - if (issueNote.UseOnTheWayLocation) + else { - transferLog.FromLocationCode = detail.OnTheWayLocationCode; - var location = await LocationAclService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); - transferLog.FromLocationGroup = location.LocationGroupCode; - transferLog.FromLocationArea = location.AreaCode; - transferLog.FromLocationErpCode = location.ErpLocationCode; - transferLog.FromWarehouseCode=location.WarehouseCode; + fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); + toLocationDTO = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); } - transferLog.TransType = TransType; + transferLog.FromLocationCode = fromLocationDTO.Code; + transferLog.FromLocationArea = fromLocationDTO.AreaCode; + transferLog.FromLocationErpCode = fromLocationDTO.ErpLocationCode; + transferLog.FromLocationGroup = fromLocationDTO.LocationGroupCode; + + transferLog.ToLocationCode = toLocationDTO.Code; + transferLog.ToLocationArea = toLocationDTO.AreaCode; + transferLog.ToLocationErpCode = toLocationDTO.ErpLocationCode; + transferLog.ToLocationGroup = toLocationDTO.LocationGroupCode; transferLog.TransSubType = Enum.Parse(issueNote.RequestType); - transferLog.Worker = issueNote.Worker; + transferLog.TransType = TransType; transferLog.DocNumber = issueNote.Number; transferLog.JobNumber = issueNote.JobNumber; @@ -128,4 +142,17 @@ public class IssueNoteEventHandler return transferLogs; } + private async Task RemovePackingCodeAndContainerCodeAndLotAsync(TransferLogEditInput transferLogCreateInput) + { + transferLogCreateInput.ToPackingCode = ""; + transferLogCreateInput.ToLot = ""; + transferLogCreateInput.ToContainerCode = ""; + + transferLogCreateInput.FromPackingCode = ""; + transferLogCreateInput.FromLot = ""; + transferLogCreateInput.FromContainerCode = ""; + + + } + } From 4d0a006f41038f7dcf88bfc76a6a56636e507c34 Mon Sep 17 00:00:00 2001 From: mahao Date: Fri, 14 Apr 2023 13:27:42 +0800 Subject: [PATCH 20/41] =?UTF-8?q?=E4=B8=8A=E6=B5=B7=E4=B8=9C=E9=98=B3?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E5=90=8C=E6=AD=A5=E9=95=BF=E6=98=A5=E4=B8=9C?= =?UTF-8?q?=E9=98=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AsnTimeWindowController.cs | 32 +- .../Controllers/MaterialRequestController.cs | 199 +++++----- .../Controllers/PlanAndActualController.cs | 262 +++++++------ .../Controllers/PurchaseReceiptController.cs | 352 ++++++++++-------- .../IPurchaseReceiptJobAppService.cs | 6 + .../InspectNotes/IInspectNoteAppService.cs | 2 + .../IPurchaseOrderAppService.cs | 2 + .../SupplierAsns/ISupplierAsnAppService.cs | 2 + .../PurchaseReceiptJobAppService.cs | 15 + .../InspectNotes/InspectNoteAppService.cs | 25 ++ .../PurchaseOrders/PurchaseOrderAppService.cs | 18 + .../SupplierAsns/SupplierAsnAppService.cs | 9 + .../Notes/InspectNotes/InspectNoteDetail.cs | 6 + 13 files changed, 534 insertions(+), 396 deletions(-) diff --git a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/AsnTimeWindowController.cs b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/AsnTimeWindowController.cs index 939f02642..be8a7352b 100644 --- a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/AsnTimeWindowController.cs +++ b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/AsnTimeWindowController.cs @@ -8,6 +8,7 @@ using Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers; +using System.Diagnostics.Metrics; using System.Linq; using Win_in.Sfs.Basedata.Application.Contracts; @@ -29,28 +30,28 @@ public class AsnTimeWindowController : AbpController [HttpGet("asn-time-window")] public virtual async Task> GetAsnTimeWindowsAsync() { - return await GetAsnTimeWindowDashboardsAsync().ConfigureAwait(false); + return await GetAsnTimeWindowDashboardsAsync(); } private async Task> GetAsnTimeWindowDashboardsAsync() { - var supplierAsns = await GetSupplierAsnsAsync().ConfigureAwait(false); + var supplierAsns = await this.GetSupplierAsnsAsync(); var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct(); - var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false); + var suppliers = await GetSuppliersAsync(supplierCodes); var asnNumbers = supplierAsns.Select(t => t.Number); - var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers).ConfigureAwait(false); + var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers); - return ConvertToAsnTimeWindowDashboards( + return this.ConvertToAsnTimeWindowDashboards( supplierAsns, suppliers, purchaseReceiptNotes); } - private static List ConvertToAsnTimeWindowDashboards( + private List ConvertToAsnTimeWindowDashboards( List supplierAsns, List suppliers, List purchaseReceiptNotes) @@ -70,16 +71,12 @@ public class AsnTimeWindowController : AbpController var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode); if (supplier == null) - { continue; - } supplierShortName = supplier.ShortName; if (dtos.Exists(t => t.TimeSpan == timeSpan && t.SupplierShortName == supplierShortName)) - { continue; - } var purchaseReceiptNote = purchaseReceiptNotes.FirstOrDefault(t => t.AsnNumber == supplierAsn.Number); @@ -111,17 +108,26 @@ public class AsnTimeWindowController : AbpController endTime.AddDays(-1); } - return await _supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime).ConfigureAwait(false); + return await this._supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime); } private async Task> GetSuppliersAsync(IEnumerable codes) { - return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false); + return await this._supplierApp.GetByCodesAsync(codes); } private async Task> GetPurchaseReceiptNotesAsync(IEnumerable asnNumbers) { - return await _purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false); + return await this._purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers); } + /// + /// + /// + /// + [HttpGet("get-server-date-time")] + public virtual async Task GetServerDate() + { + return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + } } diff --git a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs index c3ff248e8..3e1eea770 100644 --- a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs +++ b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs @@ -2,151 +2,156 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; +using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Wms.Dashboard.Host.Models; -namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers; - -using System.Linq; - -using NUglify.Helpers; +namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers +{ + using System.Linq; -using Win_in.Sfs.Shared.Domain.Shared; -using Win_in.Sfs.Wms.Store.Application.Contracts; + using NUglify.Helpers; -[ApiController] -[Route($"{PdaHostConst.ROOT_ROUTE}material-request")] + using Win_in.Sfs.Shared.Domain.Shared; + using Win_in.Sfs.Wms.Inventory.Application.Contracts; + using Win_in.Sfs.Wms.Store.Application.Contracts; + using static IdentityServer4.Models.IdentityResources; -public class MaterialRequestController : AbpController -{ - private readonly IMaterialRequestAppService _materialRequestApp; + [ApiController] + [Route($"{PdaHostConst.ROOT_ROUTE}material-request")] - private readonly IIssueNoteAppService _issueNoteApp; - public MaterialRequestController(IMaterialRequestAppService materialRequestApp, IIssueNoteAppService issueNoteApp) + public class MaterialRequestController : AbpController { - _materialRequestApp = materialRequestApp; - _issueNoteApp = issueNoteApp; - } + private readonly IMaterialRequestAppService _materialRequestApp; - [HttpGet("un-handled-order-sum")] - public virtual async Task GetUnHandledOrderSumAsync() - { - var dto = new MaterialRequestUnHandledOrderSumDto(); + private readonly IIssueNoteAppService _issueNoteApp; + public MaterialRequestController(IMaterialRequestAppService materialRequestApp, IIssueNoteAppService issueNoteApp) + { + _materialRequestApp = materialRequestApp; + _issueNoteApp = issueNoteApp; + } - var list = await GetMaterialRequestAsync().ConfigureAwait(false); + [HttpGet("un-handled-order-sum")] + public virtual async Task GetUnHandledOrderSumAsync() + { + var dto = new MaterialRequestUnHandledOrderSumDto(); - dto.Sum = list.Where(t => t.RequestStatus == EnumRequestStatus.New).Count(); + var list = await GetMaterialRequestAsync(); - return dto; - } + dto.Sum = list.Where(t => t.RequestStatus == EnumRequestStatus.New).Count(); - [HttpGet("un-issued-item-qty-sum")] - public virtual async Task GetUnIssuedItemQtySumAsync() - { - var dto = new MaterialRequestUnIssuedItemQtySumDto(); + return dto; + } - var list = await GetMaterialRequestAsync().ConfigureAwait(false); + [HttpGet("un-issued-item-qty-sum")] + public virtual async Task GetUnIssuedItemQtySumAsync() + { + var dto = new MaterialRequestUnIssuedItemQtySumDto(); - dto.Sum = list.Where(t => t.RequestStatus != EnumRequestStatus.New) - .Sum(t => t.Details.Sum(t1 => t1.Qty - t1.IssuedQty)); + var list = await GetMaterialRequestAsync(); - return dto; - } + dto.Sum = list.Where(t => t.RequestStatus != EnumRequestStatus.New) + .Sum(t => t.Details.Sum(t1 => t1.Qty - t1.IssuedQty)); - [HttpGet("un-received-item-qty-by-item-list")] - public virtual async Task> - GetUnIssuedItemQtySumByItemListAsync() - { - var dtos = new List(); + return dto; + } - var list = await GetMaterialRequestAsync().ConfigureAwait(false); + [HttpGet("un-received-item-qty-by-item-list")] + public virtual async Task> + GetUnIssuedItemQtySumByItemListAsync() + { + var dtos = new List(); + + var list = await GetMaterialRequestAsync(); - var details = new List(); + var details = new List(); - list.Where(t => t.RequestStatus != EnumRequestStatus.New).ForEach( - item => + list.Where(t => t.RequestStatus != EnumRequestStatus.New).ForEach( + item => { item.Details.ForEach( detail => + { + if (detail.IssuedQty - detail.ReceivedQty > 0) { - if (detail.IssuedQty - detail.ReceivedQty > 0) - { - details.Add(detail); - } - }); + details.Add(detail); + } + }); }); - dtos = details.GroupBy(t => t.ItemCode).Select( - item => new MaterialRequestUnReceivedItemQtyByItemDto() - { - ItemCode = item.Key, - Sum = item.Sum(t => t.IssuedQty - t.ReceivedQty) - }).ToList(); + dtos = details.GroupBy(t => t.ItemCode).Select( + item => new MaterialRequestUnReceivedItemQtyByItemDto() + { + ItemCode = item.Key, + Sum = item.Sum(t => t.IssuedQty - t.ReceivedQty) + }).ToList(); - return dtos; - } + return dtos; + } - [HttpGet("item-qty-by-received-status-list")] - public virtual async Task> GetItemQtyByReceivedStatusListAsync() - { - var dtos = new List(); + [HttpGet("item-qty-by-received-status-list")] + public virtual async Task> GetItemQtyByReceivedStatusListAsync() + { + var dtos = new List(); - var ToBeIssuedQty = 0.0M; + var ToBeIssuedQty = 0.0M; - var ToBeReceivedQty = 0.0M; + var ToBeReceivedQty = 0.0M; - var Received = 0.0M; + var Received = 0.0M; - var list = await GetMaterialRequestAsync().ConfigureAwait(false); + var list = await GetMaterialRequestAsync(); - list.ForEach( - item => + list.ForEach( + item => { ToBeIssuedQty += item.Details.Sum(t => t.ToBeIssuedQty); ToBeReceivedQty += item.Details.Sum(t => t.ToBeReceivedQty); Received += item.Details.Sum(t => t.ReceivedQty); }); - dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求未发", Sum = ToBeIssuedQty }); - dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "已发未收", Sum = ToBeReceivedQty }); - dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求已收", Sum = Received }); - - return dtos; - } - [HttpGet("un-received-item-list")] - public virtual async Task> GetUnReceivedItemListAsync() - { - var dtos = new List(); + dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求未发", Sum = ToBeIssuedQty }); + dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "已发未收", Sum = ToBeReceivedQty }); + dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求已收", Sum = Received }); - var notes = await GetIssueNotesAsync().ConfigureAwait(false); + return dtos; + } - foreach (var note in notes) + [HttpGet("un-received-item-list")] + public virtual async Task> GetUnReceivedItemListAsync() { - foreach (var noteDetail in note.Details) + var dtos = new List(); + + var notes = await this.GetIssueNotesAsync(); + + foreach (var note in notes) { - var dto = new MaterialRequestUnReceivedItemDto(); + foreach (var noteDetail in note.Details) + { + var dto = new MaterialRequestUnReceivedItemDto(); - dto.Number = note.RequestNumber; - dto.ItemCode = noteDetail.ItemCode; - dto.ItemDesc1 = noteDetail.ItemDesc1; - dto.PackingCode = noteDetail.FromPackingCode; - dto.IssuedQty = noteDetail.Qty; - dto.IssuedTime = note.ActiveDate; + dto.Number = note.RequestNumber; + dto.ItemCode = noteDetail.ItemCode; + dto.ItemDesc1 = noteDetail.ItemDesc1; + dto.PackingCode = noteDetail.FromPackingCode; + dto.IssuedQty = noteDetail.Qty; + dto.IssuedTime = note.ActiveDate; - dtos.Add(dto); + dtos.Add(dto); + } } - } - return dtos; - } + return dtos; + } - private async Task> GetIssueNotesAsync() - { - return await _issueNoteApp.GetListUnConfirmedByTypeAsync(EnumTransSubType.Issue_WIP.ToString()).ConfigureAwait(false); - } + private async Task> GetIssueNotesAsync() + { + return await this._issueNoteApp.GetListUnConfirmedByTypeAsync(EnumTransSubType.Issue_WIP.ToString()); + } - private async Task> GetMaterialRequestAsync() - { - return await _materialRequestApp.GetListByTypeAsync(EnumTransSubType.Issue_WIP.ToString()).ConfigureAwait(false); + private async Task> GetMaterialRequestAsync() + { + return await this._materialRequestApp.GetListByTypeAsync(EnumTransSubType.Issue_WIP.ToString()); + } } } diff --git a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs index 0dc46b18f..d54bb4b54 100644 --- a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs +++ b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs @@ -1,174 +1,194 @@ -using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -using Serilog; using Volo.Abp.AspNetCore.Mvc; -using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Wms.Dashboard.Host.Models; +using System; +using System.Linq; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; -namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers; - -[ApiController] -[Route($"{PdaHostConst.ROOT_ROUTE}plan-and-actual")] - -public class PlanAndActualController : AbpController +namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers { - private readonly ISupplierAsnAppService _supplierAsnApp; - private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteApp; - private readonly IPutawayNoteAppService _putawayNoteApp; - private readonly ISupplierAppService _supplierApp; - private readonly IItemSafetyStockAppService _itemSafetyStockApp; - public PlanAndActualController(ISupplierAsnAppService supplierAsnApp, IPurchaseReceiptNoteAppService purchaseReceiptNoteApp, IPutawayNoteAppService putawayNoteApp, ISupplierAppService supplierApp, IItemSafetyStockAppService itemSafetyStockApp) - { - _supplierAsnApp = supplierAsnApp; - _purchaseReceiptNoteApp = purchaseReceiptNoteApp; - _putawayNoteApp = putawayNoteApp; - _supplierApp = supplierApp; - _itemSafetyStockApp = itemSafetyStockApp; - } + [ApiController] + [Route($"{PdaHostConst.ROOT_ROUTE}plan-and-actual")] - [HttpGet("plan-actual-list")] - public virtual async Task> GetPlanAndActualListAsync() + public class PlanAndActualController : AbpController { - return await GetPlanAndActualDashboardsAsync().ConfigureAwait(false); - } + private readonly ISupplierAsnAppService _supplierAsnApp; + private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteApp; + private readonly IPutawayNoteAppService _putawayNoteApp; + private readonly ISupplierAppService _supplierApp; + private readonly IItemSafetyStockAppService _itemSafetyStockApp; + private readonly IPurchaseOrderAppService _purchaseOrderApp; + private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobApp; + + public PlanAndActualController(ISupplierAsnAppService supplierAsnApp, IPurchaseReceiptNoteAppService purchaseReceiptNoteApp, IPutawayNoteAppService putawayNoteApp, ISupplierAppService supplierApp, IItemSafetyStockAppService itemSafetyStockApp, IPurchaseOrderAppService purchaseOrderApp, IPurchaseReceiptJobAppService purchaseReceiptJobApp) + { + _supplierAsnApp = supplierAsnApp; + _purchaseReceiptNoteApp = purchaseReceiptNoteApp; + _putawayNoteApp = putawayNoteApp; + _supplierApp = supplierApp; + _itemSafetyStockApp = itemSafetyStockApp; + _purchaseOrderApp = purchaseOrderApp; + _purchaseReceiptJobApp = purchaseReceiptJobApp; + } - private async Task> GetPlanAndActualDashboardsAsync() - { - var supplierAsns = await GetSupplierAsnsAsync().ConfigureAwait(false); - var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct(); + [HttpGet("plan-actual-list")] + public virtual async Task> GetPlanAndActualListAsync() + { + return await GetPlanAndActualDashboardsAsync(); + } - var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false); + private async Task> GetPlanAndActualDashboardsAsync() + { + var supplierAsns = await this.GetSupplierAsnsAsync(); - var asnNumbers = supplierAsns.Select(t => t.Number); + var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct(); - var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers).ConfigureAwait(false); + var suppliers = await GetSuppliersAsync(supplierCodes); - var putawayNotes = await GetPutawayNotesAsync(asnNumbers).ConfigureAwait(false); + var asnNumbers = supplierAsns.Select(t => t.Number); - var itemSafetyStorks = await GetItemSafetyStocksAsync(supplierAsns).ConfigureAwait(false); + var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers); - return ConvertToPlanAndActualDashboards( - supplierAsns, - suppliers, - purchaseReceiptNotes, - putawayNotes, - itemSafetyStorks); - } + var putawayNotes = await this.GetPutawayNotesAsync(asnNumbers); - private static List ConvertToPlanAndActualDashboards(List supplierAsns, List suppliers, List purchaseReceiptNotes, List putawayNotes, List itemSafetyStorks) - { - var dtos = new List(); + var itemSafetyStorks = await this.GetItemSafetyStocksAsync(supplierAsns); + + return await this.ConvertToPlanAndActualDashboards( + supplierAsns, + suppliers, + purchaseReceiptNotes, + putawayNotes, + itemSafetyStorks); + } - foreach (var supplierAsn in supplierAsns) + private async Task> ConvertToPlanAndActualDashboards(List supplierAsns, List suppliers, List purchaseReceiptNotes, List putawayNotes, List itemSafetyStorks) { - var purchaseReceipts = purchaseReceiptNotes.FindAll(t => t.AsnNumber == supplierAsn.Number); - var putaways = putawayNotes.FindAll(t => t.AsnNumber == supplierAsn.Number); + var dtos = new List(); - var supplierShortName = string.Empty; + foreach (var supplierAsn in supplierAsns) + { + var purchaseReceipts = purchaseReceiptNotes.FindAll(t => t.AsnNumber == supplierAsn.Number); + var putaways = putawayNotes.FindAll(t => t.AsnNumber == supplierAsn.Number); - var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode); + var supplierShortName = string.Empty; - if (supplier == null) - { - continue; - } + var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode); - supplierShortName = supplier.ShortName; + if (supplier == null) + continue; - foreach (var detail in supplierAsn.Details) - { - var dto = dtos.FirstOrDefault(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode); + supplierShortName = supplier.ShortName; - if (dto == null) + foreach (var detail in supplierAsn.Details) { - dto = new PlanAndActualDashboardDto(); + var dto = dtos.FirstOrDefault(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode); - dto.SupplierShortName = supplierShortName; - dto.ItemCode = detail.ItemCode; - dto.ItemDesc1 = detail.ItemDesc1; - dto.ItemName = detail.ItemName; + if (dto == null) + { + dto = new PlanAndActualDashboardDto(); - var itemSafetyStork = itemSafetyStorks.FirstOrDefault(t => t.ItemCode == detail.ItemCode); + dto.SupplierShortName = supplierShortName; + dto.ItemCode = detail.ItemCode; + dto.ItemDesc1 = detail.ItemDesc1; + dto.ItemName = detail.ItemName; - if (itemSafetyStork != null) - { - dto.MaxQty = itemSafetyStork.MaxStock; - dto.MinQty = itemSafetyStork.MinStock; - } + var itemSafetyStork = itemSafetyStorks.FirstOrDefault(t => t.ItemCode == detail.ItemCode); - dto.ReceiptNoteCount = CountReceiptNoteCount(purchaseReceipts, detail.ItemCode, detail.Lot); - dto.ReceiptQty = CountReceiptQty(purchaseReceipts, detail.ItemCode, detail.Lot); - dto.PutawayQty = CountPutawayQty(putawayNotes, detail.ItemCode, detail.Lot); + if (itemSafetyStork != null) + { + dto.MaxQty = itemSafetyStork.MaxStock; + dto.MinQty = itemSafetyStork.MinStock; + } - dtos.Add(dto); - } + var purchaseOrderDtos = await _purchaseOrderApp.GetListBySupplierCodeAsync(supplierAsn.SupplierCode, detail.ItemCode); + var supllierAsn = await _supplierAsnApp.GetForTodayListAsync(); + var poNumberList = supllierAsn.Select(p => p.PoNumber).ToList(); - dto.SupplierAsnCount += 1; + purchaseOrderDtos = purchaseOrderDtos.Where(p => poNumberList.Contains(p.Number)).ToList(); - dto.PlanArriveQty += detail.Qty; - } - } - return dtos.OrderBy(t => t.SupplierShortName).ToList(); - } + decimal allPutawayQty = 0; + decimal allReceiptQty = 0; + decimal allPlanArriveQty = 0; - private static decimal CountPutawayQty(List putawayNotes, string itemCode, string lot) - { - return putawayNotes.Sum(t => t.Details.Where(t => t.ItemCode == itemCode && t.ToLot == lot).Sum(t => t.Qty)); - } + foreach (var purchaseOrderDTO in purchaseOrderDtos) + { + allPutawayQty += purchaseOrderDTO.Details.Where(p => p.ItemCode == detail.ItemCode).Sum(p => p.PutAwayQty); + allReceiptQty += purchaseOrderDTO.Details.Where(p => p.ItemCode == detail.ItemCode).Sum(p => p.ReceivedQty); + allPlanArriveQty += purchaseOrderDTO.Details.Where(p => p.ItemCode == detail.ItemCode).Sum(p => p.ShippedQty); + } - private static decimal CountReceiptQty(List purchaseReceipts, string itemCode, string lot) - { - return purchaseReceipts.Sum(t => t.Details.Where(t => t.ItemCode == itemCode && t.HandledLot == lot).Sum(t => t.Qty)); - } + dto.PutawayQty = allPutawayQty; + dto.PlanArriveQty = allPlanArriveQty; + dto.ReceiptQty = allReceiptQty; - private static int CountReceiptNoteCount(List purchaseReceipts, string itemCode, string lot) - { - return purchaseReceipts.Sum(t => t.Details.Count(t => t.ItemCode == itemCode && t.Lot == lot)); - } + dtos.Add(dto); + } - private async Task> GetSupplierAsnsAsync() - { - var startTime = DateTime.Today.AddHours(DashboardConst.AsnReceiptTimeLimitHour); + var purchaseReceiptJobDtos = await _purchaseReceiptJobApp.GetListBySupplierCodeOnTodayAsync(supplierAsn.SupplierCode); + + dto.ReceiptNoteCount = purchaseReceiptJobDtos.Count(p => p.JobStatus == EnumJobStatus.Done); - var endTime = startTime.AddDays(1).AddSeconds(-1); + dto.SupplierAsnCount = purchaseReceiptJobDtos.Count(); + } + } + + return dtos.OrderBy(t => t.SupplierShortName).ToList(); + } - if (DateTime.Now.Hour < DashboardConst.AsnReceiptTimeLimitHour) + private decimal CountReceiptQty(List purchaseReceipts, string itemCode) { - startTime.AddDays(-1); - endTime.AddDays(-1); + return purchaseReceipts.Sum(t => t.Details.Where(t => t.ItemCode == itemCode).Sum(t => t.Qty)); } - return await _supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime).ConfigureAwait(false); - } + private int CountReceiptNoteCount(List purchaseReceipts, string itemCode) + { + return purchaseReceipts.Sum(t => t.Details.Count(t => t.ItemCode == itemCode)); + } - private async Task> GetSuppliersAsync(IEnumerable codes) - { - return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false); - } + private async Task> GetSupplierAsnsAsync() + { + var startTime = DateTime.Today.AddHours(DashboardConst.AsnReceiptTimeLimitHour); - private async Task> GetPurchaseReceiptNotesAsync(IEnumerable asnNumbers) - { - return await _purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false); - } + var endTime = startTime.AddDays(1).AddSeconds(-1); - private async Task> GetPutawayNotesAsync(IEnumerable asnNumbers) - { - return await _putawayNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false); - } - private async Task> GetItemSafetyStocksAsync(List supplierAsns) - { - var itemCodes = new List(); + if (DateTime.Now.Hour < DashboardConst.AsnReceiptTimeLimitHour) + { + startTime.AddDays(-1); + endTime.AddDays(-1); + } - supplierAsns.ForEach(t => { itemCodes.AddRange(t.Details.Select(t => t.ItemCode).ToList()); }); + return await this._supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime); + } - var itemSafetyStorks = await _itemSafetyStockApp.GetByItemCodesAsync(itemCodes).ConfigureAwait(false); - return itemSafetyStorks; + private async Task> GetSuppliersAsync(IEnumerable codes) + { + return await this._supplierApp.GetByCodesAsync(codes); + } + + private async Task> GetPurchaseReceiptNotesAsync(IEnumerable asnNumbers) + { + return await this._purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers); + } + + private async Task> GetPutawayNotesAsync(IEnumerable asnNumbers) + { + return await this._putawayNoteApp.GetListByAsnNumbers(asnNumbers); + } + private async Task> GetItemSafetyStocksAsync(List supplierAsns) + { + var itemCodes = new List(); + + supplierAsns.ForEach(t => { itemCodes.AddRange(t.Details.Select(t => t.ItemCode).ToList()); }); + + var itemSafetyStorks = await this._itemSafetyStockApp.GetByItemCodesAsync(itemCodes); + return itemSafetyStorks; + } } } diff --git a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs index d4ff0307c..6ecbf7f47 100644 --- a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs +++ b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs @@ -5,233 +5,255 @@ using Volo.Abp.AspNetCore.Mvc; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Wms.Dashboard.Host.Models; -namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers; - -using System.Linq; +namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers +{ + using System; + using System.Linq; -using Win_in.Sfs.Label.Application.Contracts; -using Win_in.Sfs.Shared.Domain.Shared; -using Win_in.Sfs.Wms.Inventory.Application.Contracts; -using Win_in.Sfs.Wms.Store.Application.Contracts; + using Volo.Abp; -[ApiController] -[Route($"{PdaHostConst.ROOT_ROUTE}purchase-receipt")] + using Win_in.Sfs.Label.Application.Contracts; + using Win_in.Sfs.Label.Domain; + using Win_in.Sfs.Shared.Domain.Shared; + using Win_in.Sfs.Wms.Inventory.Application.Contracts; + using Win_in.Sfs.Wms.Store.Application.Contracts; -public class PurchaseReceiptController : AbpController -{ - private readonly IBalanceAppService _balanceApp; - private readonly IInventoryLabelAppService _labelService; - private readonly ISupplierAppService _supplierApp; - private readonly ISupplierAsnAppService _supplierAsnApp; + [ApiController] + [Route($"{PdaHostConst.ROOT_ROUTE}purchase-receipt")] - public PurchaseReceiptController(IBalanceAppService balanceApp, IInventoryLabelAppService labelService, ISupplierAppService supplierApp, ISupplierAsnAppService supplierAsnApp) + public class PurchaseReceiptController : AbpController { - this._balanceApp = balanceApp; - this._labelService = labelService; - this._supplierApp = supplierApp; - this._supplierAsnApp = supplierAsnApp; - } + private readonly IBalanceAppService _balanceApp; + private readonly IInventoryLabelAppService _labelService; + private readonly ISupplierAppService _supplierApp; + private readonly ISupplierAsnAppService _supplierAsnApp; + private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteAppService; + private readonly IInspectNoteAppService _inspectNoteAppService; + + public PurchaseReceiptController(IBalanceAppService balanceApp, IInventoryLabelAppService labelService, ISupplierAppService supplierApp, ISupplierAsnAppService supplierAsnApp, IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService, IInspectNoteAppService inspectNoteAppService) + { + this._balanceApp = balanceApp; + this._labelService = labelService; + this._supplierApp = supplierApp; + this._supplierAsnApp = supplierAsnApp; + _purchaseReceiptNoteAppService = purchaseReceiptNoteAppService; + _inspectNoteAppService = inspectNoteAppService; + } - [HttpGet("receipt-sum-qty")] - public virtual async Task GetReceiptSumQtyAsync() - { - var dto = new PurchaseReceiptSumQtyDashboardDto(); + /// + /// 未上架数量 + /// + /// + [HttpGet("no-put-away-sum-qty")] + public virtual async Task GetNoPutAwaySumQtyAsync() + { + var dto = new PurchaseReceiptSumQtyDashboardDto(); - var items = await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); + var items = await GetPurchaseReceiptItemDashboardAsync(); - dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) }; + dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) }; - return dto; - } + return dto; + } - [HttpGet("receipt-count-by-supplier")] - public virtual async Task> GetReceiptCountBySupplierQtyAsync() - { - var items = await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); + /// + /// 未上架汇总 + /// + /// + [HttpGet("no-put-away-by-supplier")] + public virtual async Task> GetNoPutAwayBySupplierAsync() + { + var items = await GetPurchaseReceiptItemDashboardAsync(); - var dtos = items.GroupBy(t => t.SupplierShortName) - .Select( - t => new PurchaseReceiptCountBySupplierDashboardDto - { - SupplierShortName = t.Key, - Qty = t.Sum(t1 => t1.Qty) - }).OrderBy(t => t.SupplierShortName).ToList(); + var dtos = items.GroupBy(t => t.SupplierShortName) + .Select( + t => new PurchaseReceiptCountBySupplierDashboardDto + { + SupplierShortName = t.Key, + Qty = t.Sum(t1 => t1.Qty) + }).OrderBy(t => t.SupplierShortName).ToList(); - return dtos; - } + return dtos; + } - [HttpGet("receipt-item-list")] - public virtual async Task> GetReceiptItemListAsync() - { - return await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); - } + /// + /// 未上架明细 + /// + /// + [HttpGet("no-put-away-item-list")] + public virtual async Task> GetReceiptItemListAsync() + { + return await GetPurchaseReceiptItemDashboardAsync(); + } - [HttpGet("un-receipt-sum-qty")] - public virtual async Task GetUnReceiptSumQtyAsync() - { - var dto = new PurchaseReceiptSumQtyDashboardDto(); + [HttpGet("un-receipt-sum-qty")] + public virtual async Task GetUnReceiptSumQtyAsync() + { + var dto = new PurchaseReceiptSumQtyDashboardDto(); - var items = await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); + var items = await this.GetUnPurchaseReceiptItemDashboardAsync(); - dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) }; + dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) }; - return dto; - } + return dto; + } - [HttpGet("un-receipt-count-by-supplier")] - public virtual async Task> GetUnReceiptCountBySupplierQtyAsync() - { - var items = await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); + [HttpGet("un-receipt-count-by-supplier")] + public virtual async Task> GetUnReceiptCountBySupplierQtyAsync() + { + var items = await GetUnPurchaseReceiptItemDashboardAsync(); - var dtos = items.GroupBy(t => t.SupplierShortName) - .Select( - t => new PurchaseReceiptCountBySupplierDashboardDto - { - SupplierShortName = t.Key, - Qty = t.Sum(t1 => t1.Qty) - }).OrderBy(t => t.SupplierShortName).ToList(); + var dtos = items.GroupBy(t => t.SupplierShortName) + .Select( + t => new PurchaseReceiptCountBySupplierDashboardDto + { + SupplierShortName = t.Key, + Qty = t.Sum(t1 => t1.Qty) + }).OrderBy(t => t.SupplierShortName).ToList(); - return dtos; - } + return dtos; + } - [HttpGet("un-receipt-item-list")] - public virtual async Task> GetUnReceiptItemListAsync() - { - return await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); - } + [HttpGet("un-receipt-item-list")] + public virtual async Task> GetUnReceiptItemListAsync() + { + return await this.GetUnPurchaseReceiptItemDashboardAsync(); + } - private async Task> GetPurchaseReceiptItemDashboardAsync() - { - var balances = await GetBalancesAsync("INSPECT", EnumInventoryStatus.OK).ConfigureAwait(false); + private async Task> GetPurchaseReceiptItemDashboardAsync() + { + var inspectNoteDetailDto = await _inspectNoteAppService.GetInspectNoteDetailByToDayTaskAsync(); + var packingCodeList = inspectNoteDetailDto.Where(p => p.Status == EnumInventoryStatus.OK).Select(p => p.PackingCode).ToList(); + var balances = await _balanceApp.GetListByPackingCodesAsync(packingCodeList); + balances = balances.Where(p => p.LocationCode == "INSPECT").ToList(); - var packingcodes = balances.Select(t => t.PackingCode).Distinct(); + //var balances = await GetBalancesAsync("INSPECT", EnumInventoryStatus.OK); - var labels = await GetLabelsAsync(packingcodes).ConfigureAwait(false); + var packingcodes = balances.Select(t => t.PackingCode).Distinct(); - var supplierCodes = labels.Select(t => t.SupplierCode).Distinct(); + var labels = await GetLabelsAsync(packingcodes); - var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false); + var supplierCodes = labels.Select(t => t.SupplierCode).Distinct(); - return ConvertToPurchaseReceiptItemDashboard(balances, labels, suppliers); - } + var suppliers = await GetSuppliersAsync(supplierCodes); - private static List ConvertToPurchaseReceiptItemDashboard( - List balances, - List labels, - List suppliers) - { - var dtos = new List(); + return ConvertToPurchaseReceiptItemDashboard(balances, labels, suppliers); + } - foreach (var balance in balances) + private List ConvertToPurchaseReceiptItemDashboard( + List balances, + List labels, + List suppliers) { - var supplierShortName = string.Empty; + var dtos = new List(); - var label = labels.FirstOrDefault(t => t.Code == balance.PackingCode); - - if (label == null) + foreach (var balance in balances) { - continue; - } + var supplierShortName = string.Empty; - var supplier = suppliers.FirstOrDefault(t => t != null && t.Code == label.SupplierCode); + var label = labels.FirstOrDefault(t => t.Code == balance.PackingCode); - if (supplier == null) - { - continue; - } + if (label == null) + continue; - supplierShortName = supplier.ShortName; + var supplier = suppliers.FirstOrDefault(t => t != null && t.Code == label.SupplierCode); - var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == balance.ItemCode); + if (supplier == null) + continue; - if (dto == null) - { - dto = new PurchaseReceiptItemDashboardDto(); + supplierShortName = supplier.ShortName; - dto.SupplierShortName = supplierShortName; - dto.ItemCode = balance.ItemCode; - dto.ItemDesc1 = balance.ItemDesc1; - dto.Qty = 0; + var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == balance.ItemCode); - dtos.Add(dto); - } + if (dto == null) + { + dto = new PurchaseReceiptItemDashboardDto(); - dto.Qty += balance.Qty; - } + dto.SupplierShortName = supplierShortName; + dto.ItemCode = balance.ItemCode; + dto.ItemDesc1 = balance.ItemDesc1; + dto.Qty = 0; - return dtos.OrderBy(t => t.SupplierShortName).ToList(); - } + dtos.Add(dto); + } - private async Task> GetBalancesAsync(string locationCode, EnumInventoryStatus status) - { - return await _balanceApp.GetListByLocationCodeAndStatusAsync(locationCode, status).ConfigureAwait(false); - } - private async Task> GetLabelsAsync(IEnumerable codes) - { - return await _labelService.GetByCodesAsync(codes).ConfigureAwait(false); - } - private async Task> GetSuppliersAsync(IEnumerable codes) - { - return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false); - } + dto.Qty += balance.Qty; + } - private async Task> GetSupplierAsnsAsync() - { - return await _supplierAsnApp.GetForTodayUnReceivedListAsync().ConfigureAwait(false); - } + return dtos.OrderBy(t => t.SupplierShortName).ToList(); + } - private static List ConvertToUnPurchaseReceiptItemDashboard( - List supplierAsns, - List suppliers) - { - var dtos = new List(); + private async Task> GetBalancesAsync(string locationCode, EnumInventoryStatus status) + { + return await this._balanceApp.GetListByLocationCodeAndStatusAsync(locationCode, status); + } + private async Task> GetLabelsAsync(IEnumerable codes) + { + return await this._labelService.GetByCodesAsync(codes); + } + private async Task> GetSuppliersAsync(IEnumerable codes) + { + return await this._supplierApp.GetByCodesAsync(codes); + } - foreach (var supplierAsn in supplierAsns) + private async Task> GetSupplierAsnsAsync() { - var supplierShortName = string.Empty; + return await this._supplierAsnApp.GetForTodayUnReceivedListAsync(); + } - var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode); + private List ConvertToUnPurchaseReceiptItemDashboard( + List supplierAsns, + List suppliers) + { + var dtos = new List(); - if (supplier == null) + foreach (var supplierAsn in supplierAsns) { - continue; - } + var supplierShortName = string.Empty; - supplierShortName = supplier.ShortName; + var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode); - foreach (var detail in supplierAsn.Details) - { - var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode); + if (supplier == null) + continue; - if (dto == null) + supplierShortName = supplier.ShortName; + + foreach (var detail in supplierAsn.Details) { - dto = new PurchaseReceiptItemDashboardDto(); + var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode); - dto.SupplierShortName = supplierShortName; - dto.ItemCode = detail.ItemCode; - dto.ItemDesc1 = detail.ItemDesc1; - dto.Qty = 0; + if (dto == null) + { + dto = new PurchaseReceiptItemDashboardDto(); - dtos.Add(dto); - } + dto.SupplierShortName = supplierShortName; + dto.ItemCode = detail.ItemCode; + dto.ItemDesc1 = detail.ItemDesc1; + dto.Qty = 0; + + dtos.Add(dto); + } - dto.Qty += detail.Qty; + dto.Qty += detail.Qty; + } } - } - return dtos.OrderBy(t => t.SupplierShortName).ToList(); - } + return dtos.OrderBy(t => t.SupplierShortName).ToList(); + } - private async Task> GetUnPurchaseReceiptItemDashboardAsync() - { - var dtos = new List(); + private async Task> GetUnPurchaseReceiptItemDashboardAsync() + { + var dtos = new List(); - var supplierAsns = await GetSupplierAsnsAsync().ConfigureAwait(false); + var supplierAsns = await this.GetSupplierAsnsAsync(); - var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct(); + var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct(); - var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false); + var suppliers = await GetSuppliersAsync(supplierCodes); - return ConvertToUnPurchaseReceiptItemDashboard(supplierAsns, suppliers); + return this.ConvertToUnPurchaseReceiptItemDashboard(supplierAsns, suppliers); + } } + + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs index 1b26733b8..791a05915 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs @@ -48,4 +48,10 @@ public interface IPurchaseReceiptJobAppService /// /// Task GetNoCacheAsync(Guid id); + + /// + /// 根据收货编号获取收货任务 + /// + /// + Task> GetListBySupplierCodeOnTodayAsync(string supplierCode); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InspectNotes/IInspectNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InspectNotes/IInspectNoteAppService.cs index eead05bf0..ea5242e09 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InspectNotes/IInspectNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InspectNotes/IInspectNoteAppService.cs @@ -21,4 +21,6 @@ public interface IInspectNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase /// /// Task> CreateSummaryDetailAndDetailByIdAsync(Guid id, InspectNoteEditInput input); + + Task> GetInspectNoteDetailByToDayTaskAsync(); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs index 9c7fee755..c50180570 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs @@ -37,4 +37,6 @@ public interface IPurchaseOrderAppService /// /// Task> CreateManyAsync(List inputs); + + Task> GetListBySupplierCodeAsync(string supplierCode, string itemCode); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/SupplierAsns/ISupplierAsnAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/SupplierAsns/ISupplierAsnAppService.cs index 2500f94f8..440cf5973 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/SupplierAsns/ISupplierAsnAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Plans/SupplierAsns/ISupplierAsnAppService.cs @@ -34,4 +34,6 @@ public interface ISupplierAsnAppService Task GenerateSupplierAsnNumberAsync(DateTime activeDate); Task UpdateStatusAsync(string asnNumber, EnumSupplierAsnStatus status); + + Task> GetForTodayListAsync(); } 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 22b45c3bf..a72b629b6 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 @@ -191,6 +191,21 @@ public class PurchaseReceiptJobAppService : return ObjectMapper.Map(entity); } + /// + /// 根据供应商编号获取收货任务 + /// + /// + [HttpPost("get-by-supplier-code-on-today/{supplierCode}")] + public virtual async Task> GetListBySupplierCodeOnTodayAsync(string supplierCode) + { + var purchaseReceiptJobs = await _repository.GetListAsync(p => + p.SupplierCode == supplierCode && + p.PlanArriveDate.Year == DateTime.Now.Year && + p.PlanArriveDate.Month == DateTime.Now.Month && + p.PlanArriveDate.Day == DateTime.Now.Day); + var dto = ObjectMapper.Map, List>(purchaseReceiptJobs); + return dto; + } #endregion /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InspectNotes/InspectNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InspectNotes/InspectNoteAppService.cs index 83f622f60..8c4bcb8a4 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InspectNotes/InspectNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InspectNotes/InspectNoteAppService.cs @@ -87,4 +87,29 @@ public class InspectNoteAppService : SfsStoreWithDetailsAppServiceBase< return ObjectMapper.Map, List>(inspectNotes); } + + [HttpPost("detail-list/by-to-day")] + public virtual async Task> GetInspectNoteDetailByToDayTaskAsync() + { + var entitys = await _repository.GetListAsync( + p => p.Details.Any( + y => y.InspectDate.Year == DateTime.Now.Year + && y.InspectDate.Month == DateTime.Now.Month + && y.InspectDate.Day == DateTime.Now.Day), true + ).ConfigureAwait(false); + + List list = new List(); + + + foreach (var entity in entitys) + { + list.AddRange(entity.Details.Where(y => y.InspectDate.Year == DateTime.Now.Year + && y.InspectDate.Month == DateTime.Now.Month + && y.InspectDate.Day == DateTime.Now.Day)); + } + + var detailDtos = ObjectMapper.Map, List>(list); + + return detailDtos; + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs index e386edc0c..8c91beb97 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs @@ -256,4 +256,22 @@ public class PurchaseOrderAppService : return dtos; } + + [HttpGet("get-list-by-supplier-code-and-item-code")] + public virtual async Task> GetListBySupplierCodeAsync(string supplierCode, string itemCode) + { + var entitys = await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode) && p.SupplierCode == supplierCode); + + List list = new List(); + + foreach (var entity in entitys) + { + var purchaseOrder = await _repository.GetAsync(entity.Id); + list.Add(purchaseOrder); + } + + var dtos = ObjectMapper.Map, List>(list); + + return dtos; + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs index b57a4890e..e9ac75db2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs @@ -96,6 +96,15 @@ public class SupplierAsnAppService : await _repository.UpdateAsync(supplierAsn).ConfigureAwait(false); } + [HttpGet("list-for-today")] + public virtual async Task> GetForTodayListAsync() + { + var entities = await _repository.GetListAsync( + p => p.PlanArriveDate.Year == DateTime.Now.Year && p.PlanArriveDate.Month == DateTime.Now.Month && + p.PlanArriveDate.Day == DateTime.Now.Day, true); + + return ObjectMapper.Map, List>(entities); + } #endregion diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InspectNotes/InspectNoteDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InspectNotes/InspectNoteDetail.cs index 6c4886b40..e91cbe0db 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InspectNotes/InspectNoteDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InspectNotes/InspectNoteDetail.cs @@ -1,3 +1,4 @@ +using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Win_in.Sfs.Shared.Domain; @@ -161,4 +162,9 @@ public class InspectNoteDetail : SfsStoreDetailWithLotPackingLocationStatusEntit [Column(TypeName = "decimal(18,6)")] public decimal StdPackQty { get; set; } + /// + /// 质检时间 + /// + [Display(Name = "质检时间")] + public DateTime InspectDate { get; set; } } From 062fab0067e34485a73aef53b833b832e15c2696 Mon Sep 17 00:00:00 2001 From: "mingliang.tang" Date: Fri, 14 Apr 2023 13:36:06 +0800 Subject: [PATCH 21/41] =?UTF-8?q?WMS-TYRP=E5=9B=9E=E6=94=B6=E6=96=99?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Outgoing/ItemTransformNoteConverter.cs | 139 ++++++++++++++++++ .../Outgoing/TyrpOutgoingBackgroundWorker.cs | 4 + ...s.Wms.DataExchange.Fawtyg.TyrpAgent.csproj | 1 + .../Enums/EnumOutgoingDataType.cs | 1 + .../ItemTransformNoteDetailExchangeDto.cs | 45 ++++++ .../ItemTransformNoteExchangeDto.cs | 30 ++++ .../DTOs/ItemTransformNoteDTO.cs | 5 +- .../DTOs/ItemTransformNoteDetailDTO.cs | 6 +- .../Transactions/ScrapNoteEventHandler.cs | 1 - 9 files changed, 229 insertions(+), 3 deletions(-) create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs create mode 100644 be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs create mode 100644 be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteExchangeDto.cs diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs new file mode 100644 index 000000000..8e25bb6a7 --- /dev/null +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using Volo.Abp.ObjectMapping; +using Win_in.Sfs.Auth.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.DataExchange.Domain; +using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; +using Win_in.Sfs.Wms.DataExchange.Domain.Shared; +using Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote; +using Win_in.Sfs.Wms.Store.Application.Contracts; + +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing; + + public class ItemTransformNoteConverter : IOutgoingConverter + { + private readonly IOutgoingFromWmsManager _outgoingFromWmsManager; + private readonly IOutgoingToExternalManager _outgoingToExternalManager; + private readonly ISupplierAsnAppService _supplierAsnAppService; + private readonly IDepartmentAppService _departmentAppService; + private readonly IObjectMapper _objectMapper; + + public ItemTransformNoteConverter( + IOutgoingFromWmsManager outgoingFromWmsManager + , IOutgoingToExternalManager outgoingToExternalManager + , ISupplierAsnAppService supplierAsnAppService + , IDepartmentAppService departmentAppService + , IObjectMapper objectMapper + ) + { + _outgoingFromWmsManager = outgoingFromWmsManager; + _outgoingToExternalManager = outgoingToExternalManager; + _supplierAsnAppService = supplierAsnAppService; + _departmentAppService = departmentAppService; + _objectMapper = objectMapper; + } + + public virtual async Task> ConvertAsync() + { + var outgoingToExternalList = new List(); + var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.Item_Transform, EnumSystemType.ERP).ConfigureAwait(false); + foreach (var outgoingFromWms in outgoingFromWmsList) + { + var wmsCountAdjust = JsonSerializer.Deserialize(outgoingFromWms.DataContent); + if (Enum.Parse(wmsCountAdjust.Type) == EnumTransSubType.Item_Transform) + { + var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); + var departmentCode = department == null ? "" : department.Code; + var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.ToItemCode, r.LocationErpCode, r.ToLocationCode }).Select(p => new ItemTransformNoteDetailExchangeDto { ToQty = p.Sum(itm => itm.ToQty), FromQty = p.Sum(itm => itm.FromQty), ItemCode = p.Key.ItemCode, ToItemCode = p.Key.ToItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); + foreach (var detail in details) + { + List ItemTransform = new List(); + ItemTransformNoteDetailExchangeDto ItemTrans = new ItemTransformNoteDetailExchangeDto(); + ItemTrans.ItemCode = detail.ItemCode; + ItemTrans.LocationErpCode = detail.LocationErpCode; + ItemTrans.FromQty = detail.FromQty - detail.FromQty - detail.FromQty; + ItemTrans.ReasonCode = detail.ReasonCode; + ItemTransform.Add(ItemTrans); + ItemTransformNoteDetailExchangeDto ItemTranss = new ItemTransformNoteDetailExchangeDto(); + ItemTranss.ItemCode = detail.ToItemCode; + ItemTranss.LocationErpCode = detail.LocationErpCode; + ItemTranss.FromQty = detail.ToQty; + ItemTranss.ReasonCode = detail.ReasonCode; + ItemTransform.Add(ItemTranss); + foreach (var Item in ItemTransform) + { + var outgoingToExternal = new OutgoingToExternal() + { + DataType = outgoingFromWms.DataType, + DataAction = outgoingFromWms.DataAction, + SourceSystem = EnumSystemType.WMS.ToString(), + SourceDataId = wmsCountAdjust.Number, + SourceDataGroupCode = wmsCountAdjust.Number, + SourceDataDetailCode = Item.ItemCode, + Writer = nameof(TyrpOutgoingBackgroundWorker), + DestinationSystem = EnumSystemType.ERP.ToString(), + DestinationDataId = "", + }; + outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); + var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, Item).ConfigureAwait(false); + outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); + var arrive = BuildIssue(exchangeIssue, departmentCode); + outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); + + outgoingToExternalList.Add(outgoingToExternal); + } + + } + } + } + await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false); ; + //将outgoingFromWms数据归档 + await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false); ; + return outgoingToExternalList; + //插入到中间表OutgoingToExternal + } + + private CountAdjust BuildIssue(ItemTransformNoteExchangeDto exchangeCountAdjust, string departmentCode) + { + var detail = exchangeCountAdjust.Detail; + string asdtype = ""; + if (Enum.Parse(exchangeCountAdjust.Type) == EnumTransSubType.Item_Transform) + { + asdtype = "4003"; + } + var counta = new CountAdjust() + { + mesout_asd_refc = departmentCode, + mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + mesout_asd_type = asdtype, + mesout_asd_part = detail.ItemCode, + mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"), + mesout_asd_loc = detail.LocationErpCode, + mesout_asd_code = detail.ReasonCode, + mesout_asd_qty = detail.FromQty, + mesout_asd_user = exchangeCountAdjust.Worker, + mesout_asd_k = string.Empty, + mesout_asd_stat = "Y" + + }; + + + return counta; + + } + + private async Task BuildPurchaseReceiptExchangeDtoAsync( + ItemTransformNoteDTO wmsCountAdjust, ItemTransformNoteDetailExchangeDto wmsCountAdjustDetail) + { + + var exchangeCountAdjust = _objectMapper.Map(wmsCountAdjust); + + exchangeCountAdjust.Detail = wmsCountAdjustDetail; + return exchangeCountAdjust; + } + } + diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs index 0344a59ed..52ca1123a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs @@ -120,6 +120,10 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase var scrapNoteList = await scrapNoteConvert.ConvertAsync().ConfigureAwait(false); await countadjustWriter.WriteAsync(scrapNoteList).ConfigureAwait(false); + Logger.LogInformation($"Write ItemTransformNote");//回收料调整单 + var ItemTransformNoteConvert = workerContext.ServiceProvider.GetRequiredService(); + var ItemTransformNoteList = await ItemTransformNoteConvert.ConvertAsync().ConfigureAwait(false); + await countadjustWriter.WriteAsync(ItemTransformNoteList).ConfigureAwait(false); Logger.LogInformation($"Completed: Handling {Outgoing}"); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj index bdec28966..f7135a83a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj @@ -31,6 +31,7 @@ + diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs index 798adcc81..cc783226f 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs @@ -30,6 +30,7 @@ public enum EnumOutgoingDataType RecycledMaterialReceipt = 22, ScrapNote = 23, ProductRecycle = 24, + Item_Transform = 25 } public enum EnumExchangeTableType { diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs new file mode 100644 index 000000000..211d70c8c --- /dev/null +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs @@ -0,0 +1,45 @@ + +using System.ComponentModel.DataAnnotations; + +namespace Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote; + +public class ItemTransformNoteDetailExchangeDto +{ + /// + /// 物品代码 + /// + [Display(Name = "物品代码")] + public string ItemCode { get; set; } + /// + /// ERP库位 + /// + [Display(Name = "ERP库位")] + public string LocationErpCode { get; set; } + /// + /// 原因代码 + /// + [Display(Name = "原因代码")] + public string ReasonCode { get; set; } + /// + /// 调整数量 + /// + [Display(Name = "来源数量")] + public decimal FromQty { get; set; } + /// + /// 目标数量 + /// + [Display(Name = "目标数量")] + public decimal ToQty { get; set; } + /// + /// 目标库位 + /// + [Display(Name = "目标库位")] + [Required(ErrorMessage = "{0}是必填项")] + public string ToLocationCode { get; set; } + /// + /// 目标物品代码 + /// + [Display(Name = "目标物品代码")] + public string ToItemCode { get; set; } + +} diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteExchangeDto.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteExchangeDto.cs new file mode 100644 index 000000000..64c529b77 --- /dev/null +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteExchangeDto.cs @@ -0,0 +1,30 @@ +using System; +using System.ComponentModel.DataAnnotations; +namespace Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote; + +public class ItemTransformNoteExchangeDto +{ + /// + /// 单据号 + /// + public string Number { get; set; } + /// + /// 生效日期 + /// + public DateTime ActiveDate { get; set; } = DateTime.Now.Date; + /// + /// 操作员 + /// + public string Worker { get; set; } + + /// + /// 类型 + /// + public string Type { get; set; } + + /// + /// 明细 + /// + [Display(Name = "明细")] + public ItemTransformNoteDetailExchangeDto Detail { get; set; } = new(); +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ItemTransformNotes/DTOs/ItemTransformNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ItemTransformNotes/DTOs/ItemTransformNoteDTO.cs index 10c1b8257..bf96e9680 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ItemTransformNotes/DTOs/ItemTransformNoteDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ItemTransformNotes/DTOs/ItemTransformNoteDTO.cs @@ -19,5 +19,8 @@ public class ItemTransformNoteDTO : SfsStoreDTOBase, [Display(Name = "任务单号")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string JobNumber { get; set; } - + /// + /// 调整类型 + /// + public string Type { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ItemTransformNotes/DTOs/ItemTransformNoteDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ItemTransformNotes/DTOs/ItemTransformNoteDetailDTO.cs index 12cd97405..6357fe2fd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ItemTransformNotes/DTOs/ItemTransformNoteDetailDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ItemTransformNotes/DTOs/ItemTransformNoteDetailDTO.cs @@ -214,7 +214,11 @@ public class ItemTransformNoteDetailDTO : SfsStoreDetailDTOBase /// [Display(Name = "目标ERP储位")] public string ToLocationErpCode { get; set; } - + /// + /// ERP库位 + /// + [Display(Name = "ERP库位")] + public string LocationErpCode { get; set; } /// /// 目标仓库 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs index 5501481a8..981f42265 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs @@ -7,7 +7,6 @@ using Volo.Abp.Uow; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; -using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Event.Transaction; From 8a0c77959a3ce68dd0cc8a33704125a3a8132d8c Mon Sep 17 00:00:00 2001 From: "rongguo.jia" Date: Fri, 14 Apr 2023 14:44:29 +0800 Subject: [PATCH 22/41] =?UTF-8?q?[fix]DeliverRequestFis=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/SfsStoreRequestAppServiceBase.cs | 3 ++- .../DeliverRequestFisAppService.cs | 24 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsStoreRequestAppServiceBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsStoreRequestAppServiceBase.cs index e82144b3a..7bed7b52d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsStoreRequestAppServiceBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsStoreRequestAppServiceBase.cs @@ -157,7 +157,8 @@ public abstract class SfsStoreRequestAppServiceBase CompleteByNumberAsync(string number) { var entity = await _repository.FindAsync(p => p.Number == number).ConfigureAwait(false); - Check.NotNull(entity, typeof(TEntity).Name); + if (entity == null) return null; + // Check.NotNull(entity, typeof(TEntity).Name); var result = await _requestManager.CompleteAsync(entity).ConfigureAwait(false); var dto = ObjectMapper.Map(result); return dto; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs index 84975add6..5dd549d4c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs @@ -35,14 +35,14 @@ public class DeliverRequestFisAppService : public DeliverRequestFisAppService( IDeliverRequestRepository repository, - IDeliverRequestManager DeliverRequestManager, + IDeliverRequestManager deliverRequestManager, IAreaAppService areaApp, ICustomerAppService customerApp, ICustomerAddressAppService customerAddressApp ) - : base(repository, DeliverRequestManager) + : base(repository, deliverRequestManager) { - _deliverRequestManager = DeliverRequestManager; + _deliverRequestManager = deliverRequestManager; _areaApp = areaApp; _customerApp = customerApp; _customerAddressApp = customerAddressApp; @@ -60,6 +60,24 @@ public class DeliverRequestFisAppService : return base.GetPagedListByFilterAsync(sfsRequestInput, includeDetails, cancellationToken); } + + /// + /// 【创建】发货申请 + /// + /// + /// + [HttpPost("")] + //[Authorize(DeliverRequestPermissions.Create)] + public override async Task CreateAsync(DeliverRequestEditInput input) + { + var entity = ObjectMapper.Map(input); + + await _deliverRequestManager.CreateAsync(entity).ConfigureAwait(false); + + var dto = ObjectMapper.Map(entity); + return dto; + } + #region import protected virtual async Task CheckImportInputBusinessAsync( From 97dacca3da1249387f3780f62edf735bd3d41d2d Mon Sep 17 00:00:00 2001 From: mahao Date: Fri, 14 Apr 2023 15:49:57 +0800 Subject: [PATCH 23/41] =?UTF-8?q?=E8=AE=A1=E9=87=8F=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=BF=85=E5=A1=AB=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Uoms/Inputs/UomImportInput.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs index 43aadd97c..ee648999a 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs @@ -19,6 +19,7 @@ public class UomImportInput : SfsBaseDataImportInputBase /// 名称 /// [Display(Name = "名称")] + [Required(ErrorMessage = "{0}是必填项")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string Name { get; set; } From f3925ba1c2425b2148a53327a79d5d2a1c246860 Mon Sep 17 00:00:00 2001 From: "rongguo.jia" Date: Fri, 14 Apr 2023 17:45:44 +0800 Subject: [PATCH 24/41] =?UTF-8?q?[fix]ApiFox=E8=B0=83=E8=AF=95=E9=80=9A?= =?UTF-8?q?=E8=BF=87:=E6=88=90=E5=93=81=E5=8F=91=E8=B4=A7=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=09api/wms/store/deliver-request/list=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=E6=88=90=E5=93=81=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=E4=BB=BB=E5=8A=A1=09api/wms/store/deliver-job/list=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=E6=88=90?= =?UTF-8?q?=E5=93=81=E5=8F=91=E8=B4=A7=E8=AE=B0=E5=BD=95=09api/wms/store/d?= =?UTF-8?q?eliver-note/list-for-normal=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20FIS=E5=8F=91=E8=B4=A7=E7=94=B3=E8=AF=B7=09api/wm?= =?UTF-8?q?s/store/deliver-request-fis/list=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20FIS=E5=8F=91=E8=B4=A7=E8=AE=B0=E5=BD=95=09?= =?UTF-8?q?api/wms/store/deliver-note/list-for-fis=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=E5=AE=A2=E6=88=B7=E9=80=80=E6=8B=86?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=09api/wms/store/product-recycle-request/list?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E9=80=80=E6=8B=86=E8=AE=B0=E5=BD=95=09api/wms/store/p?= =?UTF-8?q?roduct-recycle-note/list=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=E7=94=9F=E4=BA=A7=E9=80=80=E5=BA=93=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=09api/wms/store/production-return-request/list=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E9=80=80=E8=B4=A7=E4=BB=BB=E5=8A=A1=09api/wms/store/production?= =?UTF-8?q?-return-job/list=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=E7=94=9F=E4=BA=A7=E9=80=80=E5=BA=93=E8=AE=B0=E5=BD=95=09?= =?UTF-8?q?api/wms/store/production-return-note/list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...FrameworkCore.SqlServer.StoreDbContext.sql | 95 ++++++++++++++++++- .../Controllers/Stores/L7Controller.cs | 2 +- .../DeliverNotes/IDeliverNoteAppService.cs | 26 +++++ .../IProductRecycleNoteAppService.cs | 1 - .../ProductRecycleNoteAppService.cs | 17 ---- .../ProductionReturnNoteAppService.cs | 2 +- ...roductionReturnRequestAutoMapperProfile.cs | 1 - .../ProductionReturnJobAutoMapperProfile.cs | 7 +- ....cs => ProductionReturnJobEventHandler.cs} | 2 +- 9 files changed, 125 insertions(+), 28 deletions(-) rename be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/{ProductionReturnStoreEventHandler.cs => ProductionReturnJobEventHandler.cs} (98%) diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql index 472671bb6..f10be54b4 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql @@ -3069,6 +3069,7 @@ CREATE TABLE [Store_InspectNoteDetail] ( [Weight] nvarchar(max) NULL, [OtherPropertyJson] nvarchar(max) NULL, [StdPackQty] decimal(18,6) NOT NULL, + [InspectDate] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL, [CreatorId] uniqueidentifier NULL, [LastModificationTime] datetime2 NULL, @@ -5614,4 +5615,96 @@ CREATE UNIQUE INDEX [IX_Store_ScrapNote_Number] ON [Store_ScrapNote] ([Number]) CREATE INDEX [IX_Store_ScrapNoteDetail_MasterID] ON [Store_ScrapNoteDetail] ([MasterID]) -CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [ \ No newline at end of file +CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromLot], [FromStatus]) WHERE [FromPackingCode] IS NOT NULL AND [FromLot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_ScrapRequest_Number] ON [Store_ScrapRequest] ([Number]) + + +CREATE INDEX [IX_Store_ScrapRequestDetail_MasterID] ON [Store_ScrapRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_ScrapRequestDetail_Number_ItemCode_LocationCode] ON [Store_ScrapRequestDetail] ([Number], [ItemCode], [LocationCode]) + + +CREATE UNIQUE INDEX [IX_Store_SupplierAsn_Number] ON [Store_SupplierAsn] ([Number]) + + +CREATE INDEX [IX_Store_SupplierAsn_SupplierCode] ON [Store_SupplierAsn] ([SupplierCode]) + + +CREATE INDEX [IX_Store_SupplierAsnDetail_MasterID] ON [Store_SupplierAsnDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_SupplierAsnDetail_Number_ItemCode_PackingCode] ON [Store_SupplierAsnDetail] ([Number], [ItemCode], [PackingCode]) + + +CREATE UNIQUE INDEX [IX_Store_TransferNote_Number] ON [Store_TransferNote] ([Number]) + + +CREATE INDEX [IX_Store_TransferNoteDetail_MasterID] ON [Store_TransferNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_TransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode_FromStatus_ToStatus] ON [Store_TransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromStatus], [ToStatus]) WHERE [FromPackingCode] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_TransferRequest_Number] ON [Store_TransferRequest] ([Number]) + + +CREATE INDEX [IX_Store_TransferRequestDetail_MasterID] ON [Store_TransferRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNote_Number] ON [Store_UnplannedIssueNote] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedIssueNoteDetail_MasterID] ON [Store_UnplannedIssueNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequest_Number] ON [Store_UnplannedIssueRequest] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedIssueRequestDetail_MasterID] ON [Store_UnplannedIssueRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNote_Number] ON [Store_UnplannedReceiptNote] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedReceiptNoteDetail_MasterID] ON [Store_UnplannedReceiptNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequest_Number] ON [Store_UnplannedReceiptRequest] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedReceiptRequestDetail_MasterID] ON [Store_UnplannedReceiptRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNote_Number] ON [Store_WarehouseTransferNote] ([Number]) + + +CREATE INDEX [IX_Store_WarehouseTransferNoteDetail_MasterID] ON [Store_WarehouseTransferNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode] ON [Store_WarehouseTransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode]) WHERE [FromPackingCode] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_WorkOrder_Number] ON [Store_WorkOrder] ([Number]) + + +CREATE INDEX [IX_Store_WorkOrderDetail_MasterID] ON [Store_WorkOrderDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_WorkOrderDetail_Number_ItemCode] ON [Store_WorkOrderDetail] ([Number], [ItemCode]) + + diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs index a3b534eaa..6b6a9fd09 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs @@ -54,7 +54,7 @@ public class L7Controller : AbpController [HttpPost("create-product-recycle-note-with-l7")] public virtual async Task CreateProductRecycleNoteWithL7Async(ProductRecycleNoteEditInput input) { - return await _productRecycleNoteAppService.CreateWithL7Async(input).ConfigureAwait(false); + return await _productRecycleNoteAppService.CreateAsync(input).ConfigureAwait(false); } /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/IDeliverNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/IDeliverNoteAppService.cs index eb39e36ee..b0aab9524 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/IDeliverNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/IDeliverNoteAppService.cs @@ -1,4 +1,9 @@ +using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -9,4 +14,25 @@ public interface IDeliverNoteAppService : Task CreateWithL7Async(DeliverNoteEditInput input); + Task> GetForFisListAsync( + SfsStoreRequestInputBase sfsRequestDTO, + bool includeDetails = false, + CancellationToken cancellationToken = default); + + Task> GetForNormalListAsync( + SfsStoreRequestInputBase sfsRequestDTO, + bool includeDetails = false, + CancellationToken cancellationToken = default); + + Task> GetForRAWListAsync( + SfsStoreRequestInputBase sfsRequestDTO, + bool includeDetails = false, + CancellationToken cancellationToken = default); + + + Task ExportForNormalAsync(SfsStoreRequestInputBase requestInput); + + Task ExportForRAWAsync(SfsExportRequestInput requestInput); + + Task SumPrintAsync(string number); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductRecycleNotes/IProductRecycleNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductRecycleNotes/IProductRecycleNoteAppService.cs index 8a4425a1e..426677c67 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductRecycleNotes/IProductRecycleNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductRecycleNotes/IProductRecycleNoteAppService.cs @@ -7,5 +7,4 @@ public interface IProductRecycleNoteAppService : { Task CreateAsync(ProductRecycleNoteEditInput input); - Task CreateWithL7Async(ProductRecycleNoteEditInput input); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAppService.cs index 36e876a07..db384ee8f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAppService.cs @@ -54,23 +54,6 @@ public class ProductRecycleNoteAppService : return dto; } - /// - /// 新增退货接口 - /// - /// - /// - [HttpPost("create-with-l7")] - public virtual async Task CreateWithL7Async(ProductRecycleNoteEditInput input) - { - var entity = ObjectMapper.Map(input); - - await _productRecycleNoteManager.CreateAsync(entity).ConfigureAwait(false); - - var dto = ObjectMapper.Map(entity); - - return dto; - } - [HttpGet("note-and-back-flush/{id}")] public virtual async Task GetNoteAndBackFlushAsync(Guid id) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs index 302071a0f..35db79092 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs @@ -28,7 +28,7 @@ public class ProductionReturnNoteAppService : } /// - /// 新增接口 + /// 新增实体 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs index 1f074962d..18c6c170f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs @@ -20,7 +20,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile CreateMap() .IgnoreAuditedObjectProperties() - .Ignore(x => x.ToWarehouseCode) .Ignore(x => x.MasterID) .Ignore(x => x.TenantId) .Ignore(x => x.Number) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductionReturnJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductionReturnJobAutoMapperProfile.cs index 2bef49393..f75b41476 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductionReturnJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductionReturnJobAutoMapperProfile.cs @@ -52,9 +52,6 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .MapExpectInOutTo() - .Ignore(x => x.LocationArea) - .Ignore(x => x.LocationGroup) - .Ignore(x => x.WarehouseCode) .Ignore(x => x.SerialNumber) .Ignore(x => x.Worker) .Ignore(x => x.ExtraProperties) @@ -63,10 +60,10 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .MapExpectInOutTo() .ForMember(x => x.LocationCode, y => y.MapFrom(d => d.FromLocationCode)) + .ForMember(x => x.LocationArea, y => y.MapFrom(d => d.FromLocationArea)) + .ForMember(x => x.LocationGroup, y => y.MapFrom(d => d.FromLocationGroup)) .ForMember(x => x.LocationErpCode, y => y.MapFrom(d => d.FromLocationErpCode)) .ForMember(x => x.WarehouseCode, y => y.MapFrom(d => d.FromWarehouseCode)) - .Ignore(x => x.LocationArea) - .Ignore(x => x.LocationGroup) .Ignore(x => x.SerialNumber) .Ignore(x => x.Worker) .Ignore(x => x.ExtraProperties); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnStoreEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnJobEventHandler.cs similarity index 98% rename from be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnStoreEventHandler.cs rename to be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnJobEventHandler.cs index 4c80640e3..5635bf206 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnStoreEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnJobEventHandler.cs @@ -9,7 +9,7 @@ using Win_in.Sfs.Wms.Store.Event.Inventories; namespace Win_in.Sfs.Wms.Store.Event.ExpectInOuts; -public class ProductionReturnStoreEventHandler : +public class ProductionReturnJobEventHandler : StoreExpectInOutEventHandlerBase , ILocalEventHandler> , ILocalEventHandler> From 00b8b260874a67f79b98796a176f44afa5366873 Mon Sep 17 00:00:00 2001 From: "rongguo.jia" Date: Fri, 14 Apr 2023 18:12:29 +0800 Subject: [PATCH 25/41] =?UTF-8?q?[fix]ApiFox=E8=B0=83=E8=AF=95=E9=80=9A?= =?UTF-8?q?=E8=BF=87=20=E7=BA=BF=E8=BE=B9=E4=BB=93=E7=BC=B4=E5=BA=93?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=09api/wms/store/product-receipt-request/by-t?= =?UTF-8?q?ype/ProductReceipt=5FWIP=20=E7=BA=BF=E8=BE=B9=E4=BB=93=E7=BC=B4?= =?UTF-8?q?=E5=BA=93=E8=AE=B0=E5=BD=95=09api/wms/store/product-receipt-not?= =?UTF-8?q?e/by-type/ProductReceipt=5FWIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inputs/ProductReceiptRequestEditInput.cs | 3 ++- .../ProductReceiptRequestAppService.cs | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs index 09f948138..b91d9c807 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -70,7 +71,7 @@ public class ProductReceiptRequestEditInput : SfsStoreRequestCreateOrUpdateInput /// 类型 /// [Display(Name = "类型")] - public string EnumProductReceiptType { get; set; } + public EnumProductReceiptType Type { get; set; } /// /// 明细列表 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs index 5a388cefe..54689060c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs @@ -6,12 +6,14 @@ using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; using DocumentFormat.OpenXml.Office.CustomUI; +using FluentValidation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities; +using Volo.Abp.Validation; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; @@ -176,7 +178,12 @@ public class ProductReceiptRequestAppService : bool includeDetails = false, CancellationToken cancellationToken = default) { - Expression> expression = p => p.Type.ToString() == type; + if (!EnumProductReceiptType.TryParse(type, true, out EnumProductReceiptType enumType)) + { + throw new AbpValidationException($"type {type} is not valid"); + } + + Expression> expression = p => p.Type == enumType; if (requestInput.Condition.Filters?.Count > 0) { expression = expression.And(requestInput.Condition.Filters.ToLambda()); From eada31f702bc482e8a5bc90e98503db174b8a352 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Fri, 14 Apr 2023 20:23:55 +0800 Subject: [PATCH 26/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8F=AB=E6=96=99=20=E4=BA=BA=E5=B7=A5=E5=8F=91=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PurchaseOrderAppService.cs | 6 +- ...FrameworkCore.SqlServer.StoreDbContext.sql | 94 +++++++++++++++++- .../Jobs/PurchaseReceiptJobController.cs | 2 +- .../Controllers/Stores/IssueNoteController.cs | 3 +- .../Balances/BalanceManager.cs | 7 +- .../Enums/Inventory/EnumTransSubType.cs | 6 ++ .../Enums/Store/EnumMaterialRequestType.cs | 2 +- .../IPurchaseReceiptJobAppService.cs | 8 -- .../PurchaseReceiptJobAppService.cs | 77 +++++++-------- .../Notes/IssueNotes/IssueNoteAppService.cs | 10 +- .../PurchaseOrders/PurchaseOrderAppService.cs | 97 +++++++++---------- .../Plans/CountPlans/CountPlanAppService.cs | 17 ---- .../MaterialRequestAppService.cs | 40 +++++--- .../Jobs/IssueJobs/IssueJobManager.cs | 13 ++- .../Plans/CountPlans/CountPlanManager.cs | 18 ++-- .../MaterialRequestManager.cs | 27 ++++-- .../Requests/MaterialRequestEventHandler.cs | 6 +- .../Requests/Note/IssueNoteEventHandler.cs | 2 +- 18 files changed, 270 insertions(+), 165 deletions(-) diff --git a/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs b/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs index 085cf9304..441352764 100644 --- a/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs +++ b/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs @@ -22,7 +22,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad; [ApiExplorerSettings(GroupName = SwaggerGroupConsts.WmsWebApi)] public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppService { - private readonly Store.Application.Contracts.IPurchaseOrderAppService _purchaseOrderAppService; + //private readonly Store.Application.Contracts.IPurchaseOrderAppService _purchaseOrderAppService; private readonly IPo_mstrRepository _po_mstrRepository; @@ -34,7 +34,7 @@ public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppServ IConfiguration configuration ) { - _purchaseOrderAppService = purchaseOrderAppService; + //_purchaseOrderAppService = purchaseOrderAppService; _po_mstrRepository = po_mstrRepository; _configuration = configuration; } @@ -77,7 +77,7 @@ public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppServ targetObj.ContactEmail = ""; #endregion - await _purchaseOrderAppService.UpsertAsync(targetObj).ConfigureAwait(false); + //await _purchaseOrderAppService.UpsertAsync(targetObj).ConfigureAwait(false); } catch (Exception ex) { diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql index 472671bb6..8cbecdc09 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql @@ -5614,4 +5614,96 @@ CREATE UNIQUE INDEX [IX_Store_ScrapNote_Number] ON [Store_ScrapNote] ([Number]) CREATE INDEX [IX_Store_ScrapNoteDetail_MasterID] ON [Store_ScrapNoteDetail] ([MasterID]) -CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [ \ No newline at end of file +CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromLot], [FromStatus]) WHERE [FromPackingCode] IS NOT NULL AND [FromLot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_ScrapRequest_Number] ON [Store_ScrapRequest] ([Number]) + + +CREATE INDEX [IX_Store_ScrapRequestDetail_MasterID] ON [Store_ScrapRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_ScrapRequestDetail_Number_ItemCode_LocationCode] ON [Store_ScrapRequestDetail] ([Number], [ItemCode], [LocationCode]) + + +CREATE UNIQUE INDEX [IX_Store_SupplierAsn_Number] ON [Store_SupplierAsn] ([Number]) + + +CREATE INDEX [IX_Store_SupplierAsn_SupplierCode] ON [Store_SupplierAsn] ([SupplierCode]) + + +CREATE INDEX [IX_Store_SupplierAsnDetail_MasterID] ON [Store_SupplierAsnDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_SupplierAsnDetail_Number_ItemCode_PackingCode] ON [Store_SupplierAsnDetail] ([Number], [ItemCode], [PackingCode]) + + +CREATE UNIQUE INDEX [IX_Store_TransferNote_Number] ON [Store_TransferNote] ([Number]) + + +CREATE INDEX [IX_Store_TransferNoteDetail_MasterID] ON [Store_TransferNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_TransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode_FromStatus_ToStatus] ON [Store_TransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromStatus], [ToStatus]) WHERE [FromPackingCode] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_TransferRequest_Number] ON [Store_TransferRequest] ([Number]) + + +CREATE INDEX [IX_Store_TransferRequestDetail_MasterID] ON [Store_TransferRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNote_Number] ON [Store_UnplannedIssueNote] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedIssueNoteDetail_MasterID] ON [Store_UnplannedIssueNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequest_Number] ON [Store_UnplannedIssueRequest] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedIssueRequestDetail_MasterID] ON [Store_UnplannedIssueRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNote_Number] ON [Store_UnplannedReceiptNote] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedReceiptNoteDetail_MasterID] ON [Store_UnplannedReceiptNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequest_Number] ON [Store_UnplannedReceiptRequest] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedReceiptRequestDetail_MasterID] ON [Store_UnplannedReceiptRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNote_Number] ON [Store_WarehouseTransferNote] ([Number]) + + +CREATE INDEX [IX_Store_WarehouseTransferNoteDetail_MasterID] ON [Store_WarehouseTransferNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode] ON [Store_WarehouseTransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode]) WHERE [FromPackingCode] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_WorkOrder_Number] ON [Store_WorkOrder] ([Number]) + + +CREATE INDEX [IX_Store_WorkOrderDetail_MasterID] ON [Store_WorkOrderDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_WorkOrderDetail_Number_ItemCode] ON [Store_WorkOrderDetail] ([Number], [ItemCode]) + + diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs index dc0477c94..907793da8 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs @@ -53,7 +53,7 @@ public class PurchaseReceiptJobController : AbpController [HttpGet("{id}")] public virtual async Task> GetAsync(Guid id) { - var result = await _purchaseReceiptJobAppService.GetNoCacheAsync(id).ConfigureAwait(false); + var result = await _purchaseReceiptJobAppService.GetAsync(id).ConfigureAwait(false); var supplier = await _supplierAppService.GetByCodeAsync(result.SupplierCode).ConfigureAwait(false); result.SupplierName = supplier.Name; diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs index 450e9326c..86c329304 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs @@ -33,7 +33,7 @@ public class IssueNoteController : AbpController [HttpPost("")] public virtual async Task CreateAsync([FromBody] IssueNoteEditInput input) { - input.RequestType = EnumMaterialRequestType.Direct_Issue.ToString(); + input.RequestType = EnumMaterialRequestType.Issue_Direct.ToString(); input.Details.ForEach(p => { @@ -54,5 +54,4 @@ public class IssueNoteController : AbpController { return await _issueNoteAppService.ConfirmAsync(id).ConfigureAwait(false); } - } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs index 7eb2e6173..65dd8b377 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs @@ -423,9 +423,12 @@ public class BalanceManager : DomainService, IBalanceManager expression = expression.And(p => p.ExpireDate > DateTime.Now); } //筛选有效库区 - if (validLocationAreas.Any()) + if (validLocationAreas.Any() ) { - expression = expression.And(p => validLocationAreas.Contains(p.LocationArea)); + if (!string.IsNullOrEmpty(validLocationAreas[0])) + { + expression = expression.And(p => validLocationAreas.Contains(p.LocationArea)); + } } var allBalances = await (await _balanceRepository.GetDbSetAsync().ConfigureAwait(false)) 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 f99e6672e..451f73df2 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 @@ -127,6 +127,12 @@ public enum EnumTransSubType [Display(Name = "安全库存拉动")] Issue_SafetyStock = 1504, + /// + /// 直接发料 + /// + [Display(Name = "直接发料")] + Issue_Direct = 1505, + /// /// 标准发货 /// diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs index 245c1f9e8..0fa48dec0 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs @@ -28,5 +28,5 @@ public enum EnumMaterialRequestType //Issue_SfaetyStock = 1504, [Display(Name = "直接发料")] - Direct_Issue = 1505 + Issue_Direct = 1505 } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs index 1b26733b8..dc4e8ffe1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs @@ -40,12 +40,4 @@ public interface IPurchaseReceiptJobAppService /// /// Task> SetInspectWithNotInspectAsync(Guid id); - - /// - /// 按Id获取实体 不走缓存 - /// - /// 实体Id - /// - /// - Task GetNoCacheAsync(Guid id); } 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 22b45c3bf..aa58ca118 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 @@ -5,7 +5,6 @@ using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Volo.Abp.ObjectMapping; using Win_in.Sfs.FileStorage.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -22,31 +21,21 @@ public class PurchaseReceiptJobAppService : , IPurchaseReceiptJobAppService { private readonly IFileAppService _fileAppService; - private readonly IInspectJobManager _inspectJobManager; - private readonly IInspectRequestAppService _inspectRequestAppService; private readonly IPurchaseReceiptJobManager _purchaseReceiptJobManager; - private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteAppService; /// /// /// - /// /// /// - /// /// public PurchaseReceiptJobAppService(IPurchaseReceiptJobRepository repository, - IInspectJobManager inspectJobManager, IPurchaseReceiptJobManager purchaseReceiptJobManager, IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService, - IInspectRequestAppService inspectRequestAppService, IFileAppService fileAppService) : base(repository, purchaseReceiptJobManager) { _purchaseReceiptJobManager = purchaseReceiptJobManager; - _purchaseReceiptNoteAppService = purchaseReceiptNoteAppService; - _inspectRequestAppService = inspectRequestAppService; _fileAppService = fileAppService; - _inspectJobManager = inspectJobManager; } #region 东阳使用 @@ -151,49 +140,38 @@ public class PurchaseReceiptJobAppService : var dict = await _fileAppService.CreateManyHasDictAsync(input.FilesList).ConfigureAwait(false); detail.InspectPhotoJson = JsonSerializer.Serialize(dict); } - - if (detail != null) + else { - detail.FailedReason = input.FailedReason; - detail.MassDefect = input.MassDefect; - detail.PurchaseReceiptInspectStatus = input.PurchaseReceiptInspectStatus; - detail.HandledLot = detail.RecommendLot; - detail.HandledSupplierBatch = detail.RecommendSupplierBatch; - detail.HandledArriveDate = detail.RecommendArriveDate; - detail.HandledProduceDate = detail.RecommendProduceDate; - detail.HandledExpireDate = detail.RecommendExpireDate; - detail.HandledToLocationArea=detail.RecommendToLocationArea; - detail.HandledToLocationGroup=detail.RecommendToLocationGroup; - detail.HandledContainerCode = detail.RecommendContainerCode; - detail.HandledToLocationCode = detail.RecommendToLocationCode; - detail.HandledToLocationErpCode = detail.RecommendToLocationErpCode; - detail.HandledToWarehouseCode = detail.RecommendToWarehouseCode; - detail.HandledPackingCode = detail.RecommendPackingCode; - detail.HandledQty = detail.RecommendQty; + detail.InspectPhotoJson = string.Empty; } + detail.FailedReason = input.FailedReason; + detail.MassDefect = input.MassDefect; + detail.PurchaseReceiptInspectStatus = input.PurchaseReceiptInspectStatus; + detail.HandledLot = detail.RecommendLot; + detail.HandledSupplierBatch = detail.RecommendSupplierBatch; + detail.HandledArriveDate = detail.RecommendArriveDate; + detail.HandledProduceDate = detail.RecommendProduceDate; + detail.HandledExpireDate = detail.RecommendExpireDate; + detail.HandledToLocationArea = detail.RecommendToLocationArea; + detail.HandledToLocationGroup = detail.RecommendToLocationGroup; + detail.HandledContainerCode = detail.RecommendContainerCode; + detail.HandledToLocationCode = detail.RecommendToLocationCode; + detail.HandledToLocationErpCode = detail.RecommendToLocationErpCode; + detail.HandledToWarehouseCode = detail.RecommendToWarehouseCode; + detail.HandledPackingCode = detail.RecommendPackingCode; + detail.HandledQty = detail.RecommendQty; + var entity = await _repository.UpdateAsync(job).ConfigureAwait(false); return ObjectMapper.Map( entity.Details.Find(p => p.Id == input.DetailId)); } - /// - /// 按Id获取实体 不走缓存 - /// - /// 实体Id - /// - /// - [HttpGet("no-cache/{id}")] - public virtual async Task GetNoCacheAsync(Guid id) - { - var entity= await _repository.GetAsync(id).ConfigureAwait(false); - return ObjectMapper.Map(entity); - } - #endregion /// + /// 取消收货 /// /// [HttpPost("cancel-by-request/{purchaseReceiptRequestNumber}")] @@ -207,6 +185,21 @@ public class PurchaseReceiptJobAppService : } } + ///// + ///// 取消请求 + ///// + ///// + //[HttpPost("cancel-by-request/{purchaseReceiptRequestNumber}")] + //public virtual async Task CancelByPurchaseReceiptRequestAsync(string purchaseReceiptRequestNumber) + //{ + // var entities = await _repository + // .GetListAsync(p => p.PurchaseReceiptRequestNumber == purchaseReceiptRequestNumber).ConfigureAwait(false); + // foreach (var entity in entities) + // { + // await _purchaseReceiptJobManager.CancelAsync(entity).ConfigureAwait(false); + // } + //} + /* /// /// 承接收货任务 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAppService.cs index ea96420d5..af6df5643 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAppService.cs @@ -8,7 +8,9 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -50,9 +52,11 @@ public class IssueNoteAppService : [HttpPost("confirm/{id}")] public virtual async Task ConfirmAsync(Guid id) { - var entity = await _issueNoteManager.ConfirmAsync(id).ConfigureAwait(false); - var dto = ObjectMapper.Map(entity); - return dto; + var issueNote= await _repository.GetAsync(id).ConfigureAwait(false); + issueNote.Confirmed = true; + issueNote=await _repository.UpdateAsync(issueNote).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData(issueNote), false).ConfigureAwait(false); + return ObjectMapper.Map(issueNote); } [HttpPost("confirm-by-number/{number}")] diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs index e386edc0c..9e4cd7008 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs @@ -3,23 +3,15 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -using DocumentFormat.OpenXml.Office2010.ExcelAc; -using DocumentFormat.OpenXml.Spreadsheet; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Volo.Abp; -using Volo.Abp.Uow; -using Volo.Abp.Users; using Win_in.Sfs.Basedata.Application.Contracts; -using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; -using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; -using PurchaseOrderDetail = Win_in.Sfs.Wms.Store.Domain.PurchaseOrderDetail; namespace Win_in.Sfs.Wms.Store.Application; @@ -34,7 +26,7 @@ public class PurchaseOrderAppService : private readonly IPurchaseOrderManager _purchaseOrderManager; private readonly ISupplierAppService _supplierAppService; private readonly IItemBasicAppService _itemBasicAppService; - + public PurchaseOrderAppService( IPurchaseOrderRepository repository, IPurchaseOrderManager purchaseOrderManager, @@ -53,30 +45,31 @@ public class PurchaseOrderAppService : #region 东阳使用 /// - /// 用来重写 导入数据时可以加工数据 + /// 用来重写 导入数据时可以加工数据 /// /// /// protected override async Task> ImportProcessingEntityAsync( Dictionary dictionary) { - var addList= dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); foreach (var purchaseOrder in addList) { purchaseOrder.CreatorId = CurrentUser.Id; purchaseOrder.Worker = CurrentUser.Name; - var supplierDto=await _supplierAppService.GetByCodeAsync(purchaseOrder.SupplierCode).ConfigureAwait(false); + var supplierDto = + await _supplierAppService.GetByCodeAsync(purchaseOrder.SupplierCode).ConfigureAwait(false); purchaseOrder.SupplierCode = supplierDto.Code; purchaseOrder.SupplierAddress = supplierDto.Address; - purchaseOrder.SupplierName= supplierDto.Name; + purchaseOrder.SupplierName = supplierDto.Name; foreach (var detail in purchaseOrder.Details) { - var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); - detail.ItemName= itemBasicDto.Name; + detail.ItemName = itemBasicDto.Name; detail.ItemDesc1 = itemBasicDto.Desc1; detail.ItemDesc2 = itemBasicDto.Desc2; } @@ -87,10 +80,8 @@ public class PurchaseOrderAppService : #endregion - - /// - /// 【创建】采购订单 + /// 【创建】采购订单 /// /// /// @@ -111,7 +102,7 @@ public class PurchaseOrderAppService : } /// - /// 【批量创建】采购订单 + /// 【批量创建】采购订单 /// /// /// @@ -163,8 +154,6 @@ public class PurchaseOrderAppService : await _repository.UpdateAsync(entity).ConfigureAwait(false); } - #region Function - [HttpPost("complete/{number}")] public async Task CompleteAsync(string number) { @@ -173,9 +162,6 @@ public class PurchaseOrderAppService : } [HttpPost("cancel/{id}")] - - #endregion - [HttpPost("{id}/detail/open/{detailId}")] public virtual async Task OpenDetailAsync(Guid id, Guid detailId) { @@ -188,13 +174,6 @@ public class PurchaseOrderAppService : await _purchaseOrderManager.CloseDetailAsync(id, detailId).ConfigureAwait(false); } - [HttpPost("check-status")] - public virtual async Task CheckStatusAsync(string number) - { - await Task.CompletedTask.ConfigureAwait(false); - throw new NotImplementedException(); - } - [HttpPost("upsert")] public virtual async Task UpsertAsync(PurchaseOrderEditInput input) { @@ -202,6 +181,27 @@ public class PurchaseOrderAppService : await _repository.UpsertAsync(entity).ConfigureAwait(false); } + + [HttpGet("get-list-by-item-code")] + public virtual async Task> GetListByItemCodeAsync(string itemCode) + { + var entitys = await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode)) + .ConfigureAwait(false); + + var dtos = ObjectMapper.Map, List>(entitys); + + return dtos; + } + + #region 校验 + + [HttpPost("check-status")] + public virtual async Task CheckStatusAsync(string number) + { + await Task.CompletedTask.ConfigureAwait(false); + throw new NotImplementedException(); + } + protected virtual async Task CheckImportInputBusinessAsync(PurchaseOrderImportInput importInput, EnumImportMethod importMethod, List validationRresult) { @@ -231,29 +231,20 @@ public class PurchaseOrderAppService : Check.NotNull(item, "供应商代码", "供应商不存在"); } - protected override async Task GetEntityAsync(PurchaseOrderImportInput importInput) - { - return await _repository.FindAsync(t => t.Number == importInput.Number).ConfigureAwait(false); - } - - protected virtual async Task ImportDataAsync(List entites, List deleteEntities) - { - await _purchaseOrderManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); - } - - protected override Func GetEntityExpression() - { - return t => t.Number; - } + #endregion - [HttpGet("get-list-by-item-code")] - public virtual async Task> GetListByItemCodeAsync(string itemCode) - { - var entitys = await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode)) - .ConfigureAwait(false); + //protected override async Task GetEntityAsync(PurchaseOrderImportInput importInput) + //{ + // return await _repository.FindAsync(t => t.Number == importInput.Number).ConfigureAwait(false); + //} - var dtos = ObjectMapper.Map, List>(entitys); + //protected virtual async Task ImportDataAsync(List entites, List deleteEntities) + //{ + // await _purchaseOrderManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); + //} - return dtos; - } + //protected override Func GetEntityExpression() + //{ + // return t => t.Number; + //} } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs index 597a98ee4..a750ba193 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs @@ -121,23 +121,6 @@ public class CountPlanAppService : await _countPlanManager.CompleteAsync(id, type).ConfigureAwait(false); } - /* - /// - /// 校正库存 - /// - /// - /// - [HttpPost("adjust/{id}")] - public virtual async Task AdjustAsync(Guid id) - { - - var entity = await _repository.FindAsync(id); - Check.NotNull(entity, EntityClassName); - - await _countPlanManager.AdjustAsync(entity); - - } - */ [HttpPost("check-status")] public virtual async Task CheckStatusAsync(string number) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs index d7f3a3545..fb06276e5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs @@ -42,7 +42,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase(input); + foreach (var detail in entity.Details) + { + var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false); + + detail.ToLocationArea= toLocationDto.AreaCode; + detail.ToLocationErpCode = toLocationDto.ErpLocationCode; + detail.ToLocationGroup = toLocationDto.LocationGroupCode; + detail.ToWarehouseCode= toLocationDto.WarehouseCode; + } + + entity.UseOnTheWayLocation = true; var result = await _materialRequestManager.CreateBynNumberAsync(entity).ConfigureAwait(false); @@ -372,7 +390,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase CheckItemBasicAsync(MaterialRequestImportInput importInput, List validationRresult) { - var item = await ItemBasicAclService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false); + var item = await _itemBasicAppService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false); if (item == null) { validationRresult.Add(new ValidationResult($"物品代码{importInput.ItemCode}不存在", new[] { "物品代码" })); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IssueJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IssueJobManager.cs index 7590d0ddc..ead66142e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IssueJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IssueJobManager.cs @@ -33,8 +33,17 @@ public class IssueJobManager : SfsJobManagerBase, IIss foreach (var detail in input.Details) { //发料子任务 赋值实际转移 - await entity.BuildDetail(detail.Id, detail.HandledFromLocationCode, detail.HandledFromLocationErpCode, detail.HandledFromWarehouseCode, - detail.HandledQty, detail.HandledSupplierBatch, detail.HandledArriveDate, detail.HandledProduceDate, detail.HandledExpireDate, detail.HandledContainerCode, detail.HandledLot, + await entity.BuildDetail(detail.Id, + detail.HandledFromLocationCode, + detail.HandledFromLocationErpCode, + detail.HandledFromWarehouseCode, + detail.HandledQty, + detail.HandledSupplierBatch, + detail.HandledArriveDate, + detail.HandledProduceDate, + detail.HandledExpireDate, + detail.HandledContainerCode, + detail.HandledLot, detail.HandledPackingCode).ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs index bebfabce1..88cf2c24a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs @@ -107,9 +107,11 @@ public class CountPlanManager : SfsStoreRequestManagerBase 0) { - SfsBaseDataRequestInputBase itemInput = new SfsBaseDataRequestInputBase(); - itemInput.Condition = partCondition; - itemInput.MaxResultCount = 99999; + var itemInput = new SfsBaseDataRequestInputBase + { + Condition = partCondition, + MaxResultCount = 99999 + }; var itemBaseList = await ItemBasicAppService.GetAllListByFilterAsync(itemInput, false).ConfigureAwait(false); @@ -119,16 +121,18 @@ public class CountPlanManager : SfsStoreRequestManagerBase 0) { - SfsBaseDataRequestInputBase locInput = new SfsBaseDataRequestInputBase(); - locInput.Condition = locCondition; - locInput.MaxResultCount = 99999; + var locInput = new SfsBaseDataRequestInputBase + { + Condition = locCondition, + MaxResultCount = 99999 + }; var locList = await LocationAppService.GetAllListByFilterAsync(locInput, false).ConfigureAwait(false); //库位列表 selectLocationCodes = locList.Select(p => p.Code).Distinct().ToList(); } //状态查询 - string statusStr = System.Text.Json.JsonSerializer.Serialize(selectStatusList.Select(p => (int)p).ToList()); + var statusStr = System.Text.Json.JsonSerializer.Serialize(selectStatusList.Select(p => (int)p).ToList()); //最终的查询条件语句 SfsInventoryRequestInputBase banlanceInput = new SfsInventoryRequestInputBase(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs index de51fc56f..02f0fe835 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs @@ -1,6 +1,9 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Shared.Event; +using static Win_in.Sfs.Wms.Store.Domain.Shared.StoreSettings; namespace Win_in.Sfs.Wms.Store.Domain; @@ -26,16 +29,13 @@ public class MaterialRequestManager { var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(typeof(MaterialRequest).Name, entity.ActiveDate).ConfigureAwait(false) : entity.Number; entity.SetIdAndNumberWithDetails(GuidGenerator, number); - await PublishCreatedAsync(entity).ConfigureAwait(false); - - if (entity.AutoSubmit) - { - return await SubmitAsync(entity).ConfigureAwait(false); - } - else - { - return await Repository.InsertAsync(entity).ConfigureAwait(false); - } + entity.Submit(); + entity.Agree(); + entity.RequestStatus = EnumRequestStatus.Partial; + await LocalEventBus.PublishAsync(new SfsHandledEntityEventData(entity), false) + .ConfigureAwait(false); + await _repository.InsertAsync(entity).ConfigureAwait(false); + return entity; } @@ -128,6 +128,13 @@ public class MaterialRequestManager oldEntity.ReplaceDetail(newDetail.Id, newDetail); } + var flag=oldEntity.Details.Any(p => p.ReceivedQty < p.Qty);//还有补料完 没收到的货 + + if (!flag) + { + oldEntity.Complete(); + } + await Repository.UpdateAsync(oldEntity).ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs index 845a07a72..df7782591 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs @@ -214,7 +214,10 @@ public class MaterialRequestEventHandler var detail = await BuildIssueJobDetailAsync(materialRequestDetail, recommend, toLocationGroupCode).ConfigureAwait(false); if (materialRequest.UseOnTheWayLocation) { - detail.OnTheWayLocationCode = await SettingManager.GetOrNullGlobalAsync(StoreSettings.Common.IssueOnTheWayLocation).ConfigureAwait(false); + //获取在途库 + var locationDto= await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false); + + detail.OnTheWayLocationCode = locationDto.Code; } jobDetails.Add(detail); @@ -251,6 +254,7 @@ public class MaterialRequestEventHandler detail.ToLocationCode = materialRequestDetail.ToLocationCode; detail.ToLocationErpCode = materialRequestDetail.ToLocationErpCode; + detail.ToLocationArea= materialRequestDetail.ToLocationArea; detail.ToWarehouseCode = materialRequestDetail.ToWarehouseCode; detail.ToLocationGroup = materialRequestDetail.ToLocationGroup; //detail.Operation = //TODO diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs index e113d92e4..94d4e8369 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs @@ -46,7 +46,7 @@ public class IssueNoteEventHandler var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); - if (entity.RequestType != EnumMaterialRequestType.Direct_Issue.ToString()) + if (entity.RequestType != EnumMaterialRequestType.Issue_Direct.ToString()) { //更新叫料请求的已收数量 foreach (var materialRequestDetail in materialRequest.Details) From 0d34dd8ca26ed8a1aff757173198e4c425512700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Sat, 15 Apr 2023 01:33:35 +0800 Subject: [PATCH 27/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E6=94=B6=E6=96=99=20=E6=94=B6=E8=B4=A7=E3=80=91=20=E7=9B=98?= =?UTF-8?q?=E7=82=B9=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RecycledMaterialReceiptNoteController.cs | 2 +- .../IPurchaseReceiptJobAppService.cs | 6 +++ .../PurchaseReceiptJobAppService.cs | 17 +++++++ .../Notes/CountNotes/CountNoteAppService.cs | 43 ++++++++++++++++- .../RecycledMaterialReceiptNoteAppService.cs | 48 ++++++++++++++++--- ...ledMaterialReceiptNoteAutoMapperProfile.cs | 9 ++++ .../PurchaseOrders/PurchaseOrderAppService.cs | 28 ++--------- .../IRecycledMaterialReceiptNoteManager.cs | 2 +- .../RecycledMaterialReceiptNoteManager.cs | 14 ------ .../Plans/CountPlans/CountPlanManager.cs | 9 ++-- ...RecycledMaterialReceiptNoteEventHandler.cs | 34 ++++++++----- 11 files changed, 151 insertions(+), 61 deletions(-) diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs index 0fd4dd012..c5682b153 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs @@ -26,7 +26,7 @@ public class RecycledMaterialReceiptNoteController : AbpController } /// - /// 获取盘点任务详情 + /// 回收料调整 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs index dc4e8ffe1..027134838 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs @@ -40,4 +40,10 @@ public interface IPurchaseReceiptJobAppService /// /// Task> SetInspectWithNotInspectAsync(Guid id); + + /// + /// 根据供应商编号获取收货任务 + /// + /// + Task> GetListBySupplierCodeOnTodayAsync(string supplierCode); } 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 6af63c5b9..e1c099ab0 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 @@ -5,6 +5,7 @@ using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.ObjectMapping; using Win_in.Sfs.FileStorage.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -198,6 +199,22 @@ public class PurchaseReceiptJobAppService : } } + /// + /// 根据供应商编号获取收货任务 + /// + /// + [HttpPost("get-by-supplier-code-on-today/{supplierCode}")] + public virtual async Task> GetListBySupplierCodeOnTodayAsync(string supplierCode) + { + var purchaseReceiptJobs = await _repository.GetListAsync(p => + p.SupplierCode == supplierCode && + p.PlanArriveDate.Year == DateTime.Now.Year && + p.PlanArriveDate.Month == DateTime.Now.Month && + p.PlanArriveDate.Day == DateTime.Now.Day).ConfigureAwait(false); + var dto = ObjectMapper.Map, List>(purchaseReceiptJobs); + return dto; + } + ///// ///// 取消请求 ///// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs index 015825e1f..501ef2e4a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs @@ -1,11 +1,13 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Domain.Repositories; +using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -35,6 +37,45 @@ public class CountNoteAppService : _countPlanAppService = countPlanAppService; } + #region 东阳 + + /// + /// 用来重写 导入数据时可以加工数据 + /// + /// + /// + protected async override Task> ImportProcessingEntityAsync(Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var countNote in addList) + { + var countPlanDto=await _countPlanAppService.GetByNumberAsync(countNote.CountPlanNumber).ConfigureAwait(false); + if (countPlanDto.RequestType != CountPlanRequestType.Import) + { + throw new UserFriendlyException("非Excel盘点执行方式不能使用导入"); + } + //特殊处理 因为盘点记录可以重复导入 所以每次导入前删除调原有记录 + //_repository.DeleteAsync(p=>p.CountPlanNumber==CountPlan) + + countNote.Worker = CurrentUser.GetUserName(); + countNote.CreatorId = CurrentUser.Id; + countNote.BeginTime= DateTime.Now; + countNote.Adjusted = false; + countNote.EndTime=DateTime.Now; + countNote.Stage = EnumCountStage.Audit; + + //foreach (var detail in purchaseReturnRequest.Details) + //{ + + //} + } + + return dictionary; + } + + #endregion + /// /// 新增接口 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs index ad717ec51..d502ec9d8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs @@ -1,6 +1,11 @@ using System.Threading.Tasks; +using DocumentFormat.OpenXml.Bibliography; +using FluentValidation.Validators; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.ObjectMapping; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -22,24 +27,53 @@ public class RecycledMaterialReceiptNoteAppService : { private readonly IRecycledMaterialReceiptNoteManager _RecycledMaterialReceiptNoteManager; private readonly ILocationCapacityAppService _locationCapacityAppService; + private readonly ILocationAppService _locationAppService; + private readonly IItemBasicAppService _itemBasicAppService; public RecycledMaterialReceiptNoteAppService(IRecycledMaterialReceiptNoteRepository repository, IRecycledMaterialReceiptNoteManager RecycledMaterialReceiptNoteManager, - ILocationCapacityAppService locationCapacityAppService) : base(repository) + ILocationCapacityAppService locationCapacityAppService, + ILocationAppService locationAppService, + IItemBasicAppService itemBasicAppService) : base(repository) { _RecycledMaterialReceiptNoteManager = RecycledMaterialReceiptNoteManager; _locationCapacityAppService = locationCapacityAppService; + _locationAppService = locationAppService; + _itemBasicAppService = itemBasicAppService; } - [HttpPost("")] - //[Authorize(RecycledMaterialReceiptNotePermissions.Create)] + /// + /// 新增实体 + /// + /// CreateInput public override async Task CreateAsync(RecycledMaterialReceiptNoteEditInput input) { - var entity = ObjectMapper.Map(input); - await _RecycledMaterialReceiptNoteManager.CreateAsync(entity).ConfigureAwait(false); + var entity= ObjectMapper.Map(input); - var dto = ObjectMapper.Map(entity); + entity.Number=string.IsNullOrEmpty(input.Number) + ? await GenerateNumberAsync(nameof(RecycledMaterialReceiptNote), input.ActiveDate) + .ConfigureAwait(false) + : input.Number; - return dto; + foreach (var detail in entity.Details) + { + var detailNumber = await GenerateNumberAsync(nameof(RecycledMaterialReceiptNote), input.ActiveDate) + .ConfigureAwait(false); + detail.Number=detailNumber; + var locationDto = await _locationAppService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); + detail.LocationErpCode = locationDto.ErpLocationCode; + detail.LocationArea = locationDto.AreaCode; + detail.LocationGroup = locationDto.LocationGroupCode; + detail.WarehouseCode=locationDto.WarehouseCode; + var itemBasicDto=await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + detail.StdPackQty = itemBasicDto.StdPackQty; + detail.Uom = itemBasicDto.BasicUom; + } + + entity=await _repository.InsertAsync(entity).ConfigureAwait(false); + + await LocalEventBus.PublishAsync(new SfsCreatedEntityEventData(entity),false).ConfigureAwait(false); + + return ObjectMapper.Map(entity); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs index edd59fb19..35ee6a020 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs @@ -22,5 +22,14 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap< RecycledMaterialReceiptNoteEditInput,RecycledMaterialReceiptNote > () + .IgnoreAuditedObjectProperties() + .Ignore(x => x.Remark) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs index c3fb8dffc..533107d6b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs @@ -26,6 +26,7 @@ public class PurchaseOrderAppService : private readonly IPurchaseOrderManager _purchaseOrderManager; private readonly ISupplierAppService _supplierAppService; private readonly IItemBasicAppService _itemBasicAppService; + private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService; public PurchaseOrderAppService( IPurchaseOrderRepository repository, @@ -233,34 +234,15 @@ public class PurchaseOrderAppService : #endregion - //protected override async Task GetEntityAsync(PurchaseOrderImportInput importInput) - //{ - // return await _repository.FindAsync(t => t.Number == importInput.Number).ConfigureAwait(false); - //} - - //protected virtual async Task ImportDataAsync(List entites, List deleteEntities) - //{ - // await _purchaseOrderManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); - //} - - return dtos; - } - [HttpGet("get-list-by-supplier-code-and-item-code")] public virtual async Task> GetListBySupplierCodeAsync(string supplierCode, string itemCode) { - var entitys = await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode) && p.SupplierCode == supplierCode); - - List list = new List(); + var entitys = await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode) && p.SupplierCode == supplierCode).ConfigureAwait(false); - foreach (var entity in entitys) - { - var purchaseOrder = await _repository.GetAsync(entity.Id); - list.Add(purchaseOrder); - } - - var dtos = ObjectMapper.Map, List>(list); + var dtos = ObjectMapper.Map, List>(entitys); return dtos; } + + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/IRecycledMaterialReceiptNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/IRecycledMaterialReceiptNoteManager.cs index f45395934..7a96bcad8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/IRecycledMaterialReceiptNoteManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/IRecycledMaterialReceiptNoteManager.cs @@ -4,5 +4,5 @@ namespace Win_in.Sfs.Wms.Store.Domain; public interface IRecycledMaterialReceiptNoteManager : ISfsStoreManager { - Task CreateByPurchaseReceiptNoteAsync(PurchaseReceiptNote purchaseReceiptNote); + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteManager.cs index 1ccb6c7b1..0b0ea9e7f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteManager.cs @@ -10,18 +10,4 @@ public class RecycledMaterialReceiptNoteManager : SfsStoreManagerBase CreateAsync(RecycledMaterialReceiptNote entity) - { - return await base.CreateAsync(entity).ConfigureAwait(false); - - } - - public virtual async Task CreateByPurchaseReceiptNoteAsync(PurchaseReceiptNote purchaseReceiptNote) - { - var RecycledMaterialReceiptNote = ObjectMapper.Map(purchaseReceiptNote); - - await base.CreateAsync(RecycledMaterialReceiptNote).ConfigureAwait(false); - } - } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs index 88cf2c24a..a48c1c1cb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs @@ -14,12 +14,14 @@ namespace Win_in.Sfs.Wms.Store.Domain; public class CountPlanManager : SfsStoreRequestManagerBase, ICountPlanManager { + private readonly ICountPlanRepository _repository; public CountPlanManager( ICountPlanRepository repository ) : base(repository) { + _repository = repository; } /// @@ -200,10 +202,8 @@ public class CountPlanManager : SfsStoreRequestManagerBase> - , ILocalEventHandler>> + , ILocalEventHandler> + , ILocalEventHandler>> { private const EnumTransInOut TransInOut = EnumTransInOut.In; private const EnumTransType TransType = EnumTransType.UnplannedReceipt; private const EnumTransSubType TransSubType = EnumTransSubType.UnplannedReceipt_RecycledMaterialReceipt; + /// + /// 创建后 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { @@ -26,6 +31,20 @@ public class RecycledMaterialReceiptNoteEventHandler await AddTransactionsAsync(entity).ConfigureAwait(false); } + /// + /// 批量创建后 + /// + /// + /// + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + await AddTransactionsAsync(entities).ConfigureAwait(false); + } + + #region 私有 + private async Task AddTransactionsAsync(RecycledMaterialReceiptNote RecycledMaterialReceiptNote) { var inboundTransactions = new List(); @@ -33,19 +52,10 @@ public class RecycledMaterialReceiptNoteEventHandler inboundTransactions.AddRange(BuildTransactions(RecycledMaterialReceiptNote)); await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); - - } - - [UnitOfWork] - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) - { - var entities = eventData.Entity; - await AddTransactionsAsync(entities).ConfigureAwait(false); } private async Task AddTransactionsAsync(List RecycledMaterialReceiptNotes) { - var inboundTransactions = new List(); //如果要做库存事务汇总,可以修改此处 @@ -74,7 +84,9 @@ public class RecycledMaterialReceiptNoteEventHandler transactions.Add(transaction); } + return transactions; } + #endregion } From 8b72465d6e5cc5113f6f0c3106620305900c7efc Mon Sep 17 00:00:00 2001 From: mahao Date: Sat, 15 Apr 2023 10:10:41 +0800 Subject: [PATCH 28/41] =?UTF-8?q?generate-and-create/many/{count}=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20fullBarcodeString=20=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=B5=8B=E5=80=BC=E4=B8=BA=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InventoryLabels/InventoryLabelAppService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs index 76770e7eb..e4b830cf7 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs @@ -112,6 +112,7 @@ public class InventoryLabelAppService var createInput = ObjectMapper.Map(input); createInput.Code = numbers[i]; var dto = await base.CreateAsync(createInput).ConfigureAwait(false); + dto.FullBarcodeString = dto.Code; dtos.Add(dto); } return dtos; From 60c77e8c87282626dde84d3e6573f96012a4cdfa Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Sat, 15 Apr 2023 10:17:36 +0800 Subject: [PATCH 29/41] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20httppost=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RecycledMaterialReceiptNoteAppService.cs | 1 + .../ItemTransformRequests/ItemTransformRequestAppService.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs index d502ec9d8..ba42b49cf 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs @@ -46,6 +46,7 @@ public class RecycledMaterialReceiptNoteAppService : /// 新增实体 /// /// CreateInput + [HttpPost("")] public override async Task CreateAsync(RecycledMaterialReceiptNoteEditInput input) { var entity= ObjectMapper.Map(input); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs index a0479d957..2feeef110 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs @@ -20,7 +20,7 @@ namespace Win_in.Sfs.Wms.Store.Application; /// 回收料调整申请 /// [Authorize] -[Route($"{StoreConsts.RootPath}item-transfrom-request")] +[Route($"{StoreConsts.RootPath}item-transform-request")] public class ItemTransformRequestAppService : SfsStoreRequestAppServiceBase, IItemTransformRequestAppService From a27ba871d3e7199f1b145025c69d70fe25e70e71 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Sat, 15 Apr 2023 10:19:33 +0800 Subject: [PATCH 30/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Notes/ItemTransformNotes/ItemTransformNoteAppService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ItemTransformNotes/ItemTransformNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ItemTransformNotes/ItemTransformNoteAppService.cs index 8180238fa..0d361afa1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ItemTransformNotes/ItemTransformNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ItemTransformNotes/ItemTransformNoteAppService.cs @@ -12,7 +12,7 @@ namespace Win_in.Sfs.Wms.Store.Application; /// 回收料调整记录 /// [Authorize] -[Route($"{StoreConsts.RootPath}item-transfrom-note")] +[Route($"{StoreConsts.RootPath}item-transform-note")] public class ItemTransformNoteAppService : SfsStoreWithDetailsAppServiceBase, From 50f615b7bad0dca79b55ca7d25beeb326135bfc9 Mon Sep 17 00:00:00 2001 From: mahao Date: Sat, 15 Apr 2023 10:57:04 +0800 Subject: [PATCH 31/41] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InventoryLabels/InventoryLabelAppService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs index e4b830cf7..e107c261f 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs @@ -112,7 +112,6 @@ public class InventoryLabelAppService var createInput = ObjectMapper.Map(input); createInput.Code = numbers[i]; var dto = await base.CreateAsync(createInput).ConfigureAwait(false); - dto.FullBarcodeString = dto.Code; dtos.Add(dto); } return dtos; @@ -130,6 +129,12 @@ public class InventoryLabelAppService var createInput = ObjectMapper.Map(input); createInput.Code = numbers[i]; var dto = await base.CreateAsync(createInput).ConfigureAwait(false); + + dto.SupplierCode = createInput.SupplierCode; + dto.PoNumber = createInput.PoNumber; + dto.Remark = createInput.Remark; + dto.FullBarcodeString = dto.Code; + dtos.Add(dto); } return dtos; From 60fda4319fec1b3ab64a10c93f5f551c285d0a6e Mon Sep 17 00:00:00 2001 From: "rongguo.jia" Date: Sat, 15 Apr 2023 10:58:11 +0800 Subject: [PATCH 32/41] =?UTF-8?q?[fix]=E8=A7=A3=E5=86=B3ItemTransformReque?= =?UTF-8?q?stAppService=E5=AF=BC=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ItemTransformRequestAppService.cs | 37 +++++++++++++++++++ .../MaterialRequestAppService.cs | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs index 2feeef110..b714424fe 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs @@ -6,9 +6,11 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -57,6 +59,41 @@ public class ItemTransformRequestAppService : return dto; } + protected override async Task> ImportProcessingEntityAsync(Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var itemTransformRequest in addList) + { + itemTransformRequest.Worker = CurrentUser.GetUserName(); + itemTransformRequest.CreatorId = CurrentUser.Id; + foreach (var detail in itemTransformRequest.Details) + { + var fromLocationDto= await LocationAclService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); + var toLocationDto= await LocationAclService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + var itemBasicDto=await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + + detail.FromLocationArea = fromLocationDto.AreaCode; + detail.FromLocationErpCode = fromLocationDto.ErpLocationCode; + detail.FromLocationGroup = fromLocationDto.LocationGroupCode; + detail.FromWarehouseCode = fromLocationDto.WarehouseCode; + + detail.ToLocationArea = toLocationDto.AreaCode; + detail.ToLocationErpCode = toLocationDto.ErpLocationCode; + detail.ToLocationGroup = toLocationDto.LocationGroupCode; + detail.ToWarehouseCode = toLocationDto.WarehouseCode; + detail.ItemDesc1 = itemBasicDto.Desc1; + detail.ItemDesc2= itemBasicDto.Desc2; + detail.ItemName= itemBasicDto.Name; + detail.Uom = itemBasicDto.BasicUom; + } + } + + return dictionary; + + + } + protected virtual async Task ImportDataAsync(List entites, List deleteEntities) { await _manager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs index fb06276e5..7a3ddd00b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs @@ -95,7 +95,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase HandleAsync(Guid id) From f9650e8d5f2998c5d7680ae79fb41056ae5f560a Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Sat, 15 Apr 2023 14:49:33 +0800 Subject: [PATCH 33/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E7=9B=98=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SfsCrudWithDetailsAppServiceBase.cs | 1 - .../CountNotes/Inputs/CountNoteImportInput.cs | 8 +++ .../CountAdjustNoteAutoMapperProfile.cs | 9 ++++ .../Notes/CountNotes/CountNoteAppService.cs | 51 ++++++++++++++----- .../CountNotes/CountNoteAutoMapperProfile.cs | 1 - .../CountAdjustRequestAppService.cs | 18 ------- .../Plans/CountPlanAutoMapperProfile.cs | 2 - 7 files changed, 56 insertions(+), 34 deletions(-) diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs index 2c022d8d3..83fcd6ee9 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs @@ -512,7 +512,6 @@ public abstract class SfsCrudWithDetailsAppServiceBase /// 导入数据具体实现,可重写 /// - //[UnitOfWork] protected virtual async Task ImportInternalAsync(SfsImportRequestInput requestInput, byte[] inputFileBytes) { IList modelList = null; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CountNotes/Inputs/CountNoteImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CountNotes/Inputs/CountNoteImportInput.cs index 8afa8d50b..f785c718e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CountNotes/Inputs/CountNoteImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CountNotes/Inputs/CountNoteImportInput.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -39,6 +40,13 @@ public class CountNoteImportInput : SfsStoreImportInputBase [Required(ErrorMessage = "{0}是必填项", AllowEmptyStrings = true)] public string PackingCode { get; set; } + /// + /// 库存状态 + /// + [Display(Name = "库存状态")] + [Required(ErrorMessage = "{0}是必填项", AllowEmptyStrings = true)] + public EnumInventoryStatus Status { get; set; } + /// /// 托码 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountAdjustNotes/CountAdjustNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountAdjustNotes/CountAdjustNoteAutoMapperProfile.cs index 26971205d..a1529c8b5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountAdjustNotes/CountAdjustNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountAdjustNotes/CountAdjustNoteAutoMapperProfile.cs @@ -21,5 +21,14 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.Remark) + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs index 501ef2e4a..278f8a52c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs @@ -7,6 +7,8 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Domain.Repositories; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -27,14 +29,18 @@ public class CountNoteAppService : { private readonly ICountNoteManager _countNoteManager; private readonly ICountPlanAppService _countPlanAppService; + private readonly ILocationAppService _locationAppService; + private readonly IItemBasicAppService _itemBasicAppService; public CountNoteAppService( ICountNoteRepository repository, - ICountNoteManager countNoteManager, ICountPlanAppService countPlanAppService) : base(repository) + ICountNoteManager countNoteManager, ICountPlanAppService countPlanAppService, ILocationAppService locationAppService, IItemBasicAppService itemBasicAppService) : base(repository) { _countNoteManager = countNoteManager; _countPlanAppService = countPlanAppService; + _locationAppService = locationAppService; + _itemBasicAppService = itemBasicAppService; } #region 东阳 @@ -44,20 +50,25 @@ public class CountNoteAppService : /// /// /// - protected async override Task> ImportProcessingEntityAsync(Dictionary dictionary) + protected override async Task> ImportProcessingEntityAsync(Dictionary dictionary) { - var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + var dataList = dictionary.Select(p => p.Key);//查询所有的导入盘点数据 + var resultDictionary = new Dictionary(); - foreach (var countNote in addList) + var allCountPlanNumbersList= dataList.GroupBy(p => p.CountPlanNumber).Select(p => p.Key).ToList(); + //特殊处理 因为盘点记录可以重复导入 所以每次导入前删除调原有记录 + foreach (var countPlanNumber in allCountPlanNumbersList) { - var countPlanDto=await _countPlanAppService.GetByNumberAsync(countNote.CountPlanNumber).ConfigureAwait(false); + var countPlanDto = await _countPlanAppService.GetByNumberAsync(countPlanNumber).ConfigureAwait(false); if (countPlanDto.RequestType != CountPlanRequestType.Import) { throw new UserFriendlyException("非Excel盘点执行方式不能使用导入"); } - //特殊处理 因为盘点记录可以重复导入 所以每次导入前删除调原有记录 - //_repository.DeleteAsync(p=>p.CountPlanNumber==CountPlan) + await _repository.DeleteAsync(p => p.CountPlanNumber == countPlanNumber).ConfigureAwait(false); + } + foreach (var countNote in dataList) + { countNote.Worker = CurrentUser.GetUserName(); countNote.CreatorId = CurrentUser.Id; countNote.BeginTime= DateTime.Now; @@ -65,13 +76,29 @@ public class CountNoteAppService : countNote.EndTime=DateTime.Now; countNote.Stage = EnumCountStage.Audit; - //foreach (var detail in purchaseReturnRequest.Details) - //{ - - //} + foreach (var detail in countNote.Details) + { + var locationDto= await _locationAppService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); + var itemcBasicDto=await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + + + detail.CountLabel =Guid.NewGuid().ToString(); + detail.LocationArea = locationDto.AreaCode; + detail.LocationGroup= locationDto.LocationGroupCode; + detail.LocationErpCode= locationDto.ErpLocationCode; + detail.WarehouseCode= locationDto.WarehouseCode; + + detail.ItemCode = itemcBasicDto.Code; + detail.ItemDesc1 = itemcBasicDto.Desc1; + detail.ItemDesc2 = itemcBasicDto.Desc2; + detail.ItemName= itemcBasicDto.Name; + detail.Uom = itemcBasicDto.BasicUom; + } + + resultDictionary.Add(countNote,EntityState.Added); } - return dictionary; + return resultDictionary; } #endregion diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAutoMapperProfile.cs index ebeda8f63..fb83ae1ac 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAutoMapperProfile.cs @@ -69,7 +69,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Adjusted) .Ignore(X => X.StdPackQty) .Ignore(x => x.ItemName).Ignore(x => x.ItemDesc1).Ignore(x => x.ItemDesc2) - .Ignore(x => x.Status) .Ignore(x => x.SupplierBatch) .Ignore(x => x.ArriveDate) .Ignore(x => x.ProduceDate) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/CountAdjustRequests/CountAdjustRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/CountAdjustRequests/CountAdjustRequestAppService.cs index c0a9e3222..9f4dece77 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/CountAdjustRequests/CountAdjustRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/CountAdjustRequests/CountAdjustRequestAppService.cs @@ -25,22 +25,4 @@ public abstract class CountAdjustRequestAppService : { _countAdjustRequestManager = countAdjustRequestManager; } - - /// - /// 【创建】盘点调整申请 - /// - /// - /// - [HttpPost("")] - //[Authorize(CountAdjustRequestPermissions.Create)] - public override async Task CreateAsync(CountAdjustRequestEditInput input) - { - var entity = ObjectMapper.Map(input); - - await _countAdjustRequestManager.CreateAsync(entity).ConfigureAwait(false); - - var dto = ObjectMapper.Map(entity); - return dto; - } - } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Plans/CountPlanAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Plans/CountPlanAutoMapperProfile.cs index 815ec6b6a..bfd07f21d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Plans/CountPlanAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Plans/CountPlanAutoMapperProfile.cs @@ -52,13 +52,11 @@ public partial class StoreEventAutoMapperProfile : Profile //盘点计划映射到盘点记录 CreateMap() .ForMember(x => x.CountPlanNumber, y => y.MapFrom(d => d.Number)) - .Ignore(x => x.Adjusted) ; CreateMap() .ForMember(x => x.CountPlanNumber, y => y.MapFrom(d => d.Number)) - .Ignore(x => x.Adjusted) ; From 52972e48b18f84e0cc86a4421b15f948e104c7d5 Mon Sep 17 00:00:00 2001 From: mahao Date: Sat, 15 Apr 2023 14:49:39 +0800 Subject: [PATCH 34/41] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=BF=85=E5=A1=AB=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inputs/PurchaseOrderImportInput.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/Inputs/PurchaseOrderImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/Inputs/PurchaseOrderImportInput.cs index c3d4b92a8..827b3dead 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/Inputs/PurchaseOrderImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/Inputs/PurchaseOrderImportInput.cs @@ -20,18 +20,21 @@ public class PurchaseOrderImportInput : SfsStoreImportInputBase /// [Display(Name = "采购订单号")] [Key] + [Required(ErrorMessage = "{0}是必填项")] public string Number { get; set; } /// /// 供应商代码 /// [Display(Name = "供应商代码")] + [Required(ErrorMessage = "{0}是必填项")] public string SupplierCode { get; set; } /// /// 订单类型 /// [Display(Name = "订单类型")] + [Required(ErrorMessage = "{0}是必填项")] public string PoType { get; set; } /// @@ -52,6 +55,7 @@ public class PurchaseOrderImportInput : SfsStoreImportInputBase /// 订单日期 /// [Display(Name = "订单日期")] + [Required(ErrorMessage = "{0}是必填项")] [ImporterHeader(Name = "订单日期", Format = "yyyy/MM/dd")] [ExporterHeader(DisplayName = "订单日期", Format = "yyyy/MM/dd")] public DateTime OrderDate { get; set; } @@ -60,6 +64,7 @@ public class PurchaseOrderImportInput : SfsStoreImportInputBase /// 截止日期 /// [Display(Name = "截止日期")] + [Required(ErrorMessage = "{0}是必填项")] [ImporterHeader(Name = "截止日期", Format = "yyyy/MM/dd")] [ExporterHeader(DisplayName = "截止日期", Format = "yyyy/MM/dd")] public DateTime DueDate { get; set; } @@ -81,18 +86,21 @@ public class PurchaseOrderImportInput : SfsStoreImportInputBase /// 仓库代码 /// [Display(Name = "仓库代码")] + [Required(ErrorMessage = "{0}是必填项")] public string WarehouseCode { get; set; } /// /// 明细-订单行 /// [Display(Name = "明细-订单行")] + [Required(ErrorMessage = "{0}是必填项")] public string PoLine { get; set; } /// /// 明细-物品代码 /// [Display(Name = "明细-物品代码")] + [Required(ErrorMessage = "{0}是必填项")] public string ItemCode { get; set; } /// @@ -106,6 +114,7 @@ public class PurchaseOrderImportInput : SfsStoreImportInputBase /// 数量计量单位 /// [Display(Name = "明细-数量计量单位")] + [Required(ErrorMessage = "{0}是必填项")] public string Uom { get; set; } /// @@ -126,6 +135,7 @@ public class PurchaseOrderImportInput : SfsStoreImportInputBase /// 明细-供应商包装单位 /// [Display(Name = "明细-供应商包装单位")] + [Required(ErrorMessage = "{0}是必填项")] public string SupplierPackUom { get; set; } /// @@ -146,12 +156,14 @@ public class PurchaseOrderImportInput : SfsStoreImportInputBase /// 筹措员代码 /// [Display(Name = "明细-筹措员代码")] + [Required(ErrorMessage = "{0}是必填项")] public string PlanUserCode { get; set; } /// /// 生产批次 /// [Display(Name = "明细-生产批次")] + [Required(ErrorMessage = "{0}是必填项")] public string Lot { get; set; } /// @@ -167,6 +179,7 @@ public class PurchaseOrderImportInput : SfsStoreImportInputBase /// 明细-类型 暂定:备件是B 辅材是F 生产为空 /// [Display(Name = "明细-类型 备件是B 辅材是F 生产为空")] + [Required(ErrorMessage = "{0}是必填项")] public string Ctype { get; set; } /// @@ -182,6 +195,7 @@ public class PurchaseOrderImportInput : SfsStoreImportInputBase /// 过期时间 /// [Display(Name = "明细-过期时间")] + [Required(ErrorMessage = "{0}是必填项")] public DateTime ExpireDate { get; set; } /// From a421537096a46f9bcd305098f19c1f6a50cc39e8 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Sat, 15 Apr 2023 15:41:06 +0800 Subject: [PATCH 35/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Balances/BalanceManager.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs index 65dd8b377..d7142e35e 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs @@ -244,6 +244,16 @@ public class BalanceManager : DomainService, IBalanceManager balance.Status ).ConfigureAwait(false); + if (!existBalance.IsActive) + { + throw new UserFriendlyException( + $"箱码为{balance.PackingCode}," + + $"库位在{balance.LocationCode}," + + $"批次为{balance.Lot}," + + $"状态为{balance.Status.GetDisplayName()}" + + $"的库存是不可用状态"); + } + existBalance.Qty = balance.Qty; existBalance.ItemName = balance.ItemName; existBalance.ItemDesc1 = balance.ItemDesc1; From c2a5dfdc8fdfede6ca4665f45fed825209aaaa87 Mon Sep 17 00:00:00 2001 From: mahao Date: Sat, 15 Apr 2023 15:49:33 +0800 Subject: [PATCH 36/41] =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InventoryLabelWithoutCodeCreateInput.cs | 7 +++++++ .../InventoryLabels/InventoryLabelAppService.cs | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs index d2dc012b1..723b2350c 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs @@ -207,4 +207,11 @@ public class InventoryLabelWithoutCodeCreateInput [Display(Name = "要求到货时间")] [Required(ErrorMessage = "{0}是必填项")] public DateTime PlanArriveDate { get; set; } + + /// + /// 备注 + /// + [Display(Name = "备注")] + public string Remark { get; set; } + } diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs index e107c261f..04222ca2a 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs @@ -130,9 +130,9 @@ public class InventoryLabelAppService createInput.Code = numbers[i]; var dto = await base.CreateAsync(createInput).ConfigureAwait(false); - dto.SupplierCode = createInput.SupplierCode; - dto.PoNumber = createInput.PoNumber; - dto.Remark = createInput.Remark; + dto.SupplierCode = input.SupplierCode; + dto.PoNumber = input.PoNumber; + dto.Remark = input.Remark; dto.FullBarcodeString = dto.Code; dtos.Add(dto); From 6de369e439615e70c4bd7475cca74d1245d8dd48 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Sat, 15 Apr 2023 16:08:58 +0800 Subject: [PATCH 37/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=86=BB=E7=BB=93?= =?UTF-8?q?=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ItemTransformRequests/ItemTransformRequestAppService.cs | 4 ++-- .../Requests/CountPlanEventHandler.cs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs index b714424fe..3d655298c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs @@ -33,8 +33,8 @@ public class ItemTransformRequestAppService : private readonly IInventoryLabelAppService _inventoryLabelAppService; public ItemTransformRequestAppService( - IItemTransformRequestRepository repository - , IItemTransformRequestManager manager, + IItemTransformRequestRepository repository, + IItemTransformRequestManager manager, IInventoryLabelAppService inventoryLabelAppService) : base(repository, manager) { _manager = manager; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountPlanEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountPlanEventHandler.cs index 05ba4fdaa..53547826f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountPlanEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountPlanEventHandler.cs @@ -41,6 +41,9 @@ public class CountPlanEventHandler switch (entity.RequestType) { case CountPlanRequestType.Import: + //冻结库存 + await FreezeBalancesAsync(entity).ConfigureAwait(false); + break; case CountPlanRequestType.Manual: //冻结库存 await FreezeBalancesAsync(entity).ConfigureAwait(false); From d8690626baf92a3fd4556360ce5d0d480b800fcc Mon Sep 17 00:00:00 2001 From: mahao Date: Sat, 15 Apr 2023 16:35:20 +0800 Subject: [PATCH 38/41] =?UTF-8?q?=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InventoryLabelAppService.cs | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs index 04222ca2a..e88e07199 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; @@ -15,6 +16,7 @@ using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Label.Domain; using Win_in.Sfs.Label.Domain.Shared; using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Label.Application; @@ -33,12 +35,14 @@ public class InventoryLabelAppService private new readonly IInventoryLabelRepository _repository; private readonly ISupplierAppService _supplierAppService; private readonly ISupplierItemAppService _supplierItemAppService; + private readonly IItemBasicAppService _itemBasicAppService; public InventoryLabelAppService( IInventoryLabelRepository repository, ILabelDefinitionManager labelDefinitionManager , ISupplierAppService supplierAppService , IItemPackAppService itemPackAppService , ISupplierItemAppService supplierItemAppService + , IItemBasicAppService itemBasicAppService ) : base(repository) { _repository = repository; @@ -46,6 +50,7 @@ public class InventoryLabelAppService _supplierAppService = supplierAppService; _itemPackAppService = itemPackAppService; _supplierItemAppService = supplierItemAppService; + _itemBasicAppService = itemBasicAppService; } [HttpPost("")] @@ -60,6 +65,45 @@ public class InventoryLabelAppService return await base.CreateAsync(input).ConfigureAwait(false); } + /// + /// 按Id获取实体 + /// + /// 实体Id + /// + [HttpGet("{id}")] + public override async Task GetAsync(Guid id) + { + var dto = await base.GetAsync(id).ConfigureAwait(false); + + if (dto != null) + { + var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(dto.ItemCode).ConfigureAwait(false); + if (itemBasicDto != null) + { + switch (itemBasicDto.ValidityUnit) + { + case EnumValidityUnit.Infinite: + dto.ExpireDate = DateTime.MaxValue; + break; + case EnumValidityUnit.Day: + dto.ExpireDate = DateTime.Now.AddDays(itemBasicDto.Validity); + break; + case EnumValidityUnit.WeeK: + dto.ExpireDate = DateTime.Now.AddDays(itemBasicDto.Validity * 7); + break; + case EnumValidityUnit.Month: + dto.ExpireDate = DateTime.Now.AddMonths(itemBasicDto.Validity); + break; + case EnumValidityUnit.None: + default: + break; + } + } + } + + return dto; + } + [HttpPost("many")] [UnitOfWork] public virtual async Task> CreateManyAsync(List inputs) @@ -83,7 +127,7 @@ public class InventoryLabelAppService [UnitOfWork] public virtual async Task> CreateManyByNoCodeAsync(List inputs) { - var entitys= ObjectMapper.Map, List>(inputs); + var entitys = ObjectMapper.Map, List>(inputs); await _repository.InsertManyAsync(entitys).ConfigureAwait(false); return ObjectMapper.Map, List>(entitys); } @@ -133,8 +177,32 @@ public class InventoryLabelAppService dto.SupplierCode = input.SupplierCode; dto.PoNumber = input.PoNumber; dto.Remark = input.Remark; + dto.AsnNumber = input.AsnNumber; dto.FullBarcodeString = dto.Code; + var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(dto.ItemCode).ConfigureAwait(false); + if (itemBasicDto != null) + { + switch (itemBasicDto.ValidityUnit) + { + case EnumValidityUnit.Infinite: + dto.ExpireDate = DateTime.MaxValue; + break; + case EnumValidityUnit.Day: + dto.ExpireDate = DateTime.Now.AddDays(itemBasicDto.Validity); + break; + case EnumValidityUnit.WeeK: + dto.ExpireDate = DateTime.Now.AddDays(itemBasicDto.Validity * 7); + break; + case EnumValidityUnit.Month: + dto.ExpireDate = DateTime.Now.AddMonths(itemBasicDto.Validity); + break; + case EnumValidityUnit.None: + default: + break; + } + } + dtos.Add(dto); } return dtos; From 2f9ef4073f981d3607512dc6ee4cab0ef6c3ff4c Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Sat, 15 Apr 2023 21:02:42 +0800 Subject: [PATCH 39/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20FIS=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=20=E5=9B=9E=E6=94=B6=E6=96=99=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E9=80=80=E6=8B=86=20=E5=AE=8C=E5=B7=A5?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E6=8A=A5=E5=BA=9F=20=E7=9B=98=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Balances/BalanceManager.cs | 18 +- .../Jobs/CountJobs/CountJobAppService.cs | 1 + .../ItemTransformNoteAutoMapperProfile.cs | 10 + .../Plans/CountPlans/CountPlanAppService.cs | 2 +- .../CountPlans/CountPlanAutoMapperProfile.cs | 9 + .../DeliverRequestAppService.cs | 2 +- .../DeliverRequestFisAppService.cs | 96 +++++-- .../ItemTransformRequestAppService.cs | 17 +- .../ProductRecycleRequestAppService.cs | 250 ++++++++---------- .../ProductionReturnRequestAppService.cs | 46 +++- .../ItemTransformRequestEventHandler.cs | 13 +- .../ProductRecycleRequestEventHandler.cs | 4 +- .../ItemTransformNoteEventHandler.cs | 7 +- 13 files changed, 297 insertions(+), 178 deletions(-) diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs index d7142e35e..37c115932 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs @@ -244,15 +244,15 @@ public class BalanceManager : DomainService, IBalanceManager balance.Status ).ConfigureAwait(false); - if (!existBalance.IsActive) - { - throw new UserFriendlyException( - $"箱码为{balance.PackingCode}," + - $"库位在{balance.LocationCode}," + - $"批次为{balance.Lot}," + - $"状态为{balance.Status.GetDisplayName()}" + - $"的库存是不可用状态"); - } + //if (!existBalance.IsActive) + //{ + // throw new UserFriendlyException( + // $"箱码为{balance.PackingCode}," + + // $"库位在{balance.LocationCode}," + + // $"批次为{balance.Lot}," + + // $"状态为{balance.Status.GetDisplayName()}" + + // $"的库存是不可用状态"); + //} existBalance.Qty = balance.Qty; existBalance.ItemName = balance.ItemName; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAppService.cs index 60673f7ac..f2b69f2c0 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAppService.cs @@ -71,6 +71,7 @@ public class CountJobAppService throw new AbpValidationException(result.Errors); } var entity = ObjectMapper.Map(dto); + entity.Number = checkEntity.Number; await _countJobManager.CompleteAsync(entity, CurrentUser).ConfigureAwait(false); return dto; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ItemTransformNotes/ItemTransformNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ItemTransformNotes/ItemTransformNoteAutoMapperProfile.cs index c26dee52a..341d1b2ac 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ItemTransformNotes/ItemTransformNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ItemTransformNotes/ItemTransformNoteAutoMapperProfile.cs @@ -22,5 +22,15 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id) + .Ignore(x=>x.ExtraProperties) + .Ignore(x => x.Remark) + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs index a750ba193..de9cea2ea 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs @@ -106,7 +106,7 @@ public class CountPlanAppService : public virtual async Task UpdateByJobAsync(CountPlanEditInput input) { var entity = ObjectMapper.Map(input); - + entity.Number = input.Number; await _countPlanManager.CompleteByJobAsync(entity).ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAutoMapperProfile.cs index 060a9b36a..fbac04195 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAutoMapperProfile.cs @@ -39,5 +39,14 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.Remark) + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs index 439657791..9f59ab043 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Application.Dtos; using Win_in.Sfs.Basedata.Application.Contracts; @@ -29,7 +30,6 @@ public class DeliverRequestAppService : { private readonly IDeliverRequestManager _deliverRequestManager; private readonly IAreaAppService _areaApp; - private readonly ICustomerAppService _customerApp; private readonly ICustomerAddressAppService _customerAddressApp; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs index 5dd549d4c..484fe8dfb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Data; @@ -32,22 +33,97 @@ public class DeliverRequestFisAppService : private readonly IAreaAppService _areaApp; private readonly ICustomerAppService _customerApp; private readonly ICustomerAddressAppService _customerAddressApp; + private readonly ITransactionTypeAppService _transactionTypeAppService; + private readonly IBalanceAppService _balanceAppService; + private readonly IItemBasicAppService _itemBasicAppService; public DeliverRequestFisAppService( IDeliverRequestRepository repository, IDeliverRequestManager deliverRequestManager, IAreaAppService areaApp, ICustomerAppService customerApp, - ICustomerAddressAppService customerAddressApp - ) + ICustomerAddressAppService customerAddressApp, + ITransactionTypeAppService transactionTypeAppService, + IBalanceAppService balanceAppService, + IItemBasicAppService itemBasicAppService) : base(repository, deliverRequestManager) { _deliverRequestManager = deliverRequestManager; _areaApp = areaApp; _customerApp = customerApp; _customerAddressApp = customerAddressApp; + _transactionTypeAppService = transactionTypeAppService; + _balanceAppService = balanceAppService; + _itemBasicAppService = itemBasicAppService; } + #region 东阳 + + private async Task SetRequestAutoPropertiesAsync(DeliverRequest entity) + { + var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Deliver, EnumTransSubType.Deliver_FIS).ConfigureAwait(false); + + Check.NotNull(tranType, "事务类型", "事务类型不存在"); + + entity.AutoCompleteJob = tranType.AutoCompleteJob; + entity.AutoSubmit = tranType.AutoSubmitRequest; + entity.AutoAgree = tranType.AutoAgreeRequest; + entity.AutoHandle = tranType.AutoHandleRequest; + entity.DirectCreateNote = tranType.DirectCreateNote; + entity.DeliverRequestType = EnumDeliverRequestType.FIS; + } + + protected override async Task> ImportProcessingEntityAsync(Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var itemTransformRequest in addList) + { + itemTransformRequest.Worker = CurrentUser.GetUserName(); + itemTransformRequest.CreatorId = CurrentUser.Id; + itemTransformRequest.DeliverRequestType = EnumDeliverRequestType.FIS; + await SetRequestAutoPropertiesAsync(itemTransformRequest).ConfigureAwait(false); + foreach (var detail in itemTransformRequest.Details) + { + var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + var transactionType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.Deliver, + EnumTransSubType.Deliver_FIS) + .ConfigureAwait(false); + + var balances = await _balanceAppService.GetRecommendBalancesAsync( + new RecommendBalanceRequestInput() + { + ItemCode = itemBasicDto.Code, + Qty = detail.Qty, + LocationTypes = transactionType.OutLocationTypes, + LocationAreas = new List() { detail.AreaCode }, + Statuses = transactionType.OutInventoryStatuses + }).ConfigureAwait(false); + + var balanceSumQty = balances.Sum(t => t.Qty); + + if (balanceSumQty < detail.Qty) + { + throw new UserFriendlyException($"物料号 {detail.ItemCode} " + + $"在库位类型 {transactionType.OutLocationTypes.JoinAsString(",")}," + + $"库区 {detail.AreaCode} " + + $"状态 {transactionType.OutInventoryStatuses.JoinAsString(",")}" + + $"库存余额 {balanceSumQty} 小于 {detail.Qty}。"); + } + + detail.ItemDesc1 = itemBasicDto.Desc1; + detail.ItemDesc2 = itemBasicDto.Desc2; + detail.ItemName = itemBasicDto.Name; + detail.Uom = itemBasicDto.BasicUom; + + } + } + + return dictionary; + } + + #endregion + [HttpPost("list")] public override Task> GetPagedListByFilterAsync( SfsStoreRequestInputBase sfsRequestInput, @@ -55,7 +131,7 @@ public class DeliverRequestFisAppService : CancellationToken cancellationToken = default) { sfsRequestInput.Condition.Filters.Add( - new Filter(nameof(DeliverRequest.DeliverRequestType), "2")); + new Filter(nameof(DeliverRequest.DeliverRequestType), "FIS")); return base.GetPagedListByFilterAsync(sfsRequestInput, includeDetails, cancellationToken); } @@ -285,19 +361,7 @@ public class DeliverRequestFisAppService : await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false); } - private async Task SetRequestAutoPropertiesAsync(DeliverRequest entity) - { - var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Deliver, EnumTransSubType.Deliver_FIS).ConfigureAwait(false); - - Check.NotNull(tranType, "事务类型", "事务类型不存在"); - - entity.AutoCompleteJob = tranType.AutoCompleteJob; - entity.AutoSubmit = tranType.AutoSubmitRequest; - entity.AutoAgree = tranType.AutoAgreeRequest; - entity.AutoHandle = tranType.AutoHandleRequest; - entity.DirectCreateNote = tranType.DirectCreateNote; - entity.DeliverRequestType = EnumDeliverRequestType.FIS; - } + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs index 3d655298c..647f38610 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs @@ -12,6 +12,7 @@ using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -31,14 +32,17 @@ public class ItemTransformRequestAppService : private readonly IItemTransformRequestManager _manager; private readonly IInventoryLabelAppService _inventoryLabelAppService; + private readonly IBalanceAppService _balanceAppService; public ItemTransformRequestAppService( IItemTransformRequestRepository repository, IItemTransformRequestManager manager, - IInventoryLabelAppService inventoryLabelAppService) : base(repository, manager) + IInventoryLabelAppService inventoryLabelAppService, + IBalanceAppService balanceAppService) : base(repository, manager) { _manager = manager; _inventoryLabelAppService = inventoryLabelAppService; + _balanceAppService = balanceAppService; } /// @@ -72,16 +76,27 @@ public class ItemTransformRequestAppService : var fromLocationDto= await LocationAclService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); var toLocationDto= await LocationAclService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); var itemBasicDto=await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + var balanceDto= await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode, detail.ItemCode, + detail.FromLocationCode).ConfigureAwait(false); detail.FromLocationArea = fromLocationDto.AreaCode; detail.FromLocationErpCode = fromLocationDto.ErpLocationCode; detail.FromLocationGroup = fromLocationDto.LocationGroupCode; detail.FromWarehouseCode = fromLocationDto.WarehouseCode; + detail.FromSupplierBatch = balanceDto.SupplierBatch; + detail.FromLot = balanceDto.Lot; + detail.FromStatus = balanceDto.Status; + + detail.ToSupplierBatch = string.Empty; + detail.ToLot = balanceDto.Lot; + detail.ToStatus = balanceDto.Status; + detail.ToLocationArea = toLocationDto.AreaCode; detail.ToLocationErpCode = toLocationDto.ErpLocationCode; detail.ToLocationGroup = toLocationDto.LocationGroupCode; detail.ToWarehouseCode = toLocationDto.WarehouseCode; + detail.ItemDesc1 = itemBasicDto.Desc1; detail.ItemDesc2= itemBasicDto.Desc2; detail.ItemName= itemBasicDto.Name; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs index c974a01d1..0393a2ccd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain; @@ -17,6 +18,7 @@ namespace Win_in.Sfs.Wms.Store.Application; using System.ComponentModel.DataAnnotations; using Volo.Abp.Data; +using Volo.Abp.Domain.Entities; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Wms.Inventory.Application.Contracts; @@ -27,23 +29,32 @@ using Win_in.Sfs.Wms.Inventory.Application.Contracts; [Route($"{StoreConsts.RootPath}product-recycle-request")] public class ProductRecycleRequestAppService : - SfsStoreRequestAppServiceBase, + SfsStoreRequestAppServiceBase, IProductRecycleRequestAppService { private readonly IProductRecycleRequestManager _productRecycleRequestManager; private readonly IBomAppService _bomApp; private readonly IItemStoreRelationAppService _itemStoreRelationApp; + private readonly IItemBasicAppService _itemBasicAppService; + private readonly IBalanceAppService _balanceAppService; + private readonly ILocationAppService _locationAppService; + private readonly ITransactionTypeAppService _transactionTypeAppService; public ProductRecycleRequestAppService( IProductRecycleRequestRepository repository, IProductRecycleRequestManager productRecycleRequestManager, IBomAppService bomApp, - IItemStoreRelationAppService itemStoreRelationApp) + IItemStoreRelationAppService itemStoreRelationApp, ILocationAppService locationAppService, IBalanceAppService balanceAppService, ITransactionTypeAppService transactionTypeAppService) : base(repository, productRecycleRequestManager) { _productRecycleRequestManager = productRecycleRequestManager; _bomApp = bomApp; _itemStoreRelationApp = itemStoreRelationApp; + _locationAppService = locationAppService; + _balanceAppService = balanceAppService; + _transactionTypeAppService = transactionTypeAppService; base.CreatePolicyName = ProductRecycleRequestPermissions.Create; base.UpdatePolicyName = ProductRecycleRequestPermissions.Update; @@ -75,6 +86,100 @@ public class ProductRecycleRequestAppService : throw new NotImplementedException(); } + #region 东阳 + + protected override async Task> ImportProcessingEntityAsync(Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var productRecycleRequest in addList) + { + await SetRequestAutoPropertiesAsync(productRecycleRequest) + .ConfigureAwait(false); + productRecycleRequest.Worker = CurrentUser.GetUserName(); + + foreach (var detail in productRecycleRequest.Details) + { + var balance = await _balanceAppService.GetByItemLocationAndPackingAsync( + string.Empty, + detail.ItemCode, + detail.LocationCode).ConfigureAwait(false); + + if (balance != null) + { + detail.Status = balance.Status; + } + + var locationDto = await _locationAppService.GetByCodeAsync(detail.LocationCode) + .ConfigureAwait(false); + + await SetDetailPropertiesAsync(detail).ConfigureAwait(false); + } + } + + return dictionary; + } + + private async Task SetRequestAutoPropertiesAsync(ProductRecycleRequest entity) + { + var tranType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.ProductRecycle, EnumTransSubType.None).ConfigureAwait(false); + + Check.NotNull(tranType, "事务类型", "事务类型不存在"); + + entity.AutoCompleteJob = tranType.AutoCompleteJob; + entity.AutoSubmit = tranType.AutoSubmitRequest; + entity.AutoAgree = tranType.AutoAgreeRequest; + entity.AutoHandle = tranType.AutoHandleRequest; + entity.DirectCreateNote = tranType.DirectCreateNote; + } + + private async Task SetDetailPropertiesAsync( + ProductRecycleRequestDetail detail) + { + var item = await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + + if (item != null) + { + detail.ItemName = item.Name; + detail.ItemDesc1 = item.Desc1; + detail.ItemDesc2 = item.Desc2; + detail.Uom = item.BasicUom; + detail.Qty = detail.Qty; + } + + var location = await LocationAclService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); + + if (location != null) + { + detail.LocationErpCode = location.ErpLocationCode; + detail.WarehouseCode = location.WarehouseCode; + detail.LocationGroup = location.LocationGroupCode; + detail.LocationArea = location.AreaCode; + } + + var rawLocation = await LocationAclService.GetByCodeAsync(detail.RawLocationCode).ConfigureAwait(false); + + if (rawLocation != null) + { + detail.RawLocationErpCode = rawLocation.ErpLocationCode; + detail.RawWarehouseCode = rawLocation.WarehouseCode; + detail.RawLocationArea = rawLocation.AreaCode; + detail.RawLocationGroup = rawLocation.LocationGroupCode; + } + + var balance = await BalanceAclService.GetByItemLocationAndPackingAsync( + string.Empty, + detail.ItemCode, + detail.LocationCode).ConfigureAwait(false); + + if (balance != null) + { + detail.Status = balance.Status; + } + } + + #endregion + #region Import protected virtual async Task CheckImportInputBusinessAsync(ProductRecycleRequestImportInput importInput, EnumImportMethod importMethod, List validationRresult) @@ -202,147 +307,6 @@ public class ProductRecycleRequestAppService : return boms; } - protected virtual async Task ImportDataAsync(List entites, List deleteEntities) - { - await _productRecycleRequestManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); - } - - protected override Func GetEntityExpression() - { - return p => 1; - } - - protected virtual async Task<(List entites, List deleteEntities)> BuildImportDataAsync(ImportResult importResult, EnumImportMethod importMethod = EnumImportMethod.Update, bool isAllowPartImport = false) - { - if (importResult.Data.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) - { - if (!isAllowPartImport) - { - return (null, null); - } - } - - var entites = new List(); - - var details = new List(); - - var deleteEntites = new List(); - - var entityExpression = GetEntityExpression(); - - var groupList = importResult.Data.ToList().GroupBy(entityExpression).Distinct().ToList(); - - foreach (var group in groupList) - { - var input = group.FirstOrDefault(); - - var inputDetails = group.ToList(); - - if (!inputDetails.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) - { - var exist = await GetEntityAsync(input).ConfigureAwait(false); - - var entity = ObjectMapper.Map(input); - - await SetEntityPropertiesAsync(entity, input).ConfigureAwait(false); - - switch (importMethod) - { - case EnumImportMethod.Update: - if (exist != null) - { - entity.SetId(exist.Id); - } - break; - case EnumImportMethod.Replace: - if (exist != null) - { - deleteEntites.Add(exist); - } - break; - } - - foreach (var inputDetail in inputDetails) - { - var detail = ObjectMapper.Map(inputDetail); - - detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number); - - await SetDetailPropertiesAsync(detail, input).ConfigureAwait(false); - entity.AddDetail(detail); - } - - entites.Add(entity); - } - } - - return (entites, deleteEntites); - } - - private async Task SetDetailPropertiesAsync( - ProductRecycleRequestDetail detail, - ProductRecycleRequestImportInput input) - { - var item = await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); - - if (item != null) - { - detail.ItemName = item.Name; - detail.ItemDesc1 = item.Desc1; - detail.ItemDesc2 = item.Desc2; - detail.Qty = input.Qty; - } - - var location = await LocationAclService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); - - if (location != null) - { - detail.LocationErpCode = location.ErpLocationCode; - detail.WarehouseCode = location.WarehouseCode; - } - - var rawLocation = await LocationAclService.GetByCodeAsync(detail.RawLocationCode).ConfigureAwait(false); - - if (rawLocation != null) - { - detail.RawLocationErpCode = rawLocation.ErpLocationCode; - detail.RawWarehouseCode = rawLocation.WarehouseCode; - } - - var balance = await BalanceAclService.GetByItemLocationAndPackingAsync( - string.Empty, - detail.ItemCode, - input.LocationCode).ConfigureAwait(false); - - if (balance != null) - { - detail.Status = balance.Status; - } - - detail.SetProperty(nameof(input.PreStartTime), input.PreStartTime); - detail.SetProperty(nameof(input.WorkHour), input.WorkHour); - } - - private async Task SetEntityPropertiesAsync(ProductRecycleRequest entity, ProductRecycleRequestImportInput input) - { - entity.Worker = CurrentUser.GetUserName(); - - await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false); - } - - private async Task SetRequestAutoPropertiesAsync(ProductRecycleRequest entity) - { - var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.ProductRecycle, EnumTransSubType.None).ConfigureAwait(false); - - Check.NotNull(tranType, "事务类型", "事务类型不存在"); - - entity.AutoCompleteJob = tranType.AutoCompleteJob; - entity.AutoSubmit = tranType.AutoSubmitRequest; - entity.AutoAgree = tranType.AutoAgreeRequest; - entity.AutoHandle = tranType.AutoHandleRequest; - entity.DirectCreateNote = tranType.DirectCreateNote; - } - #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs index c180d8e1b..2b7f6a0d5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain; @@ -27,22 +28,25 @@ public class ProductionReturnRequestAppService : IProductionReturnRequestAppService { private readonly IProductionReturnRequestManager _productionReturnRequestManager; - private readonly IItemStoreRelationAppService _itemStoreRelationApp; - private readonly IPurchaseOrderAppService _purchaseOrderApp; + private readonly IItemBasicAppService _itemBasicAppService; + private readonly ILocationAppService _locationAppService; public ProductionReturnRequestAppService( IProductionReturnRequestRepository repository, IProductionReturnRequestManager productionRequestReturnManager, IItemStoreRelationAppService itemStoreRelationApp, - IPurchaseOrderAppService purchaseOrderApp - ) + IPurchaseOrderAppService purchaseOrderApp, + IItemBasicAppService itemBasicAppService, + ILocationAppService locationAppService) : base(repository, productionRequestReturnManager) { _productionReturnRequestManager = productionRequestReturnManager; _itemStoreRelationApp = itemStoreRelationApp; _purchaseOrderApp = purchaseOrderApp; + _itemBasicAppService = itemBasicAppService; + _locationAppService = locationAppService; } /// @@ -62,6 +66,40 @@ public class ProductionReturnRequestAppService : return dto; } + protected override async Task> ImportProcessingEntityAsync(Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var productionReturnRequest in addList) + { + productionReturnRequest.Worker = CurrentUser.GetUserName(); + productionReturnRequest.CreatorId = CurrentUser.Id; + + await SetRequestAutoPropertiesAsync(productionReturnRequest).ConfigureAwait(false); + foreach (var detail in productionReturnRequest.Details) + { + var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + detail.Uom = itemBasicDto.BasicUom; + detail.StdPackQty=itemBasicDto.StdPackQty; + + var fromLocationDto= await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); + var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + + detail.FromLocationArea = fromLocationDto.AreaCode; + detail.FromWarehouseCode = fromLocationDto.WarehouseCode; + detail.FromLocationGroup = fromLocationDto.LocationGroupCode; + detail.FromLocationErpCode= fromLocationDto.ErpLocationCode; + + detail.ToLocationArea = toLocationDto.AreaCode; + detail.ToWarehouseCode = toLocationDto.WarehouseCode; + detail.ToLocationGroup = toLocationDto.LocationGroupCode; + detail.ToLocationErpCode = toLocationDto.ErpLocationCode; + } + } + + return dictionary; + } + #region import protected virtual async Task CheckImportInputBusinessAsync(ProductionReturnRequestImportInput importInput, EnumImportMethod importMethod, List validationRresult) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ItemTransformRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ItemTransformRequestEventHandler.cs index 199be122d..a71aeb6c3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ItemTransformRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ItemTransformRequestEventHandler.cs @@ -44,6 +44,16 @@ public class ItemTransformRequestEventHandler { var transformNoteDetail = new ItemTransformNoteDetailInput() { + FromLocationCode = detail.FromLocationCode, + FromLocationArea = detail.FromLocationArea, + FromLocationErpCode = detail.FromLocationErpCode, + FromLocationGroup = detail.FromLocationGroup, + + ToLocationArea = detail.ToLocationArea, + ToLocationCode = detail.ToLocationCode, + ToLocationErpCode = detail.ToLocationErpCode, + ToLocationGroup = detail.ToLocationGroup, + FromSupplierBatch = detail.FromSupplierBatch, ItemCode = detail.ItemCode, ToItemCode = detail.ToItemCode, @@ -52,7 +62,6 @@ public class ItemTransformRequestEventHandler FromExpireDate = detail.FromExpireDate, FromLot = detail.FromLot, FromPackingCode = detail.FromPackingCode, - ToLocationCode = detail.ToLocationCode, FromStatus = detail.FromStatus, ToContainerCode = detail.ToContainerCode, FromProduceDate = detail.FromProduceDate, @@ -74,6 +83,8 @@ public class ItemTransformRequestEventHandler ToProduceDate = detail.ToProduceDate, ToStatus = detail.ToStatus, ToSupplierBatch = detail.ToSupplierBatch, + FromWarehouseCode = detail.FromWarehouseCode, + ToWarehouseCode = detail.ToWarehouseCode }; createInput.Details.Add(transformNoteDetail); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs index a315b3a07..fa0a16a2e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs @@ -99,7 +99,9 @@ public class ProductRecycleRequestEventHandler LocationErpCode = detail.RawLocationErpCode, WarehouseCode = detail.RawWarehouseCode, Lot = string.Empty, - Status = EnumInventoryStatus.OK + Status = EnumInventoryStatus.OK, + LocationArea = detail.LocationArea, + LocationGroup = detail.LocationGroup, }; if (item != null) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs index af56eb5a4..c33adc601 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs @@ -72,7 +72,9 @@ public class ItemTransformNoteEventHandler TransType = Type, TransSubType = SubType, TransInOut = EnumTransInOut.Out, - + LocationArea = detail.FromLocationArea, + LocationGroup = detail.FromLocationGroup, + LocationErpCode = detail.FromLocationErpCode, PackingCode = detail.FromPackingCode, ItemCode = detail.ItemCode, Lot = detail.FromLot, @@ -106,6 +108,9 @@ public class ItemTransformNoteEventHandler ItemCode = detail.ToItemCode, Lot = detail.ToLot, Status = detail.ToStatus, + LocationArea = detail.ToLocationArea, + LocationGroup = detail.ToLocationGroup, + LocationErpCode = detail.ToLocationErpCode, WarehouseCode = detail.ToWarehouseCode, LocationCode = detail.ToLocationCode, ContainerCode = detail.ToContainerCode, From 235f2c93c8ce7223da1e3d0f1982654a800b8574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Sun, 16 Apr 2023 01:02:35 +0800 Subject: [PATCH 40/41] =?UTF-8?q?=E9=9D=9E=E7=94=9F=E4=BA=A7=20=E9=A2=86?= =?UTF-8?q?=E6=96=99=20=E9=9D=9E=E7=94=9F=E4=BA=A7=E9=80=80=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnplannedReceiptNoteAutoMapperProfile.cs | 9 + ...lannedIssueRequestForDongyangAppService.cs | 301 +++++++++-------- ...nplannedReceiptRequestAutoMapperProfile.cs | 3 +- ...nnedReceiptRequestForDongyangAppService.cs | 302 ++++++++---------- .../Plans/CountPlans/CountPlanManager.cs | 3 + 5 files changed, 329 insertions(+), 289 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteAutoMapperProfile.cs index 1880e6110..0733dd99a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteAutoMapperProfile.cs @@ -21,5 +21,14 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id) + .Ignore(x => x.Remark) + .Ignore(x => x.ExtraProperties) + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs index a55992254..630967205 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs @@ -20,16 +20,189 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA { private readonly IDepartmentAppService _departmentApp; private readonly IUnplannedIssueRequestManager _unplannedIssueRequestManager; + private readonly IBalanceAppService _balanceAppService; + private readonly IDepartmentAppService _departmentAppService; public UnplannedIssueRequestForDongyangAppService(IUnplannedIssueRequestRepository repository, IUnplannedIssueRequestManager unplannedIssueRequestManager, - IDepartmentAppService departmentApp - ) : base(repository, unplannedIssueRequestManager) + IDepartmentAppService departmentApp, IBalanceAppService balanceAppService, IDepartmentAppService departmentAppService) : base(repository, unplannedIssueRequestManager) { _unplannedIssueRequestManager = unplannedIssueRequestManager; _departmentApp = departmentApp; + _balanceAppService = balanceAppService; + _departmentAppService = departmentAppService; } + /// + /// 用来重写 导入数据时可以加工数据 + /// + /// + /// + protected override async Task> ImportProcessingEntityAsync(Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var unplannedIssueRequest in addList) + { + unplannedIssueRequest.Worker = CurrentUser.GetUserName(); + unplannedIssueRequest.CreatorId = CurrentUser.Id; + + await SetRequestAutoPropertiesAsync(unplannedIssueRequest).ConfigureAwait(false); + await SetEntityPropertiesAsync(unplannedIssueRequest).ConfigureAwait(false); + + foreach (var detail in unplannedIssueRequest.Details) + { + await SetDetailPropertiesAsync(detail).ConfigureAwait(false); + } + } + + return dictionary; + } + + #region 赋值 + + /// + /// 赋值详情 + /// + /// + /// + private async Task SetDetailPropertiesAsync(UnplannedIssueRequestDetail detail) + { + var itemBasic = await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + + if (itemBasic != null) + { + detail.ItemCode = itemBasic.Code; + detail.ItemName = itemBasic.Name; + detail.ItemDesc1 = itemBasic.Desc1; + detail.ItemDesc2 = itemBasic.Desc2; + + detail.StdPackQty = itemBasic.StdPackQty; + detail.Uom = itemBasic.BasicUom; + } + + var location = await LocationAclService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); + + if (location != null) + { + detail.WarehouseCode = location.WarehouseCode; + detail.LocationErpCode = location.ErpLocationCode; + detail.LocationGroup = location.LocationGroupCode; + detail.LocationArea = location.AreaCode; + detail.LocationCode = location.Code; + } + + var balance = await _balanceAppService.GetByItemLocationAndPackingAsync( + string.Empty, + detail.ItemCode, + detail.LocationCode).ConfigureAwait(false); + + if (balance != null) + { + detail.SupplierBatch = balance.SupplierBatch; + detail.ArriveDate = balance.ArriveDate; + detail.ProduceDate = balance.ProduceDate; + detail.ExpireDate = balance.ExpireDate; + + detail.Lot = balance.Lot; + detail.ContainerCode = balance.ContainerCode; + detail.PackingCode = balance.PackingCode; + detail.Qty = balance.Qty; + detail.Status = balance.Status; + } + + //if (!string.IsNullOrEmpty(detail)) + //{ + // var dict = await DictAppService.GetByCodeAsync(nameof(input.OnceBusiCode)).ConfigureAwait(false); + + // if (dict.Items != null && dict.Items.Count > 0) + // { + // var item = dict.Items.FirstOrDefault(t => t.Code == input.OnceBusiCode); + + // Check.NotNull(item, "次交易码", "次交易码不存在"); + + // detail.SetProperty("OnceBusiCode", item.Code); + // detail.SetProperty("OnceBusiName", item.Name); + // } + //} + + //if (!string.IsNullOrEmpty(input.CaseCode)) + //{ + // var dict = await DictAppService.GetByCodeAsync(nameof(input.CaseCode)).ConfigureAwait(false); + + // if (dict.Items != null && dict.Items.Count > 0) + // { + // var item = dict.Items.FirstOrDefault(t => t.Code == input.CaseCode); + + // Check.NotNull(item, "专案代码", "专案代码不存在"); + + // detail.SetProperty("CaseCode", item.Code); + // detail.SetProperty("CaseName", item.Name); + // } + //} + + //if (!string.IsNullOrEmpty(input.ProjCapacityCode)) + //{ + // var dict = await DictAppService.GetByCodeAsync(nameof(input.ProjCapacityCode)).ConfigureAwait(false); + + // if (dict.Items != null && dict.Items.Count > 0) + // { + // var item = dict.Items.FirstOrDefault(t => t.Code == input.ProjCapacityCode); + + // Check.NotNull(item, "项目分类代码", "项目分类代码不存在"); + + // detail.SetProperty("ProjCapacityCode", item.Code); + // detail.SetProperty("ProjCapacityName", item.Name); + // } + //} + } + + /// + /// 赋值主记录 + /// + /// + /// + private async Task SetEntityPropertiesAsync(UnplannedIssueRequest entity) + { + var userName = CurrentUser.GetUserName(); + + var department = await _departmentAppService.GetByUsernameAsync(userName).ConfigureAwait(false); + + if (department != null) + { + entity.DeptCode = department.Code; + entity.DeptName = department.Name; + } + + entity.Worker = userName; + + entity.BuildDate = DateTime.Now; + + await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false); + } + + /// + /// 赋值业务事务 + /// + /// + /// + private async Task SetRequestAutoPropertiesAsync(UnplannedIssueRequest entity) + { + var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.UnplannedIssue, EnumTransSubType.None).ConfigureAwait(false); + + Check.NotNull(tranType, "事务类型", "事务类型不存在"); + + entity.AutoCompleteJob = tranType.AutoCompleteJob; + entity.AutoSubmit = tranType.AutoSubmitRequest; + entity.AutoAgree = tranType.AutoAgreeRequest; + entity.AutoHandle = tranType.AutoHandleRequest; + entity.DirectCreateNote = tranType.DirectCreateNote; + } + + #endregion + + #region 校验 + protected async Task CheckBalanceAsync(UnplannedIssueRequestImportInput importInput, List validationRresult) { var balance = await BalanceAclService.GetByItemLocationAndPackingAsync( @@ -155,127 +328,5 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA } } - protected override Func GetEntityExpression() - { - return p => (1); - } - - protected override async Task ValidateImportEntityAsync(UnplannedIssueRequestImportInput input, UnplannedIssueRequest entity, List validationRresult) - { - foreach (var detail in entity.Details) - { - var itemBasic = await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); - - if (itemBasic != null) - { - detail.ItemName = itemBasic.Name; - detail.ItemDesc1 = itemBasic.Desc1; - detail.ItemDesc2 = itemBasic.Desc2; - detail.StdPackQty = itemBasic.StdPackQty; - } - - var location = await LocationAclService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); - - if (location != null) - { - detail.LocationErpCode = location.ErpLocationCode; - detail.WarehouseCode = location.WarehouseCode; - } - - // var balance = await this._balanceApp.GetByPackingCodeAsync(input.PackingCode); - - var balance = await BalanceAclService.GetByItemLocationAndPackingAsync( - string.Empty, - input.ItemCode, - input.LocationCode).ConfigureAwait(false); - - if (balance != null) - { - detail.SupplierBatch = balance.SupplierBatch; - detail.ArriveDate = balance.ArriveDate; - detail.ProduceDate = balance.ProduceDate; - detail.ExpireDate = balance.ExpireDate; - detail.Lot = balance.Lot; - detail.ContainerCode = balance.ContainerCode; - detail.PackingCode = balance.PackingCode; - detail.Qty = input.Qty; - detail.Status = balance.Status; - } - - if (!string.IsNullOrEmpty(input.OnceBusiCode)) - { - var dict = await DictAppService.GetByCodeAsync(nameof(input.OnceBusiCode)).ConfigureAwait(false); - - if (dict.Items != null && dict.Items.Count > 0) - { - var item = dict.Items.FirstOrDefault(t => t.Code == input.OnceBusiCode); - - Check.NotNull(item, "次交易码", "次交易码不存在"); - - detail.SetProperty("OnceBusiCode", item.Code); - detail.SetProperty("OnceBusiName", item.Name); - } - } - - if (!string.IsNullOrEmpty(input.CaseCode)) - { - var dict = await DictAppService.GetByCodeAsync(nameof(input.CaseCode)).ConfigureAwait(false); - - if (dict.Items != null && dict.Items.Count > 0) - { - var item = dict.Items.FirstOrDefault(t => t.Code == input.CaseCode); - - Check.NotNull(item, "专案代码", "专案代码不存在"); - - detail.SetProperty("CaseCode", item.Code); - detail.SetProperty("CaseName", item.Name); - } - } - - if (!string.IsNullOrEmpty(input.ProjCapacityCode)) - { - var dict = await DictAppService.GetByCodeAsync(nameof(input.ProjCapacityCode)).ConfigureAwait(false); - - if (dict.Items != null && dict.Items.Count > 0) - { - var item = dict.Items.FirstOrDefault(t => t.Code == input.ProjCapacityCode); - - Check.NotNull(item, "项目分类代码", "项目分类代码不存在"); - - detail.SetProperty("ProjCapacityCode", item.Code); - detail.SetProperty("ProjCapacityName", item.Name); - } - } - } - } - - protected override async Task ValidateImportEntities(Dictionary dicts) - { - foreach (var entity in dicts.Keys) - { - var userName = CurrentUser.GetUserName(); - - var department = await _departmentApp.GetByUsernameAsync(userName).ConfigureAwait(false); - - if (department != null) - { - entity.DeptCode = department.Code; - entity.DeptName = department.Name; - } - - entity.Worker = userName; - - entity.BuildDate = DateTime.Now; - var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.UnplannedIssue, EnumTransSubType.None).ConfigureAwait(false); - - Check.NotNull(tranType, "事务类型", "事务类型不存在"); - - entity.AutoCompleteJob = tranType.AutoCompleteJob; - entity.AutoSubmit = tranType.AutoSubmitRequest; - entity.AutoAgree = tranType.AutoAgreeRequest; - entity.AutoHandle = tranType.AutoHandleRequest; - entity.DirectCreateNote = tranType.DirectCreateNote; - } - return await base.ValidateImportEntities(dicts).ConfigureAwait(false); - } + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAutoMapperProfile.cs index d48b11807..078029270 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAutoMapperProfile.cs @@ -59,6 +59,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.ContainerCode) .Ignore(x => x.Lot) .Ignore(x => x.Status) - .Ignore(x => x.Number); + .Ignore(x => x.Number) + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs index e69792f7b..b4e3d4656 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; - +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Data; using Win_in.Sfs.Auth.Application.Contracts; @@ -29,75 +29,160 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ _departmentApp = departmentApp; } - protected virtual async Task<(List entites, List deleteEntities)> BuildImportDataAsync(ImportResult importResult, EnumImportMethod importMethod = EnumImportMethod.Update, bool isAllowPartImport = false) + /// + /// 用来重写 导入数据时可以加工数据 + /// + /// + /// + protected override async Task> ImportProcessingEntityAsync(Dictionary dictionary) { - if (importResult.Data.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var unplannedIssueRequest in addList) { - if (!isAllowPartImport) + unplannedIssueRequest.Worker = CurrentUser.GetUserName(); + unplannedIssueRequest.CreatorId = CurrentUser.Id; + + await SetRequestAutoPropertiesAsync(unplannedIssueRequest).ConfigureAwait(false); + await SetEntityPropertiesAsync(unplannedIssueRequest).ConfigureAwait(false); + + foreach (var detail in unplannedIssueRequest.Details) { - return (null, null); + await SetDetailPropertiesAsync(detail).ConfigureAwait(false); } } - var entites = new List(); + return dictionary; + } - var details = new List(); + #region 赋值 - var deleteEntites = new List(); + /// + /// 赋值详情 + /// + /// + /// + private async Task SetDetailPropertiesAsync(UnplannedReceiptRequestDetail detail) + { + var itemBasic = await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); - var entityExpression = GetEntityExpression(); + if (itemBasic != null) + { + detail.ItemName = itemBasic.Name; + detail.ItemDesc1 = itemBasic.Desc1; + detail.ItemDesc2 = itemBasic.Desc2; + detail.StdPackQty = itemBasic.StdPackQty; + detail.Uom = itemBasic.BasicUom; + } - var groupList = importResult.Data.ToList().GroupBy(entityExpression).Distinct().ToList(); + var location = await LocationAclService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); - foreach (var group in groupList) + if (location != null) { - var input = group.FirstOrDefault(); + detail.LocationErpCode = location.ErpLocationCode; + detail.WarehouseCode = location.WarehouseCode; + detail.LocationArea = location.AreaCode; + detail.LocationGroup = location.LocationGroupCode; + } - var inputDetails = group.ToList(); + detail.Lot = string.Empty; + detail.ContainerCode = string.Empty; + detail.PackingCode = string.Empty; + detail.Status = EnumInventoryStatus.OK; - if (!inputDetails.Any(t => t.ReportStatus == EnumImportReportStatus.Failed)) - { - var exist = await GetEntityAsync(input).ConfigureAwait(false); + //if (!string.IsNullOrEmpty(detail.OnceBusiCode)) + //{ + // var dict = await DictAclService.GetByCodeAsync(nameof(input.OnceBusiCode)).ConfigureAwait(false); - var entity = ObjectMapper.Map(input); + // if (dict.Items != null && dict.Items.Count > 0) + // { + // var item = dict.Items.FirstOrDefault(t => t.Code == input.OnceBusiCode); - await SetEntityPropertiesAsync(entity, input).ConfigureAwait(false); + // Check.NotNull(item, "次交易码", "次交易码不存在"); - switch (importMethod) - { - case EnumImportMethod.Update: - if (exist != null) - { - entity.SetId(exist.Id); - } - break; - - case EnumImportMethod.Replace: - if (exist != null) - { - deleteEntites.Add(exist); - } - break; - } + // detail.SetProperty("OnceBusiCode", item.Code); + // detail.SetProperty("OnceBusiName", item.Name); + // } + //} - foreach (var inputDetail in inputDetails) - { - var detail = ObjectMapper.Map(inputDetail); + //if (!string.IsNullOrEmpty(input.CaseCode)) + //{ + // var dict = await DictAclService.GetByCodeAsync(nameof(input.CaseCode)).ConfigureAwait(false); - detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number); + // if (dict.Items != null && dict.Items.Count > 0) + // { + // var item = dict.Items.FirstOrDefault(t => t.Code == input.CaseCode); - await SetDetailPropertiesAsync(detail, inputDetail).ConfigureAwait(false); - entity.AddDetail(detail); - } + // Check.NotNull(item, "专案代码", "专案代码不存在"); - entites.Add(entity); - } + // detail.SetProperty("CaseCode", item.Code); + // detail.SetProperty("CaseName", item.Name); + // } + //} + + //if (!string.IsNullOrEmpty(input.ProjCapacityCode)) + //{ + // var dict = await DictAclService.GetByCodeAsync(nameof(input.ProjCapacityCode)).ConfigureAwait(false); + + // if (dict.Items != null && dict.Items.Count > 0) + // { + // var item = dict.Items.FirstOrDefault(t => t.Code == input.ProjCapacityCode); + + // Check.NotNull(item, "项目分类代码", "项目分类代码不存在"); + + // detail.SetProperty("ProjCapacityCode", item.Code); + // detail.SetProperty("ProjCapacityName", item.Name); + // } + //} + } + + /// + /// 赋值主记录 + /// + /// + /// + private async Task SetEntityPropertiesAsync(UnplannedReceiptRequest entity) + { + var userName = CurrentUser.GetUserName(); + + var department = await _departmentApp.GetByUsernameAsync(userName).ConfigureAwait(false); + + if (department != null) + { + entity.DeptCode = department.Code; + entity.DeptName = department.Name; } - return (entites, deleteEntites); + entity.Worker = userName; + + entity.BuildDate = DateTime.Now; + + await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false); } - protected async Task CheckBalanceAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) + /// + /// 赋值业务事务 + /// + /// + /// + private async Task SetRequestAutoPropertiesAsync(UnplannedReceiptRequest entity) + { + var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.UnplannedReceipt, EnumTransSubType.None).ConfigureAwait(false); + + Check.NotNull(tranType, "事务类型", "事务类型不存在"); + + entity.AutoCompleteJob = tranType.AutoCompleteJob; + entity.AutoSubmit = tranType.AutoSubmitRequest; + entity.AutoAgree = tranType.AutoAgreeRequest; + entity.AutoHandle = tranType.AutoHandleRequest; + entity.DirectCreateNote = tranType.DirectCreateNote; + } + + #endregion + + #region 校验 + + protected virtual async Task CheckBalanceAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) { var balance = await BalanceAclService.GetByItemLocationAndPackingAsync( string.Empty, @@ -118,7 +203,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ return balance; } - protected async Task CheckCaseCodeAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) + protected virtual async Task CheckCaseCodeAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) { if (!string.IsNullOrEmpty(importInput.CaseCode)) { @@ -161,7 +246,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ //} } - protected async Task CheckItemBasicAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) + protected virtual async Task CheckItemBasicAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) { var item = await ItemBasicAclService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false); if (item == null) @@ -176,7 +261,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ return item; } - protected async Task CheckLocationAsync(string locationCode, List validationRresult) + protected virtual async Task CheckLocationAsync(string locationCode, List validationRresult) { var location = await LocationAclService.GetByCodeAsync(locationCode).ConfigureAwait(false); if (location == null) @@ -186,7 +271,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ return location; } - protected async Task CheckOnceBusiCodeAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) + protected virtual async Task CheckOnceBusiCodeAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) { if (!string.IsNullOrEmpty(importInput.OnceBusiCode)) { @@ -208,7 +293,8 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ } } } - protected async Task CheckProjCapacityCodeAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) + + protected virtual async Task CheckProjCapacityCodeAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) { var dict = await DictAclService.GetByCodeAsync(nameof(importInput.ProjCapacityCode)).ConfigureAwait(false); if (dict == null) @@ -227,7 +313,8 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ } } } - protected async Task CheckTransactionTypeAsync(EnumTransType enumTransType, List validationRresult) + + protected virtual async Task CheckTransactionTypeAsync(EnumTransType enumTransType, List validationRresult) { var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(enumTransType, EnumTransSubType.None).ConfigureAwait(false); if (transactionType == null) @@ -237,116 +324,5 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ return transactionType; } - protected override Func GetEntityExpression() - { - return p => (1); - } - - protected virtual async Task ImportDataAsync(List entites, List deleteEntities) - { - await _unplannedReceiptRequestManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); - } - private async Task SetDetailPropertiesAsync(UnplannedReceiptRequestDetail detail, UnplannedReceiptRequestImportInput input) - { - var itemBasic = await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); - - if (itemBasic != null) - { - detail.ItemName = itemBasic.Name; - detail.ItemDesc1 = itemBasic.Desc1; - detail.ItemDesc2 = itemBasic.Desc2; - detail.StdPackQty = itemBasic.StdPackQty; - } - - var location = await LocationAclService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); - - if (location != null) - { - detail.LocationErpCode = location.ErpLocationCode; - detail.WarehouseCode = location.WarehouseCode; - detail.Lot = string.Empty; - detail.ContainerCode = string.Empty; - } - - detail.PackingCode = string.Empty; - - detail.Status = EnumInventoryStatus.OK; - - if (!string.IsNullOrEmpty(input.OnceBusiCode)) - { - var dict = await DictAclService.GetByCodeAsync(nameof(input.OnceBusiCode)).ConfigureAwait(false); - - if (dict.Items != null && dict.Items.Count > 0) - { - var item = dict.Items.FirstOrDefault(t => t.Code == input.OnceBusiCode); - - Check.NotNull(item, "次交易码", "次交易码不存在"); - - detail.SetProperty("OnceBusiCode", item.Code); - detail.SetProperty("OnceBusiName", item.Name); - } - } - - if (!string.IsNullOrEmpty(input.CaseCode)) - { - var dict = await DictAclService.GetByCodeAsync(nameof(input.CaseCode)).ConfigureAwait(false); - - if (dict.Items != null && dict.Items.Count > 0) - { - var item = dict.Items.FirstOrDefault(t => t.Code == input.CaseCode); - - Check.NotNull(item, "专案代码", "专案代码不存在"); - - detail.SetProperty("CaseCode", item.Code); - detail.SetProperty("CaseName", item.Name); - } - } - - if (!string.IsNullOrEmpty(input.ProjCapacityCode)) - { - var dict = await DictAclService.GetByCodeAsync(nameof(input.ProjCapacityCode)).ConfigureAwait(false); - - if (dict.Items != null && dict.Items.Count > 0) - { - var item = dict.Items.FirstOrDefault(t => t.Code == input.ProjCapacityCode); - - Check.NotNull(item, "项目分类代码", "项目分类代码不存在"); - - detail.SetProperty("ProjCapacityCode", item.Code); - detail.SetProperty("ProjCapacityName", item.Name); - } - } - } - - private async Task SetEntityPropertiesAsync(UnplannedReceiptRequest entity, UnplannedReceiptRequestImportInput input) - { - var userName = CurrentUser.GetUserName(); - - var department = await _departmentApp.GetByUsernameAsync(userName).ConfigureAwait(false); - - if (department != null) - { - entity.DeptCode = department.Code; - entity.DeptName = department.Name; - } - - entity.Worker = userName; - - entity.BuildDate = DateTime.Now; - - await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false); - } - - private async Task SetRequestAutoPropertiesAsync(UnplannedReceiptRequest entity) - { - var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.UnplannedReceipt, EnumTransSubType.None).ConfigureAwait(false); - - Check.NotNull(tranType, "事务类型", "事务类型不存在"); - - entity.AutoCompleteJob = tranType.AutoCompleteJob; - entity.AutoSubmit = tranType.AutoSubmitRequest; - entity.AutoAgree = tranType.AutoAgreeRequest; - entity.AutoHandle = tranType.AutoHandleRequest; - entity.DirectCreateNote = tranType.DirectCreateNote; - } + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs index a48c1c1cb..f0c42a09b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs @@ -219,6 +219,7 @@ public class CountPlanManager : SfsStoreRequestManagerBase Date: Sun, 16 Apr 2023 13:03:45 +0800 Subject: [PATCH 41/41] =?UTF-8?q?=E7=BA=BF=E8=BE=B9=E4=BB=93=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...FrameworkCore.SqlServer.StoreDbContext.sql | 153 ++++++++++++++++++ .../SfsCrudWithDetailsAppServiceBase.cs | 3 +- .../DTOs/WipWarehouseAdjustNoteDTO.cs | 41 +++++ .../DTOs/WipWarehouseAdjustNoteDetailDTO.cs | 24 +++ .../IWipWarehouseAdjustNoteAppService.cs | 17 ++ .../WipWarehouseAdjustNoteDetailInput.cs | 24 +++ .../Inputs/WipWarehouseAdjustNoteEditInput.cs | 48 ++++++ .../WipWarehouseAdjustNoteImportInput.cs | 71 ++++++++ .../WipWarehouseAdjustNotePermissions.cs | 21 +++ .../StorePermissionDefinitionProvider.cs | 3 + .../DTOs/WipWarehouseAdjustRequestDTO.cs | 15 ++ .../WipWarehouseAdjustRequestDetailDTO.cs | 24 +++ .../IWipWarehouseAdjustRequestAppService.cs | 7 + .../WipWarehouseAdjustRequestDetailInput.cs | 24 +++ .../WipWarehouseAdjustRequestEditInput.cs | 26 +++ .../WipWarehouseAdjustRequestImportInput.cs | 54 +++++++ .../WipWarehouseAdjustRequestPermissions.cs | 24 +++ ...Sfs.Wms.Store.Application.Contracts.csproj | 2 - .../PurchaseReceiptJobAppService.cs | 1 - .../WipWarehouseAdjustNoteAppService.cs | 136 ++++++++++++++++ ...WipWarehouseAdjustNoteAutoMapperProfile.cs | 88 ++++++++++ .../PurchaseOrders/PurchaseOrderAppService.cs | 1 - .../SupplierAsns/SupplierAsnAppService.cs | 4 +- .../ProductReceiptRequestAppService.cs | 1 - .../ProductRecycleRequestAppService.cs | 6 +- .../PurchaseReturnRequestAppService.cs | 2 +- .../WipWarehouseAdjustRequestAppService.cs | 148 +++++++++++++++++ ...WarehouseAdjustRequestAutoMapperProfile.cs | 77 +++++++++ .../StoreApplicationAutoMapperProfile.cs | 3 + .../Win_in.Sfs.Wms.Store.Application.csproj | 1 + .../IWipWarehouseAdjustNoteManager.cs | 11 ++ .../IWipWarehouseAdjustNoteRepository.cs | 8 + .../WipWarehouseAdjustNote.cs | 65 ++++++++ .../WipWarehouseAdjustNoteDetail.cs | 24 +++ .../WipWarehouseAdjustNoteManager.cs | 118 ++++++++++++++ .../IWipWarehouseAdjustRequestManager.cs | 9 ++ .../IWipWarehouseAdjustRequestRepository.cs | 9 ++ .../WipWarehouseAdjustRequest.cs | 25 +++ .../WipWarehouseAdjustRequestDetail.cs | 30 ++++ .../WipWarehouseAdjustRequestManager.cs | 80 +++++++++ .../IStoreDbContext.cs | 3 +- ...ustNoteDbContextModelCreatingExtensions.cs | 52 ++++++ .../WipWarehouseAdjustNoteEfCoreRepository.cs | 11 ++ ...RequestDbContextModelCreatingExtensions.cs | 52 ++++++ ...pWarehouseAdjustRequestEfCoreRepository.cs | 13 ++ .../StoreDbContext.cs | 3 +- .../StoreDbContextModelCreatingExtensions.cs | 2 + .../StoreEntityFrameworkCoreModule.cs | 6 + .../Notes/TransferNoteAutoMapperProfile.cs | 13 +- ...WipWarehouseAdjustNoteAutoMapperProfile.cs | 26 +++ ...WarehouseAdjustRequestAutoMapperProfile.cs | 24 +++ .../Jobs/ProductionReturnJobEventHandler.cs | 2 +- .../WipWarehouseAdjustRequestEventHandler.cs | 95 +++++++++++ .../StoreEventAutoMapperProfile.cs | 40 +++-- .../WipWarehouseAdjustNoteEventHandler.cs | 128 +++++++++++++++ 55 files changed, 1868 insertions(+), 30 deletions(-) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/DTOs/WipWarehouseAdjustNoteDTO.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/DTOs/WipWarehouseAdjustNoteDetailDTO.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/IWipWarehouseAdjustNoteAppService.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteDetailInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteEditInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteImportInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNotePermissions.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/DTOs/WipWarehouseAdjustRequestDTO.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/DTOs/WipWarehouseAdjustRequestDetailDTO.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestAppService.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestDetailInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestEditInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestImportInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestPermissions.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteAppService.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteAutoMapperProfile.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAppService.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAutoMapperProfile.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/IWipWarehouseAdjustNoteManager.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/IWipWarehouseAdjustNoteRepository.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNote.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNoteDetail.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNoteManager.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestManager.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestRepository.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequest.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestDetail.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestManager.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteDbContextModelCreatingExtensions.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteEfCoreRepository.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestDbContextModelCreatingExtensions.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestEfCoreRepository.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/WipWarehouseAdjustNoteAutoMapperProfile.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/WipWarehouseAdjustRequestAutoMapperProfile.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/WipWarehouseAdjustRequestEventHandler.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/WipWarehouseAdjustNoteEventHandler.cs diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql index f10be54b4..9e908aedd 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql @@ -1863,6 +1863,52 @@ CREATE TABLE [Store_WarehouseTransferNote] ( ) +CREATE TABLE [Store_WipWarehouseAdjustNote] ( + [Id] uniqueidentifier NOT NULL, + [Type] nvarchar(64) NULL, + [RequestNumber] nvarchar(max) NULL, + [JobNumber] nvarchar(64) NULL, + [Confirmed] bit NOT NULL, + [ConfirmTime] datetime2 NULL, + [ExtraProperties] nvarchar(max) NULL, + [ConcurrencyStamp] nvarchar(40) NULL, + [CreationTime] datetime2 NOT NULL, + [CreatorId] uniqueidentifier NULL, + [LastModificationTime] datetime2 NULL, + [LastModifierId] uniqueidentifier NULL, + [TenantId] uniqueidentifier NULL, + [Remark] nvarchar(3072) NULL, + [Worker] nvarchar(max) NULL, + [Number] nvarchar(64) NOT NULL, + [ActiveDate] datetime2 NOT NULL, + CONSTRAINT [PK_Store_WipWarehouseAdjustNote] PRIMARY KEY ([Id]) +) + + +CREATE TABLE [Store_WipWarehouseAdjustRequest] ( + [Id] uniqueidentifier NOT NULL, + [Type] nvarchar(64) NULL, + [ExtraProperties] nvarchar(max) NULL, + [ConcurrencyStamp] nvarchar(40) NULL, + [CreationTime] datetime2 NOT NULL, + [CreatorId] uniqueidentifier NULL, + [LastModificationTime] datetime2 NULL, + [LastModifierId] uniqueidentifier NULL, + [TenantId] uniqueidentifier NULL, + [Remark] nvarchar(3072) NULL, + [Worker] nvarchar(max) NULL, + [Number] nvarchar(64) NOT NULL, + [ActiveDate] datetime2 NOT NULL, + [AutoSubmit] bit NOT NULL, + [AutoAgree] bit NOT NULL, + [AutoHandle] bit NOT NULL, + [AutoCompleteJob] bit NOT NULL, + [DirectCreateNote] bit NOT NULL, + [RequestStatus] nvarchar(64) NOT NULL, + CONSTRAINT [PK_Store_WipWarehouseAdjustRequest] PRIMARY KEY ([Id]) +) + + CREATE TABLE [Store_WorkOrder] ( [Id] uniqueidentifier NOT NULL, [WorkOrderId] nvarchar(64) NULL, @@ -5069,6 +5115,98 @@ CREATE TABLE [Store_WarehouseTransferNoteDetail] ( ) +CREATE TABLE [Store_WipWarehouseAdjustNoteDetail] ( + [Id] uniqueidentifier NOT NULL, + [Reason] nvarchar(64) NULL, + [ReasonCode] nvarchar(max) NULL, + [CreationTime] datetime2 NOT NULL, + [CreatorId] uniqueidentifier NULL, + [LastModificationTime] datetime2 NULL, + [LastModifierId] uniqueidentifier NULL, + [MasterID] uniqueidentifier NOT NULL, + [TenantId] uniqueidentifier NULL, + [Number] nvarchar(64) NOT NULL, + [Remark] nvarchar(3072) NULL, + [ItemName] nvarchar(64) NULL, + [ItemDesc1] nvarchar(64) NULL, + [ItemDesc2] nvarchar(64) NULL, + [ItemCode] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, + [Qty] decimal(18,6) NOT NULL, + [StdPackQty] decimal(18,6) NOT NULL, + [FromPackingCode] nvarchar(450) NULL, + [ToPackingCode] nvarchar(max) NULL, + [FromContainerCode] nvarchar(max) NULL, + [ToContainerCode] nvarchar(max) NULL, + [FromLot] nvarchar(max) NULL, + [ToLot] nvarchar(max) NULL, + [SupplierBatch] nvarchar(64) NULL, + [ArriveDate] datetime2 NOT NULL, + [ProduceDate] datetime2 NOT NULL, + [ExpireDate] datetime2 NOT NULL, + [FromLocationCode] nvarchar(64) NOT NULL, + [FromLocationArea] nvarchar(64) NULL, + [FromLocationGroup] nvarchar(64) NULL, + [FromLocationErpCode] nvarchar(64) NOT NULL, + [FromWarehouseCode] nvarchar(64) NOT NULL, + [FromStatus] nvarchar(64) NOT NULL, + [ToLocationCode] nvarchar(64) NOT NULL, + [ToLocationArea] nvarchar(64) NULL, + [ToLocationGroup] nvarchar(64) NULL, + [ToLocationErpCode] nvarchar(64) NOT NULL, + [ToWarehouseCode] nvarchar(64) NOT NULL, + [ToStatus] nvarchar(64) NOT NULL, + CONSTRAINT [PK_Store_WipWarehouseAdjustNoteDetail] PRIMARY KEY ([Id]), + CONSTRAINT [FK_Store_WipWarehouseAdjustNoteDetail_Store_WipWarehouseAdjustNote_MasterID] FOREIGN KEY ([MasterID]) REFERENCES [Store_WipWarehouseAdjustNote] ([Id]) ON DELETE CASCADE +) + + +CREATE TABLE [Store_WipWarehouseAdjustRequestDetail] ( + [Id] uniqueidentifier NOT NULL, + [Reason] nvarchar(max) NULL, + [ReasonCode] nvarchar(max) NULL, + [CreationTime] datetime2 NOT NULL, + [CreatorId] uniqueidentifier NULL, + [LastModificationTime] datetime2 NULL, + [LastModifierId] uniqueidentifier NULL, + [MasterID] uniqueidentifier NOT NULL, + [TenantId] uniqueidentifier NULL, + [Number] nvarchar(64) NOT NULL, + [Remark] nvarchar(3072) NULL, + [ItemName] nvarchar(64) NULL, + [ItemDesc1] nvarchar(64) NULL, + [ItemDesc2] nvarchar(64) NULL, + [ItemCode] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, + [Qty] decimal(18,6) NOT NULL, + [StdPackQty] decimal(18,6) NOT NULL, + [FromPackingCode] nvarchar(max) NULL, + [ToPackingCode] nvarchar(max) NULL, + [FromContainerCode] nvarchar(max) NULL, + [ToContainerCode] nvarchar(max) NULL, + [FromLot] nvarchar(max) NULL, + [ToLot] nvarchar(max) NULL, + [SupplierBatch] nvarchar(64) NULL, + [ArriveDate] datetime2 NOT NULL, + [ProduceDate] datetime2 NOT NULL, + [ExpireDate] datetime2 NOT NULL, + [FromLocationCode] nvarchar(64) NOT NULL, + [FromLocationArea] nvarchar(64) NULL, + [FromLocationGroup] nvarchar(64) NULL, + [FromLocationErpCode] nvarchar(64) NOT NULL, + [FromWarehouseCode] nvarchar(64) NOT NULL, + [FromStatus] nvarchar(64) NOT NULL, + [ToLocationCode] nvarchar(64) NOT NULL, + [ToLocationArea] nvarchar(64) NULL, + [ToLocationGroup] nvarchar(64) NULL, + [ToLocationErpCode] nvarchar(64) NOT NULL, + [ToWarehouseCode] nvarchar(64) NOT NULL, + [ToStatus] nvarchar(64) NOT NULL, + CONSTRAINT [PK_Store_WipWarehouseAdjustRequestDetail] PRIMARY KEY ([Id]), + CONSTRAINT [FK_Store_WipWarehouseAdjustRequestDetail_Store_WipWarehouseAdjustRequest_MasterID] FOREIGN KEY ([MasterID]) REFERENCES [Store_WipWarehouseAdjustRequest] ([Id]) ON DELETE CASCADE +) + + CREATE TABLE [Store_WorkOrderDetail] ( [Id] uniqueidentifier NOT NULL, [EffectiveDate] datetime2 NOT NULL, @@ -5699,6 +5837,21 @@ CREATE INDEX [IX_Store_WarehouseTransferNoteDetail_MasterID] ON [Store_Warehouse CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode] ON [Store_WarehouseTransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode]) WHERE [FromPackingCode] IS NOT NULL +CREATE UNIQUE INDEX [IX_Store_WipWarehouseAdjustNote_Number] ON [Store_WipWarehouseAdjustNote] ([Number]) + + +CREATE INDEX [IX_Store_WipWarehouseAdjustNoteDetail_MasterID] ON [Store_WipWarehouseAdjustNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_WipWarehouseAdjustNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode_FromStatus_ToStatus] ON [Store_WipWarehouseAdjustNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromStatus], [ToStatus]) WHERE [FromPackingCode] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_WipWarehouseAdjustRequest_Number] ON [Store_WipWarehouseAdjustRequest] ([Number]) + + +CREATE INDEX [IX_Store_WipWarehouseAdjustRequestDetail_MasterID] ON [Store_WipWarehouseAdjustRequestDetail] ([MasterID]) + + CREATE UNIQUE INDEX [IX_Store_WorkOrder_Number] ON [Store_WorkOrder] ([Number]) diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs index 83fcd6ee9..600523dce 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs @@ -558,7 +558,7 @@ public abstract class SfsCrudWithDetailsAppServiceBase protected virtual async Task> ImportProcessingEntityAsync(Dictionary dictionary) { + await Task.CompletedTask.ConfigureAwait(false); return dictionary; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/DTOs/WipWarehouseAdjustNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/DTOs/WipWarehouseAdjustNoteDTO.cs new file mode 100644 index 000000000..18f2d3f4a --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/DTOs/WipWarehouseAdjustNoteDTO.cs @@ -0,0 +1,41 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +/// +/// 线边调整-实体DTO +/// +public class WipWarehouseAdjustNoteDTO : SfsStoreDTOBase, IHasNumber +{ + /// + /// 线边仓调整申请单号 + /// + [Display(Name = "线边仓调整申请单号")] + public string RequestNumber { get; set; } + + /// + /// 任务ID + /// + [Display(Name = "任务ID")] + public string JobNumber { get; set; } + + /// + /// 调整类型 + /// + [Display(Name = "调整类型")] + public string Type { get; set; } + + /// + /// 已确认 + /// + [Display(Name = "已确认")] + public bool Confirmed { get; set; } + + /// + /// 确认时间 + /// + [Display(Name = "确认时间")] + public DateTime? ConfirmTime { get; set; } + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/DTOs/WipWarehouseAdjustNoteDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/DTOs/WipWarehouseAdjustNoteDetailDTO.cs new file mode 100644 index 000000000..0e460c91b --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/DTOs/WipWarehouseAdjustNoteDetailDTO.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +/// +/// 线边调整记录-明细表 +/// +public class WipWarehouseAdjustNoteDetailDTO : SfsStoreDetailWithFromToDTOBase +{ + /// + /// 原因 + /// + [Display(Name = "调整原因")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string Reason { get; set; } + + /// + /// 调整代码 + /// + [Display(Name = "原因代码")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string ReasonCode { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/IWipWarehouseAdjustNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/IWipWarehouseAdjustNoteAppService.cs new file mode 100644 index 000000000..737ae169c --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/IWipWarehouseAdjustNoteAppService.cs @@ -0,0 +1,17 @@ +using System; +using System.Threading.Tasks; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public interface IWipWarehouseAdjustNoteAppService : + ISfsStoreMasterReadOnlyAppServiceBase +{ + Task ConfirmAsync(Guid id); + + /// + /// 新增实体 + /// + /// CreateInput + Task CreateAsync(WipWarehouseAdjustNoteEditInput input); +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteDetailInput.cs new file mode 100644 index 000000000..9c16118d8 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteDetailInput.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +/// +/// 线边仓调整-明细表DTO +/// +public class WipWarehouseAdjustNoteDetailInput : SfsStoreDetailWithFromToInputBase +{ + /// + /// 原因 + /// + [Display(Name = "调整原因")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string Reason { get; set; } + + /// + /// 调整代码 + /// + [Display(Name = "原因代码")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string ReasonCode { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteEditInput.cs new file mode 100644 index 000000000..5a92e2884 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteEditInput.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +/// +/// 新增和更新基础DTO +/// +public class WipWarehouseAdjustNoteEditInput : SfsStoreCreateOrUpdateInputBase +{ + #region Base + /// + /// 已确认 + /// + [Display(Name = "已确认")] + public bool Confirmed { get; set; } + #endregion + + #region Update + /// + /// 确认时间 + /// + [Display(Name = "确认时间")] + public DateTime? ConfirmTime { get; set; } + #endregion + + /// + /// 线边仓调整申请单号 + /// + [Display(Name = "线边仓调整申请单号")] + public string RequestNumber { get; set; } + + /// + /// 任务ID + /// + [Display(Name = "任务ID")] + public string JobNumber { get; set; } + + /// + /// 调拨类型 + /// + [Display(Name = "调整类型")] + public string Type { get; set; } + + [Display(Name = "详情")] + public List Details { get; set; } = new List(); +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteImportInput.cs new file mode 100644 index 000000000..05ab88ea6 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/Inputs/WipWarehouseAdjustNoteImportInput.cs @@ -0,0 +1,71 @@ +using System; +using System.ComponentModel.DataAnnotations; +using DocumentFormat.OpenXml.Drawing; +using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class WipWarehouseAdjustNoteImportInput : SfsStoreImportInputBase +{ + /// + /// 调拨类型 + /// + [Display(Name = "调拨类型")] + [Required(ErrorMessage = "{0}是必填项")] + [ImporterHeader(Name = "调拨类型")] + [ExporterHeader(DisplayName = "调拨类型")] + [ValueMapping("区域内调拨(储位内移库)", EnumTransSubType.Transfer_Inside)] + public string Type { get; set; } + + /// + /// 已确认 + /// + [Display(Name = "已确认")] + [ImporterHeader(IsIgnore = true)] + [Required(ErrorMessage = "{0}是必填项")] + public bool Confirmed { get; set; } + + /// + /// 物料号 + /// + [Display(Name = "物料号")] + [Required(ErrorMessage = "{0}是必填项")] + public string ItemCode { get; set; } + + /// + /// 调拨数量 + /// + [Display(Name = "调拨数量")] + [Required(ErrorMessage = "{0}是必填项")] + public decimal Qty { get; set; } + + /// + /// 调出库位 + /// + [Display(Name = "调出库位")] + [Required(ErrorMessage = "{0}是必填项")] + public string FromLocationCode { get; set; } + + /// + /// 调入库位 + /// + [Display(Name = "调入库位")] + [Required(ErrorMessage = "{0}是必填项")] + public string ToLocationCode { get; set; } + + /// + /// 箱码 + /// + [Display(Name = "箱码")] + [Required(ErrorMessage = "{0}是必填项")] + public string PackingCode { get; set; } + + /// + /// 状态 + /// + [Display(Name = "状态")] + [Required(ErrorMessage = "{0}是必填项")] + public EnumInventoryStatus Status { get; set; } + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNotePermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNotePermissions.cs new file mode 100644 index 000000000..ef96ab44a --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNotePermissions.cs @@ -0,0 +1,21 @@ +using Volo.Abp.Authorization.Permissions; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public static class WipWarehouseAdjustNotePermissions +{ + public const string Default = StorePermissions.GroupName + "." + nameof(WipWarehouseAdjustNote); + public const string Create = Default + "." + StorePermissions.CreateStr; + public const string Update = Default + "." + StorePermissions.UpdateStr; + public const string Delete = Default + "." + StorePermissions.DeleteStr; + + public static void AddWipWarehouseAdjustNotePermission(this PermissionGroupDefinition permissionGroup) + { + var WipWarehouseAdjustNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(WipWarehouseAdjustNote))); + WipWarehouseAdjustNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); + WipWarehouseAdjustNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); + WipWarehouseAdjustNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); + + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs index ceda25aae..92bbc9d6d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs @@ -79,6 +79,9 @@ public class StorePermissionDefinitionProvider : PermissionDefinitionProvider storeGroup.AddReportPermission(); storeGroup.AddDashboardPermission(); + storeGroup.AddWipWarehouseAdjustRequestPermission(); + storeGroup.AddWipWarehouseAdjustNotePermission(); + #region Jobs storeGroup.AddPurchaseReceiptJobPermission(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/DTOs/WipWarehouseAdjustRequestDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/DTOs/WipWarehouseAdjustRequestDTO.cs new file mode 100644 index 000000000..80ccd8d74 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/DTOs/WipWarehouseAdjustRequestDTO.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +/// +/// 线边调整-实体DTO +/// +public class WipWarehouseAdjustRequestDTO : SfsStoreRequestDTOBase, IHasNumber +{ + /// + /// 调整类型 + /// + [Display(Name = "调整类型")] + public string Type { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/DTOs/WipWarehouseAdjustRequestDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/DTOs/WipWarehouseAdjustRequestDetailDTO.cs new file mode 100644 index 000000000..712395401 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/DTOs/WipWarehouseAdjustRequestDetailDTO.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +/// +/// 线边调整-明细表 +/// +public class WipWarehouseAdjustRequestDetailDTO : SfsStoreDetailWithFromToDTOBase +{ + /// + /// 原因 + /// + [Display(Name = "调整原因")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string Reason { get; set; } + + /// + /// 调整代码 + /// + [Display(Name = "原因代码")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string ReasonCode { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestAppService.cs new file mode 100644 index 000000000..ba5a69fbd --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestAppService.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public interface IWipWarehouseAdjustRequestAppService + : ISfsStoreRequestMasterAppServiceBase +{ +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestDetailInput.cs new file mode 100644 index 000000000..2af3ac206 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestDetailInput.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +/// +/// 库存转移记录-明细表 +/// +public class WipWarehouseAdjustRequestDetailInput : SfsStoreDetailWithFromToInputBase +{ + /// + /// 原因 + /// + [Display(Name = "调整原因")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string Reason { get; set; } + + /// + /// 调整代码 + /// + [Display(Name = "原因代码")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string ReasonCode { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestEditInput.cs new file mode 100644 index 000000000..729cf8338 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestEditInput.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +/// +/// 新增和更新基础DTO +/// +public class WipWarehouseAdjustRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase +{ + #region Base + + /// + /// 调拨类型 + /// + [Display(Name = "调整类型")] + public string Type { get; set; } + + /// + /// 明细列表 + /// + [Display(Name = "明细列表")] + public List Details { get; set; } + + #endregion +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestImportInput.cs new file mode 100644 index 000000000..53c947bb9 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/Inputs/WipWarehouseAdjustRequestImportInput.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class WipWarehouseAdjustRequestImportInput : SfsStoreImportInputBase +{ + /// + /// 调整类型 + /// + [Display(Name = "调整类型")] + [Required(ErrorMessage = "{0}是必填项")] + [ImporterHeader(Name = "调整类型")] + [ExporterHeader(DisplayName = "调整类型")] + [ValueMapping("线边仓调整", EnumTransSubType.CountAdjust_WIP)] + public string Type { get; set; } + + /// + /// 物品编号 + /// + [Display(Name = "物料号")] + [Required(ErrorMessage = "{0}是必填项")] + public string ItemCode { get; set; } + + /// + /// 调整数量 + /// + [Display(Name = "调拨数量")] + [Required(ErrorMessage = "{0}是必填项")] + public decimal Qty { get; set; } + + /// + /// 调整库位 + /// + [Display(Name = "调整库位")] + [Required(ErrorMessage = "{0}是必填项")] + public string FromLocationCode { get; set; } + + /// + /// 原因 + /// + [Display(Name = "调整原因")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string Reason { get; set; } + + /// + /// 调整代码 + /// + [Display(Name = "原因代码")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string ReasonCode { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestPermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestPermissions.cs new file mode 100644 index 000000000..3f535c72c --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestPermissions.cs @@ -0,0 +1,24 @@ +using Volo.Abp.Authorization.Permissions; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public static class WipWarehouseAdjustRequestPermissions +{ + public const string Default = StorePermissions.GroupName + "." + nameof(WipWarehouseAdjustRequest); + public const string Create = Default + "." + StorePermissions.CreateStr; + public const string Update = Default + "." + StorePermissions.UpdateStr; + public const string Delete = Default + "." + StorePermissions.DeleteStr; + + public static void AddWipWarehouseAdjustRequestPermission(this PermissionGroupDefinition permissionGroup) + { + var WipWarehouseAdjustRequestPermission = permissionGroup.AddPermission(Default, + StorePermissionDefinitionProvider.L(nameof(WipWarehouseAdjustRequest))); + WipWarehouseAdjustRequestPermission.AddChild(Create, + StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); + WipWarehouseAdjustRequestPermission.AddChild(Update, + StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); + WipWarehouseAdjustRequestPermission.AddChild(Delete, + StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj index cfb6a4466..a14d0abb2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj @@ -42,10 +42,8 @@ - - 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 e1c099ab0..2c646ae7e 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 @@ -173,7 +173,6 @@ public class PurchaseReceiptJobAppService : /// 按Id获取实体 不走缓存 /// /// 实体Id - /// /// [HttpGet("no-cache/{id}")] public virtual async Task GetNoCacheAsync(Guid id) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteAppService.cs new file mode 100644 index 000000000..49dcab912 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteAppService.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Inventory.Application.Contracts; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application; + +/// +/// 线边调整记录 +/// +[Authorize] +[Route($"{StoreConsts.RootPath}wip-warehouse-adjust-note")] +public class WipWarehouseAdjustNoteAppService : SfsStoreWithDetailsAppServiceBase + , + IWipWarehouseAdjustNoteAppService +{ + private readonly IWipWarehouseAdjustNoteManager _WipWarehouseAdjustNoteManager; + private readonly IBalanceAppService _balanceAppService; + private readonly ILocationAppService _locationAppService; + + public WipWarehouseAdjustNoteAppService( + IWipWarehouseAdjustNoteRepository repository, + IWipWarehouseAdjustNoteManager WipWarehouseAdjustNoteManager, + IBalanceAppService balanceAppService, + ILocationAppService locationAppService) : base(repository) + { + _WipWarehouseAdjustNoteManager = WipWarehouseAdjustNoteManager; + _balanceAppService = balanceAppService; + _locationAppService = locationAppService; + } + + #region 东阳使用 + + /// + /// 用来重写 导入数据时可以加工数据 + /// + /// + /// + protected override async Task> ImportProcessingEntityAsync( + Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var WipWarehouseAdjustNote in addList) + { + if (WipWarehouseAdjustNote.Type == EnumTransSubType.Transfer_Inside.GetDisplayName()) //储位内调拨 + { + WipWarehouseAdjustNote.Type = EnumTransSubType.Transfer_Inside.ToString();//重点 需要转换 + foreach (var detail in WipWarehouseAdjustNote.Details) + { + var balanceDto = await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode, + detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false); + var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + + detail.ItemCode = balanceDto.ItemCode; + detail.ArriveDate = balanceDto.ArriveDate; + detail.ItemDesc1 = balanceDto.ItemDesc1; + detail.ItemDesc2 = balanceDto.ItemDesc2; + detail.ItemName = balanceDto.ItemName; + detail.ProduceDate = balanceDto.ProduceDate; + detail.Qty = balanceDto.Qty; + detail.Uom = balanceDto.Uom; + detail.ExpireDate = balanceDto.ExpireDate; + detail.StdPackQty = balanceDto.StdPackQty; + detail.SupplierBatch = balanceDto.SupplierBatch; + + detail.FromLocationArea = balanceDto.LocationArea; + detail.FromContainerCode = balanceDto.ContainerCode; + detail.FromLocationErpCode = balanceDto.LocationErpCode; + detail.FromLocationGroup = balanceDto.LocationGroup; + detail.FromPackingCode = balanceDto.PackingCode; + detail.FromLocationArea = balanceDto.LocationArea; + detail.FromStatus = balanceDto.Status; + detail.FromWarehouseCode = balanceDto.WarehouseCode; + detail.FromLot = balanceDto.Lot; + + detail.ToLocationArea = toLocationDto.AreaCode; + detail.ToLocationErpCode = toLocationDto.LocationGroupCode; + detail.ToLocationGroup = toLocationDto.LocationGroupCode; + detail.ToWarehouseCode = toLocationDto.WarehouseCode; + detail.ToContainerCode = balanceDto.ContainerCode; + detail.ToPackingCode = balanceDto.PackingCode; + detail.ToLocationArea = balanceDto.LocationArea; + detail.ToStatus = balanceDto.Status; + detail.ToLot = balanceDto.Lot; + } + } + } + + return dictionary; + } + + /// + /// 确认对应的记录单 + /// + /// + /// + [HttpPost("confirm/{id}")] + public virtual async Task ConfirmAsync(Guid id) + { + var entity = await _WipWarehouseAdjustNoteManager.ConfirmAsync(id).ConfigureAwait(false); + var dto = ObjectMapper.Map(entity); + return dto; + } + + /// + /// 新增实体 + /// + /// CreateInput + [HttpPost("")] + public override async Task CreateAsync(WipWarehouseAdjustNoteEditInput input) + { + var entity = ObjectMapper.Map(input); + + entity=await _WipWarehouseAdjustNoteManager.CreateAsync(entity).ConfigureAwait(false); + + var dto = ObjectMapper.Map(entity); + + return dto; + } + + #endregion +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteAutoMapperProfile.cs new file mode 100644 index 000000000..3d08493f8 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteAutoMapperProfile.cs @@ -0,0 +1,88 @@ +using AutoMapper; +using Volo.Abp.AutoMapper; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Application; + +public partial class StoreApplicationAutoMapperProfile : Profile +{ + private void WipWarehouseAdjustNoteMapperProfile() + { + CreateMap() + .ReverseMap(); + + CreateMap() + .IgnoreAuditedObjectProperties() + ; + + CreateMap() + .IgnoreAuditedObjectProperties() + ; + + CreateMap(); + + CreateMap(); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.Id) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.Remark) + .Ignore(x => x.TenantId) + .Ignore(x => x.ConcurrencyStamp) + ; + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.MasterID) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConfirmTime) + .Ignore(x => x.RequestNumber) + .Ignore(x => x.JobNumber) + .Ignore(x => x.ActiveDate) + .Ignore(x => x.Remark) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Details) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.PackingCode)) + .ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.PackingCode)) + .ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status)) + .ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status)) + .Ignore(x => x.FromLocationGroup) + .Ignore(x => x.FromLocationArea) + .Ignore(x => x.FromLocationErpCode) + .Ignore(x => x.FromWarehouseCode) + .Ignore(x => x.ToLocationArea) + .Ignore(x => x.ToLocationGroup) + .Ignore(x => x.ToLocationErpCode) + .Ignore(x => x.ToWarehouseCode) + .Ignore(x => x.Reason) + .Ignore(x => x.SupplierBatch).Ignore(x => x.ArriveDate).Ignore(x => x.ProduceDate).Ignore(x => x.ExpireDate) + .Ignore(x => x.Remark) + .Ignore(x => x.ItemName) + .Ignore(x => x.ItemDesc1) + .Ignore(x => x.ItemDesc2) + .Ignore(x => x.FromContainerCode) + .Ignore(x => x.ToContainerCode) + .Ignore(x => x.FromLot) + .Ignore(x => x.ToLot) + .Ignore(x => x.StdPackQty) + .Ignore(x => x.Uom) + .Ignore(x => x.MasterID) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs index 533107d6b..5967d9876 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs @@ -26,7 +26,6 @@ public class PurchaseOrderAppService : private readonly IPurchaseOrderManager _purchaseOrderManager; private readonly ISupplierAppService _supplierAppService; private readonly IItemBasicAppService _itemBasicAppService; - private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService; public PurchaseOrderAppService( IPurchaseOrderRepository repository, diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs index e9ac75db2..1bf717949 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs @@ -73,7 +73,7 @@ public class SupplierAsnAppService : /// /// 生成ASN订单号 /// - /// + /// /// [HttpPost("generate-supplierasn-number")] public async Task GenerateSupplierAsnNumberAsync(DateTime activeDate) @@ -101,7 +101,7 @@ public class SupplierAsnAppService : { var entities = await _repository.GetListAsync( p => p.PlanArriveDate.Year == DateTime.Now.Year && p.PlanArriveDate.Month == DateTime.Now.Month && - p.PlanArriveDate.Day == DateTime.Now.Day, true); + p.PlanArriveDate.Day == DateTime.Now.Day, true).ConfigureAwait(false); return ObjectMapper.Map, List>(entities); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs index 54689060c..f6c44ac51 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs @@ -86,7 +86,6 @@ public class ProductReceiptRequestAppService : /// 赋值详情 /// /// - /// /// private async Task SetDetailPropertiesAsync(ProductReceiptRequestDetail detail) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs index 0393a2ccd..9275973f6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs @@ -37,7 +37,6 @@ public class ProductRecycleRequestAppService : private readonly IProductRecycleRequestManager _productRecycleRequestManager; private readonly IBomAppService _bomApp; private readonly IItemStoreRelationAppService _itemStoreRelationApp; - private readonly IItemBasicAppService _itemBasicAppService; private readonly IBalanceAppService _balanceAppService; private readonly ILocationAppService _locationAppService; private readonly ITransactionTypeAppService _transactionTypeAppService; @@ -46,7 +45,10 @@ public class ProductRecycleRequestAppService : IProductRecycleRequestRepository repository, IProductRecycleRequestManager productRecycleRequestManager, IBomAppService bomApp, - IItemStoreRelationAppService itemStoreRelationApp, ILocationAppService locationAppService, IBalanceAppService balanceAppService, ITransactionTypeAppService transactionTypeAppService) + IItemStoreRelationAppService itemStoreRelationApp, + ILocationAppService locationAppService, + IBalanceAppService balanceAppService, + ITransactionTypeAppService transactionTypeAppService) : base(repository, productRecycleRequestManager) { _productRecycleRequestManager = productRecycleRequestManager; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs index c5b6388e9..77ff33bb5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs @@ -268,7 +268,7 @@ public class PurchaseReturnRequestAppService : /// /// /// - /// + /// /// /// private static void CheckTransactionType( diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAppService.cs new file mode 100644 index 000000000..819a11568 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAppService.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities; +using Volo.Abp.ObjectMapping; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Inventory.Application.Contracts; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application; + +/// +/// 调拨转移记录 +/// +[Authorize] +[Route($"{StoreConsts.RootPath}wip-warehouse-adjust-request")] +public class WipWarehouseAdjustRequestAppService : SfsStoreRequestAppServiceBase + , + IWipWarehouseAdjustRequestAppService +{ + private readonly IWipWarehouseAdjustRequestManager _WipWarehouseAdjustRequestManager; + private readonly IBalanceAppService _balanceAppService; + private readonly ILocationAppService _locationAppService; + private readonly IItemBasicAppService _itemBasicAppService; + + public WipWarehouseAdjustRequestAppService( + IWipWarehouseAdjustRequestRepository repository, + IWipWarehouseAdjustRequestManager WipWarehouseAdjustRequestManager, + IBalanceAppService balanceAppService, + ILocationAppService locationAppService, + IItemBasicAppService itemBasicAppService) : base(repository, WipWarehouseAdjustRequestManager) + { + _WipWarehouseAdjustRequestManager = WipWarehouseAdjustRequestManager; + _balanceAppService = balanceAppService; + _locationAppService = locationAppService; + _itemBasicAppService = itemBasicAppService; + } + + #region 东阳使用 + + /// + /// 用来重写 导入数据时可以加工数据 + /// + /// + /// + protected override async Task> ImportProcessingEntityAsync( + Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var WipWarehouseAdjustRequest in addList) + { + WipWarehouseAdjustRequest.Worker = CurrentUser.GetUserName(); + WipWarehouseAdjustRequest.CreatorId = CurrentUser.Id; + + await SetEntityPropertiesAsync(WipWarehouseAdjustRequest, EnumTransSubType.CountAdjust_WIP).ConfigureAwait(false); + foreach (var detail in WipWarehouseAdjustRequest.Details) + { + detail.ToLocationCode = detail.FromLocationCode;//调整库位一致 + + var itemBasicDto =await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode) + .ConfigureAwait(false); + var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode) + .ConfigureAwait(false); + + detail.ItemCode = itemBasicDto.Code; + detail.ItemDesc1 = itemBasicDto.Desc1; + detail.ItemDesc2 = itemBasicDto.Desc2; + detail.ItemName = itemBasicDto.Name; + + detail.Uom = itemBasicDto.BasicUom; + detail.StdPackQty = itemBasicDto.StdPackQty; + + detail.Qty = detail.Qty; + + detail.FromLocationErpCode = fromLocationDto.ErpLocationCode; + detail.FromLocationGroup = fromLocationDto.LocationGroupCode; + detail.FromLocationArea = fromLocationDto.AreaCode; + detail.FromWarehouseCode = fromLocationDto.WarehouseCode; + + detail.ToLocationErpCode = toLocationDto.ErpLocationCode; + detail.ToLocationGroup = toLocationDto.LocationGroupCode; + detail.ToLocationArea = toLocationDto.AreaCode; + detail.ToWarehouseCode = toLocationDto.WarehouseCode; + + detail.FromPackingCode = string.Empty; + detail.FromContainerCode = string.Empty; + detail.ToPackingCode = string.Empty; + detail.ToContainerCode = string.Empty; + detail.FromStatus = EnumInventoryStatus.OK; + detail.ToStatus = EnumInventoryStatus.OK; + detail.FromLot = string.Empty; + detail.ToLot = string.Empty; + } + } + + return dictionary; + } + + private async Task SetEntityPropertiesAsync(WipWarehouseAdjustRequest entity, EnumTransSubType subType) + { + var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Adjust, subType) + .ConfigureAwait(false); + entity.Worker = CurrentUser.GetUserName(); + + entity.AutoCompleteJob = tranType.AutoCompleteJob; + entity.AutoSubmit = tranType.AutoSubmitRequest; + entity.AutoAgree = tranType.AutoAgreeRequest; + entity.AutoHandle = tranType.AutoHandleRequest; + entity.DirectCreateNote = tranType.DirectCreateNote; + } + + /// + /// 新增实体 + /// + /// CreateInput + public override async Task CreateAsync(WipWarehouseAdjustRequestEditInput input) + { + var entity = ObjectMapper.Map(input); + + await _WipWarehouseAdjustRequestManager.CreateAsync(entity).ConfigureAwait(false); + + var dto = ObjectMapper.Map(entity); + return dto; + } + + #endregion +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAutoMapperProfile.cs new file mode 100644 index 000000000..e5ecad6a2 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAutoMapperProfile.cs @@ -0,0 +1,77 @@ +using AutoMapper; +using Volo.Abp.AutoMapper; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Application; + +public partial class StoreApplicationAutoMapperProfile : Profile +{ + private void WipWarehouseAdjustRequestMapperProfile() + { + CreateMap() + .ReverseMap(); + + CreateMap(); + + CreateMap(); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.MasterID) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ActiveDate) + .Ignore(x => x.Remark) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.RequestStatus) + .Ignore(x => x.Details) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x=>x.ToPackingCode) + .Ignore(x => x.FromPackingCode) + .Ignore(x => x.FromStatus) + .Ignore(x => x.ToStatus) + .Ignore(x => x.FromLocationGroup) + .Ignore(x => x.FromLocationArea) + .Ignore(x => x.FromLocationErpCode) + .Ignore(x => x.FromWarehouseCode) + .Ignore(x => x.ToLocationArea) + .Ignore(x => x.ToLocationGroup) + .Ignore(x => x.ToLocationErpCode) + .Ignore(x => x.ToWarehouseCode) + .Ignore(x => x.SupplierBatch).Ignore(x => x.ArriveDate).Ignore(x => x.ProduceDate).Ignore(x => x.ExpireDate) + .Ignore(x => x.Remark) + .Ignore(x => x.ItemName) + .Ignore(x => x.ItemDesc1) + .Ignore(x => x.ItemDesc2) + .Ignore(x => x.FromContainerCode) + .Ignore(x => x.ToContainerCode) + .Ignore(x => x.FromLot) + .Ignore(x => x.ToLot) + .Ignore(x => x.StdPackQty) + .Ignore(x => x.Uom) + .Ignore(x => x.MasterID) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.Id) + .Ignore(x => x.Number) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.Remark) + .Ignore(x => x.TenantId) + ; + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs index c146f557f..8dfb70eb6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs @@ -23,6 +23,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile PutawayRequestAutoMapperProfile(); CountAdjustRequestAutoMapperProfile(); ScrapRequestAutoMapperProfile(); + WipWarehouseAdjustRequestMapperProfile(); #endregion @@ -78,6 +79,8 @@ public partial class StoreApplicationAutoMapperProfile : Profile TransferNoteMapperProfile(); NoOkConvertOkNoteAutoMapperProfile(); InventoryInitialNoteAutoMapperProfile(); + WipWarehouseAdjustNoteMapperProfile(); + #endregion #region Jobs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Win_in.Sfs.Wms.Store.Application.csproj b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Win_in.Sfs.Wms.Store.Application.csproj index 1d06fbf89..8baf5221b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Win_in.Sfs.Wms.Store.Application.csproj +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Win_in.Sfs.Wms.Store.Application.csproj @@ -22,6 +22,7 @@ + diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/IWipWarehouseAdjustNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/IWipWarehouseAdjustNoteManager.cs new file mode 100644 index 000000000..8e610fb9e --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/IWipWarehouseAdjustNoteManager.cs @@ -0,0 +1,11 @@ +using System; +using System.Threading.Tasks; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public interface IWipWarehouseAdjustNoteManager : + ISfsStoreManager, IBulkImportService +{ + Task ConfirmAsync(Guid id); +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/IWipWarehouseAdjustNoteRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/IWipWarehouseAdjustNoteRepository.cs new file mode 100644 index 000000000..64a7411c6 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/IWipWarehouseAdjustNoteRepository.cs @@ -0,0 +1,8 @@ +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public interface IWipWarehouseAdjustNoteRepository : ISfsStoreRepositoryBase, + ISfsBulkRepositoryBase +{ +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNote.cs new file mode 100644 index 000000000..3ded8d094 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNote.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Volo.Abp; +using Win_in.Sfs.Shared.Domain.Entities; + +namespace Win_in.Sfs.Wms.Store.Domain; + +/// +/// 盘点差异调整记录 +/// +public class WipWarehouseAdjustNote : SfsStoreAggregateRootBase, IHasJobNumber +{ + /// + /// 调整类型 + /// + [Display(Name = "调整类型")] + public string Type { get; set; } + + /// + /// 任务ID + /// + [IgnoreUpdate] + public string RequestNumber { get; set; } + + /// + /// 任务ID + /// + [IgnoreUpdate] + public string JobNumber { get; set; } + + /// + /// 明细列表 + /// + [IgnoreUpdate] + public override List Details { get; set; } = new(); + + /// + /// 已确认 + /// + [Display(Name = "已确认")] + public bool Confirmed { get; set; } + + /// + /// 确认时间 + /// + [Display(Name = "确认时间")] + [IgnoreUpdate] + public DateTime? ConfirmTime { get; set; } + + public void Confirm(DateTime confirmTime) + { + CheckStatus(Confirmed); + Confirmed = true; + ConfirmTime = confirmTime; + } + + private static void CheckStatus(bool confirmed) + { + if (confirmed) + { + throw new UserFriendlyException("当前状态为 【已确认】 ,无法再次确认!"); + } + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNoteDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNoteDetail.cs new file mode 100644 index 000000000..878d8fd63 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNoteDetail.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Domain; + +/// +/// 盘点差异调整记录-明细表 +/// +public class WipWarehouseAdjustNoteDetail : SfsStoreDetailWithFromToEntityBase +{ + /// + /// 原因 + /// + [Display(Name = "调整原因")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string Reason { get; set; } + + /// + /// 调整代码 + /// + [Display(Name = "原因代码")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string ReasonCode { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNoteManager.cs new file mode 100644 index 000000000..ba26d8c9e --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/WipWarehouseAdjustNote/WipWarehouseAdjustNoteManager.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Volo.Abp; +using Volo.Abp.Uow; +using Win_in.Sfs.Shared.Event; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public class WipWarehouseAdjustNoteManager : SfsStoreManagerBase, + IWipWarehouseAdjustNoteManager +{ + private readonly IWipWarehouseAdjustNoteRepository _repository; + + public WipWarehouseAdjustNoteManager( + IWipWarehouseAdjustNoteRepository repository + ) : base(repository) + { + _repository = repository; + } + + [UnitOfWork] + public virtual async Task ConfirmAsync(Guid id) + { + var entity = await Repository.FindAsync(id).ConfigureAwait(false); + Check.NotNull(entity, EntityClassName); + entity.Confirm(Clock.Now); + await PublishConfirmedAsync(entity).ConfigureAwait(false); + return await Repository.UpdateAsync(entity).ConfigureAwait(false); + } + + private async Task PublishConfirmedAsync(WipWarehouseAdjustNote entity) + { + try + { + await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData(entity), false) + .ConfigureAwait(false); + } + catch (Exception ex) + { + Logger.LogDebug($"{nameof(WipWarehouseAdjustNote)} Confirmed Event:{ex.Message}", null); + Console.WriteLine(ex.Source); + throw; + } + } + + /// + /// 执行导入 + /// + public virtual async Task ImportDataAsync(List mergeEntities, + List deleteEntities = null) + { + if (deleteEntities != null && deleteEntities.Count > 0) + { + await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); + } + + foreach (var entity in mergeEntities) + { + entity.SetIdAndNumberWithDetails(GuidGenerator, + await GenerateNumberAsync(nameof(WipWarehouseAdjustNote), Clock.Now).ConfigureAwait(false)); + } + + await _repository.BulkMergeAsync(mergeEntities).ConfigureAwait(false); + + var insertDetails = new List(); + + foreach (var item in mergeEntities) + { + await SetDetailAsync(item.Details).ConfigureAwait(false); + + insertDetails.AddRange(item.Details); + } + + await _repository.BulkInsertAsync(insertDetails).ConfigureAwait(false); + } + + private async Task SetDetailAsync(List details) + { + foreach (var detail in details) + { + var item = await ItemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + Check.NotNull(item, "物品代码", $"物品 {detail.ItemCode} 不存在"); + + if (item != null) + { + detail.ItemName = item.Name; + detail.ItemDesc1 = item.Desc1; + detail.ItemDesc2 = item.Desc2; + } + + var balance = await BalanceAppService.GetByItemLocationPackingAndStatusAsync(detail.FromPackingCode, + detail.ItemCode, detail.FromLocationCode, detail.FromStatus).ConfigureAwait(false); + + Check.NotNull(balance, "库存", + $"不存在箱码为{detail.FromPackingCode},零件编码为{detail.ItemCode},库位为{detail.FromLocationCode},状态为{detail.FromStatus}的库存!"); + + detail.SupplierBatch = balance.SupplierBatch; + detail.ArriveDate = balance.ArriveDate; + detail.ProduceDate = balance.ProduceDate; + detail.ExpireDate = balance.ExpireDate; + + //通过箱码和库位获取库存信息 + detail.FromStatus = balance.Status; + + detail.FromLot = balance.Lot; + detail.FromWarehouseCode = balance.WarehouseCode; + detail.FromContainerCode = balance.ContainerCode; + + detail.ToLot = balance.Lot; + detail.ToWarehouseCode = balance.WarehouseCode; + detail.ToContainerCode = balance.ContainerCode; + + detail.ToStatus = balance.Status; + } + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestManager.cs new file mode 100644 index 000000000..3385bbe47 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestManager.cs @@ -0,0 +1,9 @@ +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public interface IWipWarehouseAdjustRequestManager : + ISfsStoreRequestManager, + IBulkImportService +{ +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestRepository.cs new file mode 100644 index 000000000..dd69d923c --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/IWipWarehouseAdjustRequestRepository.cs @@ -0,0 +1,9 @@ +using System; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Domain +{ + public interface IWipWarehouseAdjustRequestRepository : ISfsStoreRepositoryBase, ISfsBulkRepositoryBase + { + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequest.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequest.cs new file mode 100644 index 000000000..25f00e538 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequest.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain.Entities; + +namespace Win_in.Sfs.Wms.Store.Domain; + +/// +/// 调拨申请 +/// +public class WipWarehouseAdjustRequest : SfsStoreRequestAggregateRootBase +{ + + /// + /// 调整类型 + /// + [Display(Name = "调整类型")] + public string Type { get; set; } + + /// + /// 明细列表 + /// + [IgnoreUpdate] + public override List Details { get; set; } = new List(); + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestDetail.cs new file mode 100644 index 000000000..aacab5098 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestDetail.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Domain; + +/// +/// 线边库存调整调整明细 +/// +public class WipWarehouseAdjustRequestDetail : SfsStoreDetailWithFromToEntityBase +{ + /// + /// 原因 + /// + [Display(Name = "调整原因")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string Reason { get; set; } + + /// + /// 调整代码 + /// + [Display(Name = "原因代码")] + [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string ReasonCode { get; set; } + + public override string ToString() + { + return JsonSerializer.Serialize(this); + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestManager.cs new file mode 100644 index 000000000..e11444523 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestManager.cs @@ -0,0 +1,80 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public class WipWarehouseAdjustRequestManager : + SfsStoreRequestManagerBase, + IWipWarehouseAdjustRequestManager +{ + private readonly IWipWarehouseAdjustRequestRepository _repository; + + public WipWarehouseAdjustRequestManager( + IWipWarehouseAdjustRequestRepository repository + ) : base(repository) + { + _repository = repository; + } + + /// + /// 执行导入 + /// + public virtual async Task ImportDataAsync(List WipWarehouseAdjustRequests, + List deleteEntities = null) + { + if (deleteEntities != null && deleteEntities.Count > 0) + { + await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); + } + + _ = new List(); + + foreach (var item in WipWarehouseAdjustRequests) + { + await BuildDetailAsync(item.Details).ConfigureAwait(false); + } + + await CreateManyAsync(WipWarehouseAdjustRequests).ConfigureAwait(false); + } + + private async Task BuildDetailAsync(List details) + { + foreach (var detail in details) + { + var item = await ItemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + Check.NotNull(item, "物品代码", $"物品 {detail.ItemCode} 不存在"); + + if (item != null) + { + detail.ItemName = item.Name; + detail.ItemDesc1 = item.Desc1; + detail.ItemDesc2 = item.Desc2; + } + + var balance = await BalanceAppService.GetByItemLocationPackingAndStatusAsync(detail.FromPackingCode, + detail.ItemCode, detail.FromLocationCode, detail.FromStatus).ConfigureAwait(false); + + Check.NotNull(balance, "库存", + $"不存在箱码为{detail.FromPackingCode},零件编码为{detail.ItemCode},库位为{detail.FromLocationCode},状态为{detail.FromStatus}的库存!"); + + detail.SupplierBatch = balance.SupplierBatch; + detail.ArriveDate = balance.ArriveDate; + detail.ProduceDate = balance.ProduceDate; + detail.ExpireDate = balance.ExpireDate; + + //通过箱码和库位获取库存信息 + detail.FromStatus = balance.Status; + + detail.FromLot = balance.Lot; + detail.FromWarehouseCode = balance.WarehouseCode; + detail.FromContainerCode = balance.ContainerCode; + + detail.ToLot = balance.Lot; + detail.ToWarehouseCode = balance.WarehouseCode; + detail.ToContainerCode = balance.ContainerCode; + + detail.ToStatus = balance.Status; + } + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs index 782b3c977..c99a156c0 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs @@ -29,6 +29,7 @@ public interface IStoreDbContext : IEfCoreDbContext public DbSet ProductRecycleRequests { get; } public DbSet ScrapRequests { get; } public DbSet CountAdjustRequests { get; } + public DbSet WipWarehouseAdjustRequests { get; } #endregion @@ -82,7 +83,7 @@ public interface IStoreDbContext : IEfCoreDbContext public DbSet CustomerReturnNotes { get; } public DbSet ContainerBindNotes { get; } public DbSet NoOkConvertOkNotes { get; } - + public DbSet WipWarehouseAdjustNotes { get; } #endregion #region Jobs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteDbContextModelCreatingExtensions.cs new file mode 100644 index 000000000..971a7ef92 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteDbContextModelCreatingExtensions.cs @@ -0,0 +1,52 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Modeling; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; + +public static class WipWarehouseAdjustNoteDbContextModelCreatingExtensions +{ + public static void ConfigureWipWarehouseAdjustNote(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + nameof(WipWarehouseAdjustNote), options.Schema); + //Configure ABP properties + b.ConfigureByConvention(); + //Configure Sfs base properties + b.ConfigureSfsStoreBase(); + //Properties + b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.CodeLength); + + //Relations + b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); + + //Indexes + b.HasIndex(q => new { q.Number }).IsUnique(); + }); + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + nameof(WipWarehouseAdjustNoteDetail), options.Schema); + //Configure ABP properties + b.ConfigureByConvention(); + //Configure Sfs base properties + b.ConfigureSfsStoreBase(); + //Configure Sfs store detail properties + b.ConfigureSfsStoreDetailBase(); + + //Properties + b.Property(q => q.Reason).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.FromStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); + b.Property(q => q.ToStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); + + //Relations + + //Indexes + b.HasIndex(q => new { q.Number, q.FromPackingCode, q.FromLocationCode, q.ToLocationCode, q.FromStatus, q.ToStatus }).IsUnique(); + }); + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteEfCoreRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteEfCoreRepository.cs new file mode 100644 index 000000000..9cac2a7c2 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/WipWarehouseAdjustNotes/WipWarehouseAdjustNoteEfCoreRepository.cs @@ -0,0 +1,11 @@ +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; + +public class WipWarehouseAdjustNoteEfCoreRepository : SfsStoreEfCoreRepositoryBase, IWipWarehouseAdjustNoteRepository +{ + public WipWarehouseAdjustNoteEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestDbContextModelCreatingExtensions.cs new file mode 100644 index 000000000..20ce75a3f --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestDbContextModelCreatingExtensions.cs @@ -0,0 +1,52 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Modeling; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; + +public static class WipWarehouseAdjustRequestDbContextModelCreatingExtensions +{ + public static void ConfigureWipWarehouseAdjustRequest(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + nameof(WipWarehouseAdjustRequest), options.Schema); + //Configure ABP properties + b.ConfigureByConvention(); + //Configure Sfs base properties + b.ConfigureSfsStoreBase(); + //Properties + b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); + + //Relations + b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); + + //Indexes + b.HasIndex(q => new { q.Number }).IsUnique(); + }); + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + nameof(WipWarehouseAdjustRequestDetail), options.Schema); + //Configure ABP properties + b.ConfigureByConvention(); + //Configure Sfs base properties + b.ConfigureSfsStoreBase(); + //Configure Sfs store detail properties + b.ConfigureSfsStoreDetailBase(); + + //Properties + b.Property(q => q.FromStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); + b.Property(q => q.ToStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); + + //Relations + + //Indexes + + }); + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestEfCoreRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestEfCoreRepository.cs new file mode 100644 index 000000000..75e96baeb --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestEfCoreRepository.cs @@ -0,0 +1,13 @@ +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; + +public class WipWarehouseAdjustRequestEfCoreRepository : + SfsStoreEfCoreRepositoryBase, IWipWarehouseAdjustRequestRepository +{ + public WipWarehouseAdjustRequestEfCoreRepository(IDbContextProvider dbContextProvider) : base( + dbContextProvider) + { + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs index 6fc300b69..9a5dbfa35 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs @@ -28,6 +28,7 @@ public class StoreDbContext : AbpDbContext, IStoreDbContext public DbSet ProductRecycleRequests { get; set; } public DbSet ScrapRequests { get; set; } public DbSet CountAdjustRequests { get; set; } + public DbSet WipWarehouseAdjustRequests { get; set; } #endregion @@ -81,7 +82,7 @@ public class StoreDbContext : AbpDbContext, IStoreDbContext public DbSet CustomerReturnNotes { get; set; } public DbSet ContainerBindNotes { get; set; } public DbSet NoOkConvertOkNotes { get; set; } - + public DbSet WipWarehouseAdjustNotes { get; set; } #endregion #region Jobs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs index 81da8fb02..38813f279 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs @@ -59,6 +59,7 @@ public static class StoreDbContextModelCreatingExtensions builder.ConfigurePutawayRequest(options); builder.ConfigureScrapRequest(options); builder.ConfigureCountAdjustRequest(options); + builder.ConfigureWipWarehouseAdjustRequest(options); #endregion @@ -95,6 +96,7 @@ public static class StoreDbContextModelCreatingExtensions builder.ConfigureContainerBindNote(options); builder.ConfigureNoOkConvertOKNote(options); builder.ConfigureInventoryInitialNote(options); + builder.ConfigureWipWarehouseAdjustNote(options); #endregion 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 8f1d8db60..d51a8a347 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 @@ -63,6 +63,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule context.Services.AddTransient(); context.Services.AddTransient(); context.Services.AddTransient(); + context.Services.AddTransient(); #endregion @@ -100,6 +101,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule context.Services.AddTransient(); context.Services.AddTransient(); context.Services.AddTransient(); + context.Services.AddTransient(); #endregion @@ -189,6 +191,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); options.Entity(orderOptions => orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); + options.Entity(orderOptions => + orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); #endregion @@ -260,6 +264,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); options.Entity(orderOptions => orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); + options.Entity(orderOptions => + orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); #endregion diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/TransferNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/TransferNoteAutoMapperProfile.cs index 88593ab57..bec022137 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/TransferNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/TransferNoteAutoMapperProfile.cs @@ -9,13 +9,24 @@ public partial class StoreEventAutoMapperProfile : Profile { private void TransferNoteAutoMapperProfile() { - CreateMap() + CreateMap() .Ignore(x => x.ExtraProperties) .Ignore(x => x.DocNumber) .Ignore(x => x.JobNumber) .Ignore(x => x.Worker) .Ignore(x => x.TransType) .Ignore(x => x.TransSubType) + .Ignore(x=>x.PackingCode) + .Ignore(x => x.Lot) + .Ignore(x => x.Status) + .Ignore(x => x.TransInOut) + .Ignore(x => x.LocationCode) + .Ignore(x => x.LocationGroup) + .Ignore(x => x.LocationErpCode) + .Ignore(x => x.LocationArea) + .Ignore(x => x.ContainerCode) + .Ignore(x => x.ManageType) + .Ignore(x => x.WarehouseCode) ; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/WipWarehouseAdjustNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/WipWarehouseAdjustNoteAutoMapperProfile.cs new file mode 100644 index 000000000..25cba43ed --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/WipWarehouseAdjustNoteAutoMapperProfile.cs @@ -0,0 +1,26 @@ +using System; +using AutoMapper; +using Volo.Abp.AutoMapper; +using Win_in.Sfs.Shared.Application; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Inventory.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Event +{ + public partial class StoreEventAutoMapperProfile : Profile + { + private void WipWarehouseAdjustNoteAutoMapperProfile() + { + CreateMap() + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.DocNumber) + .Ignore(x => x.JobNumber) + .Ignore(x => x.Worker) + .Ignore(x => x.TransType) + .Ignore(x => x.TransSubType) + ; + } + + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/WipWarehouseAdjustRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/WipWarehouseAdjustRequestAutoMapperProfile.cs new file mode 100644 index 000000000..99dceeb96 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/WipWarehouseAdjustRequestAutoMapperProfile.cs @@ -0,0 +1,24 @@ +using AutoMapper; +using Volo.Abp.AutoMapper; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Event; + +public partial class StoreEventAutoMapperProfile : Profile +{ + private void WipWarehouseAdjustRequestAutoMapperProfile() + { + CreateMap() + .IgnoreAllPropertiesWithAnInaccessibleSetter() + .ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.Number)) + .Ignore(x => x.JobNumber) + .Ignore(x => x.Confirmed) + .Ignore(x => x.ConfirmTime) + ; + + CreateMap() + .IgnoreAllPropertiesWithAnInaccessibleSetter() + ; + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionReturnJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionReturnJobEventHandler.cs index 11cca065d..b8ac3da2a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionReturnJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionReturnJobEventHandler.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Volo.Abp.EventBus; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/WipWarehouseAdjustRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/WipWarehouseAdjustRequestEventHandler.cs new file mode 100644 index 000000000..75e931018 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/WipWarehouseAdjustRequestEventHandler.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using DocumentFormat.OpenXml.Bibliography; +using Volo.Abp.EventBus; +using Volo.Abp.ObjectMapping; +using Volo.Abp.Uow; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Inventory.Application.Contracts; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; + +public class WipWarehouseAdjustRequestEventHandler + : StoreEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> + , ILocalEventHandler> + +{ + private readonly IWipWarehouseAdjustNoteAppService _wipWarehouseAdjustNoteAppService; + private readonly IWipWarehouseAdjustRequestManager _wipWarehouseAdjustRequestManager; + private readonly IBalanceAppService _balanceAppService; + + public WipWarehouseAdjustRequestEventHandler( + IWipWarehouseAdjustNoteAppService wipWarehouseAdjustNoteAppService, IBalanceAppService balanceAppService, IWipWarehouseAdjustRequestManager wipWarehouseAdjustRequestManager) + { + _wipWarehouseAdjustNoteAppService = wipWarehouseAdjustNoteAppService; + _balanceAppService = balanceAppService; + _wipWarehouseAdjustRequestManager = wipWarehouseAdjustRequestManager; + } + + /// + /// 创建后 + /// + /// Event data + public async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + + if (entity.AutoSubmit) + { + await _wipWarehouseAdjustRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + + /// + /// 批量创建后 + /// + /// Event data + public async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + + foreach (var entity in entitys) + { + if (entity.AutoSubmit) + { + await _wipWarehouseAdjustRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + } + + /// + /// 审批后 + /// + /// + /// + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsHandledEntityEventData eventData) + { + var entity = eventData.Entity; + if (entity.DirectCreateNote) + { + var note = await BuildCountAdjustNoteCreateInputAsync(entity).ConfigureAwait(false); + await _wipWarehouseAdjustNoteAppService.CreateAsync(note).ConfigureAwait(false); + } + } + + #region 私有 + + private async Task BuildCountAdjustNoteCreateInputAsync( + WipWarehouseAdjustRequest entity) + { + var createInput = ObjectMapper.Map(entity); + createInput.JobNumber = string.Empty; + createInput.RequestNumber = entity.Number; + createInput.ActiveDate = Clock.Now; + return createInput; + } + + #endregion +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs index 72e46f880..9dfa74f8d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs @@ -24,6 +24,31 @@ public partial class StoreEventAutoMapperProfile : Profile //到货单 PurchaseReceiptRequestAutoMapperProfile(); + //线边调整 + WipWarehouseAdjustRequestAutoMapperProfile(); + + #endregion + + #region Jobs + + CountJobAutoMapperProfile(); + DeliverJobAutoMapperProfile(); + InspectJobAutoMapperProfile(); + IssueJobAutoMapperProfile(); + JisDeliverJobAutoMapperProfile(); + ProductionReturnJobAutoMapperProfile(); + ProductReceiveJobAutoMapperProfile(); + PurchaseReceiptJobAutoMapperProfile(); + PurchaseReturnJobAutoMapperProfile(); + PutawayJobAutoMapperProfile(); + UnplannedIssueJobAutoMapperProfile(); + UnplannedReceiptJobAutoMapperProfile(); + + #endregion + + #region Notes + + WipWarehouseAdjustNoteAutoMapperProfile(); #endregion @@ -69,21 +94,6 @@ public partial class StoreEventAutoMapperProfile : Profile CountAdjustRequestAutoMapperProfile(); InventoryInitialNoteAutoMapperProfile(); - #region Jobs - - CountJobAutoMapperProfile(); - DeliverJobAutoMapperProfile(); - InspectJobAutoMapperProfile(); - IssueJobAutoMapperProfile(); - JisDeliverJobAutoMapperProfile(); - ProductionReturnJobAutoMapperProfile(); - ProductReceiveJobAutoMapperProfile(); - PurchaseReceiptJobAutoMapperProfile(); - PurchaseReturnJobAutoMapperProfile(); - PutawayJobAutoMapperProfile(); - UnplannedIssueJobAutoMapperProfile(); - UnplannedReceiptJobAutoMapperProfile(); - #endregion } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/WipWarehouseAdjustNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/WipWarehouseAdjustNoteEventHandler.cs new file mode 100644 index 000000000..b80add431 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/WipWarehouseAdjustNoteEventHandler.cs @@ -0,0 +1,128 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Inventory.Application.Contracts; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Event.Transaction; + +namespace Win_in.Sfs.Wms.Store.Event.BusinessNote; + +public class WipWarehouseAdjustNoteEventHandler + : StoreInventoryEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> +{ + private const EnumTransType TransType = EnumTransType.Adjust; + private const EnumTransSubType TransSubType = EnumTransSubType.CountAdjust_WIP; + + private readonly IWipWarehouseAdjustRequestAppService _wipWarehouseAdjustRequestApp; + private readonly IItemBasicAppService _itemBasicAppService; + + public WipWarehouseAdjustNoteEventHandler( + IWipWarehouseAdjustRequestAppService wipWarehouseAdjustRequestApp, IItemBasicAppService itemBasicAppService) + { + _wipWarehouseAdjustRequestApp = wipWarehouseAdjustRequestApp; + _itemBasicAppService = itemBasicAppService; + } + + /// + /// 批量创建后 + /// + /// + /// + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + await AddTransactionsAsync(entities).ConfigureAwait(false); + + foreach (var entity in entities.Where(entity => !string.IsNullOrEmpty(entity.RequestNumber))) + { + await _wipWarehouseAdjustRequestApp.CompleteByNumberAsync(entity.RequestNumber).ConfigureAwait(false); + } + } + + /// + /// 创建后 + /// + /// + /// + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entities = new List { eventData.Entity }; + await AddTransactionsAsync(entities).ConfigureAwait(false); + + foreach (var entity in entities.Where(entity => !string.IsNullOrEmpty(entity.RequestNumber))) + { + await _wipWarehouseAdjustRequestApp.CompleteByNumberAsync(entity.RequestNumber).ConfigureAwait(false); + } + } + + #region 库存操作 + + private async Task AddTransactionsAsync(List countAdjustNotes) + { + var transactions = new List(); + //如果要做库存事务汇总,可以修改此处 + foreach (var countAdjustNote in countAdjustNotes) + { + transactions.AddRange(await BuildTransactions(countAdjustNote).ConfigureAwait(false)); + } + + await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false); + } + + private async Task> BuildTransactions(WipWarehouseAdjustNote countAdjustNote) + { + var transactions = new List(); + + foreach (var detail in countAdjustNote.Details) + { + var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + + var transaction = new TransactionEditInput(); + + transaction.TransType = TransType; + transaction.TransSubType = TransSubType; + + transaction.TransInOut = detail.Qty > 0 ? EnumTransInOut.In : EnumTransInOut.Out; + + transaction.Worker = countAdjustNote.Worker; + transaction.DocNumber = countAdjustNote.Number; + transaction.JobNumber = string.Empty; + + transaction.ItemCode = detail.ItemCode; + transaction.ItemDesc1=detail.ItemDesc1; + transaction.ItemDesc2=detail.ItemDesc2; + transaction.ItemName = detail.ItemName; + transaction.StdPackQty = detail.StdPackQty; + transaction.DocNumber = detail.Number; + transaction.Uom=detail.Uom; + transaction.PackingCode = detail.ToPackingCode; + transaction.Lot = detail.ToLot; + transaction.Qty=detail.Qty; + transaction.Status = detail.ToStatus; + transaction.LocationCode = detail.ToLocationCode; + transaction.LocationGroup = detail.ToLocationGroup; + transaction.LocationArea = detail.ToLocationArea; + transaction.LocationErpCode = detail.ToLocationErpCode; + transaction.LocationCode=detail.ToLocationCode; + transaction.ContainerCode = detail.ToContainerCode; + transaction.ManageType = itemBasicDto.ManageType; + transaction.WarehouseCode = detail.ToWarehouseCode; + + transactions.Add(transaction); + } + + return transactions; + } + + #endregion +}