Ejemplo n.º 1
0
        public static TaskConfigModel FetchTaskDetail(Guid taskId)
        {
            var result      = DalTask.GetTaskInfo(taskId);
            var triggerData = DalTask.GetTriggerTaskList(taskId);

            if (result == null)
            {
                return(null);
            }
            result.ConditionList = DalTask.GetConditionList(taskId);
            foreach (var item in result.ConditionList)
            {
                if (item.ActionName.Equals("11FinishTask", StringComparison.CurrentCultureIgnoreCase) && Guid.TryParse(item.SpecialPara, out var value))
                {
                    item.ChildName = DalTask.GetTaskInfo(value)?.TaskName;
                }
            }
            result.CouponList  = DalTask.GetCouponList(taskId);
            result.TriggerList = triggerData.Where(g => g.TriggerType == 1 && !g.IsTimeout).Select(g => new TaskSimpleModel
            {
                TaskId   = g.TriggerTaskId,
                TaskName = g.TriggerTaskName
            }).ToList();
            result.DisplayTriggerList = triggerData.Where(g => g.TriggerType == 0 && !g.IsTimeout).Select(g => new TaskSimpleModel
            {
                TaskId   = g.TriggerTaskId,
                TaskName = g.TriggerTaskName
            }).ToList();
            result.TimeoutTriggerList = triggerData.Where(g => g.TriggerType == 0 && g.IsTimeout).Select(g => new TaskSimpleModel
            {
                TaskId   = g.TriggerTaskId,
                TaskName = g.TriggerTaskName
            }).ToList();
            return(result);
        }