2021-08-23 16:57:25 +08:00
|
|
|
|
using Infrastructure.Attribute;
|
|
|
|
|
|
using System;
|
2022-03-26 20:54:02 +08:00
|
|
|
|
using System.Threading.Tasks;
|
2021-08-23 16:57:25 +08:00
|
|
|
|
using ZR.Model.System;
|
2021-09-16 19:35:17 +08:00
|
|
|
|
using ZR.Service.System.IService;
|
2021-08-23 16:57:25 +08:00
|
|
|
|
|
|
|
|
|
|
namespace ZR.Service.System
|
|
|
|
|
|
{
|
2021-11-27 09:43:04 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 任务日志
|
|
|
|
|
|
/// </summary>
|
2021-08-23 16:57:25 +08:00
|
|
|
|
[AppService(ServiceLifetime = LifeTime.Transient, ServiceType = typeof(ISysTasksLogService))]
|
2022-03-26 20:54:02 +08:00
|
|
|
|
public class SysTasksLogService : BaseService<SysTasksLog>, ISysTasksLogService
|
2021-08-23 16:57:25 +08:00
|
|
|
|
{
|
|
|
|
|
|
private ISysTasksQzService _tasksQzService;
|
|
|
|
|
|
public SysTasksLogService(ISysTasksQzService tasksQzService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_tasksQzService = tasksQzService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-26 20:54:02 +08:00
|
|
|
|
public async Task<SysTasksLog> AddTaskLog(string jobId, SysTasksLog logModel)
|
2021-08-23 16:57:25 +08:00
|
|
|
|
{
|
|
|
|
|
|
//获取任务信息
|
2022-03-26 20:54:02 +08:00
|
|
|
|
var model = await _tasksQzService.GetSingleAsync(f => f.ID == jobId);
|
2021-08-23 16:57:25 +08:00
|
|
|
|
|
|
|
|
|
|
if (model != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
logModel.JobId = jobId;
|
|
|
|
|
|
logModel.JobName = model.Name;
|
|
|
|
|
|
logModel.JobGroup = model.JobGroup;
|
|
|
|
|
|
logModel.CreateTime = DateTime.Now;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-26 20:54:02 +08:00
|
|
|
|
await InsertAsync(logModel);
|
2021-08-23 16:57:25 +08:00
|
|
|
|
return logModel;
|
|
|
|
|
|
}
|
2021-12-01 21:03:27 +08:00
|
|
|
|
|
2021-08-23 16:57:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|