Browse Source

产线超时提醒添加新方法

master
lvzb 1 year ago
parent
commit
961f43fb3d
  1. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Interfaces/IBillM100AppService.cs
  2. 82
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs
  3. 14
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Interfaces/IBillM100AppService.cs

@ -101,6 +101,8 @@ namespace WY.NewJit.MsgCheck
/// <returns>生产线超时情况</returns>
Task<ListResultDto<TimeOutRemindResultDto>> ProductLineTimeoutRemind(TimeOutRemindInputDto input);
Task<ListResultDto<TimeOutRemindResultDto>> ProductLineTimeoutRemind_New(TimeOutRemindInputDto input);
Task<PagedResultDto<ResultBillM100Dto>> GetReplenishPrintListAsync(QueryBillM100Dto input);

82
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs

@ -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);

14
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml

@ -973,7 +973,12 @@
柱护板缓存列表(打印柱护板时用到)
</summary>
</member>
<member name="M:WY.NewJit.MsgCheck.BillM100AppService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillM100,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillM100Part,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgCheck.BillM100AppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgVehicle,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.PartCfg,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.MaterialExt,System.Guid},WY.NewJit.EntityFrameworkCore.WMSDapperRepository,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.MenBanPackingRec,System.Guid},WY.NewJit.MsgBaseData.LineSNDomianService,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.ZhuHuBanPackingRec,System.Guid},WY.NewJit.Commons.SequenceDomainService,Microsoft.Extensions.Configuration.IConfiguration,Volo.Abp.Uow.IUnitOfWorkManager,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.WMS.FisTB_BILL_HIS},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.WMS.FisTS_SORT_DETAIL_HIS},WY.NewJit.MsgCheck.BillNumberRecordDomainService)">
<member name="F:WY.NewJit.MsgCheck.BillM100AppService._timeoutCacheList">
<summary>
超时提醒缓存
</summary>
</member>
<member name="M:WY.NewJit.MsgCheck.BillM100AppService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillM100,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillM100Part,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgCheck.BillM100AppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgVehicle,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.PartCfg,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.MaterialExt,System.Guid},WY.NewJit.EntityFrameworkCore.WMSDapperRepository,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.MenBanPackingRec,System.Guid},WY.NewJit.MsgBaseData.LineSNDomianService,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.ZhuHuBanPackingRec,System.Guid},WY.NewJit.Commons.SequenceDomainService,Microsoft.Extensions.Configuration.IConfiguration,Volo.Abp.Uow.IUnitOfWorkManager,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.WMS.FisTB_BILL_HIS},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.WMS.FisTS_SORT_DETAIL_HIS},WY.NewJit.MsgCheck.BillNumberRecordDomainService,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.PrintTable.WaitPrint})">
<summary>
构造函数
</summary>
@ -1081,6 +1086,13 @@
<param name="input">生产线编号列表</param>
<returns>生产线超时情况</returns>
</member>
<member name="M:WY.NewJit.MsgCheck.BillM100AppService.ProductLineTimeoutRemind_New(WY.NewJit.MsgCheck.TimeOutRemindInputDto)">
<summary>
生产线超时提醒(新)
</summary>
<param name="input">生产线编号列表</param>
<returns>生产线超时情况</returns>
</member>
<member name="M:WY.NewJit.MsgCheck.BillM100AppService.GetLastHostSNByPL(WY.NewJit.Extends.MenBanPrintInputDto)">
<summary>
保存柱护板装箱单报表

Loading…
Cancel
Save