| | |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson --> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | |
| | | |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.apache.poi.ss.util.CellRangeAddress |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import java.time.LocalDate |
| | | import java.util.* |
| | | import kotlin.math.max |
| | |
| | | /** |
| | | * èªå¨å¤çè¡åå¹¶æ°æ® |
| | | */ |
| | | fun write2(heads: List<String>, contents: List<Array<Any>>, workbook: HSSFWorkbook, sheetName:String) { |
| | | fun write2(heads: List<String>, contents: List<Array<Any>>, workbook: SXSSFWorkbook, sheetName:String) { |
| | | |
| | | val sheet = workbook.createSheet(sheetName) |
| | | |
| | |
| | | /** |
| | | * èªå¨å¤çè¡åå¹¶æ°æ® |
| | | */ |
| | | fun write(heads: List<Array<String>>, contents: List<Array<Any>>, workbook: HSSFWorkbook, sheetName: String = "sheet1") { |
| | | fun write(heads: List<Array<String>>, contents: List<Array<Any>>, workbook: SXSSFWorkbook, sheetName: String = "sheet1", row: Int = 0): Int { |
| | | |
| | | val sheet = workbook.createSheet(sheetName) |
| | | println("sheet: $sheetName") |
| | | val sheet = workbook.getSheet(sheetName)?: workbook.createSheet(sheetName) |
| | | // println("sheet: $sheetName") |
| | | |
| | | var rowIndex = 0 |
| | | var rowIndex = row |
| | | |
| | | heads.forEach { |
| | | val rows = sheet.createRow(rowIndex) |
| | |
| | | cell[0] |
| | | } |
| | | } else { |
| | | //彿°æ®ä¸æ¯æ°ç»æ¶ï¼éè¦ææå¤§è¡æ°åå¹¶åå
æ ¼ |
| | | //彿°æ®ä¸æ¯æ°ç»æ¶ï¼æ ¹æ®è®¾ç½®åå¹¶ |
| | | if (cell is MyCell) { |
| | | rowspan = cell.rowSpan |
| | | colSpan = cell.colSpan |
| | |
| | | // workbook.close() |
| | | // out.flush() |
| | | // out.close() |
| | | return rowIndex |
| | | } |
| | | |
| | | private fun getMaxRows(rowArray: Array<Any>): Int { |
| | |
| | | import com.flightfeather.uav.domain.entity.RealTimeData |
| | | import com.flightfeather.uav.socket.bean.AirData |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import java.io.File |
| | | import java.io.FileInputStream |
| | | import java.io.FileOutputStream |
| | |
| | | } |
| | | |
| | | |
| | | val newWorkBook = HSSFWorkbook() |
| | | val newWorkBook = SXSSFWorkbook(10000) |
| | | ExcelUtil.write2(heads, contents, newWorkBook, "data") |
| | | |
| | | newWorkBook.write(out) |
| | |
| | | contents.add(cList.toTypedArray()) |
| | | } |
| | | |
| | | val newWorkBook = HSSFWorkbook() |
| | | val newWorkBook = SXSSFWorkbook(10000) |
| | | ExcelUtil.write2(heads, contents, newWorkBook, "data") |
| | | |
| | | newWorkBook.write(out) |
| | |
| | | } |
| | | } |
| | | |
| | | fun saveObdData(str: String) { |
| | | fun saveObdData(str: String, newFile: Boolean = false) { |
| | | //æ£æ¥ææ¡£æ¯å¦åå¨ |
| | | if (!file.exists()) { |
| | | file.parentFile.mkdirs() |
| | |
| | | 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() |
| | | |
| | |
| | | flush() |
| | | close() |
| | | } |
| | | fw?.run { |
| | | flush() |
| | | close() |
| | | } |
| | | // fw?.run { |
| | | // flush() |
| | | // close() |
| | | // } |
| | | //æ°å»ºè¾åºæµ |
| | | fw = FileWriter(file, true) |
| | | bw = BufferedWriter(fw) |
| | |
| | | flush() |
| | | } |
| | | |
| | | readyToShutDownStream(bw, fw) |
| | | // readyToShutDownStream(bw, fw) |
| | | println("----åå
¥å®æ") |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.dataprocess |
| | | |
| | | import com.flightfeather.uav.common.utils.DateUtil |
| | | import com.flightfeather.uav.common.utils.ExcelUtil |
| | | import com.flightfeather.uav.lightshare.bean.DataVo |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook |
| | | import java.io.File |
| | | import java.io.FileInputStream |
| | | import java.io.FileOutputStream |
| | | import java.util.* |
| | | |
| | | /** |
| | | * æ°æ®å¤ç |
| | | * ç®æ ï¼å°æ¶æ°æ®ãæ¥æ°æ®åæ¥åå3ç±» |
| | | * ææ ï¼å¯¹æ¯ç±»æ°æ®ï¼è®¡ç®è®°å½æ°ãåå¼ãæ åå·®ãæå°å¼ãæå¤§å¼ï¼å¦æè®¡ç®é坿¥åï¼è®¡ç®10/25/50/75/90 %åä½å¼ã |
| | | * è¾åºæ ·å¼ï¼ï¼åæ°æ®ï¼æ¶é´ãè®°å½æ°ãåå¼ãæ åå·®ãæå°å¼ãæå¤§å¼ï¼åä½å¼ï¼æ¶é´å¯ä»¥æ¯yyyymmddhhâ¦ç®åæ ¼å¼ææ åæ¶é´æ ¼å¼ï¼å°æ¶æ°æ®æ è®°åè®°ï¼æ¶é´è®°å¨åï¼å¦17æ¶è¡¨ç¤º16~17æ¶ä¹é´çç»æï¼æåè®°æ¹å¼ï¼æ¥ååçå°æ¶äº¦åã |
| | | */ |
| | | class DataProcess( |
| | | private val outPutPath: String |
| | | ) { |
| | | companion object { |
| | | const val SHEET1 = "å°æ¶æ°æ®" |
| | | const val SHEET2 = "æ¥æ°æ®" |
| | | const val SHEET3 = "æ¥åå" |
| | | } |
| | | //æ¯æ¥å°æ¶æ°æ® |
| | | private val dateData = mutableMapOf<String?, PreData>() |
| | | //æ¯æ¥æ°æ® |
| | | private val dayData = mutableMapOf<String?, PreData>() |
| | | //æ¥å°æ¶ååæ°æ® |
| | | private val dailyVariationData = mutableMapOf<String?, PreData>() |
| | | |
| | | //åå
¥excelæä»¶ |
| | | private var workBook = SXSSFWorkbook(1000) |
| | | //è¾åºæµ |
| | | private lateinit var out: FileOutputStream |
| | | //è¾å
¥æµ |
| | | private lateinit var input: FileInputStream |
| | | //excel æ¯å¼ sheetå½ååå
¥çè¡æ° |
| | | private val sheetRow = mutableMapOf<String, Int>().apply { |
| | | put(SHEET1, 0) |
| | | put(SHEET2, 0) |
| | | put(SHEET3, 0) |
| | | } |
| | | |
| | | init { |
| | | outPutHead() |
| | | } |
| | | |
| | | /** |
| | | * æ§è¡æ°æ®é¢å¤ç |
| | | * 1. 忬¡è¾å
¥çæ°æ®è¦æ±ä¸ºä¸å¤©çæ°æ®ï¼è¾å
¥åä¼ç´æ¥è®¡ç®âæ¯æ¥å°æ¶æ°æ®âåâæ¯æ¥æ°æ®âçç»æå¹¶åå
¥excel |
| | | * 2. æ¥å°æ¶ååæ°æ®ç±äºè·¨æ¥ç»è®¡ï¼éè¦æå¨è°ç¨ |
| | | */ |
| | | fun process(dataList: List<DataVo>) { |
| | | dateData.clear() |
| | | dayData.clear() |
| | | // dailyVariationData.clear() |
| | | dataList.forEach { |
| | | val date = it.time?.substring(0, 13) |
| | | val day = it.time?.substring(0, 10) |
| | | val hour = it.time?.substring(11, 13) |
| | | |
| | | if (!dateData.containsKey(date)) { |
| | | dateData[date] = PreData(date) |
| | | } |
| | | dateData[date]?.add(it) |
| | | |
| | | if (!dayData.containsKey(day)) { |
| | | dayData[day] = PreData(day) |
| | | } |
| | | dayData[day]?.add(it) |
| | | |
| | | if (!dailyVariationData.containsKey(hour)) { |
| | | dailyVariationData[hour] = PreData(hour, false) |
| | | } |
| | | dailyVariationData[hour]?.add(it) |
| | | } |
| | | |
| | | outPut() |
| | | } |
| | | |
| | | /** |
| | | * è¾åºææ¡£æ é¢ |
| | | */ |
| | | private fun outPutHead() { |
| | | val file = File(outPutPath) |
| | | out = FileOutputStream(file) |
| | | |
| | | val contents = mutableListOf<Array<Any>>() |
| | | //第ä¸è¡ä¸ºæ¶é´ä»¥åçæµå ååç§°ï¼å¹¶ä¸éè¦æ ¹æ®ä¸ä¸è¡çç»è®¡é¡¹åå¹¶å |
| | | val firstRow = mutableListOf<ExcelUtil.MyCell>() |
| | | firstRow.add(ExcelUtil.MyCell("æ¶é´", 2)) |
| | | PreData.needFactor.forEach { firstRow.add(ExcelUtil.MyCell(it.des, colSpan = PreData.items.size)) } |
| | | contents.add(firstRow.toTypedArray()) |
| | | //第äºè¡ä¸ºæ¯ç§çæµå å对åºçç»è®¡é¡¹ï¼å
·ä½ä¸ºè®°å½æ°ãåå¼ãæ åå·®ãæå°å¼ãæå¤§å¼ã10/25/50/75/90%åä½å¼ï¼æ¯ç§çæµå åæ10å |
| | | val secondRow = mutableListOf<String>() |
| | | secondRow.add("") |
| | | repeat(PreData.needFactor.size) { secondRow.addAll(PreData.items) } |
| | | contents.add(secondRow.toTypedArray()) |
| | | //åsheetå»ºç«æ é¢ |
| | | sheetRow.forEach { (s, i) -> |
| | | val row = ExcelUtil.write(emptyList(), contents, workBook, s, i) |
| | | sheetRow[s] = row |
| | | } |
| | | workBook.write(out) |
| | | workBook.close() |
| | | out.flush() |
| | | out.close() |
| | | } |
| | | |
| | | /** |
| | | * åå
¥æ¯æ¥å°æ¶æ°æ®åæ¯æ¥æ°æ®ç»æ |
| | | * èªå¨è°ç¨ï¼ è¦æ±è¾å
¥çæ°æ®ä»¥æ¯æ¥ä¸ºä¸ç» |
| | | */ |
| | | private fun outPut() { |
| | | input = FileInputStream(outPutPath) |
| | | workBook = SXSSFWorkbook(XSSFWorkbook(input), 1000) |
| | | out = FileOutputStream(outPutPath) |
| | | //第ä¸è¡å¼å§ä¸ºè®¡ç®ç»æï¼æ¯ç§çæµå å齿坹åºçä¸ç³»åç»è®¡é¡¹ |
| | | |
| | | //æ¯æ¥å°æ¶æ°æ® |
| | | val contents = mutableListOf<Array<Any>>() |
| | | dateData.forEach { (_, pData) -> |
| | | contents.add(pData.getOutPutContent()) |
| | | } |
| | | sheetRow[SHEET1] = ExcelUtil.write(emptyList(), contents, workBook, SHEET1, sheetRow[SHEET1] ?: 0) |
| | | |
| | | //æ¯æ¥æ°æ® |
| | | contents.clear() |
| | | dayData.forEach { (_, pData) -> |
| | | contents.add(pData.getOutPutContent()) |
| | | } |
| | | sheetRow[SHEET2] = ExcelUtil.write(emptyList(), contents, workBook, SHEET2, sheetRow[SHEET2] ?: 0) |
| | | |
| | | workBook.write(out) |
| | | workBook.close() |
| | | input.close() |
| | | out.flush() |
| | | out.close() |
| | | } |
| | | |
| | | /** |
| | | * åå
¥æ¥å°æ¶ååæ°æ® |
| | | * æå¨è°ç¨ |
| | | */ |
| | | fun outPutDailyVariation() { |
| | | input = FileInputStream(outPutPath) |
| | | workBook = SXSSFWorkbook(XSSFWorkbook(input), 1000) |
| | | out = FileOutputStream(outPutPath) |
| | | //æ¥å°æ¶ååæ°æ® |
| | | val contents = mutableListOf<Array<Any>>() |
| | | dailyVariationData.forEach { (_, pData) -> |
| | | contents.add(pData.getOutPutContent()) |
| | | } |
| | | sheetRow[SHEET3] = ExcelUtil.write(emptyList(), contents, workBook, SHEET3, sheetRow[SHEET3] ?: 0) |
| | | |
| | | workBook.write(out) |
| | | workBook.close() |
| | | input.close() |
| | | out.flush() |
| | | out.close() |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®å¤çç»æ |
| | | * è°ç¨ä»¥å
³éè¾åºæµï¼éæ¾å
å |
| | | */ |
| | | fun done() { |
| | | workBook.close() |
| | | input.close() |
| | | out.flush() |
| | | out.close() |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.dataprocess |
| | | |
| | | import com.flightfeather.uav.lightshare.bean.DataVo |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | import java.math.BigDecimal |
| | | import kotlin.math.max |
| | | import kotlin.math.min |
| | | import kotlin.math.round |
| | | import kotlin.math.sqrt |
| | | |
| | | /** |
| | | * é¢å¤çæ°æ® |
| | | */ |
| | | class PreData( |
| | | //ç»è®¡æ¶é´ |
| | | private val time: String?, |
| | | //æ¯å¦éè¦è®¡ç®åä½å¼ |
| | | private val needQuartile: Boolean = true |
| | | ) { |
| | | |
| | | inner class TempData { |
| | | //æ°æ®å¹³æ¹åï¼ç¨äºè®¡ç®æ åå·®ï¼ |
| | | var sumOfSquares: BigDecimal = BigDecimal.ZERO |
| | | //æ°æ®å |
| | | var total: BigDecimal = BigDecimal.ZERO |
| | | |
| | | //è®¡æ° |
| | | var count: Int = 0 |
| | | var minV: Double = Double.MAX_VALUE |
| | | var maxV: Double = Double.MIN_VALUE |
| | | |
| | | //æ°æ®å¼è®°å½ï¼æç
§ååºæåï¼ç¨äºè·ååä½å¼ |
| | | // "10%åä½å¼", |
| | | // "25%åä½å¼", |
| | | // "50%åä½å¼", |
| | | // "75%åä½å¼", |
| | | // "90%åä½å¼" |
| | | val dataList = mutableListOf<Double>() |
| | | } |
| | | |
| | | companion object { |
| | | //éè¦ç»è®¡ççæµå å |
| | | val needFactor = listOf( |
| | | // FactorType.NO2, FactorType.CO, FactorType.H2S, FactorType.SO2, FactorType.O3, FactorType.PM25, FactorType.PM10, |
| | | FactorType.VOC |
| | | ) |
| | | //éè¦è®¡ç®çé¡¹ç® |
| | | val items = listOf( |
| | | "è®°å½æ°", "åå¼", "æ åå·®", "æå°å¼", "æå¤§å¼", "10%åä½å¼", "25%åä½å¼", "50%åä½å¼", "75%åä½å¼", "90%åä½å¼" |
| | | ) |
| | | } |
| | | |
| | | //æç
§æ¯ç§çæµå åè®°å½å½åæ¶é´ä¸çç»è®¡ä¸é´æ°æ® |
| | | private val dataMap = mutableMapOf<String?, TempData>() |
| | | |
| | | fun add(data: DataVo) { |
| | | data.values?.forEach { |
| | | if (!dataMap.containsKey(it.factorName)) { |
| | | dataMap[it.factorName] = TempData() |
| | | } |
| | | dataMap[it.factorName]?.apply { |
| | | sumOfSquares = sumOfSquares.plus(BigDecimal.valueOf( |
| | | (it.factorData ?: .0) * (it.factorData ?: .0) |
| | | )) |
| | | total = total.plus(BigDecimal.valueOf(it.factorData ?: .0)) |
| | | count++ |
| | | minV = min(minV, it.factorData?: .0) |
| | | maxV = max(maxV, it.factorData?: .0) |
| | | |
| | | if (needQuartile) { |
| | | dataList.add(it.factorData ?: .0) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è¾åºå½åç»è®¡æ¶é´ä¸çä¸è¡ç»è®¡æ°æ® |
| | | */ |
| | | fun getOutPutContent(): Array<Any> { |
| | | //æ¯ç§çæµå å齿坹åºçä¸ç³»åç»è®¡é¡¹ |
| | | val content = mutableListOf<Any>() |
| | | //第ä¸åæ¯ç»è®¡æ¶é´ |
| | | content.add(time ?: "é误æ¶é´") |
| | | needFactor.forEach { |
| | | dataMap[it.name]?.let {t -> |
| | | content.apply { |
| | | //"è®°å½æ°", |
| | | val c = BigDecimal("${t.count}") |
| | | add(t.count) |
| | | // "åå¼", |
| | | val avg = t.total.div(c) |
| | | add(avg.toString()) |
| | | // "æ åå·®", |
| | | add( |
| | | sqrt( |
| | | t.sumOfSquares.minus( |
| | | avg.times(BigDecimal(2)).times(t.total) |
| | | ).plus( |
| | | avg.times(avg).times(c) |
| | | ).div(c).toDouble() |
| | | ).toString() |
| | | ) |
| | | // "æå°å¼", |
| | | add(t.minV) |
| | | // "æå¤§å¼", |
| | | add(t.maxV) |
| | | //åä½å¼ |
| | | if (needQuartile) { |
| | | t.dataList.sortBy { d -> d } |
| | | val size = t.dataList.size |
| | | // "10%åä½å¼", |
| | | add(t.dataList[round(size * .1).toInt()]) |
| | | // "25%åä½å¼", |
| | | add(t.dataList[round(size * .25).toInt()]) |
| | | // "50%åä½å¼", |
| | | add(t.dataList[round(size * .5).toInt()]) |
| | | // "75%åä½å¼", |
| | | add(t.dataList[round(size * .75).toInt()]) |
| | | // "90%åä½å¼" |
| | | add(t.dataList[round(size * .9).toInt()]) |
| | | } else { |
| | | add("") |
| | | add("") |
| | | add("") |
| | | add("") |
| | | add("") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | clear() |
| | | return content.toTypedArray() |
| | | } |
| | | |
| | | /** |
| | | * éæ¾å
å |
| | | */ |
| | | private fun clear() { |
| | | dataMap.clear() |
| | | } |
| | | } |
| | |
| | | import com.flightfeather.uav.common.utils.DateUtil |
| | | import com.flightfeather.uav.common.utils.GsonUtils |
| | | import com.flightfeather.uav.socket.bean.AirData |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | |
| | | /** |
| | | * æ°æ®åºè¡¨å®ä½æ©å±æ¹æ³ |
| | |
| | | list.add("纬度") |
| | | val values = GsonUtils.parserJsonToArrayBeans(factors, AirData::class.java) |
| | | values.forEach { |
| | | if (FactorType.outputFactor(it.factorName)) { |
| | | val name = it.factorName ?: "" |
| | | list.add(name) |
| | | list.add("$name(ç©çé)") |
| | | // list.add("$name(ç©çé)") |
| | | } |
| | | } |
| | | return list.toTypedArray() |
| | | } |
| | |
| | | } |
| | | val values = GsonUtils.parserJsonToArrayBeans(factors, AirData::class.java) |
| | | values.forEach { |
| | | if (FactorType.outputFactor(it.factorName)) { |
| | | row.add(it.factorData ?: -1.0) |
| | | row.add(it.physicalQuantity ?: -1.0) |
| | | // row.add(it.physicalQuantity ?: -1.0) |
| | | } |
| | | } |
| | | return row.toTypedArray() |
| | | } |
| | |
| | | import com.flightfeather.uav.lightshare.bean.DataImportResult |
| | | import com.flightfeather.uav.lightshare.bean.DataVo |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import org.springframework.web.multipart.MultipartFile |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | |
| | | |
| | | fun importData(file: MultipartFile): BaseResponse<DataImportResult> |
| | | |
| | | fun outToWorkbook(deviceCode: String, startTime: String, endTime: String): HSSFWorkbook |
| | | fun outToWorkbook(deviceCode: String, startTime: String, endTime: String): SXSSFWorkbook |
| | | |
| | | fun outToExcel(deviceCode: String, startTime: String, endTime: String, response: HttpServletResponse): HttpServletResponse |
| | | } |
| | |
| | | package com.flightfeather.uav.lightshare.service.impl |
| | | |
| | | import com.flightfeather.uav.common.utils.DateUtil |
| | | import com.flightfeather.uav.common.utils.ExcelUtil |
| | | import com.flightfeather.uav.common.utils.FileExchange |
| | | import com.flightfeather.uav.common.utils.GsonUtils |
| | |
| | | import com.flightfeather.uav.lightshare.service.RealTimeDataService |
| | | import com.flightfeather.uav.socket.bean.AirData |
| | | import com.github.pagehelper.PageHelper |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import org.springframework.stereotype.Service |
| | | import org.springframework.web.multipart.MultipartFile |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.io.ByteArrayInputStream |
| | | import java.io.FileInputStream |
| | | import java.io.InputStream |
| | | import java.text.DateFormat |
| | | import java.text.SimpleDateFormat |
| | | import java.util.* |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | | @Service |
| | |
| | | } |
| | | } |
| | | }).forEach { |
| | | if (it.longitude == null || it.latitude == null) { |
| | | return@forEach |
| | | } |
| | | result.add(DataVo( |
| | | dateFormatter.format(it.dataTime), |
| | | it.deviceCode, |
| | | GsonUtils.parserJsonToArrayBeans(it.factors, AirData::class.java), |
| | | it.longitude.toDouble(), it.latitude.toDouble() |
| | | it.longitude?.toDouble(), it.latitude?.toDouble() |
| | | )) |
| | | } |
| | | if (startTime == null && endTime == null) { |
| | |
| | | return BaseResponse(true, data = DataImportResult("")) |
| | | } |
| | | |
| | | override fun outToWorkbook(deviceCode: String, startTime: String, endTime: String): HSSFWorkbook { |
| | | override fun outToWorkbook(deviceCode: String, startTime: String, endTime: String): SXSSFWorkbook { |
| | | val sTime = dateFormatter.parse(startTime) |
| | | val eTime = dateFormatter.parse(endTime) |
| | | var page = 1 |
| | | var totalPage = 1 |
| | | val pageSize = 10000 |
| | | val workbook = SXSSFWorkbook() |
| | | var rowIndex = 0 |
| | | while (page <= totalPage) { |
| | | val pageInfo = PageHelper.startPage<RealTimeData>(page, pageSize) |
| | | val r = realTimeDataMapper.selectByExample(Example(RealTimeData::class.java).apply { |
| | | createCriteria().andEqualTo("deviceCode", deviceCode) |
| | | .apply { |
| | |
| | | eTime?.let { andLessThanOrEqualTo("dataTime", it) } |
| | | } |
| | | }) |
| | | val workbook = HSSFWorkbook() |
| | | if (r.isNotEmpty()) { |
| | | val heads = getTableTitle(r[0]) |
| | | val heads = if (page == 1) { |
| | | println("[${DateUtil.instance.dateToString(Date(), DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)}] totalPage: ${pageInfo.pages}") |
| | | getTableTitle(r[0]) |
| | | } else { |
| | | emptyList() |
| | | } |
| | | val contents = getTableContents(r) |
| | | |
| | | ExcelUtil.write(heads, contents, workbook) |
| | | print("[${DateUtil.instance.dateToString(Date(), DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)}] currentPage: ${pageInfo.pageNum}......") |
| | | rowIndex = ExcelUtil.write(heads, contents, workbook, row = rowIndex) |
| | | println("output done") |
| | | } |
| | | totalPage = pageInfo.pages |
| | | page++ |
| | | } |
| | | return workbook |
| | | } |
| | |
| | | import com.flightfeather.uav.common.utils.ExcelUtil |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import java.io.File |
| | | import java.io.FileOutputStream |
| | | import java.util.* |
| | |
| | | |
| | | fun outputToExcel( |
| | | fName: String? = null, |
| | | _workbook: HSSFWorkbook? = null, |
| | | _workbook: SXSSFWorkbook? = null, |
| | | _out: FileOutputStream? = null, |
| | | sheetName: String = "sheet1", |
| | | done: Boolean = true |
| | | ): Pair<HSSFWorkbook, FileOutputStream>? { |
| | | ): Pair<SXSSFWorkbook, FileOutputStream>? { |
| | | // val rMap = formatConversion() |
| | | |
| | | val workbook = _workbook ?: HSSFWorkbook() |
| | | val workbook = _workbook ?: SXSSFWorkbook() |
| | | val fileName = fName ?: "æ±¡ææº¯æºæé模å${DateUtil.instance.dateToString(Date(), "yyyy-MM-ddHHmmss")}.xls" |
| | | // val filePath = "E:\\work\\export\\$fileName" |
| | | // val filePath = "E:\\å·¥ä½\\å¼å\\èµ°èªçæµ\\ç®æ³ç¸å
³\\èªå¨è¾åº\\$fileName" |
| | |
| | | # password: cn.FLIGHTFEATHER |
| | | |
| | | # çº¿ä¸æå¡å¨ |
| | | url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: dronemonitor |
| | | password: dronemonitor_hackxrnomxm |
| | | # url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # username: dronemonitor |
| | | # password: dronemonitor_hackxrnomxm |
| | | |
| | | # å¼åæ¬å°æå¡å¨ |
| | | # url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | |
| | | # password: 123456 |
| | | |
| | | # å¼åè¿ç¨æå¡å¨ |
| | | # url: jdbc:mysql://47.100.191.150:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # username: remoteU1 |
| | | # password: eSoF8DnzfGTlhAjE |
| | | url: jdbc:mysql://47.100.191.150:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: remoteU1 |
| | | password: eSoF8DnzfGTlhAjE |
| | | hikari: |
| | | maximum-pool-size: 500 |
| | | minimum-idle: 20 |
| | |
| | | package com.flightfeather.uav |
| | | |
| | | import com.flightfeather.uav.common.utils.FileExchange |
| | | import com.flightfeather.uav.common.utils.FileUtil |
| | | import com.flightfeather.uav.domain.entity.Company |
| | | import com.flightfeather.uav.socket.bean.DataUnit |
| | | import com.flightfeather.uav.socket.decoder.AirDataDecoder |
| | |
| | | import java.io.File |
| | | import java.io.FileOutputStream |
| | | import java.io.OutputStreamWriter |
| | | import java.math.BigDecimal |
| | | import java.text.SimpleDateFormat |
| | | import java.util.* |
| | | |
| | |
| | | |
| | | @Test |
| | | fun get_crc16(){ |
| | | val dataSegment = "QN=20210713115502858;ST=22;CN=2011;PW=555555;MN=FYHB0MH0300045;Flag=1;CP=&&DataTime=20210713115000;a34001-Avg=0.025,a34001-CPM=5.9,a34001-Flag=N;a50001-Avg=0.0,a50001-Flag=D;a01001-Avg=33.0,a01001-Flag=N;a01002-Avg=68.2,a01002-Flag=N;a01007-Avg=0.0,a01007-Flag=N;a01008-Avg=0.0,a01008-Flag=N;Period=5;Scale=0.0;SelfTemp=0.0;SelfHum=0.0;IsReplacement=N&&" |
| | | val dataSegment = "QN=20210713133901044;ST=22;CN=2011;PW=555555;MN=FYHB0DT0100001;Flag=1;CP=&&DataTime=20210713133800;a34001-Avg=0.017,a34001-CPM=3.9,a34001-Flag=N;a50001-Avg=71.1,a50001-Flag=N;a01001-Avg=34.0,a01001-Flag=N;a01002-Avg=59.3,a01002-Flag=N;a01007-Avg=0.6,a01007-Flag=N;a01008-Avg=256.3,a01008-Flag=N;Period=1;Scale=1.0;SelfTemp=0.0;SelfHum=0.0;IsReplacement=N&&" |
| | | var CRC = 0x0000ffff |
| | | val POLYNOMIAL = 0x0000a001 |
| | | var i: Int |
| | |
| | | } |
| | | println(strCRC) |
| | | } |
| | | |
| | | @Test |
| | | fun foo15() { |
| | | var i = 0 |
| | | do { |
| | | if (i == 3) { |
| | | FileUtil.instance?.saveObdData("msg", true) |
| | | } else { |
| | | FileUtil.instance?.saveObdData("msg") |
| | | } |
| | | i++ |
| | | } while (i < 10) |
| | | } |
| | | |
| | | @Test |
| | | fun foo16() { |
| | | val l = mutableListOf<BigDecimal>().apply { |
| | | add(BigDecimal.valueOf(6.23)) |
| | | add(BigDecimal("6.23")) |
| | | add(BigDecimal(6.23)) |
| | | } |
| | | l.forEach { println(it) } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.uav.dataprocess |
| | | |
| | | import com.flightfeather.uav.common.utils.DateUtil |
| | | import com.flightfeather.uav.common.utils.ExcelUtil |
| | | import com.flightfeather.uav.domain.entity.RealTimeData |
| | | import com.flightfeather.uav.domain.mapper.RealTimeDataMapper |
| | | import com.flightfeather.uav.lightshare.service.RealTimeDataService |
| | | import com.github.pagehelper.PageHelper |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import org.junit.Assert.* |
| | | import org.junit.Test |
| | | import org.junit.runner.RunWith |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit4.SpringRunner |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.text.SimpleDateFormat |
| | | import java.time.LocalDateTime |
| | | import java.time.format.DateTimeFormatter |
| | | import java.util.* |
| | | |
| | | @RunWith(SpringRunner::class) |
| | | @SpringBootTest |
| | | class DataProcessTest { |
| | | |
| | | @Autowired |
| | | lateinit var realTimeDataMapper: RealTimeDataMapper |
| | | |
| | | @Autowired |
| | | lateinit var realTimeDataService: RealTimeDataService |
| | | |
| | | @Test |
| | | fun dataProcess() { |
| | | val fileName = "ç½æ ¼åçæµæ°æ®é¢å¤ç${Date().time}.xls" |
| | | val filePath = "C:\\work\\å·¥ä½\\èµ°èªçæµ\\èµ°èªçæµ\\$fileName" |
| | | // val filePath = "E:\\å·¥ä½\\å¼å\\èµ°èªçæµ\\æ°æ®é¢å¤ç\\$fileName" |
| | | val process = DataProcess(filePath) |
| | | |
| | | /** |
| | | * ææ¯æ¥é´é循ç¯è·åæ°æ®ï¼è¿è¡æ°å¤ç |
| | | * æ°æ®ä¸º4ç§é1个å¼ï¼å æ¤ä¸å¤©çæ°æ®éæå¤ä¸º21600个 |
| | | */ |
| | | //æªæ¢æ¶é´ |
| | | val endDateTime = LocalDateTime.of(2021, 10, 5, 10, 0, 0) |
| | | var sTime = LocalDateTime.of(2021, 6, 19, 0, 0, 0) |
| | | var eTime = LocalDateTime.of(2021, 6, 19, 23, 59, 59) |
| | | |
| | | while (sTime.isBefore(endDateTime)) { |
| | | if (eTime.isAfter(endDateTime)) { |
| | | eTime = endDateTime |
| | | } |
| | | val deviceCode = "0d0000000001" |
| | | val dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") |
| | | val s = sTime.format(dateFormatter) |
| | | val e = eTime.format(dateFormatter) |
| | | val data = realTimeDataService.getSecondData(deviceCode, s, e, 1, 30000).data |
| | | data?.let { |
| | | process.process(it) |
| | | } |
| | | sTime = sTime.plusDays(1) |
| | | eTime = eTime.plusDays(1) |
| | | } |
| | | |
| | | process.outPutDailyVariation() |
| | | process.done() |
| | | } |
| | | } |
| | |
| | | package com.flightfeather.uav.lightshare.service.impl |
| | | |
| | | import com.flightfeather.uav.common.utils.DateUtil |
| | | import com.flightfeather.uav.common.utils.ExcelUtil |
| | | import com.flightfeather.uav.dataprocess.DataProcess |
| | | import com.flightfeather.uav.domain.entity.RealTimeData |
| | | import com.flightfeather.uav.lightshare.service.RealTimeDataService |
| | | import com.github.pagehelper.PageHelper |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import org.junit.Test |
| | | |
| | | import org.junit.Assert.* |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit4.SpringRunner |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.io.File |
| | | import java.io.FileOutputStream |
| | | import java.util.* |
| | |
| | | @Test |
| | | fun outToExcel() { |
| | | if (realTimeDataService is RealTimeDataServiceImpl) { |
| | | val workbook = realTimeDataService.outToWorkbook("0a0000000001", "2021-07-05 00:00:00", "2021-07-06 23:59:59") |
| | | val fileName = "æ±¡ææº¯æºæé模å${DateUtil.instance.dateToString(Date(), "yyyy-MM-ddHHmmss")}.xls" |
| | | // val deviceCode = "0a0000000001" |
| | | // val deviceCode = "0a0000000002" |
| | | val deviceCode = "0d0000000001" |
| | | val timeSet = listOf( |
| | | // Pair("2021-06-10 00:00:00", "2021-06-30 23:59:59"), |
| | | Pair("2021-07-01 00:00:00", "2021-07-31 23:59:59"), |
| | | Pair("2021-08-01 00:00:00", "2021-08-31 23:59:59"), |
| | | Pair("2021-09-01 00:00:00", "2021-09-30 23:59:59"), |
| | | // ç½æ ¼åçæµæ¯æ¥ |
| | | // Pair("2021-06-02 00:00:00", "2021-06-03 23:59:59"), |
| | | // Pair("2021-06-04 00:00:00", "2021-06-05 23:59:59"), |
| | | // Pair("2021-06-06 00:00:00", "2021-06-07 23:59:59"), |
| | | // Pair("2021-06-08 00:00:00", "2021-06-09 23:59:59"), |
| | | // Pair("2021-06-10 00:00:00", "2021-06-11 23:59:59"), |
| | | // Pair("2021-06-12 00:00:00", "2021-06-13 23:59:59"), |
| | | // Pair("2021-06-14 00:00:00", "2021-06-15 23:59:59"), |
| | | // Pair("2021-06-16 00:00:00", "2021-06-17 23:59:59"), |
| | | // Pair("2021-06-18 00:00:00", "2021-06-19 23:59:59"), |
| | | // Pair("2021-06-20 17:00:00", "2021-06-21 23:59:59"), |
| | | // Pair("2021-06-22 00:00:00", "2021-06-23 23:59:59"), |
| | | // Pair("2021-06-24 00:00:00", "2021-06-25 23:59:59"), |
| | | // Pair("2021-06-26 00:00:00", "2021-06-27 23:59:59"), |
| | | // Pair("2021-06-28 00:00:00", "2021-06-29 23:59:59"), |
| | | // Pair("2021-06-30 00:00:00", "2021-06-30 23:59:59"), |
| | | |
| | | // Pair("2021-07-01 00:00:00", "2021-07-02 23:59:59"), |
| | | // Pair("2021-07-03 00:00:00", "2021-07-04 23:59:59"), |
| | | // Pair("2021-07-05 00:00:00", "2021-07-06 23:59:59"), |
| | | // Pair("2021-07-07 00:00:00", "2021-07-08 23:59:59"), |
| | | // Pair("2021-07-09 00:00:00", "2021-07-10 23:59:59"), |
| | | // Pair("2021-07-11 00:00:00", "2021-07-12 23:59:59"), |
| | | // Pair("2021-07-13 00:00:00", "2021-07-14 23:59:59"), |
| | | // Pair("2021-07-15 00:00:00", "2021-07-16 23:59:59"), |
| | | // Pair("2021-07-17 00:00:00", "2021-07-18 23:59:59"), |
| | | // Pair("2021-07-19 17:00:00", "2021-07-20 23:59:59"), |
| | | // Pair("2021-07-21 00:00:00", "2021-07-22 23:59:59"), |
| | | // Pair("2021-07-23 00:00:00", "2021-07-24 23:59:59"), |
| | | // Pair("2021-07-25 00:00:00", "2021-07-26 23:59:59"), |
| | | // Pair("2021-07-27 00:00:00", "2021-07-28 23:59:59"), |
| | | // Pair("2021-07-29 00:00:00", "2021-07-30 23:59:59"), |
| | | // Pair("2021-07-31 00:00:00", "2021-07-31 23:59:59"), |
| | | |
| | | // Pair("2021-08-01 00:00:00", "2021-08-02 23:59:59"), |
| | | // Pair("2021-08-03 00:00:00", "2021-08-04 23:59:59"), |
| | | // Pair("2021-08-05 00:00:00", "2021-08-06 23:59:59"), |
| | | // Pair("2021-08-07 00:00:00", "2021-08-08 23:59:59"), |
| | | // Pair("2021-08-09 00:00:00", "2021-08-10 23:59:59"), |
| | | // Pair("2021-08-11 00:00:00", "2021-08-12 23:59:59"), |
| | | // Pair("2021-08-13 00:00:00", "2021-08-14 23:59:59"), |
| | | // Pair("2021-08-15 00:00:00", "2021-08-16 23:59:59"), |
| | | // Pair("2021-08-17 00:00:00", "2021-08-18 23:59:59"), |
| | | // Pair("2021-08-19 17:00:00", "2021-08-20 23:59:59"), |
| | | // Pair("2021-08-21 00:00:00", "2021-08-22 23:59:59"), |
| | | // Pair("2021-08-23 00:00:00", "2021-08-24 23:59:59"), |
| | | // Pair("2021-08-25 00:00:00", "2021-08-26 23:59:59"), |
| | | // Pair("2021-08-27 00:00:00", "2021-08-28 23:59:59"), |
| | | // Pair("2021-08-29 00:00:00", "2021-08-30 23:59:59"), |
| | | // Pair("2021-08-31 00:00:00", "2021-08-31 23:59:59"), |
| | | |
| | | // Pair("2021-09-01 00:00:00", "2021-09-02 23:59:59"), |
| | | // Pair("2021-09-03 00:00:00", "2021-09-04 23:59:59"), |
| | | // Pair("2021-09-05 00:00:00", "2021-09-06 23:59:59"), |
| | | // Pair("2021-09-07 00:00:00", "2021-09-08 23:59:59"), |
| | | // Pair("2021-09-09 00:00:00", "2021-09-10 23:59:59"), |
| | | // Pair("2021-09-11 00:00:00", "2021-09-12 23:59:59"), |
| | | // Pair("2021-09-13 00:00:00", "2021-09-14 23:59:59"), |
| | | // Pair("2021-09-15 00:00:00", "2021-09-16 23:59:59"), |
| | | // Pair("2021-09-17 00:00:00", "2021-09-18 23:59:59"), |
| | | // Pair("2021-09-19 17:00:00", "2021-09-20 23:59:59"), |
| | | // Pair("2021-09-21 00:00:00", "2021-09-22 23:59:59"), |
| | | // Pair("2021-09-23 00:00:00", "2021-09-24 23:59:59"), |
| | | // Pair("2021-09-25 00:00:00", "2021-09-26 23:59:59"), |
| | | // Pair("2021-09-27 00:00:00", "2021-09-28 23:59:59"), |
| | | // Pair("2021-09-29 00:00:00", "2021-09-30 23:59:59"), |
| | | ) |
| | | timeSet.forEach {(s, e) -> |
| | | val workbook = realTimeDataService.outToWorkbook(deviceCode, s, e) |
| | | val fileName = "ç½æ ¼åçæµ_${deviceCode}_${s.substring(0, 10).replace("-", ".")}-${e.substring(8, 10)}.xls" |
| | | val filePath = "E:\\å·¥ä½\\å¼å\\èµ°èªçæµ\\æ ¼å¼åæ°æ®\\$fileName" |
| | | val out = FileOutputStream(File(filePath)) |
| | | workbook.write(out) |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.flightfeather.uav.lightshare.bean.DataVo |
| | | import com.flightfeather.uav.lightshare.service.RealTimeDataService |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook |
| | | import org.junit.Assert.* |
| | | import org.junit.Test |
| | | import org.junit.runner.RunWith |
| | |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit4.SpringRunner |
| | | import java.io.File |
| | | import java.io.FileInputStream |
| | | import java.io.FileOutputStream |
| | | import java.time.LocalDateTime |
| | | import java.time.format.DateTimeFormatter |
| | | import java.util.* |
| | | |
| | | @RunWith(SpringRunner::class) |
| | |
| | | } |
| | | |
| | | if (dataList.isNotEmpty()) { |
| | | val workbook = HSSFWorkbook() |
| | | val workbook = SXSSFWorkbook() |
| | | val heads = mutableListOf<Array<String>>() |
| | | heads.add(dataList[0].toRowTitle()) |
| | | val contents = mutableListOf<Array<Any>>() |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | fun foo2() { |
| | | var fileName = "ç½æ ¼åçæµé¢å¤çè¿ç»æ°æ®${Date().time}.xls" |
| | | var filePath = "C:\\work\\å·¥ä½\\èµ°èªçæµ\\é¢å¤çè¿ç»æ°æ®\\$fileName" |
| | | var workBook = SXSSFWorkbook(1000) |
| | | var out: FileOutputStream |
| | | var input: FileInputStream |
| | | var row = 0 |
| | | val maxRow = 100000 |
| | | var hasHead = false |
| | | |
| | | val ePWDataPrep = EPWDataPrep() |
| | | |
| | | val endDateTime = LocalDateTime.now() |
| | | var sTime = LocalDateTime.of(2021, 6, 19, 0, 0, 0) |
| | | var eTime = LocalDateTime.of(2021, 6, 19, 23, 59, 59) |
| | | |
| | | while (sTime.isBefore(endDateTime)) { |
| | | val deviceCode = "0d0000000001" |
| | | val dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") |
| | | val s = sTime.format(dateFormatter) |
| | | val e = eTime.format(dateFormatter) |
| | | val data = realTimeDataService.getSecondData(deviceCode, s, e, 1, 30000).data |
| | | |
| | | data?.let { |
| | | val dataList = ePWDataPrep.mDataPrep(it) |
| | | |
| | | if (row + dataList.size > maxRow) { |
| | | fileName = "ç½æ ¼åçæµé¢å¤çè¿ç»æ°æ®${Date().time}.xls" |
| | | filePath = "C:\\work\\å·¥ä½\\èµ°èªçæµ\\é¢å¤çè¿ç»æ°æ®\\$fileName" |
| | | workBook = SXSSFWorkbook(1000) |
| | | row = 0 |
| | | hasHead = false |
| | | } |
| | | |
| | | if (!hasHead) { |
| | | out = FileOutputStream(filePath) |
| | | val heads = mutableListOf<Array<String>>() |
| | | heads.add(dataList[0].toRowTitle()) |
| | | row = ExcelUtil.write(heads, emptyList(), workBook, row = row) |
| | | workBook.write(out) |
| | | workBook.close() |
| | | out.flush() |
| | | out.close() |
| | | hasHead = true |
| | | } |
| | | |
| | | input = FileInputStream(filePath) |
| | | workBook = SXSSFWorkbook(XSSFWorkbook(input), 1000) |
| | | out = FileOutputStream(filePath) |
| | | |
| | | val contents = mutableListOf<Array<Any>>() |
| | | dataList.forEach {d -> |
| | | contents.add(d.toRowContent()) |
| | | } |
| | | row = ExcelUtil.write(emptyList(), contents, workBook, row = row) |
| | | |
| | | workBook.write(out) |
| | | workBook.close() |
| | | input.close() |
| | | out.flush() |
| | | out.close() |
| | | } |
| | | sTime = sTime.plusDays(1) |
| | | eTime = eTime.plusDays(1) |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.flightfeather.uav.lightshare.bean.DataVo |
| | | import com.flightfeather.uav.lightshare.service.RealTimeDataService |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook |
| | | import org.junit.Test |
| | | import org.junit.runner.RunWith |
| | | import org.springframework.beans.BeanUtils |
| | |
| | | val deviceCode = "0d0000000001" |
| | | |
| | | val epwModel = EPWModel() |
| | | var workbook: HSSFWorkbook? = null |
| | | var workbook: SXSSFWorkbook? = null |
| | | var out: FileOutputStream? = null |
| | | |
| | | for (i in timeSet.indices) { |