public IActionResult List(string keywords, int pageIndex, int pageSize, int watchType = 0, string orderby = "SID") { DataAccess.TASM_SUPPORT_Da manager = new DataAccess.TASM_SUPPORT_Da(); SqlSugar.PageModel p = new SqlSugar.PageModel(); p.PageIndex = pageIndex; p.PageSize = pageSize; List <SupportModel> list = manager.ListByWhere(keywords, ref p, (SupprotWatchType)watchType, SupprotWatchState.全部, this.UserInfo.USER_ID, orderby); return(SuccessResultList(list, p)); }
public IActionResult List(ListSupportInputModel model) { DataAccess.TASM_SUPPORT_Da manager = new DataAccess.TASM_SUPPORT_Da(); SqlSugar.PageModel p = new SqlSugar.PageModel(); p.PageIndex = model.pageindex; p.PageSize = model.pagesize; List <SupportModel> list = manager.ListByWhere(model.keywords, ref p, model.WatchType, model.WatchState, model.Uuid); return(SuccessResultList(list, p)); }
public IActionResult ExportExcel(string keyword = "") { DataAccess.TASM_SUPPORT_Da manager = new DataAccess.TASM_SUPPORT_Da(); List <TASM_SUPPORT> list = new List <TASM_SUPPORT>(); list = manager.ListByWhere(keyword); HSSFWorkbook excelBook = new HSSFWorkbook(); //创建工作簿Excel ISheet sheet1 = excelBook.CreateSheet("项目履历表"); IRow row1 = sheet1.CreateRow(0); row1.CreateCell(0).SetCellValue("概要"); row1.CreateCell(1).SetCellValue("创建者"); row1.CreateCell(2).SetCellValue("处理人"); row1.CreateCell(3).SetCellValue("发现时间"); row1.CreateCell(4).SetCellValue("创建时间"); for (int i = 0; i < list.Count(); i++) { NPOI.SS.UserModel.IRow rowTemp = sheet1.CreateRow(i + 1); rowTemp.CreateCell(0).SetCellValue(list[i].TITLE); rowTemp.CreateCell(1).SetCellValue(list[i].CREATOR); rowTemp.CreateCell(2).SetCellValue(list[i].CONDUCTOR); rowTemp.CreateCell(3).SetCellValue(list[i].FINDATE); rowTemp.CreateCell(4).SetCellValue(list[i].CREATETIME.ToString()); } var fileName = "工单信息" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-ffff") + ".xls";//文件名 //将Excel表格转化为流,输出 MemoryStream bookStream = new MemoryStream(); excelBook.Write(bookStream); bookStream.Seek(0, SeekOrigin.Begin); return(File(bookStream, "application/vnd.ms-excel", fileName)); }