| | |
| | | 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 |
| | |
| | | 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 { |
| | | |
| | | } |
| | | |