feiyu02
2021-11-10 db7243622e8b5f4cc23de5594b2d973562f0b2a3
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
@@ -4,6 +4,7 @@
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.dataprocess.AverageUtil
import com.flightfeather.uav.domain.entity.*
import com.flightfeather.uav.domain.mapper.RealTimeDataGridMapper
import com.flightfeather.uav.domain.mapper.RealTimeDataMapper
@@ -276,17 +277,28 @@
        var total = -1
        var count = 0
        val minFormatter = SimpleDateFormat("yyyy-MM-dd HH:mm")
        val averageUtil = AverageUtil<RealTimeDataGrid>({d ->
            minFormatter.format(d.dataTime)
        },{list ->
            list.avg()
        })
        while (total == -1 || page <= total) {
            println("------start------")
            val res = getOriginData("0d0000000001", "2021-07-05 19:47:01", "2021-11-05 00:00:00", page, 50000)
            res.head?.let {
                total = it.totalPage
            }
            val p = PageHelper.startPage<RealTimeDataGrid>(page, 50000)
            val res = realTimeDataGridMapper.selectByExample(Example(RealTimeDataGrid::class.java).apply {
                createCriteria().andBetween("dataTime", "2021-06-01 00:00:00", "2021-11-05 00:00:00")
            })
            total = p.pages
            if (page == 1) {
                println("总页数:$total")
            }
            println("当前页数:$page")
            res.data?.forEach {
            averageUtil.avg(res).forEach {
            }