|
@@ -1325,22 +1325,38 @@ open class ReportService( |
|
|
|
|
|
|
|
|
salarys.forEachIndexed { index, salary -> |
|
|
salarys.forEachIndexed { index, salary -> |
|
|
|
|
|
|
|
|
sheet.getRow(rowIndex++).apply { |
|
|
|
|
|
|
|
|
val row = sheet.getRow(rowIndex) ?: sheet.createRow(rowIndex) |
|
|
|
|
|
|
|
|
|
|
|
row?.apply { |
|
|
|
|
|
|
|
|
getCell(0).setCellValue(salary.salaryPoint.toDouble()) |
|
|
|
|
|
|
|
|
val cell = getCell(0) ?: createCell(0) |
|
|
|
|
|
cell.setCellValue(salary.salaryPoint.toDouble()) |
|
|
when (index) { |
|
|
when (index) { |
|
|
0 -> getCell(1).setCellValue(salary.lowerLimit.toDouble()) |
|
|
|
|
|
|
|
|
0 -> { |
|
|
|
|
|
val cell1 = getCell(1) ?: createCell(1) |
|
|
|
|
|
cell1.setCellValue(salary.lowerLimit.toDouble()) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
else -> getCell(1).cellFormula = |
|
|
|
|
|
"(C{previousRow}+1)".replace("{previousRow}", (rowIndex - 1).toString()) |
|
|
|
|
|
|
|
|
else -> { |
|
|
|
|
|
val cell1 = getCell(1) ?: createCell(1) |
|
|
|
|
|
cell1.cellFormula = |
|
|
|
|
|
"(C{previousRow}+1)".replace("{previousRow}", (rowIndex).toString()) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
getCell(2).cellFormula = "(B{currentRow}+D{currentRow})-1".replace("{currentRow}", rowIndex.toString()) |
|
|
|
|
|
|
|
|
val cell2 = getCell(2) ?: createCell(2) |
|
|
|
|
|
cell2.cellFormula = "(B{currentRow}+D{currentRow})-1".replace("{currentRow}", (rowIndex+1).toString()) |
|
|
// getCell(2).cellStyle.dataFormat = accountingStyle |
|
|
// getCell(2).cellStyle.dataFormat = accountingStyle |
|
|
getCell(3).setCellValue(salary.increment.toDouble()) |
|
|
|
|
|
getCell(4).cellFormula = |
|
|
|
|
|
"(((C{currentRow}+B{currentRow})/2)/20)/8".replace("{currentRow}", rowIndex.toString()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val cell3 = getCell(3)?:createCell(3) |
|
|
|
|
|
cell3.setCellValue(salary.increment.toDouble()) |
|
|
|
|
|
|
|
|
|
|
|
val cell4 = getCell(4)?:createCell(4) |
|
|
|
|
|
cell4.cellFormula = |
|
|
|
|
|
"(((C{currentRow}+B{currentRow})/2)/20)/8".replace("{currentRow}", (rowIndex+1).toString()) |
|
|
// getCell(4).cellStyle.dataFormat = accountingStyle |
|
|
// getCell(4).cellStyle.dataFormat = accountingStyle |
|
|
|
|
|
cell4.cellStyle.dataFormat = accountingStyle |
|
|
} |
|
|
} |
|
|
|
|
|
rowIndex++; |
|
|
} |
|
|
} |
|
|
// println(salarys.size) |
|
|
// println(salarys.size) |
|
|
|
|
|
|
|
|