1、删除无用类
2、调整定时逻辑,将定时改为框架的事件总线 3、电梯业务逻辑代码调整
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.TaskScheduler.Entitys;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Core.EventBus.Constants;
|
||||
using Tnb.Common.Core.EventBus.Sources;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr.EventSubscribers;
|
||||
|
||||
/// <summary>
|
||||
/// 任务事件订阅.
|
||||
/// </summary>
|
||||
public class TaskStatusChangeSubscriber : IEventSubscriber, ISingleton
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化客户端.
|
||||
/// </summary>
|
||||
//private static SqlSugarScope? _sqlSugarClient;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
/// <summary>
|
||||
/// 构造函数.
|
||||
/// </summary>
|
||||
public TaskStatusChangeSubscriber(IWareHouseService wareHouseService)
|
||||
{
|
||||
_wareHouseService = wareHouseService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建任务日记.
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
[EventSubscribe(EventSubscribeEventConsts.TaskStatusChangeEventId)]
|
||||
public async Task Excute(EventHandlerExecutingContext context)
|
||||
{
|
||||
var tscSource = (TaskStatusChangeSource)context.Source;
|
||||
switch (tscSource.Payload)
|
||||
{
|
||||
case nameof(_wareHouseService.GenTaskExecute):
|
||||
await _wareHouseService.GenTaskExecute();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user