//package com.weiqi.mis.export;
//
//import org.apache.poi.ss.usermodel.Row;
//import org.apache.poi.ss.usermodel.Sheet;
//import org.apache.poi.ss.usermodel.Workbook;
//import org.springframework.web.servlet.view.document.AbstractXlsView;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.OutputStream;
//import java.util.List;
//import java.util.Map;
//
//public class SmsListExcel extends AbstractXlsView {
//
//
//    @Override
//    protected void buildExcelDocument(Map<String, Object> model, Workbook workbook, HttpServletRequest request, HttpServletResponse response) throws Exception {
//
//        // change the file name
////        response.setHeader("Content-Disposition", "attachment; filename=\"my-xls-file.xls\"");
////
////        @SuppressWarnings("unchecked")
////        List<SmsSend> courses = (List<SmsSend>) model.get("courses");
////
////        // create excel xls sheet
////        Sheet sheet = workbook.createSheet("下行列表");
////
////        // create header row
////        Row header = sheet.createRow(0);
////        sheet.setColumnWidth(1, 2000*2 );
////        sheet.setColumnWidth(2, 2000*3 );
////        sheet.setColumnWidth(4, 2000 * 13);
////        initHead(header);
////
////
////        int rowCount = 1;
////        for (SmsSend course : courses) {
////            Row courseRow = sheet.createRow(rowCount++);
////            courseRow.createCell(0).setCellValue(course.getAppid());
////            courseRow.createCell(1).setCellValue(course.getSp());
////            courseRow.createCell(2).setCellValue(course.getRsaMobile());
////            courseRow.createCell(3).setCellValue(course.getMobile());
////            courseRow.createCell(4).setCellValue(course.getMessage());
////            courseRow.createCell(5).setCellValue(course.getMd5Mobile());
////            courseRow.createCell(6).setCellValue(course.getReportDesc());
////        }
////
////
////        String filename = "sms.xls";// 设置下载时客户端Excel的名称
////        response.setContentType("application/vnd.ms-excel;charset=UTF-8");
////        response.setCharacterEncoding("UTF-8");
////        response.setHeader("Content-disposition", "attachment;filename=" + filename);
////        OutputStream ouputStream = response.getOutputStream();
////        workbook.write(ouputStream);
////        ouputStream.flush();
////        ouputStream.close();
////
////    }
////
////
////    public void initHead(Row header) {
////
////        header.createCell(0).setCellValue("业务线");
////        header.createCell(1).setCellValue("SP通道");
////        header.createCell(2).setCellValue("发送时间");
////        header.createCell(3).setCellValue("接收者号码");
////        header.createCell(4).setCellValue("内容");
////        header.createCell(5).setCellValue("状态");
////        header.createCell(6).setCellValue("备注");
////
//    }
//
//
//}
//
//
