Commit 2b364f7d by liulongfei

添加 任务日志

parent ee36a959
......@@ -35,6 +35,30 @@ namespace VIZ.Package.Domain
/// </summary>
public const string SYSTEM_HOT_KEY = "触发快捷键";
// =============================================================================
// Task
// =============================================================================
/// <summary>
/// 注册任务
/// </summary>
public const string SYSTEM_TASK_REGISTER = "注册任务";
/// <summary>
/// 取消任务
/// </summary>
public const string SYSTEM_TASK_CANCEL = "取消任务";
/// <summary>
/// 开始任务
/// </summary>
public const string SYSTEM_TASK_START = "开始任务";
/// <summary>
/// 停止任务
/// </summary>
public const string SYSTEM_TASK_STOP = "停止任务";
// ===============================================================================================
// 操作
// ===============================================================================================
......@@ -362,7 +386,7 @@ namespace VIZ.Package.Domain
/// <summary>
/// 文件列表
/// </summary>
public const string OPERATE_FILE_LIST = "文件:列表";
/// <summary>
......
......@@ -12,6 +12,7 @@ using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Plugin;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.Package.Module
{
......@@ -69,6 +70,11 @@ namespace VIZ.Package.Module
/// </summary>
private VizCommandControlObjectService vizCommandControlObjectService = new VizCommandControlObjectService();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// ==============================================================
// Property
// ==============================================================
......@@ -105,6 +111,9 @@ namespace VIZ.Package.Module
private void Start(PackageTaskModel task)
{
task.IsRunning = true;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_TASK_START, task.Name);
}
#endregion
......@@ -123,6 +132,9 @@ namespace VIZ.Package.Module
private void Stop(PackageTaskModel task)
{
task.IsRunning = false;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_TASK_STOP, task.Name);
}
#endregion
......@@ -189,6 +201,9 @@ namespace VIZ.Package.Module
string key = $"PackageTask_{task.ID}";
task.TimerInfo = ApplicationDomainEx.TimerManager.Register(key, task.Interval, () => this.ExecuteTask(task));
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.System, RecordLogTrigger.System, RecordLogConstants.SYSTEM_TASK_REGISTER, task.Name);
}
/// <summary>
......@@ -209,6 +224,9 @@ namespace VIZ.Package.Module
task.TimerInfo?.Dispose();
}
}
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.System, RecordLogTrigger.System, RecordLogConstants.SYSTEM_TASK_CANCEL, task.Name);
}
// ==============================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment