diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs index 45a9746f..49284549 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs @@ -24,13 +24,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs SyncTableName = "BeiSeSync", SyncDeliverBillType = EnumDeliverBjBmpBillType.北汽4S备件, SyncDeliverSubBillTypes = new List - { - EnumDeliverSubBillType.北汽4S备件BBAC - }, + { + EnumDeliverSubBillType.北汽4S备件BBAC + }, BusinessType = EnumBusinessType.BeiJian }; } + /// + /// 执行备件发运同步 + /// [UnitOfWork(IsDisabled = true)] public virtual async Task Invoke(IServiceProvider serviceProvider) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs index 6ab897ee..413c6b38 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs @@ -28,11 +28,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 同步 /// + /// + /// 发运数据手动同步 + /// JisBBAC、JisHBPO、买单件BBAC、买单件HBPO、直供件BBAC、直供件HBPO、备件、印度件 + /// [HttpPost] [UnitOfWork(IsDisabled = true)] public virtual async Task SyncAsync([FromBody] EnumBusinessType businessType) { - using var scope = this._applicationServices.CreateScope(); + using var scope = _applicationServices.CreateScope(); IInvocable seSyncAppService = businessType switch { EnumBusinessType.JisBBAC => scope.ServiceProvider.GetRequiredService(), diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs index c931c069..ae0d3281 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs @@ -29,6 +29,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 执行 /// + /// + /// 根据PN、无空格的客户零件号分组查询出状态为无Edi数据的发运数据 + /// 根据PN、无空格的客户零件号分组查询出状态为无发运数据的Edi数据 + /// 关联发运数据和Edi数据PN相同、无空格的客户零件号系统的前5_000条数据,获取匹配上的PN、CustomerPartCodeNoSpace + /// 根据PN、CustomerPartCodeNoSpace查询发运、Eid + /// 修改发运数据状态为有Eid数据 + /// 修改Eid数据状态为有发运数据 + /// public async Task Invoke() { using var serviceScope = _serviceProvider.CreateScope(); @@ -88,14 +96,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 处理删除的EDI数据 /// + /// + /// 处理10次、每次处理1000条已删除、有发运的Edi数据(JisBBAC) + /// 获取对应的发运数据和Edi数据 + /// 设置发运数据状态为无EDI数据 + /// 设置EDI数据状态为无发运数据 + /// private async Task HandDelEdiDataAsync() { - /* - * 处理有发运数据状态是删除的数据 - * 获取对应的发运数据 - * 设置发运数据状态为无EDI数据 - * 设置EDI数据状态为无发运数据 - */ using var serviceScope = _serviceProvider.CreateScope(); var db = serviceScope.ServiceProvider.GetRequiredService(); var seed = 0; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs index 0cf47d72..caa579c3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs @@ -38,6 +38,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs }; } + /// + /// 执行JisBBAC发运同步 + /// [UnitOfWork(IsDisabled = true)] public async Task Invoke(IServiceProvider serviceProvider) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs index c75a0375..11be30ae 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs @@ -51,6 +51,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// public SeSyncConfig SeSyncConfigInfo { get; set; } + /// + /// 执行发运同步 + /// + /// + /// 执行JisBBAC、买单件BBAC发运同步 + /// 从WMS系统中 TM_BJBMPT_JIT_RECORD、TM_BJBMPT_JIS_RECORD 表中获取发运数据 + /// [HttpPost] public async Task Invoke() { @@ -65,6 +72,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 同步JitRecord /// + /// + /// 同步TM_BJBMPT_JIT_RECORD表发运数据 + /// 同步十次、每次同步100_000条发运数据 + /// private async Task SyncJitRecordAsync() { //同步表名称 @@ -91,7 +102,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs var jisSeDetails = ObjectMapper.Map, List>(wmsSeRecords); if (jisSeDetails.Any()) { - await SeDataPutInStorageAsync(jisSeDetails, false).ConfigureAwait(false); + await SeDataPutInStorageAsync(jisSeDetails, syncTableName).ConfigureAwait(false); } else { @@ -103,6 +114,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 同步JisRecord /// + /// + /// 同步TM_BJBMPT_JIS_RECORD表发运数据 + /// 同步十次、每次同步100_000条发运数据 + /// private async Task SyncJisRecordAsync() { //同步表名称 @@ -129,7 +144,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs var jisSeDetails = ObjectMapper.Map, List>(wmsSeRecords); if (jisSeDetails.Any()) { - await SeDataPutInStorageAsync(jisSeDetails, true).ConfigureAwait(false); + await SeDataPutInStorageAsync(jisSeDetails, syncTableName).ConfigureAwait(false); } else { @@ -141,11 +156,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 发运数据入库 /// - private async Task SeDataPutInStorageAsync(List seDetails, bool isJisTable) + /// + /// 添加客户与厂内零件号关系 + /// 记录同步位置、发运数据入库、入库寄售库数据 + /// + private async Task SeDataPutInStorageAsync(List seDetails, string syncTableName) { - //同步表名称 - var syncTableName = isJisTable ? SeSyncConfigInfo.SyncTableName + - "_Jis" : SeSyncConfigInfo.SyncTableName + "_Jit"; //业务类别 var businessType = SeSyncConfigInfo.BusinessType; @@ -189,6 +205,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs _settleAccountDbContext.Add(syncPositionFlag); } await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); + var isJisTable = syncTableName.EndsWith("_Jis"); await _syncExtendManager.JisSeDetailsSaveConsignAsync(seDetails, isJisTable).ConfigureAwait(false); await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); await transaction.CommitAsync().ConfigureAwait(false); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs index 16837783..6907fef0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs @@ -30,6 +30,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 执行 /// + /// + /// 根据PN、无空格的客户零件号分组查询出状态为无Edi数据的发运数据 + /// 根据PN、无空格的客户零件号分组查询出状态为无发运数据的Edi数据 + /// 关联发运数据和Edi数据PN相同、无空格的客户零件号系统的前5_000条数据,获取匹配上的PN、CustomerPartCodeNoSpace + /// 根据PN、CustomerPartCodeNoSpace查询发运、Eid + /// 修改发运数据状态为有Eid数据 + /// 修改Eid数据状态为有发运数据 + /// public async Task Invoke() { using var serviceScope = _serviceProvider.CreateScope(); @@ -89,6 +97,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 处理删除的EDI数据 /// + /// + /// 处理10次、每次处理1000条已删除、有发运的Edi数据(JisHBPO) + /// 获取对应的发运数据和Edi数据 + /// 设置发运数据状态为无EDI数据 + /// 设置EDI数据状态为无发运数据 + /// private async Task HandDelEdiDataAsync() { using var serviceScope = _serviceProvider.CreateScope(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs index d8e0205d..49fc92ef 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs @@ -36,6 +36,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs }; } + /// + /// 执行JisHBPO发运同步 + /// [UnitOfWork(IsDisabled = true)] public virtual async Task Invoke(IServiceProvider serviceProvider) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs index 610a982d..6db96639 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs @@ -52,6 +52,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// public SeSyncConfig SeSyncConfigInfo { get; set; } + /// + /// 执行发运同步 + /// + /// + /// 执行JisBBAC、买单件BBAC发运同步 + /// 从WMS系统中 TM_BJBMPT_JIT_RECORD、TM_BJBMPT_JIS_RECORD 表中获取发运数据 + /// [HttpPost] public virtual async Task Invoke() { @@ -66,6 +73,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 同步JitRecord /// + /// + /// 同步TM_BJBMPT_JIT_RECORD表发运数据 + /// 同步十次、每次同步100_000条发运数据 + /// private async Task SyncJitRecordAsync() { //同步表名称 @@ -92,7 +103,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs var jisSeDetails = ObjectMapper.Map, List>(wmsSeRecords); if (jisSeDetails.Any()) { - await SeDataPutInStorageAsync(jisSeDetails, false).ConfigureAwait(false); + await SeDataPutInStorageAsync(jisSeDetails, syncTableName).ConfigureAwait(false); } else { @@ -104,6 +115,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 同步JisRecord /// + /// + /// 同步TM_BJBMPT_JIS_RECORD表发运数据 + /// 同步十次、每次同步100_000条发运数据 + /// private async Task SyncJisRecordAsync() { //同步表名称 @@ -130,7 +145,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs var jisSeDetails = ObjectMapper.Map, List>(wmsRecords); if (jisSeDetails.Any()) { - await SeDataPutInStorageAsync(jisSeDetails, true).ConfigureAwait(false); + await SeDataPutInStorageAsync(jisSeDetails, syncTableName).ConfigureAwait(false); } else { @@ -142,11 +157,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 发运数据入库 /// - private async Task SeDataPutInStorageAsync(List seDetails, bool isJisTable) + /// + /// 添加客户与厂内零件号关系 + /// 记录同步位置、发运数据入库、入库寄售库数据 + /// + private async Task SeDataPutInStorageAsync(List seDetails, string syncTableName) { - //同步表名称 - var syncTableName = isJisTable ? SeSyncConfigInfo.SyncTableName + - "_Jis" : SeSyncConfigInfo.SyncTableName + "_Jit"; //业务类别 var businessType = SeSyncConfigInfo.BusinessType; @@ -190,6 +206,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs _settleAccountDbContext.Add(syncPositionFlag); } await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); + var isJisTable = syncTableName.EndsWith("_Jis"); await _syncExtendManager.JisSeDetailsSaveConsignAsync(seDetails, isJisTable).ConfigureAwait(false); await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); await transaction.CommitAsync().ConfigureAwait(false); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs index 9a634f4d..0b074641 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs @@ -50,6 +50,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// public SeSyncConfig SeSyncConfigInfo { get; set; } + /// + /// 执行发运同步 + /// + /// + /// 直供件BBAC、直供件HBPO、备件、印度件发运同步 + /// 数据同步规则 + /// * 同步十次、每次同步100_000条发运数据 + /// * 每次同步需要记录同步WMS数据的最大Id(递增Id)、下次同步从最大Id向后查询数据 + /// [HttpPost] public async Task Invoke() { @@ -91,6 +100,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 发运数据入库 /// + /// + /// 除了备件业务外,直供件BBAC、直供件HBPO、印度件业务需要添加客户与厂内零件号关系 + /// 记录同步位置、发运数据入库、入库寄售库数据 + /// private async Task SeDataPutInStorageAsync(List seDetails) { var syncTableName = SeSyncConfigInfo.SyncTableName; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs index b48ef4e6..d5b621f0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs @@ -38,6 +38,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs }; } + /// + /// 执行买单件BBAC发运同步 + /// [UnitOfWork(IsDisabled = true)] public async Task Invoke(IServiceProvider serviceProvider) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs index 22f49bfd..2881848e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs @@ -36,6 +36,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs }; } + /// + /// 执行买单件HBPO发运同步 + /// [UnitOfWork(IsDisabled = true)] public async Task Invoke(IServiceProvider serviceProvider) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs index 24ce3ad3..9cc643cc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs @@ -32,6 +32,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 添加零件关系 /// + /// + /// 过滤客户零件号、厂内零件号、业务类型已存在的数据 + /// 其他数据入库 + /// public async Task AddNewMaterialRelationshipsAsync(IEnumerable materialRelationships) { //新客户零件号和厂内零件号 @@ -52,6 +56,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// Jis发运数据保存寄售库 /// + /// + /// JisBBAC、JisHBPO、买单件BBAC、买单件HBPO发运同步保存寄售库 + /// isJisTable 用于区分数据来源表 TM_BJBMPT_JIS_RECORD、TM_BJBMPT_JIT_RECORD + /// 不同表获取的字段有差别 + /// public async Task JisSeDetailsSaveConsignAsync(List seDetails, bool isJisTable) where T : JisSeBase { var deliverSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.发货); @@ -121,6 +130,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// Pub发运数据保存寄售库 /// + /// + /// 直供件BBAC、直供件HBPO、备件、印度件 + /// 发运同步保存寄售库 + /// public async Task PubSeDetailsSaveConsignAsync(List seDetails) { var deliverSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.发货); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs index 22fabaf9..a3071375 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs @@ -31,6 +31,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs }; } + /// + /// 执行印度件发运同步 + /// [UnitOfWork(IsDisabled = true)] public virtual async Task Invoke(IServiceProvider serviceProvider) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs index acb4f39e..3b74b8f6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs @@ -31,6 +31,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs }; } + /// + /// 执行直供件BBAC发运同步 + /// [UnitOfWork(IsDisabled = true)] public virtual async Task Invoke(IServiceProvider serviceProvider) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs index 67f76f59..38e3ce38 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs @@ -31,6 +31,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs }; } + /// + /// 执行直供件HBPO发运同步 + /// [UnitOfWork(IsDisabled = true)] public virtual async Task Invoke(IServiceProvider serviceProvider) {