dengjunjie
2025-02-24 733e63cb362f17aea4a1020654fa348a0d0c1f06
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
 
namespace WIDESEAWCS_TaskInfoService
{
    public partial class TaskHtyService : ServiceBase<Dt_Task_Hty, ITaskHtyRepository>, ITaskHtyService
    {
        private readonly IMapper _mapper;
        public ITaskHtyRepository TaskHtyRepository => BaseDal;
        public TaskHtyService(ITaskHtyRepository BaseDal, IMapper mapper) : base(BaseDal)
        {
            _mapper = mapper;
        }
 
        /// <summary>
        /// 添加历史任务
        /// </summary>
        /// <param name="Task">任务</param>
        /// <param name="OperateType">操作类型</param>
        /// <returns></returns>
        public WebResponseContent AddTask_Hty(Dt_Task Task, TaskOperateTypeEnum OperateType)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_Task_Hty task_Hty = _mapper.Map<Dt_Task_Hty>(Task);
                task_Hty.SourceId = Task.TaskId;
                task_Hty.OperateType = OperateType.ToString();
                content.Status = BaseDal.AddData(task_Hty) > 0;
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}