feiyu02
2024-07-19 4e20a1aaaba1bb843820fca844c20055a33febce
src/main/kotlin/cn/flightfeather/supervision/business/location/UtilFile.kt
@@ -33,6 +33,7 @@
            ExcelUtil.MyCell("单位地址", colSpan = 1),
            ExcelUtil.MyCell("经度", colSpan = 1),
            ExcelUtil.MyCell("纬度", colSpan = 1),
            ExcelUtil.MyCell("区县", colSpan = 1),
            ExcelUtil.MyCell("街道", colSpan = 1),
            ExcelUtil.MyCell("常用联系人", colSpan = 1),
            ExcelUtil.MyCell("联系方式", colSpan = 1),
@@ -66,6 +67,7 @@
            scense.location ?: "",
            scense.longitude?.toDouble() ?: .0,
            scense.latitude?.toDouble() ?: .0,
            scense.districtname ?: "",
            scense.townname ?: "",
            scense.contacts ?: "",
            scense.contactst ?: ""
@@ -74,9 +76,10 @@
        index++
    }
    fun outPutToFile() {
    fun outPutToFile(distance: Double? = null) {
        val workbook = HSSFWorkbook()
        val fileName = "金山区周边点位-${DateUtil().DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls"
        val tag = if (distance == null) "" else  "${distance}米"
        val fileName = "周边${tag}点位-${DateUtil().DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls"
        val filePath = "C:\\work\\工作\\第三方监管\\周边点位\\$fileName"
        val out = FileOutputStream(File(filePath))
        ExcelUtil.write(heads, contents, workbook)