shgx_tz_mom/ZR.Service/System/SysTasksLogService.cs

40 lines
1.1 KiB
C#
Raw Normal View History

2021-08-23 16:57:25 +08:00
using Infrastructure.Attribute;
using System;
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))]
public class SysTasksLogService : BaseService<SysTasksLog>, ISysTasksLogService
2021-08-23 16:57:25 +08:00
{
private ISysTasksQzService _tasksQzService;
public SysTasksLogService(ISysTasksQzService tasksQzService)
{
_tasksQzService = tasksQzService;
}
public async Task<SysTasksLog> AddTaskLog(string jobId, SysTasksLog logModel)
2021-08-23 16:57:25 +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;
}
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
}
}