| | |
| | | package cn.flightfeather.supervision.business.report |
| | | |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import java.io.File |
| | | import java.io.FileOutputStream |
| | | import java.io.OutputStream |
| | | import java.util.* |
| | |
| | | // excel文档 |
| | | private var workbook = HSSFWorkbook() |
| | | |
| | | fun getReportName(): String = "${dataSource.areaName()}-${fileName}.xls" |
| | | |
| | | fun toFile(path: String) { |
| | | val fileName = "${dataSource.areaName()}-${fileName}-${Date().time}.xls" |
| | | val out = FileOutputStream(path + fileName) |
| | | val fileName = getReportName() |
| | | val file = File(path + fileName) |
| | | if (!file.parentFile.exists()) { |
| | | file.parentFile.mkdirs() |
| | | } |
| | | val out = FileOutputStream(file) |
| | | toOutputStream(out) |
| | | } |
| | | |