Example #1
0
        public IActionResult Export(
            int?projectId,
            string problemApplicationIds,
            string keyword,
            int?categoryId,
            CoordinationState?coordinationState
            )
        {
            var problemApplicationIdList = new List <int>();

            if (!string.IsNullOrEmpty(problemApplicationIds))
            {
                problemApplicationIdList = problemApplicationIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(u => Convert.ToInt32(u)).ToList();
            }
            var ms = _problemService.Export(
                projectId,
                "存在问题表",
                AppWebContext.Instance.Comments,
                categoryId,
                coordinationState,
                keyword,
                problemApplicationIdList

                );
            var bytes = new byte[ms.Length];

            ms.Read(bytes);
            ms.Close();
            return(File(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "存在问题表.xlsx"));
        }