|
@ -14,7 +14,7 @@ namespace WY.NewJit.MsgCheck |
|
|
public class BillNumberRecordDomainService : DomainService |
|
|
public class BillNumberRecordDomainService : DomainService |
|
|
{ |
|
|
{ |
|
|
private readonly IRepository<BillNumberRecord, Guid> _billNumberRepository; |
|
|
private readonly IRepository<BillNumberRecord, Guid> _billNumberRepository; |
|
|
// private readonly IRepository<WaitPrint, Guid> _waitPrintRepository;
|
|
|
private readonly IRepository<WaitPrint, Guid> _waitPrintRepository; |
|
|
private ILogger<M100CheckDomainService> _logger; |
|
|
private ILogger<M100CheckDomainService> _logger; |
|
|
private readonly LogRemindDomainService _logRemindDomainService; |
|
|
private readonly LogRemindDomainService _logRemindDomainService; |
|
|
public static List<BillNumberRecord> _billNumberRecordCaches= new List<BillNumberRecord>() ; |
|
|
public static List<BillNumberRecord> _billNumberRecordCaches= new List<BillNumberRecord>() ; |
|
@ -22,11 +22,13 @@ namespace WY.NewJit.MsgCheck |
|
|
public BillNumberRecordDomainService( |
|
|
public BillNumberRecordDomainService( |
|
|
IRepository<BillNumberRecord, Guid> billNumberRepository, |
|
|
IRepository<BillNumberRecord, Guid> billNumberRepository, |
|
|
ILogger<M100CheckDomainService> logger, |
|
|
ILogger<M100CheckDomainService> logger, |
|
|
LogRemindDomainService logRemindDomainService) |
|
|
LogRemindDomainService logRemindDomainService, |
|
|
|
|
|
IRepository<WaitPrint, Guid> waitPrintRepository) |
|
|
{ |
|
|
{ |
|
|
_billNumberRepository = billNumberRepository; |
|
|
_billNumberRepository = billNumberRepository; |
|
|
_logger = logger; |
|
|
_logger = logger; |
|
|
_logRemindDomainService = logRemindDomainService; |
|
|
_logRemindDomainService = logRemindDomainService; |
|
|
|
|
|
_waitPrintRepository = waitPrintRepository; |
|
|
} |
|
|
} |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 清空缓存
|
|
|
/// 清空缓存
|
|
@ -36,8 +38,9 @@ namespace WY.NewJit.MsgCheck |
|
|
_billNumberRecordCaches.Clear(); |
|
|
_billNumberRecordCaches.Clear(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async Task<List<BillNumberRecord>> GetOrUpDateBillNumberRecordCache(bool isupdate) |
|
|
public async Task<ObjectResultDto> GetOrUpDateBillNumberRecordCache(bool isupdate) |
|
|
{ |
|
|
{ |
|
|
|
|
|
ObjectResultDto ret = new ObjectResultDto(true, null); |
|
|
if (isupdate) |
|
|
if (isupdate) |
|
|
{ |
|
|
{ |
|
|
await _billNumberRepository.UpdateManyAsync(_billNumberRecordCaches); |
|
|
await _billNumberRepository.UpdateManyAsync(_billNumberRecordCaches); |
|
@ -45,13 +48,22 @@ namespace WY.NewJit.MsgCheck |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
_billNumberRecordCaches = await _billNumberRepository.GetListAsync(); |
|
|
_billNumberRecordCaches = await _billNumberRepository.GetListAsync(); |
|
|
//foreach (var item in _billNumberRecordCaches)
|
|
|
foreach (var item in _billNumberRecordCaches) |
|
|
//{
|
|
|
{ |
|
|
// var iii=await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine);
|
|
|
var list = await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine); |
|
|
// var ss= iii.Select(r => r.HostSN2).Max();
|
|
|
if (list.Count > 0) |
|
|
//}
|
|
|
{ |
|
|
|
|
|
var max = list.Select(r => r.HostSN2).Max(); |
|
|
|
|
|
if(item.RecordNumber!= max) |
|
|
|
|
|
{ |
|
|
|
|
|
ret.Status = false; |
|
|
|
|
|
ret.Message = "获取记录缓存错误!"; |
|
|
|
|
|
_logger.LogDebug("获取记录缓存错误!"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
return _billNumberRecordCaches; |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return ret; |
|
|
} |
|
|
} |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 解析号码
|
|
|
/// 解析号码
|
|
@ -143,5 +155,6 @@ namespace WY.NewJit.MsgCheck |
|
|
item.HostSN2 = item.HostSN + item.Round; |
|
|
item.HostSN2 = item.HostSN + item.Round; |
|
|
return item; |
|
|
return item; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|