From 9d4ca2e7bdfc0d634b0cc27c7fbe23740f4bb398 Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期五, 27 十二月 2024 15:43:30 +0800 Subject: [PATCH] 1. 新增aod数据索引,aod详细数据实体类,mapper,service 2. 新增卫星遥测数据网格数据pm2.5、aod数据导入,模板下载 3. FileExchange.kt 新增转换pm2.5和aod数据方法 --- src/main/kotlin/com/flightfeather/uav/common/utils/FileUtil.kt | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/uav/common/utils/FileUtil.kt b/src/main/kotlin/com/flightfeather/uav/common/utils/FileUtil.kt index f290f76..851cedf 100644 --- a/src/main/kotlin/com/flightfeather/uav/common/utils/FileUtil.kt +++ b/src/main/kotlin/com/flightfeather/uav/common/utils/FileUtil.kt @@ -13,7 +13,7 @@ class FileUtil { private var file: File - private var basePath:String = "${File.separator}ObdData${File.separator}" + private var basePath:String = "${File.separator}UAVData${File.separator}" private var closeThread: Thread? = null private var fw: FileWriter? = null private var bw: BufferedWriter? = null @@ -36,7 +36,7 @@ } } - fun saveObdData(str: String) { + fun saveObdData(str: String, newFile: Boolean = false) { //妫�鏌ユ枃妗f槸鍚﹀瓨鍦� if (!file.exists()) { file.parentFile.mkdirs() @@ -45,7 +45,7 @@ println("----鍒涘缓鏂囦欢锛�${file.absolutePath}") } //鏂囦欢鏈�澶�512Kb,瓒呰繃鍚庢柊寤烘枃妗� - if (file.length() + str.toByteArray().size > 512 * 1024 || TimeUtil.isNextDay(oldTime, Date())) { + if (newFile || file.length() + str.toByteArray().size > 512 * 1024 || TimeUtil.isNextDay(oldTime, Date())) { //瓒呰繃涓�澶╁悗锛屾洿鏂板綋鍓嶆椂闂� oldTime = Date() @@ -59,10 +59,10 @@ flush() close() } - fw?.run { - flush() - close() - } +// fw?.run { +// flush() +// close() +// } //鏂板缓杈撳嚭娴� fw = FileWriter(file, true) bw = BufferedWriter(fw) @@ -79,7 +79,7 @@ flush() } - readyToShutDownStream(bw, fw) +// readyToShutDownStream(bw, fw) println("----鍐欏叆瀹屾垚") } -- Gitblit v1.9.3