|
@ -23,6 +23,7 @@ using WY.NewJit.EdiReceive.Interfaces; |
|
|
using WY.NewJit.EdiReceive.Services; |
|
|
using WY.NewJit.EdiReceive.Services; |
|
|
using WY.NewJit.EntityFrameworkCore; |
|
|
using WY.NewJit.EntityFrameworkCore; |
|
|
using WY.NewJit.MsgBaseData; |
|
|
using WY.NewJit.MsgBaseData; |
|
|
|
|
|
using WY.NewJit.MsgCheck; |
|
|
|
|
|
|
|
|
namespace WY.NewJit.EdiReceive |
|
|
namespace WY.NewJit.EdiReceive |
|
|
{ |
|
|
{ |
|
@ -61,6 +62,11 @@ namespace WY.NewJit.EdiReceive |
|
|
|
|
|
|
|
|
private readonly EdiParseDomainService _ediParseDomainService; |
|
|
private readonly EdiParseDomainService _ediParseDomainService; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 配置
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly Microsoft.Extensions.Configuration.IConfiguration _configuration; |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 错误信息前缀
|
|
|
/// 错误信息前缀
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
@ -84,7 +90,8 @@ namespace WY.NewJit.EdiReceive |
|
|
NewJitDapperRepository newJitDapperRepository, |
|
|
NewJitDapperRepository newJitDapperRepository, |
|
|
IBlobContainer<OurFileContainer> blobContainer, |
|
|
IBlobContainer<OurFileContainer> blobContainer, |
|
|
DicDomainService dicDomainService, |
|
|
DicDomainService dicDomainService, |
|
|
EdiParseDomainService ediParseDomainService) |
|
|
EdiParseDomainService ediParseDomainService, |
|
|
|
|
|
Microsoft.Extensions.Configuration.IConfiguration configuration) |
|
|
{ |
|
|
{ |
|
|
_importRecordRepository = importRecordRepository; |
|
|
_importRecordRepository = importRecordRepository; |
|
|
_logger = logger; |
|
|
_logger = logger; |
|
@ -92,6 +99,7 @@ namespace WY.NewJit.EdiReceive |
|
|
_blobContainer = blobContainer; |
|
|
_blobContainer = blobContainer; |
|
|
_dicDomainService = dicDomainService; |
|
|
_dicDomainService = dicDomainService; |
|
|
_ediParseDomainService = ediParseDomainService; |
|
|
_ediParseDomainService = ediParseDomainService; |
|
|
|
|
|
_configuration = configuration; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#region 私有方法
|
|
|
#region 私有方法
|
|
@ -485,6 +493,32 @@ namespace WY.NewJit.EdiReceive |
|
|
return ret; |
|
|
return ret; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 打印时间提醒
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[UnitOfWork] |
|
|
|
|
|
[HttpPost] |
|
|
|
|
|
[Route("print-timeout-remind")] |
|
|
|
|
|
public virtual async Task<TimeOutRemindResultDto> PrintTimeoutRemind(TimeOutRemindInputDto input) |
|
|
|
|
|
{ |
|
|
|
|
|
TimeOutRemindResultDto retObj = new TimeOutRemindResultDto(); |
|
|
|
|
|
retObj.ConfigMinutes = _configuration[$"ConfigDic:ProductLineTimeoutRemind_New:{"Record"}"].TryToInt() ?? 40; |
|
|
|
|
|
var qry = await _importRecordRepository.MaxAsync(itm => itm.CreateTime); |
|
|
|
|
|
retObj.LastReceiveTime = qry != null ? Convert.ToDateTime(qry) : ServerHelper.CurrentDateTime; |
|
|
|
|
|
retObj.TimeoutMinutes = MinuteDiff(retObj.LastReceiveTime, ServerHelper.CurrentDateTime); |
|
|
|
|
|
return retObj; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int MinuteDiff(DateTime beginTime, DateTime endTime) |
|
|
|
|
|
{ |
|
|
|
|
|
TimeSpan beginSpan = new TimeSpan(beginTime.Ticks); |
|
|
|
|
|
TimeSpan endSpan = new TimeSpan(endTime.Ticks); |
|
|
|
|
|
TimeSpan diffSpan = endSpan.Subtract(beginSpan).Duration(); |
|
|
|
|
|
return (int)(diffSpan.TotalMinutes); |
|
|
|
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|