|
|
@ -26,6 +26,7 @@ using System.Reflection; |
|
|
|
using WY.NewJit.Commons; |
|
|
|
using Volo.Abp; |
|
|
|
using System.Diagnostics; |
|
|
|
using WY.NewJit.PrintTable; |
|
|
|
|
|
|
|
namespace WY.NewJit.MsgCheck |
|
|
|
{ |
|
|
@ -116,6 +117,8 @@ namespace WY.NewJit.MsgCheck |
|
|
|
private readonly IRepository<FisTB_BILL_HIS> _tbBillHisRepository; |
|
|
|
private readonly IRepository<FisTS_SORT_DETAIL_HIS> _tsSortDetailHisRepository; |
|
|
|
|
|
|
|
private readonly IRepository<WaitPrint> _waitPrintRepository; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 错误信息前缀
|
|
|
|
/// </summary>
|
|
|
@ -134,6 +137,13 @@ namespace WY.NewJit.MsgCheck |
|
|
|
/// </summary>
|
|
|
|
private List<MaterialExt> _zhbCacheList = new List<MaterialExt>(); |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 缓存
|
|
|
|
/// <summary>
|
|
|
|
/// 超时提醒缓存
|
|
|
|
/// </summary>
|
|
|
|
private static List<TimeOutRemindResultDto> _timeoutCacheList = new List<TimeOutRemindResultDto>(); |
|
|
|
#endregion
|
|
|
|
private readonly BillNumberRecordDomainService _aaa; |
|
|
|
#region 构造函数
|
|
|
|
/// <summary>
|
|
|
@ -157,7 +167,8 @@ namespace WY.NewJit.MsgCheck |
|
|
|
IUnitOfWorkManager unitOfWorkManager, |
|
|
|
IRepository<FisTB_BILL_HIS> tbBillHisRepository, |
|
|
|
IRepository<FisTS_SORT_DETAIL_HIS> tsSortDetailHisRepository, |
|
|
|
BillNumberRecordDomainService aaa |
|
|
|
BillNumberRecordDomainService aaa, |
|
|
|
IRepository<WaitPrint> waitPrintRepository |
|
|
|
//IRepository<PrintTemplateConfiguration,Guid> printTemplateConfigurationRepository,
|
|
|
|
//IRepository<ZHBPrintStatus, Guid> zHBPrintStatusRepository
|
|
|
|
|
|
|
@ -182,6 +193,7 @@ namespace WY.NewJit.MsgCheck |
|
|
|
_tbBillHisRepository = tbBillHisRepository; |
|
|
|
_tsSortDetailHisRepository = tsSortDetailHisRepository; |
|
|
|
_aaa = aaa; |
|
|
|
_waitPrintRepository = waitPrintRepository; |
|
|
|
//_printTemplateConfigurationRepository = printTemplateConfigurationRepository;
|
|
|
|
//_zHBPrintStatusRepository = zHBPrintStatusRepository;
|
|
|
|
} |
|
|
@ -592,7 +604,7 @@ select * from |
|
|
|
ListResultDto<BillM100> ret = new ListResultDto<BillM100>(billLst); |
|
|
|
|
|
|
|
int printBillCnt = 0; |
|
|
|
if (input.PrintType == PrintTypeEnum.正常打印) |
|
|
|
if (input.PrintType == Extends.PaiGe.PrintTypeEnum.正常打印) |
|
|
|
{ |
|
|
|
if ((input.BeginHostSN % 10000) > 1999) |
|
|
|
{ |
|
|
@ -656,7 +668,7 @@ select * from |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (input.PrintType == PrintTypeEnum.补账打印) |
|
|
|
else if (input.PrintType == Extends.PaiGe.PrintTypeEnum.补账打印) |
|
|
|
{ |
|
|
|
//string beginVin = input.BeginVin.TryToRight(6);
|
|
|
|
//string endVin = input.EndVin.TryToRight(6);
|
|
|
@ -680,7 +692,7 @@ select * from |
|
|
|
} |
|
|
|
|
|
|
|
# region 断号处理
|
|
|
|
if (isFillBreakNum == true && billLst.Count > 1 && input.PrintType != PrintTypeEnum.补账打印) |
|
|
|
if (isFillBreakNum == true && billLst.Count > 1 && input.PrintType != Extends.PaiGe.PrintTypeEnum.补账打印) |
|
|
|
{ |
|
|
|
billLst = DoBreakNumOperation(input.BeginHostSN, input.EndHostSN, billLst); |
|
|
|
} |
|
|
@ -2169,6 +2181,68 @@ select * from |
|
|
|
return new ListResultDto<TimeOutRemindResultDto>(retLst); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 生产线超时提醒(新)
|
|
|
|
/// 先取未打印列表然后更新缓存列表,如果未打印列表为空取m100更新缓存列表
|
|
|
|
/// 当未打印列表没有数据,则取缓存列表返回
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input">生产线编号列表</param>
|
|
|
|
/// <returns>生产线超时情况</returns>
|
|
|
|
[UnitOfWork] |
|
|
|
[HttpPost] |
|
|
|
[Route("product-line-timeout-remind-new")] |
|
|
|
public virtual async Task<ListResultDto<TimeOutRemindResultDto>> ProductLineTimeoutRemind_New(TimeOutRemindInputDto input) |
|
|
|
{ |
|
|
|
List<TimeOutRemindResultDto> retLst = new List<TimeOutRemindResultDto>(); |
|
|
|
foreach (string plStr in input.ProductLineList) |
|
|
|
{ |
|
|
|
TimeOutRemindResultDto retObj = new TimeOutRemindResultDto(); |
|
|
|
retObj.ProductLine = plStr; |
|
|
|
retObj.ConfigMinutes = _configuration[$"ConfigDic:ProductLineTimeoutRemind_New:{plStr}"].TryToInt() ?? 30; |
|
|
|
|
|
|
|
int maxSN2= await _waitPrintRepository.Where(itm => itm.ProductLine == plStr).MaxAsync(itm => itm.HostSN2); |
|
|
|
WaitPrint lastitem = await _waitPrintRepository.FirstOrDefaultAsync(itm => itm.ProductLine == plStr && itm.HostSN2 == maxSN2); |
|
|
|
var cache = _timeoutCacheList.FirstOrDefault(itm => itm.ProductLine == plStr); |
|
|
|
if (lastitem != null) |
|
|
|
{ |
|
|
|
retObj.LastReceiveTime = lastitem.ReceiveTime ?? ServerHelper.CurrentDateTime; |
|
|
|
retObj.TimeoutMinutes = MinuteDiff(retObj.LastReceiveTime, ServerHelper.CurrentDateTime); |
|
|
|
if (cache != null) |
|
|
|
{ |
|
|
|
cache.ConfigMinutes = retObj.ConfigMinutes; |
|
|
|
cache.LastReceiveTime = retObj.LastReceiveTime; |
|
|
|
cache.TimeoutMinutes = retObj.TimeoutMinutes; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_timeoutCacheList.Add(retObj); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (cache != null) |
|
|
|
{ |
|
|
|
retObj.LastReceiveTime = cache.LastReceiveTime; |
|
|
|
retObj.TimeoutMinutes = MinuteDiff(cache.LastReceiveTime, ServerHelper.CurrentDateTime); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
string maxSNStr = await _billM100Repository.Where(itm => itm.ProductLine == plStr).MaxAsync(itm => itm.SerialNumStr); |
|
|
|
BillM100 lastBill = await _billM100Repository.FirstOrDefaultAsync(itm => itm.ProductLine == plStr && itm.SerialNumStr == maxSNStr); |
|
|
|
if (lastBill != null) |
|
|
|
{ |
|
|
|
retObj.LastReceiveTime = lastBill.ReceiveTime ?? ServerHelper.CurrentDateTime; |
|
|
|
retObj.TimeoutMinutes = MinuteDiff(retObj.LastReceiveTime, ServerHelper.CurrentDateTime); |
|
|
|
} |
|
|
|
_timeoutCacheList.Add(retObj); |
|
|
|
} |
|
|
|
} |
|
|
|
retLst.Add(retObj); |
|
|
|
} |
|
|
|
return new ListResultDto<TimeOutRemindResultDto>(retLst); |
|
|
|
} |
|
|
|
|
|
|
|
private int MinuteDiff(DateTime beginTime, DateTime endTime) |
|
|
|
{ |
|
|
|
TimeSpan beginSpan = new TimeSpan(beginTime.Ticks); |
|
|
|