public async Task <JsonResult> GetPagingExceptionLog(SystemExceptionLogGetPagingInput paging)
        {
            var list = new List <FilterDefinition <SystemExceptionLog> >
            {
                Builders <SystemExceptionLog> .Filter.Lt("CreateTime", DateTime.Now)
            };

            if (!paging.Name.IsNullOrEmpty())
            {
                list.Add(Builders <SystemExceptionLog> .Filter.Where(w => w.CreateUserName.Contains(paging.Name)));
            }
            if (!paging.Code.IsNullOrEmpty())
            {
                list.Add(Builders <SystemExceptionLog> .Filter.Where(w => w.CreateUserCode.Contains(paging.Code)));
            }
            if (!paging.CreateTime.IsNullOrEmpty())
            {
                list.Add(Builders <SystemExceptionLog> .Filter.Where(w => w.CreateTime <= paging.EndCreateTime && w.CreateTime >= paging.BeginCreateTime));
            }

            var filter = Builders <SystemExceptionLog> .Filter.And(list);

            var sort = Builders <SystemExceptionLog> .Sort.Descending(d => d.CreateTime);

            var datas = await _exceptionLogLogic.PagingQueryProcAsync(filter, paging, sort);

            foreach (var data in datas.Data)
            {
                data.CreateTime = TimeZone.CurrentTimeZone.ToLocalTime(data.CreateTime);
            }
            return(JsonForGridPaging(datas));
        }
Exemple #2
0
 public async Task <JsonResult> GetPagingExceptionLog(QueryParam paging)
 {
     return(JsonForGridPaging(await _exceptionLogLogic.PagingQueryProcAsync(paging)));
 }