feiyu02
2024-01-26 01eae19a4870033e879a3faa6749eece92926cab
1. 新增多项yml配置文件
2. 新增导入静安监测数据功能模块(未完成)
已修改14个文件
已添加3个文件
345 ■■■■ 文件已修改
pom.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/common/exception/ResponseErrorException.kt 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/common/utils/ExcelUtil.kt 123 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/common/utils/FileExchange.kt 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/bean/ElectricDailyInfo.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/web/BaseResPack.kt 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/web/RealTimeDataController.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/model/epw/WindDirWeight.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/socket/processor/ElectricProcessor.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-pro.yml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-test.yml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/com/flightfeather/uav/Test.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -260,6 +260,30 @@
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>dev</id>
            <properties>
                <profileActive>dev</profileActive>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>pro</id>
            <properties>
                <profileActive>pro</profileActive>
            </properties>
        </profile>
        <profile>
            <id>test</id>
            <properties>
                <profileActive>test</profileActive>
            </properties>
        </profile>
    </profiles>
    <!--依赖下载地址-->
    <repositories>
        <repository>
src/main/kotlin/com/flightfeather/uav/common/exception/ResponseErrorException.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.flightfeather.uav.common.exception
/**
 * å…è®¸æŽ¥å£è¿”回的业务层面的错误
 */
