|
|
@ -14,7 +14,7 @@ namespace WY.NewJit.MsgCheck |
|
|
|
public class BillNumberRecordDomainService : DomainService |
|
|
|
{ |
|
|
|
private readonly IRepository<BillNumberRecord, Guid> _billNumberRepository; |
|
|
|
// private readonly IRepository<WaitPrint, Guid> _waitPrintRepository;
|
|
|
|
private readonly IRepository<WaitPrint, Guid> _waitPrintRepository; |
|
|
|
private ILogger<M100CheckDomainService> _logger; |
|
|
|
private readonly LogRemindDomainService _logRemindDomainService; |
|
|
|
public static List<BillNumberRecord> _billNumberRecordCaches= new List<BillNumberRecord>() ; |
|
|
@ -22,11 +22,13 @@ namespace WY.NewJit.MsgCheck |
|
|
|
public BillNumberRecordDomainService( |
|
|
|
IRepository<BillNumberRecord, Guid> billNumberRepository, |
|
|
|
ILogger<M100CheckDomainService> logger, |
|
|
|
LogRemindDomainService logRemindDomainService) |
|
|
|
LogRemindDomainService logRemindDomainService, |
|
|
|
IRepository<WaitPrint, Guid> waitPrintRepository) |
|
|
|
{ |
|
|
|
_billNumberRepository = billNumberRepository; |
|
|
|
_logger = logger; |
|
|
|
_logRemindDomainService = logRemindDomainService; |
|
|
|
_waitPrintRepository = waitPrintRepository; |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 清空缓存
|
|
|
@ -36,8 +38,9 @@ namespace WY.NewJit.MsgCheck |
|
|
|
_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) |
|
|
|
{ |
|
|
|
await _billNumberRepository.UpdateManyAsync(_billNumberRecordCaches); |
|
|
@ -45,13 +48,22 @@ namespace WY.NewJit.MsgCheck |
|
|
|
else |
|
|
|
{ |
|
|
|
_billNumberRecordCaches = await _billNumberRepository.GetListAsync(); |
|
|
|
//foreach (var item in _billNumberRecordCaches)
|
|
|
|
//{
|
|
|
|
// var iii=await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine);
|
|
|
|
// var ss= iii.Select(r => r.HostSN2).Max();
|
|
|
|
//}
|
|
|
|
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 _billNumberRecordCaches; |
|
|
|
} |
|
|
|
} |
|
|
|
return ret; |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 解析号码
|
|
|
@ -143,5 +155,6 @@ namespace WY.NewJit.MsgCheck |
|
|
|
item.HostSN2 = item.HostSN + item.Round; |
|
|
|
return item; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|