|
@@ -473,17 +473,13 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
|
473
|
473
|
|
474
|
474
|
InputStream inputStream = null;
|
475
|
475
|
HSSFWorkbook workbook = null;
|
476
|
|
- try {
|
477
|
|
- inputStream = new FileInputStream("缴费单模板.xls");
|
478
|
|
- workbook = new HSSFWorkbook(inputStream);
|
479
|
|
- } catch (FileNotFoundException e) {
|
480
|
|
- e.printStackTrace();
|
481
|
|
- } catch (IOException e) {
|
482
|
|
- e.printStackTrace();
|
483
|
|
- }
|
|
476
|
+
|
|
477
|
+ //inputStream = this.getClass().getResourceAsStream("/缴费单模板.xls");
|
|
478
|
+ workbook = new HSSFWorkbook();
|
|
479
|
+
|
484
|
480
|
|
485
|
481
|
|
486
|
|
- HSSFSheet sheet = workbook.createSheet("缴费单");
|
|
482
|
+ HSSFSheet sheet = workbook.getSheet("Sheet1");
|
487
|
483
|
// 创建行
|
488
|
484
|
HSSFRow row = sheet.createRow(0);
|
489
|
485
|
// 创建列
|
|
@@ -514,16 +510,16 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
|
514
|
510
|
cell = row.createCell(6);
|
515
|
511
|
cell.setCellValue("金额(元)");
|
516
|
512
|
|
517
|
|
- String [] [] data = new String[][] {{"1区","0", "0", "0", "0", "示例忽删", "12.34", "<-示例"}};
|
518
|
|
- int crrentRow = 5;
|
519
|
|
- // 行数
|
520
|
|
- for (int i = 0; i < data.length; i++) {
|
521
|
|
- row = sheet.createRow(i + crrentRow);
|
522
|
|
- for (int t = 0; t < data[i].length; t++) {
|
523
|
|
- cell = row.createCell(t);
|
524
|
|
- cell.setCellValue(data[i][t]);
|
525
|
|
- }
|
526
|
|
- }
|
|
513
|
+// String [] [] data = new String[][] {{"1区","0", "0", "0", "0", "示例忽删", "12.34", "<-示例"}};
|
|
514
|
+// int crrentRow = 5;
|
|
515
|
+// // 行数
|
|
516
|
+// for (int i = 0; i < data.length; i++) {
|
|
517
|
+// row = sheet.createRow(i + crrentRow);
|
|
518
|
+// for (int t = 0; t < data[i].length; t++) {
|
|
519
|
+// cell = row.createCell(t);
|
|
520
|
+// cell.setCellValue(data[i][t]);
|
|
521
|
+// }
|
|
522
|
+// }
|
527
|
523
|
|
528
|
524
|
responseBean.addSuccess(workbook);
|
529
|
525
|
return responseBean;
|