using AutoMapper; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_ITaskInfoRepository; using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; namespace WIDESEAWCS_TaskInfoService { public partial class TaskHtyService : ServiceBase, ITaskHtyService { private readonly IMapper _mapper; public ITaskHtyRepository TaskHtyRepository => BaseDal; public TaskHtyService(ITaskHtyRepository BaseDal, IMapper mapper) : base(BaseDal) { _mapper = mapper; } /// /// 添加历史任务 /// /// 任务 /// 操作类型 /// public WebResponseContent AddTask_Hty(Dt_Task Task, string OperateType) { WebResponseContent content = new WebResponseContent(); try { Dt_Task_Hty task_Hty = _mapper.Map(Task); task_Hty.SourceId = Task.TaskId; task_Hty.OperateType = OperateType; content.Status = BaseDal.AddData(task_Hty) > 0; } catch (Exception ex) { content.Error(ex.Message); } return content; } } }