diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs index c1bedb0..34239cc 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs @@ -192,13 +192,8 @@ namespace WY.NewJit.MsgCheck [UnitOfWork] [HttpPost] [Route("get-billnumber")] - public async Task GetBillNumber(int number, string productLine, bool t) + public async Task GetBillNumber(int number, string productLine) { - if (t) - { - _aaa.CleanBillNumberRecordCache(); - } - var res = await _aaa.GetBillNumber(number, productLine); return res; } 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 33ea011..c37e759 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 @@ -150,7 +150,7 @@ namespace WY.NewJit.PrintTable /// /// /// - public async Task GetEntityCountAsync(string tableName, string where) + private async Task GetEntityCountAsync(string tableName, string where) { string sql = $"select count(*) from {tableName} where 1=1 {where}"; var ret = await _newJitDapperRepository.GetSingleBySqlAsync(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 61dbe7f..5b7bfc1 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 @@ -32,13 +32,6 @@ namespace WY.NewJit.MsgCheck _waitPrintRepository = waitPrintRepository; } /// - /// 清空缓存 - /// - public void CleanBillNumberRecordCache() - { - _billNumberRecordCaches.Clear(); - } - /// /// 获取和更新记录和内存 /// /// @@ -49,9 +42,22 @@ namespace WY.NewJit.MsgCheck if (isupdate) { await _billNumberRepository.UpdateManyAsync(_billNumberRecordCaches); + foreach (var item in _billNumberRecordCaches) + { + var re = await _billNumberRepository.GetListAsync(r=>r.Id==item.Id); + if (re.Count == 0) + { + await _billNumberRepository.InsertAsync(item); + } + else + { + await _billNumberRepository.UpdateAsync(item); + } + } } else { + _billNumberRecordCaches.Clear(); _billNumberRecordCaches = await _billNumberRepository.GetListAsync(); foreach (var item in _billNumberRecordCaches) { @@ -86,7 +92,7 @@ namespace WY.NewJit.MsgCheck GuidGenerator.Create(), productLine, 1, - 0, + number, 0, DateTime.Now );