/// <summary> /// 获取任务执行计划 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public TriggerDto GetTrigger(TriggerFilterDto filter) { var trigger = TriggerDomainService.GetTrigger(CreateQueryObject(filter)); return(trigger.MapTo <TriggerDto>()); }
/// <summary> /// 获取任务执行计划列表 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public List <TriggerDto> GetTriggerList(TriggerFilterDto filter) { var triggerList = TriggerDomainService.GetTriggerList(CreateQueryObject(filter)); return(triggerList.Select(c => c.MapTo <TriggerDto>()).ToList()); }
/// <summary> /// 根据查询条件生成查询对象 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> IQuery CreateQueryObject(TriggerFilterDto filter, bool useBaseFilter = false) { if (filter == null) { return(null); } IQuery query = null; if (useBaseFilter) { query = QueryFactory.Create(filter); #region 筛选条件 if (!filter.Ids.IsNullOrEmpty()) { query.In <TriggerQuery>(c => c.Id, filter.Ids); } if (!filter.Name.IsNullOrEmpty()) { query.Like <TriggerQuery>(c => c.Name, filter.Name); } if (!filter.Description.IsNullOrEmpty()) { query.Equal <TriggerQuery>(c => c.Description, filter.Description); } if (!filter.Job.IsNullOrEmpty()) { query.Equal <TriggerQuery>(c => c.Job, filter.Job); } if (filter.ApplyTo.HasValue) { query.Equal <TriggerQuery>(c => c.ApplyTo, filter.ApplyTo.Value); } if (filter.PrevFireTime.HasValue) { query.Equal <TriggerQuery>(c => c.PrevFireTime, filter.PrevFireTime.Value); } if (filter.NextFirTime.HasValue) { query.Equal <TriggerQuery>(c => c.NextFirTime, filter.NextFirTime.Value); } if (filter.Priority.HasValue) { query.Equal <TriggerQuery>(c => c.Priority, filter.Priority.Value); } if (filter.Status.HasValue) { query.Equal <TriggerQuery>(c => c.Status, filter.Status.Value); } if (filter.Type.HasValue) { query.Equal <TriggerQuery>(c => c.Type, filter.Type.Value); } if (filter.StartTime.HasValue) { query.Equal <TriggerQuery>(c => c.StartTime, filter.StartTime.Value); } if (filter.EndTime.HasValue) { query.Equal <TriggerQuery>(c => c.EndTime, filter.EndTime.Value); } if (filter.MisFireType.HasValue) { query.Equal <TriggerQuery>(c => c.MisFireType, filter.MisFireType.Value); } if (filter.FireTotalCount.HasValue) { query.Equal <TriggerQuery>(c => c.FireTotalCount, filter.FireTotalCount.Value); } #endregion #region 数据加载 if (filter.LoadJob) { query.SetLoadPropertys <Trigger>(true, c => c.Job); } if (filter.LoadCondition) { query.SetLoadPropertys <Trigger>(true, c => c.Condition); } #endregion } else { if (filter is ServerScheduleTriggerFilterDto) { query = CreateQueryObject(filter as ServerScheduleTriggerFilterDto); } else { query = CreateQueryObject(filter, true); } } return(query); }
/// <summary> /// 获取任务执行计划分页 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public IPaging <TriggerDto> GetTriggerPaging(TriggerFilterDto filter) { var triggerPaging = TriggerDomainService.GetTriggerPaging(CreateQueryObject(filter)); return(triggerPaging.ConvertTo <TriggerDto>()); }
/// <summary> /// 获取任务执行计划分页 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public IPaging <TriggerDto> GetTriggerPaging(TriggerFilterDto filter) { return(triggerBusiness.GetTriggerPaging(filter)); }
/// <summary> /// 获取任务执行计划列表 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public List <TriggerDto> GetTriggerList(TriggerFilterDto filter) { return(triggerBusiness.GetTriggerList(filter)); }
/// <summary> /// 获取任务执行计划 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public TriggerDto GetTrigger(TriggerFilterDto filter) { return(triggerBusiness.GetTrigger(filter)); }