| | |
| | | |
| | | import cn.flightfeather.supervision.business.report.BaseCols |
| | | import cn.flightfeather.supervision.business.report.DataSource |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import kotlin.math.round |
| | | |
| | | class ColLedger : BaseCols() { |
| | | override fun onHeads(dataSource: DataSource): MutableList<MutableList<ExcelUtil.MyCell>> { |
| | |
| | | } |
| | | |
| | | override fun onOneRow(rowData: DataSource.RowData): List<Any> { |
| | | return listOf("", "", "") |
| | | val dateUtil = DateUtil() |
| | | rowData.ledgerRecords.sortedByDescending { |
| | | it.lrSubmitdate |
| | | } |
| | | val per = rowData.ledgerRecords.size.toDouble() / rowData.ledgerCount |
| | | var t1 = "" |
| | | var t2 = "/" |
| | | if (rowData.ledgerRecords.isNotEmpty()) { |
| | | val r = rowData.ledgerRecords[0] |
| | | t1 = "${dateUtil.DateToString(r.lrSubmitdate, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_CN)}" |
| | | } |
| | | return listOf(ExcelUtil.MyCell(per.toString(), isPercent = true), t1, t2) |
| | | } |
| | | } |