Пример #1
0
        public JsonResult QueryExternalDepartmentStatistics()
        {
            QF_Report filter = BuildQueryFilterEntity <QF_Report>();
            var       list   = ReportBigService.ExternalDepartmentStatisticsList(filter);

            return(AjaxGridJson(list));
        }
Пример #2
0
        public ActionResult SearchExportExternalDepartmentStatistics()
        {
            var filter = SerializeHelper.JsonDeserializeFixed <QF_Report>(Request.Form["queryString"]);

            filter.PageIndex = 0;
            filter.PageSize  = int.MaxValue;

            var list = ReportBigService.ExternalDepartmentStatisticsList(filter);

            list.data.ForEach(p => { p.Id = list.data.IndexOf(p) + 1; });
            var tables = new List <DataTable>
            {
                DataMapper.ListToDataTable(list.data)
            };
            var columns = new List <List <ColumnData> >
            {
                new List <ColumnData>
                {
                    new ColumnData {
                        FieldName = "Id", Width = 20, Title = "序号", HorizontalAlignment = HorizAlignments.Centered
                    },
                    new ColumnData {
                        FieldName = "SubjectDepartmentName", Width = 20, Title = "主题所属公司", HorizontalAlignment = HorizAlignments.Left
                    },
                    new ColumnData {
                        FieldName = "CreateSubjectUserName", Width = 20, Title = "主题发表人", HorizontalAlignment = HorizAlignments.Left
                    },
                    new ColumnData {
                        FieldName = "ParseTitle", Width = 20, Title = "主题标题", HorizontalAlignment = HorizAlignments.Left
                    },
                    new ColumnData {
                        FieldName = "ExternalUserName", Width = 20, Title = "外协人员", HorizontalAlignment = HorizAlignments.Left
                    },
                    new ColumnData {
                        FieldName = "ExternalDepartmentName", Width = 20, Title = "外协部门", HorizontalAlignment = HorizAlignments.Left
                    },
                    new ColumnData {
                        FieldName = "AssignmentTime", Width = 40, Title = "分派时间", ValueFormat = "yyyy-MM-dd HH:mm:ss", HorizontalAlignment = HorizAlignments.Left
                    },
                    new ColumnData {
                        FieldName = "Stat", Width = 10, Title = "完结评星数", HorizontalAlignment = HorizAlignments.Left
                    }
                }
            };
            var excelExport = new ExcelFileExporter();
            var fileName    = string.Empty;
            var excelByte   = excelExport.CreateFile(tables, new List <string>()
            {
                "外部门协助统计"
            }, columns, null, out fileName, "外部门协助统计");

            fileName = "外部门协助统计.xls";
            return(File(new MemoryStream(excelByte), "application/ms-excel", fileName));
        }