From 233eb7b92a29fad5728adf69d2781e5f1e306a71 Mon Sep 17 00:00:00 2001 From: mahao Date: Fri, 28 Jul 2023 13:25:52 +0800 Subject: [PATCH] =?UTF-8?q?Jit=E5=8F=91=E8=BF=90=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Syncs/BeiSeSyncAppService.cs | 38 +++++++++++++++++++ .../Entities/BQ/Syncs/JitSeSyncAppService.cs | 14 +++---- .../Entities/BQ/Syncs/SeSyncConfig.cs | 2 - .../BQ/Syncs/YinDuSeSyncAppService.cs | 3 -- .../BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs | 3 -- 5 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs 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 new file mode 100644 index 00000000..f57cf9a0 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; +using Win.Sfs.SettleAccount.EntityFrameworkCore; +using Win.Sfs.Shared.RepositoryBase; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; + +/// +/// 备件发运同步 +/// +[AllowAnonymous] +[Route("api/settleaccount/[controller]/[action]")] +public class BeiSeSyncAppService : JitSeSyncAppService +{ + /// + /// 构造 + /// + public BeiSeSyncAppService( + WMSBJBMPTDbContext wmsBJBMPTContext, + INormalEfCoreRepository syncPositionFlagRepository, + INormalEfCoreRepository pubSeDetailRepository + ) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository) + { + base.SeSyncConfigInfo = new SeSyncConfig() + { + SyncTableName = "BeiSeSync", + SyncDeliverBillType = EnumDeliverBjBmpBillType.北汽4S备件, + SyncDeliverSubBillTypes = new List + { + EnumDeliverSubBillType.无 + }, + BusinessType = EnumBusinessType.BeiJian + }; + } +} 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 c3a913ce..dfebce46 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 @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; @@ -15,6 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; /// /// Jit发运数据同步 /// +[ApiExplorerSettings(IgnoreApi = true)] public class JitSeSyncAppService : ApplicationService, IInvocable { /// @@ -68,10 +69,10 @@ public class JitSeSyncAppService : ApplicationService, IInvocable { predicate = (t) => t.DeliverBillType == deliverBillType && t.UID > int.Parse(syncPositionFlag.Position) && (!deliverSubBillTypes.Any() || deliverSubBillTypes.Contains(t.DeliverSubBillType)); } + //WMS发运记录 + var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); - var jitRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); - - var pubSeDetails = ObjectMapper.Map, List>(jitRecords); + var pubSeDetails = ObjectMapper.Map, List>(wmsSeRecords); if (pubSeDetails.Any()) { pubSeDetails.ForEach(t => t.BusinessType = businessType); @@ -79,7 +80,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable if (syncPositionFlag != null) { - syncPositionFlag.Position = jitRecords.Last().UID.ToString(); + syncPositionFlag.Position = wmsSeRecords.Last().UID.ToString(); await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag); } else @@ -87,11 +88,10 @@ public class JitSeSyncAppService : ApplicationService, IInvocable syncPositionFlag = new SyncPositionFlag() { TableName = syncTableName, - Position = jitRecords.Last().UID.ToString() + Position = wmsSeRecords.Last().UID.ToString() }; await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); } } - await Task.CompletedTask; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs index d528bd8e..27e64885 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs @@ -1,6 +1,4 @@ using System.Collections.Generic; -using System.ComponentModel; -using DocumentFormat.OpenXml.Office2010.ExcelAc; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; 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 3ea72c05..f026ba44 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 @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ; 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 cc3ecb3d..9f04c134 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 @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ;