예제 #1
0
        public async Task <JsonResult> GetPagingOperationLog(SystemOperationLogGetPagingInput paging)
        {
            var list = new List <FilterDefinition <SystemOperationLog> >
            {
                Builders <SystemOperationLog> .Filter.Lt("CreateTime", DateTime.Now)
            };

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

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

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

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

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