diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs index c37e759..50ecaa8 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs @@ -167,7 +167,7 @@ namespace WY.NewJit.PrintTable /// /// /// - public async Task> GetEntityListAsync(string tableName, string where, string orderFieldName, int pageSize, int pageIndex) + private async Task> GetEntityListAsync(string tableName, string where, string orderFieldName, int pageSize, int pageIndex) { int skipNum = (pageIndex - 1) * pageSize; int takeNum = pageSize; @@ -176,7 +176,7 @@ namespace WY.NewJit.PrintTable return ret; } - public async Task> GetEntityListFromToAsync(string tableName, string where, string orderFieldName, int skipNum, int takeNum) + private async Task> GetEntityListFromToAsync(string tableName, string where, string orderFieldName, int skipNum, int takeNum) { string sql = $"select * from {tableName} where 1=1 {where} order by {orderFieldName} offset {skipNum} rows fetch next {takeNum} rows only"; var ret = await _newJitDapperRepository.GetListBySqlAsync(sql); diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs index 5b7bfc1..9781ce5 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs @@ -59,20 +59,20 @@ namespace WY.NewJit.MsgCheck { _billNumberRecordCaches.Clear(); _billNumberRecordCaches = await _billNumberRepository.GetListAsync(); - foreach (var item in _billNumberRecordCaches) - { - var list = await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine); - if (list.Count > 0) - { - var max = list.Select(r => r.HostSN2).Max(); - if(item.RecordNumber!= max) - { - ret.Status = false; - ret.Message = "获取记录缓存错误!"; - _logger.LogDebug("获取记录缓存错误!"); - } - } - } + //foreach (var item in _billNumberRecordCaches) + //{ + // var list = await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine); + // if (list.Count > 0) + // { + // var max = list.Select(r => r.HostSN2).Max(); + // if(item.RecordNumber!= max) + // { + // ret.Status = false; + // ret.Message = "获取记录缓存错误!"; + // _logger.LogDebug("获取记录缓存错误!"); + // } + // } + //} } return ret; } diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/Messages/MsgTransmissionService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/Messages/MsgTransmissionService.cs index 960086d..4c86adf 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/Messages/MsgTransmissionService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/Messages/MsgTransmissionService.cs @@ -119,6 +119,8 @@ namespace WY.NewJit.Job.ConsoleApp.Messages /// 跨进程全局配置领域服务 /// private readonly GlobalSettingsDomainService _globalSettingsDomainService; + + private readonly BillNumberRecordDomainService _billNumRecDomainSrv; #endregion #region 缓存 @@ -232,7 +234,8 @@ namespace WY.NewJit.Job.ConsoleApp.Messages DicDomainService dicDomainService, IGuidGenerator guidGenerator, GlobalSettingsDomainService globalSettingsDomainService, - IRepository messageReceiveArchiveRepository + IRepository messageReceiveArchiveRepository, + BillNumberRecordDomainService billNumRecDomainSrv //CacheManagerDomainService cacheManagerDomainService ) { @@ -255,6 +258,7 @@ namespace WY.NewJit.Job.ConsoleApp.Messages _globalSettingsDomainService = globalSettingsDomainService; _messageReceiveArchiveRepository = messageReceiveArchiveRepository; //_cacheManagerDomainService = cacheManagerDomainService; + _billNumRecDomainSrv = billNumRecDomainSrv; } #endregion @@ -274,6 +278,8 @@ namespace WY.NewJit.Job.ConsoleApp.Messages string fileName = ""; try { + //_billNumRecDomainSrv.CleanBillNumberRecordCache(); + _billNumRecDomainSrv.GetOrUpDateBillNumberRecordCache(false).GetAwaiter().GetResult(); //PathConfigInfo cfgInfo = ReadConfig(); int countPerTime = _configuration["ConfigDic:TransferFileCountPerTime"].TryToInt() ?? 10; @@ -287,6 +293,7 @@ namespace WY.NewJit.Job.ConsoleApp.Messages fileName = msgReceiveObj.MessageFileName; ParseOneEdiFile(msgReceiveObj); } + _billNumRecDomainSrv.GetOrUpDateBillNumberRecordCache(true).GetAwaiter().GetResult(); } catch (Exception ex) {