class ResponseErrorException : Exception {
    constructor():super()
    constructor(message: String) : super(message)
    constructor(message: String, cause: Throwable) : super(message, cause)
    constructor(cause: Throwable) : super(cause)
    constructor(message: String, cause: Throwable, enableSuppression: Boolean, writableStackTrace: Boolean)
            : super(message, cause, enableSuppression, writableStackTrace)
}
src/main/kotlin/com/flightfeather/uav/common/utils/ExcelUtil.kt
@@ -1,8 +1,16 @@
package com.flightfeather.uav.common.utils
import org.apache.poi.hssf.usermodel.HSSFWorkbook
import com.flightfeather.uav.common.exception.ResponseErrorException
import org.apache.poi.ss.usermodel.Row
import org.apache.poi.ss.util.CellRangeAddress
import org.apache.poi.xssf.streaming.SXSSFWorkbook
import org.apache.poi.xssf.usermodel.XSSFRow
import org.apache.poi.xssf.usermodel.XSSFWorkbook
import org.jetbrains.kotlin.incremental.isJavaFile
import java.io.ByteArrayInputStream
import java.io.File
import java.io.FileInputStream
import java.io.InputStream
import java.time.LocalDate
import java.util.*
import kotlin.math.max
@@ -16,16 +24,44 @@
    private const val isLog = false
    class MyCell(
            var text: String,
            var rowSpan: Int = 1,
            var colSpan: Int = 1,
            var fontColor: Short? = null
        var text: String,
        var rowSpan: Int = 1,
        var colSpan: Int = 1,
        var fontColor: Short? = null,
    )
    /**
     * è¯»å–文件
     * @param file è¦è¯»å–的文件
     * @param headerCheck æ–‡ä»¶é¦–行检查回调
     * @param onRow å•行内容回调,从第二行开始
     */
    fun read(file: File, headerCheck: (header: XSSFRow) -> Boolean, onRow: (row: Row) -> Unit): Boolean {
        if (!file.exists() || !file.isFile) throw ResponseErrorException("it's not a normal file!")
        if (!file.extension.equals("xls", ignoreCase = true) || !file.extension.equals("xlsx", ignoreCase = true)) {
            throw ResponseErrorException("file's extension name should be xls or xlsx!")
        }
        return read(FileInputStream(file), headerCheck, onRow)
    }
    fun read(input: InputStream, headerCheck: (header: XSSFRow) -> Boolean, onRow: (row: Row) -> Unit): Boolean {
        val workbook = XSSFWorkbook(input)
        val sheet1 = workbook.getSheetAt(0)
        val header = sheet1.getRow(sheet1.topRow.toInt())
        return if (headerCheck(header)) {
            // èŽ·å–è¿­ä»£å™¨å¹¶åŽ»é™¤ç¬¬ä¸€è¡Œæ ‡é¢˜
            val iterator = sheet1.rowIterator().also { it.next() }
            iterator.forEach { onRow(it) }
            true
        } else {
            false
        }
    }
    /**
     * è‡ªåŠ¨å¤„ç†è¡Œåˆå¹¶æ•°æ®
     */
    fun write2(heads: List<String>, contents: List<Array<Any>>, workbook: SXSSFWorkbook, sheetName:String) {
    fun write2(heads: List<String>, contents: List<Array<Any>>, workbook: SXSSFWorkbook, sheetName: String) {
        val sheet = workbook.createSheet(sheetName)
@@ -52,31 +88,31 @@
                var rowspan = maxRow//合并的行的跨度
                val c =
                        if (cell is Array<*>) {
                            //当数据为数组时,需要根据最大行数重新计算该单元格的行跨度
                            arrayMap[i] = cell
                            rowspan = maxRow / if (cell.size == 0) 1 else cell.size
                            val c = cell[0]
                            if (c is MyCell) {
                                rowspan = c.rowSpan
                            }
                            if (rowspan > 1) {
                                log("合并1-1:$rowIndex;${rowIndex + rowspan - 1};$i")
                                sheet.addMergedRegion(CellRangeAddress(rowIndex, rowIndex + rowspan - 1, i, i))
                            }
                            if (cell.isEmpty()) {
                                ""
                            } else {
                                cell[0]
                            }
                        } else {
                            //当数据不是数组时,需要按最大行数合并单元格
                            if (rowspan > 1) {
                                log("合并1-2:$rowIndex;${rowIndex + rowspan - 1};$i")
                                sheet.addMergedRegion(CellRangeAddress(rowIndex, rowIndex + rowspan - 1, i, i))
                            }
                            cell
                    if (cell is Array<*>) {
                        //当数据为数组时,需要根据最大行数重新计算该单元格的行跨度
                        arrayMap[i] = cell
                        rowspan = maxRow / if (cell.size == 0) 1 else cell.size
                        val c = cell[0]
                        if (c is MyCell) {
                            rowspan = c.rowSpan
                        }
                        if (rowspan > 1) {
                            log("合并1-1:$rowIndex;${rowIndex + rowspan - 1};$i")
                            sheet.addMergedRegion(CellRangeAddress(rowIndex, rowIndex + rowspan - 1, i, i))
                        }
                        if (cell.isEmpty()) {
                            ""
                        } else {
                            cell[0]
                        }
                    } else {
                        //当数据不是数组时,需要按最大行数合并单元格
                        if (rowspan > 1) {
                            log("合并1-2:$rowIndex;${rowIndex + rowspan - 1};$i")
                            sheet.addMergedRegion(CellRangeAddress(rowIndex, rowIndex + rowspan - 1, i, i))
                        }
                        cell
                    }
                when (c) {
                    is MyCell -> {
                        rows.createCell(i).setCellValue(c.text)
@@ -107,7 +143,7 @@
                        if (c is MyCell) {
                            rowspan = c.rowSpan
                        }
                        val _c = array[i-1]
                        val _c = array[i - 1]
                        if (_c is MyCell) {
                            lastRowSpan = _c.rowSpan
                        }
@@ -153,9 +189,15 @@
    /**
     * è‡ªåŠ¨å¤„ç†è¡Œåˆå¹¶æ•°æ®
     */
    fun write(heads: List<Array<String>>, contents: List<Array<Any>>, workbook: SXSSFWorkbook, sheetName: String = "sheet1", row: Int = 0): Int {
    fun write(
        heads: List<Array<String>>,
        contents: List<Array<Any>>,
        workbook: SXSSFWorkbook,
        sheetName: String = "sheet1",
        row: Int = 0,
    ): Int {
        val sheet = workbook.getSheet(sheetName)?: workbook.createSheet(sheetName)
        val sheet = workbook.getSheet(sheetName) ?: workbook.createSheet(sheetName)
//        println("sheet: $sheetName")
        var rowIndex = row
@@ -195,7 +237,10 @@
                        }
                        if (rowspan > 1 || colSpan > 1) {
                            log("合并1-1:$rowIndex;${rowIndex + rowspan - 1};$col")
                            sheet.addMergedRegion(CellRangeAddress(rowIndex, rowIndex + rowspan - 1, col, col + colSpan - 1))
                            sheet.addMergedRegion(CellRangeAddress(rowIndex,
                                rowIndex + rowspan - 1,
                                col,
                                col + colSpan - 1))
                        }
                        if (cell.isEmpty()) {
                            ""
@@ -210,7 +255,10 @@
                        }
                        if (rowspan > 1 || colSpan > 1) {
                            log("合并1-2:$rowIndex;${rowIndex + rowspan - 1};$col")
                            sheet.addMergedRegion(CellRangeAddress(rowIndex, rowIndex + rowspan - 1, col, col + colSpan - 1))
                            sheet.addMergedRegion(CellRangeAddress(rowIndex,
                                rowIndex + rowspan - 1,
                                col,
                                col + colSpan - 1))
                        }
                        cell
                    }
@@ -272,7 +320,10 @@
                        }
                        if (rowspan > 1 || colSpan > 1) {
                            log("合并2:${index};${index + rowspan - 1};${map.key}")
                            sheet.addMergedRegion(CellRangeAddress(index, index + rowspan - 1, map.key, map.key + colSpan - 1))
                            sheet.addMergedRegion(CellRangeAddress(index,
                                index + rowspan - 1,
                                map.key,
                                map.key + colSpan - 1))
                        }
                        when (c) {
src/main/kotlin/com/flightfeather/uav/common/utils/FileExchange.kt
@@ -1,6 +1,7 @@
package com.flightfeather.uav.common.utils
import com.alibaba.fastjson.JSONObject
import com.flightfeather.uav.common.exception.ResponseErrorException
import com.flightfeather.uav.domain.entity.RealTimeData
import com.flightfeather.uav.socket.bean.AirData
import org.apache.poi.hssf.usermodel.HSSFWorkbook
@@ -13,7 +14,7 @@
import java.util.*
/**
 * æ— äººèˆ¹é‡‡é›†æ•°æ®æ ¼å¼è½¬æ¢
 * é‡‡é›†æ•°æ®æ ¼å¼è½¬æ¢
 */
class FileExchange {
@@ -27,6 +28,55 @@
        private val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
    }
    fun exchangeJinanData(file: File) {
        val headers = listOf(
            "longitude",
            "latitude",
            "data_time",
            "NO2",
            "CO",
            "H2S",
            "SO2",
            "O3",
            "PM25",
            "PM10",
            "temperature",
            "humidity",
            "VOC",
            "NOI",
            "velocity",
            "wind_speed",
            "wind_direction"
        )
        try {
            ExcelUtil.read(file, headerCheck = {
                val cellIterator = it.cellIterator()
                val headIterator = headers.iterator()
                while (headIterator.hasNext()) {
                    val head = headIterator.next()
                    if (cellIterator.hasNext()) {
                        val cellText = cellIterator.next().stringCellValue
                        if (!cellText.equals(head)) {
                            throw ResponseErrorException("文件格式错误, è¡¨å¤´[${head}]应该为[${cellText}]")
                        }
                    } else {
                        throw ResponseErrorException("文件格式错误, è¡¨å¤´[${head}]缺失")
                    }
                }
                true
            }, onRow = {
                it.cellIterator().forEach {
                    it.numericCellValue
                }
            })
        } catch (e: Exception) {
            throw ResponseErrorException("excel文件内容错误,数据转换失败!", e)
        }
    }
    /**
     * è½¬æ¢æ— äººèˆ¹çš„æ°´è´¨ç›‘测数据
     */
    fun exchangeBoatData(deviceCode: String, file: InputStream): List<RealTimeData> {
        val workbook = HSSFWorkbook(file)
        val sheet = workbook.getSheetAt(0)
@@ -205,7 +255,15 @@
        val filePath = "e:/$fileName"
        val out = FileOutputStream(File(filePath))
        val heads = listOf("id", "device_code", "latitude", "longitude", "altitude", "height", "factors", "data_time", "create_time")
        val heads = listOf("id",
            "device_code",
            "latitude",
            "longitude",
            "altitude",
            "height",
            "factors",
            "data_time",
            "create_time")
        val contents = mutableListOf<Array<Any>>()
        for (i in 1..sheet.lastRowNum) {
src/main/kotlin/com/flightfeather/uav/lightshare/bean/ElectricDailyInfo.kt
@@ -200,8 +200,8 @@
    fun getResult() {
        // ç”¨ç”µé‡
        plPower = round(plPower * 100) / 100
        pfPower = round(pfPower * 100) / 100
        pfPower = round(pfPower * 100) / 100
        // å¼€å…³æ—¶é—´æ ¼å¼åŒ–
        plRTimeStr = DateUtil.instance.dateToString(plRTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
        plETimeStr = DateUtil.instance.dateToString(plETime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt
@@ -16,6 +16,8 @@
    fun importData(file: MultipartFile): BaseResponse<DataImportResult>
    fun importJinanData(file: MultipartFile): BaseResponse<DataImportResult>
    fun outToWorkbook(deviceCode: String, startTime: String, endTime: String): SXSSFWorkbook
    fun outToExcel(deviceCode: String, startTime: String, endTime: String, response: HttpServletResponse): HttpServletResponse
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
@@ -173,6 +173,10 @@
        return BaseResponse(true, data = DataImportResult(""))
    }
    override fun importJinanData(file: MultipartFile): BaseResponse<DataImportResult> {
        TODO("Not yet implemented")
    }
    override fun outToWorkbook(deviceCode: String, startTime: String, endTime: String): SXSSFWorkbook {
        val sTime = dateFormatter.parse(startTime)
        val eTime = dateFormatter.parse(endTime)
src/main/kotlin/com/flightfeather/uav/lightshare/web/BaseResPack.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
package com.flightfeather.uav.lightshare.web
import com.flightfeather.uav.common.exception.ResponseErrorException
import com.flightfeather.uav.lightshare.bean.BaseResponse
import com.flightfeather.uav.lightshare.bean.DataHead
/**
 * åŒ…装接口返回结果
 */
fun resPack(service: () -> Any?): BaseResponse<Any> {
    return try {
        val res = service()
        if (res is Pair<*, *>) {
            val head = res.first
            if (head is DataHead) {
                BaseResponse(true, head = head, data = res.second)
            } else {
                BaseResponse(true, data = res)
            }
        } else {
            BaseResponse(true, data = res)
        }
    } catch (e: ResponseErrorException) {
        BaseResponse(false, message = e.message ?: "")
    }
}
src/main/kotlin/com/flightfeather/uav/lightshare/web/RealTimeDataController.kt
@@ -2,6 +2,7 @@
import com.flightfeather.uav.lightshare.service.RealTimeDataService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
import org.springframework.web.multipart.MultipartFile
@@ -33,4 +34,10 @@
    fun importData(
        @RequestPart("excel") file: MultipartFile
    ) = realTimeDataService.importData(file)
    @ApiOperation(value = "导入静安区生态环境监测站的走行数据")
    @PostMapping("/import/jinan")
    fun importJinanData(
        @RequestPart("excel") file: MultipartFile
    ) = realTimeDataService.importJinanData(file)
}
src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt
@@ -36,7 +36,7 @@
                val range = FactorType.getRange(a.factorName) ?: return@v
                // åˆ¤æ–­æ•°æ®æ˜¯å¦åœ¨åˆç†èŒƒå›´å†…
                if (a.factorData ?: 0.0 < range.first || a.factorData ?: 0.0 > range.second) {
                if (a.factorData != null && (a.factorData!! < range.first || a.factorData!! > range.second)) {
                    a.factorData = null
                }
            }
@@ -165,7 +165,7 @@
        if (lastData.isNotEmpty() && newList.isNotEmpty()) {
            val lastTime = DateUtil.instance.StringToDate(lastData.last().time)
            val thisTime = DateUtil.instance.StringToDate(newList.first().time)
            if (thisTime?.time?.minus(lastTime?.time ?: 0) ?: 0 >= (60 * 1000)) {
            if ((thisTime?.time?.minus(lastTime?.time ?: 0) ?: 0) >= (60 * 1000)) {
                lastData.clear()
            }
        }
@@ -225,7 +225,7 @@
                val f = it.values?.get(i)
                if (f?.factorName == factorName) {
                    val range = FactorType.getRange(f?.factorName) ?: continue
                    if (f?.factorData ?: 0.0 in range.first..range.second) {
                    if ((f?.factorData ?: 0.0) in range.first..range.second) {
                        t += (f?.factorData!! - avg) * (f.factorData!! - avg)
                        c++
                    }
src/main/kotlin/com/flightfeather/uav/model/epw/WindDirWeight.kt
@@ -32,14 +32,13 @@
    private fun getAngle(p1: Pair<Double, Double>, p2: Pair<Double, Double>, wd: Double): Double {
        val dx = p2.first - p1.first
        val dy = p2.second - p1.second
        var x1 = atan2(dy, dx) * 180 / PI
        var x1 = atan2(dy, dx) * 180 / PI + 180
        if (x1 < 0) x1 += 360
        var x2 = 270 - wd
        if (x2 < 0) x2 += 360
        x1 = abs(x2 - x1)
        if (x1 > 180) x1 = 360 - x1
//        println("夹角:$x1")
        x1 = 180 - x1
        return x1
    }
}
src/main/kotlin/com/flightfeather/uav/socket/processor/ElectricProcessor.kt
@@ -41,7 +41,7 @@
    }
    private fun saveToDataBase(message: BaseMessage, msg: String) {
        if (message is ElectricMessage) {
        if (message is ElectricMessage && message.mn.isNotBlank()) {
            instance.electricRepository.saveData(message)
        }
    }
src/main/resources/application-dev.yml
@@ -1,3 +1,10 @@
spring:
  datasource:
    # å¼€å‘本地服务器
    url: jdbc:mysql://localhost:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
    username: root
    password: 123456
springfox:
  documentation:
    swagger:
src/main/resources/application-pro.yml
@@ -1,3 +1,10 @@
spring:
  datasource:
    #    çº¿ä¸ŠæœåС噍
    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
springfox:
  documentation:
    swagger:
src/main/resources/application-test.yml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    #    å±€åŸŸç½‘服务器
    #    url: jdbc:mysql://192.168.0.200:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
    #    username: root
    #    password: cn.FLIGHTFEATHER
    #   è¿œç¨‹æœåС噍
    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
springfox:
  documentation:
    swagger:
      v2:
        enabled: true
src/main/resources/application.yml
@@ -1,25 +1,6 @@
spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
#    å±€åŸŸç½‘服务器
#    url: jdbc:mysql://192.168.0.200:3306/dronemonitor?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
#    username: root
#    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: root
#    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
    hikari:
      maximum-pool-size: 500
      minimum-idle: 20
@@ -52,10 +33,4 @@
    helperDialect: mysql
    reasonable: true
    supportMethodsArguments: true
    params: count=countSql
springfox:
  documentation:
    swagger:
      v2:
        enabled: false
    params: count=countSql
src/test/kotlin/com/flightfeather/uav/Test.kt
@@ -118,11 +118,10 @@
    @Test
    fun foo16() {
        val l = mutableListOf<BigDecimal>().apply {
            add(BigDecimal.valueOf(6.23))
            add(BigDecimal("6.23"))
            add(BigDecimal(6.23))
        val list = listOf(1, 2, 3, 4, 5, 6)
        val iterator = list.iterator().also { it.next() }
        iterator.forEach {
            println(it)
        }
        l.forEach { println(it) }
    }
}