Browse Source

存储记录号方法修改

master
lvzb 1 year ago
parent
commit
e7f3de8550
  1. 7
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs
  2. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs
  3. 22
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs

7
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<BillNumberRecord> GetBillNumber(int number, string productLine, bool t)
public async Task<BillNumberRecord> GetBillNumber(int number, string productLine)
{
if (t)
{
_aaa.CleanBillNumberRecordCache();
}
var res = await _aaa.GetBillNumber(number, productLine);
return res;
}

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs

@ -150,7 +150,7 @@ namespace WY.NewJit.PrintTable
/// <param name="pageSize"></param>
/// <param name="pageIndex"></param>
/// <returns></returns>
public async Task<int> GetEntityCountAsync(string tableName, string where)
private async Task<int> GetEntityCountAsync(string tableName, string where)
{
string sql = $"select count(*) from {tableName} where 1=1 {where}";
var ret = await _newJitDapperRepository.GetSingleBySqlAsync<int>(sql);

22
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs

@ -32,13 +32,6 @@ namespace WY.NewJit.MsgCheck
_waitPrintRepository = waitPrintRepository;
}
/// <summary>
/// 清空缓存
/// </summary>
public void CleanBillNumberRecordCache()
{
_billNumberRecordCaches.Clear();
}
/// <summary>
/// 获取和更新记录和内存
/// </summary>
/// <param name="isupdate"></param>
@ -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
);

Loading…
Cancel
Save