Browse Source

增加接口控制

dev_DY_CC
lvzb 10 months ago
parent
commit
d39b50bb7f
  1. 21
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/EosOutgoingBackgroundWorker.cs
  2. 31
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs
  3. 197
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
  4. 21
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Outgoing/MesOutgoingBackgroundWorker.cs
  5. 21
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs
  6. 21
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
  7. 37
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
  8. 4
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs
  9. 4
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs
  10. 7
      build/src/docker/publish/conf/settings/appsettings.Development.json

21
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/EosOutgoingBackgroundWorker.cs

@ -5,6 +5,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers; using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win_in.Sfs.Wms.DataExchange.Domain;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
@ -29,10 +30,24 @@ public class EosOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{ {
Logger.LogInformation($"开始: 执行 {Outgoing}"); Logger.LogInformation($"开始: 执行 {Outgoing}");
if (!_options.Value.IncomingOptions.Active)
var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
var confitem = await configManager.GetInterfaceConfig("EOS-OUT").ConfigureAwait(false);
if (confitem == null)
{
if (!_options.Value.OutgoingOptions.Active)
{
Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
return;
}
}
else
{ {
Logger.LogInformation($"{Outgoing} 已关闭没有执行!"); if (!confitem.Active)
return; {
Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
return;
}
} }
Logger.LogInformation($"传出 采购上架单"); Logger.LogInformation($"传出 采购上架单");

31
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs

@ -6,6 +6,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers; using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming; using Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -13,7 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class InjectionMoldingTaskIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase public class InjectionMoldingTaskIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
{ {
private readonly string Incoming = "InjectionMoldingTask Incoming"; private readonly string Incoming = "视觉接收";
private readonly IOptions<InjectionMoldingTaskOptions> _options; private readonly IOptions<InjectionMoldingTaskOptions> _options;
@ -32,30 +33,36 @@ public class InjectionMoldingTaskIncomingBackgroundWorker : AsyncPeriodicBackgro
_options.Value.AutoRemote.Interval = 2; _options.Value.AutoRemote.Interval = 2;
#endif #endif
Timer.Period = options.Value.AutoRemote.TimeCycle * 60 * 1000; //default 10 minutes Timer.Period = options.Value.AutoRemote.TimeCycle * 60 * 1000; //default 10 minutes
} }
[UnitOfWork] [UnitOfWork]
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{ {
Logger.LogInformation($"Starting: Handling {Incoming}"); Logger.LogInformation($"开始: 执行 {Incoming}");
if (!_options.Value.IncomingOptions.Active) var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
var confitem = await configManager.GetInterfaceConfig("SJ-IN").ConfigureAwait(false);
if (confitem == null)
{ {
Logger.LogInformation($"{Incoming} is not active!"); if (!_options.Value.IncomingOptions.Active)
return; {
Logger.LogInformation($"{Incoming} 已关闭没有执行!");
return;
}
} }
int min = DateTime.Now.Hour*60+ DateTime.Now.Minute;//第二天00:05:00与当天23:55:00不执行避免tyrpnumber重复 else
if ( (24*60-5)<= min || min <= 5)
{ {
Logger.LogInformation($"{Incoming} 时间小于第二天00:05:00大于当天23:55:00"); if (!confitem.Active)
return; {
Logger.LogInformation($"{Incoming} 已关闭没有执行!");
return;
}
} }
Logger.LogInformation($"注塑任务");//缴库 Logger.LogInformation($"注塑任务");//缴库
var reader = workerContext.ServiceProvider.GetService<InjectionMoldingRequestReader>(); var reader = workerContext.ServiceProvider.GetService<InjectionMoldingRequestReader>();
await reader.ReadAsync().ConfigureAwait(false); await reader.ReadAsync().ConfigureAwait(false);
Logger.LogInformation($"Completed: Handling {Incoming}"); Logger.LogInformation($"提交: 执行 {Incoming}");
} }
} }

197
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs

