From 4de8bd0827215adc6bb75aff0ec7b493ee0343ae Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 30 Aug 2023 10:45:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=AF=84=E5=94=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SettleAccount.HttpApi.Host/Startup.cs | 4 +- .../Entities/BQ/Syncs/BeiSeSyncAppService.cs | 9 +- .../BQ/Syncs/JisHBPOSeEdiCompareAppService.cs | 59 ++-- .../Entities/BQ/Syncs/JitSeSyncAppService.cs | 259 +++++++++--------- .../BQ/Syncs/YinDuSeSyncAppService.cs | 12 +- .../BQ/Syncs/ZhiGongBBACSeSyncAppService.cs | 15 +- .../BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs | 18 +- .../Options/SeConfigOptions.cs | 8 + .../BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs | 2 +- .../SettleAccount.Domain/Entities/Boms/Bom.cs | 6 +- 10 files changed, 183 insertions(+), 209 deletions(-) create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Options/SeConfigOptions.cs diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs index 08f12964..9711eff4 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs @@ -79,8 +79,8 @@ public class Startup app.UseEndpoints(endpoints => endpoints.MapHub("/api/hub")); app.ApplicationServices.UseScheduler(scheduler => { - //scheduler.Schedule().EverySeconds(10); - //scheduler.Schedule().EverySeconds(10); + scheduler.Schedule().EveryMinute(); + scheduler.Schedule().EveryMinute(); }); var contentTypeProvider = new FileExtensionContentTypeProvider(); contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); 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 b19c31b3..b8aac923 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 @@ -22,14 +22,7 @@ public class BeiSeSyncAppService : JitSeSyncAppService, IJobService /// /// 构造 /// - public BeiSeSyncAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - INormalEfCoreRepository syncPositionFlagRepository, - INormalEfCoreRepository pubSeDetailRepository, - MaterialRelationshipManager materialRelationshipManager, - VmiAppService vmiService - ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) + public BeiSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext) : base(wmsBJBMPTContext, settleAccountDbContext) { base.SeSyncConfigInfo = new SeSyncConfig() { 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 e70ace91..92470ab7 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 @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Linq.Dynamic.Core; using System.Threading.Tasks; @@ -62,36 +61,38 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable await HandDelEdiDataAsync().ConfigureAwait(false); - using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false)) - { - var seDetailGroup = db.Set().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, LU = t.Key.CustomerPartCodeNoSpace }); - var ediDetailGroup = db.Set().Where(t => t.IsDeleted == false && t.IsHaveSeData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }); + var seDetailGroup = db.Set().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, LU = t.Key.CustomerPartCodeNoSpace }); + var ediDetailGroup = db.Set().Where(t => t.IsDeleted == false && t.IsHaveSeData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }); + + var keyCodes = from se in seDetailGroup + from edi in ediDetailGroup + where se.PN == edi.PN && se.LU == edi.LU + select new { se.PN, se.LU }; + var seDetailsQuery = from se in db.Set() + from keyCode in keyCodes + where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.LU && se.IsHaveEdiData == false + select se; + var ediDetailsQuery = from edi in db.Set() + from keyCode in keyCodes + where edi.PN == keyCode.PN && edi.LU == keyCode.LU && edi.IsDeleted == false && edi.IsHaveSeData == false + select edi; - var keyCodes = from se in seDetailGroup - from edi in ediDetailGroup - where se.PN == edi.PN && se.LU == edi.LU - select new { se.PN, se.LU }; - var seDetailsQuery = from se in db.Set() - from keyCode in keyCodes - where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.LU && se.IsHaveEdiData == false - select se; - var ediDetailsQuery = from edi in db.Set() - from keyCode in keyCodes - where edi.PN == keyCode.PN && edi.LU == keyCode.LU && edi.IsDeleted == false && edi.IsHaveSeData == false - select edi; + var seDetails = seDetailsQuery.Take(5000).ToList(); + var ediDetails = ediDetailsQuery.Take(5000).ToList(); + seDetails.ForEach(t => t.IsHaveEdiData = true); + ediDetails.ForEach(t => t.IsHaveSeData = true); - var seDetails = seDetailsQuery.Take(5000).ToList(); - var ediDetails = ediDetailsQuery.Take(5000).ToList(); - if (seDetails.Any()) - { - seDetails.ForEach(t => t.IsHaveEdiData = true); - db.BulkUpdate(seDetails); - } - if (ediDetails.Any()) - { - ediDetails.ForEach(t => t.IsHaveSeData = true); - db.BulkUpdate(ediDetails); - } + using var transaction = await db.Database.BeginTransactionAsync().ConfigureAwait(false); + try + { + await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); + await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); + } + catch (Exception) + { + await transaction.RollbackAsync().ConfigureAwait(false); + throw; } } catch (Exception) 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 aa625cf4..ef43435d 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 @@ -7,9 +7,9 @@ using Coravel.Invocable; using EFCore.BulkExtensions; using LinqToDB; using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; using SettleAccount.Domain.BQ; using Volo.Abp.Application.Services; -using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.MaterialRelationships; @@ -27,52 +27,28 @@ public class JitSeSyncAppService : ApplicationService, IInvocable /// WMS数据上下文 /// private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; - /// /// 数据上下文 /// private readonly SettleAccountDbContext _settleAccountDbContext; - /// - /// 同步位置标记 - /// - private readonly INormalEfCoreRepository _syncPositionFlagRepository; - - /// - /// Jit发运数据仓储 - /// - private readonly INormalEfCoreRepository _pubSeDetailRepository; - - /// - /// 客户零件关系领域 - /// - private readonly MaterialRelationshipManager _materialRelationshipManager; - - //private readonly IVmiService _vmiService; - /// /// 构造 /// - public JitSeSyncAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - INormalEfCoreRepository syncPositionFlagRepository, - INormalEfCoreRepository pubSeDetailRepository, - MaterialRelationshipManager materialRelationshipManager, - VmiAppService vmiService) + public JitSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext) { _wmsBJBMPTContext = wmsBJBMPTContext; _settleAccountDbContext = settleAccountDbContext; - _syncPositionFlagRepository = syncPositionFlagRepository; - _pubSeDetailRepository = pubSeDetailRepository; - _materialRelationshipManager = materialRelationshipManager; - //_vmiService = vmiService; } /// /// 发运同步配置 /// public SeSyncConfig SeSyncConfigInfo { get; set; } + /// + /// Seed + /// + public int Seed { get; set; } [HttpPost] public async Task Invoke() @@ -90,30 +66,70 @@ public class JitSeSyncAppService : ApplicationService, IInvocable //业务类别 var businessType = SeSyncConfigInfo.BusinessType; - Expression> predicate = (t) => t.DeliverBillType == deliverBillType && (!deliverSubBillTypes.Any() || deliverSubBillTypes.Contains(t.DeliverSubBillType)); - var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName).ConfigureAwait(false); - if (syncPositionFlag != null) + while (Seed < 10) + { + Seed++; + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + var syncPosition = syncPositionFlag?.Position ?? "0"; + + Expression> predicate = (t) => t.DeliverBillType == deliverBillType && t.UID > int.Parse(syncPosition) && (!deliverSubBillTypes.Any() || deliverSubBillTypes.Contains(t.DeliverSubBillType)); + //WMS发运记录 + var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).Take(100_000).OrderBy(b => b.UID).ToList(); + var pubSeDetails = ObjectMapper.Map, List>(wmsSeRecords); + if (pubSeDetails.Any()) + { + await SeDataPutInStorageAsync(pubSeDetails).ConfigureAwait(false); + } + else + { + break; + } + } + } + + #region 私有方法 + /// + /// 添加零件关系 + /// + private async Task AddNewMaterialRelationshipsAsync(IEnumerable materialRelationships) + { + //新客户零件号和厂内零件号 + var noHaveLuRePartCodes = from item1 in materialRelationships + join item2 in _settleAccountDbContext.Set() + on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode } + into temp + from item3 in temp.DefaultIfEmpty() + where item3 == null + select item1; + + if (noHaveLuRePartCodes.Any()) { - predicate = (t) => t.DeliverBillType == deliverBillType && t.UID > int.Parse(syncPositionFlag.Position) && (!deliverSubBillTypes.Any() || deliverSubBillTypes.Contains(t.DeliverSubBillType)); + await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false); } - //WMS发运记录 - var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); - var pubSeDetails = ObjectMapper.Map, List>(wmsSeRecords); - if (pubSeDetails.Any()) + } + + /// + /// 发运数据入库 + /// + private async Task SeDataPutInStorageAsync(List seDetails) + { + var syncTableName = SeSyncConfigInfo.SyncTableName; + var businessType = SeSyncConfigInfo.BusinessType; + if (seDetails.Any()) { if (businessType != EnumBusinessType.BeiJian) { //备件以外其他业务添加客户零件号与厂内零件号关系 //客户零件号和厂内零件号 - var luRePartCodes = pubSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); + var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); if (luRePartCodes.Any()) { var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); - await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + await this.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); } } - pubSeDetails.ForEach(t => + seDetails.ForEach(t => { t.SetId(GuidGenerator.Create()); t.BusinessType = businessType; @@ -124,108 +140,101 @@ public class JitSeSyncAppService : ApplicationService, IInvocable t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); } }); - - if (syncPositionFlag != null) - { - syncPositionFlag.Position = wmsSeRecords.Last().UID.ToString(); - } - else - { - syncPositionFlag = new SyncPositionFlag() - { - TableName = syncTableName, - Position = wmsSeRecords.Last().UID.ToString() - }; - } + var syncPosition = seDetails.Last().UID.ToString(); using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); try { - _settleAccountDbContext.Set().AddOrUpdate(t => t.TableName == syncPositionFlag.TableName, syncPositionFlag); - await _settleAccountDbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false); - await transaction.CommitAsync().ConfigureAwait(false); - } - catch (Exception) - { - await transaction.RollbackAsync().ConfigureAwait(false); - throw; - } - - foreach (var pubSeDetail in pubSeDetails) - { - if (pubSeDetail.TransType == EnumDelTransType.发货) + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + if (syncPositionFlag != null) { - var vmiBalance = new VmiBalance() - { - RealPartCode = pubSeDetail.PartCode, - VinCode = pubSeDetail.PN, - CustPartCode = default, - CodeType = default, - DeliverBillType = pubSeDetail.DeliverBillType, - Qty = pubSeDetail.Qty, - BillTime = pubSeDetail.BillTime ?? new DateTime(), - AssembleData = pubSeDetail.AssembleData, - ErpToLoc = pubSeDetail.ToErpLocCode, - Seq = default, - OrderNum = pubSeDetail.DeliveryIndex, - UniqueCode = default, - MatchNumber = default, - PjsNum = default, - Configcode = default, - factory = default, - DeliverSubBillType = pubSeDetail.DeliverSubBillType, - RealCode = default, - ReMark = pubSeDetail.Remark, - }; - //await _vmiService.In(logType: Vmi.VmiLogType.Type100, changedNumber: pubSeDetail.DnBillNum, data: vmiBalance).ConfigureAwait(false); + syncPositionFlag.Position = syncPosition; + _settleAccountDbContext.Update(syncPositionFlag); } - else if (pubSeDetail.TransType == EnumDelTransType.退货) + else { - var vmiLog = new VmiLog() + syncPositionFlag = new SyncPositionFlag() { - RealPartCode = pubSeDetail.PartCode, - VinCode = pubSeDetail.PN, - CustPartCode = default, - CodeType = default, - DeliverBillType = pubSeDetail.DeliverBillType, - Qty = pubSeDetail.Qty, - BillTime = pubSeDetail.BillTime ?? new DateTime(), - AssembleData = pubSeDetail.DnBillTime, - ErpToLoc = pubSeDetail.ToErpLocCode, - Seq = default, - OrderNum = pubSeDetail.DnBillNum, - UniqueCode = default, - MatchNumber = default, - PjsNum = default, - Configcode = default, - factory = default, - DeliverSubBillType = pubSeDetail.DeliverSubBillType, - RealCode = default, - ReMark = pubSeDetail.Remark, + TableName = syncTableName, + Position = syncPosition }; - //await _vmiService.Out(VmiLogType.Type400, pubSeDetail.DnBillNum, vmiLog).ConfigureAwait(false); + _settleAccountDbContext.Add(syncPositionFlag); } + await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); + await SaveVmiLogsAsync(seDetails).ConfigureAwait(false); + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); + } + catch (Exception) + { + await transaction.RollbackAsync().ConfigureAwait(false); + throw; } } } /// - /// 添加零件关系 + /// 保存寄售库Log /// - public async Task AddNewMaterialRelationships(IEnumerable materialRelationships) + private async Task SaveVmiLogsAsync(List seDetails) { - //新客户零件号和厂内零件号 - var noHaveLuRePartCodes = from item1 in materialRelationships - join item2 in _settleAccountDbContext.Set() - on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode } - into temp - from item3 in temp.DefaultIfEmpty() - where item3 == null - select item1; + var deliverSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.发货); + var returnSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.退货); + var dateTimeNow = DateTime.Now; - if (noHaveLuRePartCodes.Any()) + var vmiLogList = deliverSeDetails.Select(t => new VmiLog(Guid.NewGuid()) { - await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false); - } + LogType = VmiLogType.Type100, + ChangedQty = t.Qty, + ChangedType = VmiType.In, + ChangedBy = "WMS", + ChangedNumber = t.PN, + ChangedTime = dateTimeNow, + AssembleData = t.AssembleData, + BillTime = t.BillTime, + CustPartCode = t.CustPartCode, + DeliverBillType = t.DeliverBillType, + DeliverSubBillType = t.DeliverSubBillType, + ErpToLoc = t.ToErpLocCode, + OrderNum = t.DnBillNum, + Qty = t.Qty, + ReMark = t.Remark, + RealCode = t.PartCode + }).ToList(); + var returnVmiLogList = returnSeDetails.Select(t => new VmiLog(Guid.NewGuid()) + { + LogType = VmiLogType.Type400, + ChangedQty = t.Qty, + ChangedType = VmiType.In, + ChangedBy = "WMS", + ChangedNumber = t.PN, + ChangedTime = dateTimeNow, + AssembleData = t.AssembleData, + BillTime = t.BillTime, + CustPartCode = t.CustPartCode, + DeliverBillType = t.DeliverBillType, + DeliverSubBillType = t.DeliverSubBillType, + ErpToLoc = t.ToErpLocCode, + OrderNum = t.DnBillNum, + Qty = -t.Qty, + ReMark = t.Remark, + RealCode = t.PartCode + }).ToList(); + vmiLogList.AddRange(returnVmiLogList); + await SaveVmiMessagesAsync(vmiLogList).ConfigureAwait(false); + await _settleAccountDbContext.BulkInsertAsync(vmiLogList).ConfigureAwait(false); + } + + /// + /// 保存寄售库Message + /// + public async Task SaveVmiMessagesAsync(List vmiLogs) + { + var vmiMessages = vmiLogs.Select(t => new VmiMessage(Guid.NewGuid()) + { + Message = JsonConvert.SerializeObject(t) + }).ToList(); + await _settleAccountDbContext.BulkInsertAsync(vmiMessages).ConfigureAwait(false); } + #endregion } 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 04fa087b..2ddb2bbb 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 @@ -3,11 +3,8 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using SettleAccount.Domain.BQ; -using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; @@ -21,14 +18,7 @@ public class YinDuSeSyncAppService : JitSeSyncAppService, IJobService /// /// 构造 /// - public YinDuSeSyncAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - INormalEfCoreRepository syncPositionFlagRepository, - INormalEfCoreRepository pubSeDetailRepository, - MaterialRelationshipManager materialRelationshipManager, - VmiAppService vmiService - ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) + public YinDuSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext) : base(wmsBJBMPTContext, settleAccountDbContext) { base.SeSyncConfigInfo = new SeSyncConfig() { 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 fb846ff9..17d355e0 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 @@ -3,12 +3,8 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using SettleAccount.Domain.BQ; -using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -using Win.Sfs.SettleAccount.MaterialRelationships; -using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; @@ -22,14 +18,7 @@ public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService, IJobService /// /// 构造 /// - public ZhiGongBBACSeSyncAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - INormalEfCoreRepository syncPositionFlagRepository, - INormalEfCoreRepository pubSeDetailRepository, - MaterialRelationshipManager materialRelationshipManager, - VmiAppService vmiService - ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) + public ZhiGongBBACSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext) : base(wmsBJBMPTContext, settleAccountDbContext) { base.SeSyncConfigInfo = new SeSyncConfig() { @@ -46,6 +35,6 @@ public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService, IJobService [HttpPost] public async Task Invoke(IServiceProvider serviceProvider) { - await this.Invoke(); + await this.Invoke().ConfigureAwait(false); } } 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 970d031b..3dfb6e9c 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,18 +1,10 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using SettleAccount.Domain.BQ; -using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; -using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.EntityFrameworkCore; -using Win.Sfs.SettleAccount.MaterialRelationships; -using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; @@ -26,15 +18,7 @@ public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService /// /// 构造 /// - public ZhiGongHBPOSeSyncAppService( - IHost host, - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - INormalEfCoreRepository syncPositionFlagRepository, - INormalEfCoreRepository pubSeDetailRepository, - MaterialRelationshipManager materialRelationshipManager, - VmiAppService vmiService - ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) + public ZhiGongHBPOSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext) : base(wmsBJBMPTContext, settleAccountDbContext) { base.SeSyncConfigInfo = new SeSyncConfig() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Options/SeConfigOptions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Options/SeConfigOptions.cs new file mode 100644 index 00000000..30388ff1 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Options/SeConfigOptions.cs @@ -0,0 +1,8 @@ +namespace Win.Sfs.SettleAccount.Options; + +/// +/// 发运配置选项 +/// +public class SeConfigOptions +{ +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs index 2f4d5970..9c6dff17 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs @@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; /// -/// Jit(非Jis +/// Jit(非Jis) /// public class TM_BJBMPT_OTHER_RECORD { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/Bom.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/Bom.cs index 8ab5cc58..558afe84 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/Bom.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/Bom.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared.DomainBase; @@ -83,7 +83,7 @@ namespace Win.Sfs.SettleAccount.Boms - protected Bom() + public Bom() { } @@ -159,4 +159,4 @@ namespace Win.Sfs.SettleAccount.Boms Enabled = enabled; } } -} \ No newline at end of file +}