#region 年度考核互评（评价）模板下载
        public FileResult DownEvaluateTemplate()
        {
            string filePath = _hostingEnvironment.WebRootPath + "\\upload\\" + System.Guid.NewGuid().ToString() + ".xls";
            try
            {
                HSSFWorkbook workBook = new HSSFWorkbook();
                CreateAssessmentTemplateDto result = new CheckResultManagementAppService(_orgRepository, _tExemptExamEntity, _tCheckResultEntity, _tGroupDeclarationEntity).CreateAssessmentTemplate();
                var gList = _tGroupDeclarationEntity.GetAll().Where(s => s.IsDeleted == false && s.Year == DateTime.Now.Year).GroupBy(s => s.GroupTime);
                string sheetName = "";
                foreach (var rekey in gList)
                {
                    var rekeyLsts = rekey.ToList();
                    string sheet1 = rekeyLsts.Count() > 0 ? rekeyLsts[0].DeclareTypeName : "";
                    sheetName = rekey.Key == null ? "未分组" : sheet1 + Convert.ToDateTime(rekey.Key).ToString("yyyy年MM月dd日HH时mm分ss秒");
                    CreateEvaluateSheet(workBook, sheetName + "互评表", rekeyLsts, "互评表");
                }
                foreach (var rekey in gList)
                {
                    var rekeyLsts = rekey.ToList();
                    string sheet1 = rekeyLsts.Count() > 0 ? rekeyLsts[0].DeclareTypeName : "";
                    sheetName = rekey.Key == null ? "未分组" : sheet1 + Convert.ToDateTime(rekey.Key).ToString("yyyy年MM月dd日HH时mm分ss秒");
                    CreateEvaluateSheet(workBook, sheetName + "专家打分表", rekeyLsts, "专家打分表");
                }


                if (Directory.Exists(filePath))
                {
                    Directory.Delete(filePath);
                }
                using (FileStream file = new FileStream(filePath, FileMode.Create))
                {
                    workBook.Write(file);  //创建Excel文件。
                    file.Close();
                }

            }
            catch (Exception ex)
            {
                string msg = ex.Message;
            }
            return File(new FileStream(filePath, FileMode.Open), "application/octet-stream", (DateTime.Now.Year + "年互评表模板" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls"));

        }

        private ISheet CreateEvaluateSheet(HSSFWorkbook workBook, string sheetName, List<TGroupDeclarationEntity> list, string ScoreTypeName)
        {
            ISheet sheet = workBook.CreateSheet(sheetName);
            IRow RowHead = sheet.CreateRow(0);
            string[] rows = new string[] { "序号", "单位名称", "互评分数" };
            #region 标题合并单元格
            ICellStyle cellStyle = workBook.CreateCellStyle();//声明样式
            cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;//水平居中
            cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;//垂直居中
            IFont font = workBook.CreateFont();//声明字体
            font.Boldweight = (Int16)FontBoldWeight.Bold;//加粗
            font.FontHeightInPoints = 14;//字体大小
            cellStyle.SetFont(font);//加入单元格
            IRow row0 = sheet.CreateRow(0);//创建行
            row0.HeightInPoints = 20;//行高
            NPOI.SS.UserModel.ICell cell0 = row0.CreateCell(0);//创建单元格
            cell0.SetCellValue(ScoreTypeName);//赋值
            cell0.CellStyle = cellStyle;//设置样式
            sheet.AddMergedRegion(new CellRangeAddress(0, 0, 0, 2));//合并单元格（第几行，到第几行，第几列，到第几列） 
            #endregion 
            #region 表头
            IRow RowBody1 = sheet.CreateRow(1);

            RowBody1.CreateCell(0).SetCellValue("序号");
            sheet.AutoSizeColumn(0);

            RowBody1.CreateCell(1).SetCellValue("单位名称");
            sheet.AutoSizeColumn(1);

            RowBody1.CreateCell(2).SetCellValue("互评分数");
            sheet.AutoSizeColumn(2);
            #endregion

            for (int iRowIndex = 0; iRowIndex < list.Count; iRowIndex++)
            {
                IRow RowBody = sheet.CreateRow(iRowIndex + 2);

                RowBody.CreateCell(0).SetCellValue((iRowIndex + 1).ToString());
                sheet.AutoSizeColumn(0);

                RowBody.CreateCell(1).SetCellValue(list[iRowIndex].OrganizationName);
                sheet.AutoSizeColumn(1);

                RowBody.CreateCell(2).SetCellValue("");
                sheet.AutoSizeColumn(2);
            }
            return sheet;

        }
        #endregion