@ -7,6 +7,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers; using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
@ -32,12 +33,27 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{ {
Logger.LogInformation($"开始: 执行 {Incoming}"); Logger.LogInformation($"开始: 执行 {Incoming}");
if (!_options.Value.IncomingOptions.Active)
var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
var confitem = await configManager.GetInterfaceConfig("MES-IN").ConfigureAwait(false);
if (confitem == null)
{ {
Logger.LogInformation($"{Incoming} 已关闭没有执行!"); if (!_options.Value.IncomingOptions.Active)
return; {
Logger.LogInformation($"{Incoming} 已关闭没有执行!");
return;
}
}
else
{
if (!confitem.Active)
{
Logger.LogInformation($"{Incoming} 已关闭没有执行!");
return;
}
} }
int min = DateTime.Now.Hour*60+ DateTime.Now.Minute;//第二天00:05:00与当天23:55:00不执行避免tyrpnumber重复 int min = DateTime.Now.Hour*60+ DateTime.Now.Minute;//第二天00:05:00与当天23:55:00不执行避免tyrpnumber重复
if ( (24*60-5)<= min || min <= 5) if ( (24*60-5)<= min || min <= 5)
{ {
@ -45,94 +61,93 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
return; return;
} }
//#region 缴库 MesOut #region 缴库 MesOut
//Logger.LogInformation($"读取缴库(MesOut)");//缴库 Logger.LogInformation($"读取缴库(MesOut)");//缴库
//var mesOutReader = workerContext.ServiceProvider.GetRequiredService<MesOutReader>(); var mesOutReader = workerContext.ServiceProvider.GetRequiredService<MesOutReader>();
//var mesOutConverter = workerContext.ServiceProvider.GetRequiredService<MesOutConverter>(); var mesOutConverter = workerContext.ServiceProvider.GetRequiredService<MesOutConverter>();
//var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService<QtyrfeConverter>(); var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService<QtyrfeConverter>();
////读取mes缴库 //读取mes缴库
//var mesOutsFromExternalList = await mesOutReader.ReadAsync().ConfigureAwait(false); var mesOutsFromExternalList = await mesOutReader.ReadAsync().ConfigureAwait(false);
//var mesOutsFromExternalList_ProductReceipt = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.ProductReceipt.ToString()).ToList(); var mesOutsFromExternalList_ProductReceipt = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.ProductReceipt.ToString()).ToList();
//var mesOutsFromExternalList_TransferNote = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.TransferNote.ToString()).ToList(); var mesOutsFromExternalList_TransferNote = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.TransferNote.ToString()).ToList();
////转换缴库数据(如果有质量补得数据直接生产移库数据移到客户库位) //转换缴库数据(如果有质量补得数据直接生产移库数据移到客户库位)
//await mesOutConverter.ConvertAsync(mesOutsFromExternalList_ProductReceipt).ConfigureAwait(false); await mesOutConverter.ConvertAsync(mesOutsFromExternalList_ProductReceipt).ConfigureAwait(false);
//if (mesOutsFromExternalList_TransferNote.Count > 0)//如果有质量补则生产储位调拨任务 if (mesOutsFromExternalList_TransferNote.Count > 0)//如果有质量补则生产储位调拨任务
//{ {
// await TransferNoteConverter.ConvertAsync(mesOutsFromExternalList_TransferNote).ConfigureAwait(false); await TransferNoteConverter.ConvertAsync(mesOutsFromExternalList_TransferNote).ConfigureAwait(false);
//} }
//Logger.LogInformation($"处理完工收货(缴库)【{mesOutsFromExternalList_ProductReceipt.Count}】条数据"); Logger.LogInformation($"处理完工收货(缴库)【{mesOutsFromExternalList_ProductReceipt.Count}】条数据");
//Logger.LogInformation($"处理储位调拨【{mesOutsFromExternalList_TransferNote.Count}】条数据"); Logger.LogInformation($"处理储位调拨【{mesOutsFromExternalList_TransferNote.Count}】条数据");
//#endregion #endregion
//#region 冻结解冻 Frozen #region 冻结解冻 Frozen
//Logger.LogInformation($"读取冻结解冻 (Frozen)");//冻结解冻 Logger.LogInformation($"读取冻结解冻 (Frozen)");//冻结解冻
//var FrozenReader = workerContext.ServiceProvider.GetRequiredService<FrozenReader>(); var FrozenReader = workerContext.ServiceProvider.GetRequiredService<FrozenReader>();
//var FrozenConverter = workerContext.ServiceProvider.GetRequiredService<FrozenConverter>(); var FrozenConverter = workerContext.ServiceProvider.GetRequiredService<FrozenConverter>();
////读取并保存Frozen //读取并保存Frozen
//var mesNoteFromExternalList = await FrozenReader.ReadAsync().ConfigureAwait(false); var mesNoteFromExternalList = await FrozenReader.ReadAsync().ConfigureAwait(false);
////转换Frozen //转换Frozen
//await FrozenConverter.ConvertAsync(mesNoteFromExternalList).ConfigureAwait(false); await FrozenConverter.ConvertAsync(mesNoteFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"处理冻结解冻【{mesNoteFromExternalList.Count}】条数据"); Logger.LogInformation($"处理冻结解冻【{mesNoteFromExternalList.Count}】条数据");
//#endregion #endregion
//#region 报废 Scrap #region 报废 Scrap
//Logger.LogInformation($"读取报废(Scrap)");//报废 Logger.LogInformation($"读取报废(Scrap)");//报废
//var scrapReader = workerContext.ServiceProvider.GetRequiredService<ScrapReader>(); var scrapReader = workerContext.ServiceProvider.GetRequiredService<ScrapReader>();
//var scrapConverter = workerContext.ServiceProvider.GetRequiredService<ScrapConverter>(); var scrapConverter = workerContext.ServiceProvider.GetRequiredService<ScrapConverter>();
////读取并保存Scrap //读取并保存Scrap
//var scrapsFromExternalList = await scrapReader.ReadAsync().ConfigureAwait(false); var scrapsFromExternalList = await scrapReader.ReadAsync().ConfigureAwait(false);
////转换Scrap //转换Scrap
//await scrapConverter.ConvertAsync(scrapsFromExternalList).ConfigureAwait(false); await scrapConverter.ConvertAsync(scrapsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"处理报废【{scrapsFromExternalList.Count}】条数据"); Logger.LogInformation($"处理报废【{scrapsFromExternalList.Count}】条数据");
//#endregion #endregion
//#region 耗用单 BackFlush #region 耗用单 BackFlush
//Logger.LogInformation($"读取耗用单 (BackFlush)");//耗用单 Logger.LogInformation($"读取耗用单 (BackFlush)");//耗用单
//var BackFlushReader = workerContext.ServiceProvider.GetRequiredService<BackFluReader>(); var BackFlushReader = workerContext.ServiceProvider.GetRequiredService<BackFluReader>();
//var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService<BackFluConverter>(); var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService<BackFluConverter>();
////读取并保存BackFlush //读取并保存BackFlush
//var backFlushsFromExternalList = await BackFlushReader.ReadAsync().ConfigureAwait(false); var backFlushsFromExternalList = await BackFlushReader.ReadAsync().ConfigureAwait(false);
////转换BackFlush //转换BackFlush
//await BackFlushConverter.ConvertAsync(backFlushsFromExternalList).ConfigureAwait(false); await BackFlushConverter.ConvertAsync(backFlushsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"处理耗用单【{backFlushsFromExternalList.Count}】条数据"); Logger.LogInformation($"处理耗用单【{backFlushsFromExternalList.Count}】条数据");
//#endregion #endregion
//#region 储位调拨 TransferNote #region 储位调拨 TransferNote
//Logger.LogInformation($"读取储位调拨 (TransferNote)");//储位调拨 Logger.LogInformation($"读取储位调拨 (TransferNote)");//储位调拨
//var TransferNoteReader = workerContext.ServiceProvider.GetRequiredService<QtyrfeReader>(); var TransferNoteReader = workerContext.ServiceProvider.GetRequiredService<QtyrfeReader>();
//// var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService<QtyrfeConverter>(); //读取并保存TransferNote
////读取并保存TransferNote var transferNoteFromExternalList = await TransferNoteReader.ReadAsync().ConfigureAwait(false);
//var transferNoteFromExternalList = await TransferNoteReader.ReadAsync().ConfigureAwait(false); //转换TransferNote
////转换TransferNote await TransferNoteConverter.ConvertAsync(transferNoteFromExternalList).ConfigureAwait(false);
//await TransferNoteConverter.ConvertAsync(transferNoteFromExternalList).ConfigureAwait(false); Logger.LogInformation($"处理储位调拨【{transferNoteFromExternalList.Count}】条数据");
//Logger.LogInformation($"处理储位调拨【{transferNoteFromExternalList.Count}】条数据"); #endregion
//#endregion
#region 成品发运 Delivery
//#region 成品发运 Delivery Logger.LogInformation($"读取成品发运 (Delivery)");//成品发运
//Logger.LogInformation($"读取成品发运 (Delivery)");//成品发运 var DeliveryReader = workerContext.ServiceProvider.GetRequiredService<DeliveryReader>();
//var DeliveryReader = workerContext.ServiceProvider.GetRequiredService<DeliveryReader>(); var DeliveryConverter = workerContext.ServiceProvider.GetRequiredService<DeliveryConverter>();
//var DeliveryConverter = workerContext.ServiceProvider.GetRequiredService<DeliveryConverter>(); //读取并保存Delivery
////读取并保存Delivery var deliveryNoteFromExternalList = await DeliveryReader.ReadAsync().ConfigureAwait(false);
//var deliveryNoteFromExternalList = await DeliveryReader.ReadAsync().ConfigureAwait(false); //转换Delivery
////转换Delivery await DeliveryConverter.ConvertAsync(deliveryNoteFromExternalList).ConfigureAwait(false);
//await DeliveryConverter.ConvertAsync(deliveryNoteFromExternalList).ConfigureAwait(false); Logger.LogInformation($"处理成品发运【{deliveryNoteFromExternalList.Count}】条数据");
//Logger.LogInformation($"处理成品发运【{deliveryNoteFromExternalList.Count}】条数据"); #endregion
//#endregion
#region 自动叫料 CallMtl
//#region 自动叫料 CallMtl
Logger.LogInformation($"读取自动叫料 (CallMtl)");//自动叫料
//Logger.LogInformation($"读取自动叫料 (CallMtl)");//自动叫料 var CallMtlReader = workerContext.ServiceProvider.GetRequiredService<CallMtlReader>();
//var CallMtlReader = workerContext.ServiceProvider.GetRequiredService<CallMtlReader>(); var CallMtlConverter = workerContext.ServiceProvider.GetRequiredService<CallMtlConverter>();
//var CallMtlConverter = workerContext.ServiceProvider.GetRequiredService<CallMtlConverter>(); //读取并保存Delivery
////读取并保存Delivery var callMtlFromExternalList = await CallMtlReader.ReadAsync().ConfigureAwait(false);
//var callMtlFromExternalList = await CallMtlReader.ReadAsync().ConfigureAwait(false); //转换Delivery
////转换Delivery await CallMtlConverter.ConvertAsync(callMtlFromExternalList).ConfigureAwait(false);
//await CallMtlConverter.ConvertAsync(callMtlFromExternalList).ConfigureAwait(false); Logger.LogInformation($"处理自动叫料【{callMtlFromExternalList.Count}】条数据");
//Logger.LogInformation($"处理自动叫料【{callMtlFromExternalList.Count}】条数据"); #endregion
//#endregion
#region 底盘 Chassis #region 底盘 Chassis

21
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Outgoing/MesOutgoingBackgroundWorker.cs

@ -5,6 +5,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers; using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Outgoing; using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Outgoing;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
@ -30,10 +31,24 @@ public class MesOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{ {
Logger.LogInformation($"Starting: Handling {Outgoing}"); Logger.LogInformation($"Starting: Handling {Outgoing}");
if (!_options.Value.IncomingOptions.Active)
var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
var confitem = await configManager.GetInterfaceConfig("MES-OUT").ConfigureAwait(false);
if (confitem == null)
{
if (!_options.Value.OutgoingOptions.Active)
{
Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
return;
}
}
else
{ {
Logger.LogInformation($"{Outgoing} is not active!"); if (!confitem.Active)
return; {
Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
return;
}
} }
Logger.LogInformation($"Write Issue"); Logger.LogInformation($"Write Issue");

21
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs

@ -7,6 +7,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers; using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming; using Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming;
@ -34,10 +35,24 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{ {
Logger.LogInformation($"开始: 执行 {Incoming}"); Logger.LogInformation($"开始: 执行 {Incoming}");
if (!_options.Value.IncomingOptions.Active)
var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
var confitem = await configManager.GetInterfaceConfig("TYRP-IN").ConfigureAwait(false);
if (confitem == null)
{ {
Logger.LogInformation($"{Incoming} 已关闭没有执行!"); if (!_options.Value.IncomingOptions.Active)
return; {
Logger.LogInformation($"{Incoming} 已关闭没有执行!");
return;
}
}
else
{
if (!confitem.Active)
{
Logger.LogInformation($"{Incoming} 已关闭没有执行!");
return;
}
} }
//var repository = workerContext.ServiceProvider.GetRequiredService<IPartLinq2DbRepository>(); //var repository = workerContext.ServiceProvider.GetRequiredService<IPartLinq2DbRepository>();

21
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs

@ -7,6 +7,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers; using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing; using Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing;
@ -33,11 +34,23 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{ {
Logger.LogInformation($"开始: 执行 {Outgoing}"); Logger.LogInformation($"开始: 执行 {Outgoing}");
var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
if (!_options.Value.OutgoingOptions.Active) var confitem = await configManager.GetInterfaceConfig("TYRP-OUT").ConfigureAwait(false);
if (confitem == null)
{ {
Logger.LogInformation($"{Outgoing} 已关闭没有执行!"); if (!_options.Value.OutgoingOptions.Active)
return; {
Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
return;
}
}
else
{
if (!confitem.Active)
{
Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
return;
}
} }
var scontrolWriter = workerContext.ServiceProvider.GetRequiredService<ScontrolWriter>();//scontrol中间表服务 var scontrolWriter = workerContext.ServiceProvider.GetRequiredService<ScontrolWriter>();//scontrol中间表服务
var wmsoutmWriter = workerContext.ServiceProvider.GetRequiredService<WmsoutmWriter>();//wmsoutm中间表的服务 var wmsoutmWriter = workerContext.ServiceProvider.GetRequiredService<WmsoutmWriter>();//wmsoutm中间表的服务

37
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs

@ -50,25 +50,24 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{ {
Logger.LogInformation("开始接收数据..."); Logger.LogInformation("开始接收数据...");
// var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>(); var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
//var confitem = await configManager.GetInterfaceConfig("").ConfigureAwait(false); var confitem = await configManager.GetInterfaceConfig("WMS-IN").ConfigureAwait(false);
// if (confitem == null) if (confitem == null)
// { {
// if (!_options.Value.IncomingOptions.Active) if (!_options.Value.IncomingOptions.Active)
// { {
// Logger.LogInformation("Wms接收接口已关闭!"); Logger.LogInformation("Wms接收接口已关闭!");
// return; return;
// } }
// } }
// else else
// { {
// if (!confitem.Active) if (!confitem.Active)
// { {
// Logger.LogInformation("Wms接收接口已关闭!"); Logger.LogInformation("Wms接收接口已关闭!");
// return; return;
// } }
// } }
await HandleIncomingDataAsync(workerContext).ConfigureAwait(false); await HandleIncomingDataAsync(workerContext).ConfigureAwait(false);

4
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs

@ -29,8 +29,9 @@ public class OutgoingFromWmsWorker : AsyncPeriodicBackgroundWorkerBase
[UnitOfWork] [UnitOfWork]
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{ {
Logger.LogInformation("开始传出数据...");
var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>(); var configManager = workerContext.ServiceProvider.GetRequiredService<IInterfaceConfigManager>();
var confitem = await configManager.GetInterfaceConfig("").ConfigureAwait(false); var confitem = await configManager.GetInterfaceConfig("WMS-OUT").ConfigureAwait(false);
if (confitem == null) if (confitem == null)
{ {
if (!_options.Active) if (!_options.Active)
@ -79,5 +80,6 @@ public class OutgoingFromWmsWorker : AsyncPeriodicBackgroundWorkerBase
{ {
Logger.LogInformation(ex.Message+ex?.InnerException.Message); Logger.LogInformation(ex.Message+ex?.InnerException.Message);
} }
Logger.LogInformation("提交传出数据...");
} }
} }

4
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs

@ -344,8 +344,8 @@ public class KittingAppService : SfsBaseDataWithCodeAppServiceBase<Kitting, Kitt
} }
var fileContent1 = _excelService.Export(importList); var fileContent1 = _excelService.Export(importList);
return new TestResult(fileContent1.FileContents, ExportImportService.ContentType) { FileDownloadName = "Kitting导入文件" }; // return new TestResult(fileContent1.FileContents, ExportImportService.ContentType) { FileDownloadName = "Kitting导入文件" };
// return new JsonResult(new { Code = 200, FileDownloadName="" }); return new JsonResult(new { Code = 200, FileDownloadName="" });
} }

7
build/src/docker/publish/conf/settings/appsettings.Development.json

@ -142,6 +142,7 @@
}, },
"FileStorage": { "FileStorage": {
"BaseUrl": "http://dev.ccwin-in.com:60082/" "BaseUrl": "http://dev.ccwin-in.com:60082/"
//"BaseUrl": "http://localhost:59092/"
}, },
"Inventory": { "Inventory": {
"BaseUrl": "http://localhost:59095/" "BaseUrl": "http://localhost:59095/"
@ -150,10 +151,12 @@
"BaseUrl": "http://localhost:59095/" "BaseUrl": "http://localhost:59095/"
}, },
"Label": { "Label": {
"BaseUrl": "http://dev.ccwin-in.com:60082/" "BaseUrl": "http://dev.ccwin-in.com:60082/"
//"BaseUrl": "http://localhost:59092/"
}, },
"Message": { "Message": {
"BaseUrl": "http://dev.ccwin-in.com:60082/" "BaseUrl": "http://dev.ccwin-in.com:60082/"
//"BaseUrl": "http://localhost:59092/"
}, },
"Store": { "Store": {
"BaseUrl": "http://localhost:59095/" "BaseUrl": "http://localhost:59095/"

Loading…
Cancel
Save