|
|
@@ -4,6 +4,7 @@ import com.ffii.core.support.AbstractBaseEntityService |
|
|
|
import com.ffii.core.support.AbstractIdEntityService |
|
|
|
import com.ffii.core.support.JdbcDao |
|
|
|
import com.ffii.core.utils.ExcelUtils |
|
|
|
import com.ffii.core.utils.NumberUtils |
|
|
|
import com.ffii.tsms.modules.data.entity.Salary |
|
|
|
import com.ffii.tsms.modules.data.entity.SalaryRepository |
|
|
|
import com.ffii.tsms.modules.data.entity.projections.SalarySearchInfo |
|
|
@@ -25,7 +26,7 @@ open class SalaryService( |
|
|
|
|
|
|
|
open fun combo(args: Map<String, Any>): List<Map<String, Any>> { |
|
|
|
val sql = StringBuilder("select" |
|
|
|
+ " id, " |
|
|
|
+ " salaryPoint as id, " |
|
|
|
+ " concat(salaryPoint, ' (', lowerLimit,' - ', upperLimit, ') ') as label " |
|
|
|
+ " from salary s " |
|
|
|
) |
|
|
@@ -50,19 +51,26 @@ open class SalaryService( |
|
|
|
"SET FOREIGN_KEY_CHECKS = 1" |
|
|
|
) |
|
|
|
|
|
|
|
val resetAutoIncrement = StringBuilder( |
|
|
|
"ALTER TABLE salary AUTO_INCREMENT = 1" |
|
|
|
) |
|
|
|
|
|
|
|
jdbcDao.executeUpdate(disableForeignKeyChecks.toString()) |
|
|
|
jdbcDao.executeUpdate(resetAutoIncrement.toString()) |
|
|
|
jdbcDao.executeUpdate(deleteDataInSalary.toString()) |
|
|
|
|
|
|
|
val sheet: Sheet = workbook.getSheetAt(0) |
|
|
|
// val sheetValues: MutableList<Map<String, Any>> = ArrayList() |
|
|
|
val evaluator = sheet.workbook.creationHelper.createFormulaEvaluator() |
|
|
|
|
|
|
|
for (i in 2..sheet.lastRowNum){ |
|
|
|
val salary = Salary().apply { |
|
|
|
|
|
|
|
salaryPoint = ExcelUtils.getIntValue(ExcelUtils.getCell(sheet, i, 0)) |
|
|
|
lowerLimit = ExcelUtils.getIntValue(ExcelUtils.getCell(sheet, i, 1)) |
|
|
|
upperLimit = ExcelUtils.getIntValue(ExcelUtils.getCell(sheet, i, 2)) |
|
|
|
lowerLimit = evaluator.evaluate(ExcelUtils.getCell(sheet, i, 1)).numberValue.toInt() |
|
|
|
upperLimit = evaluator.evaluate(ExcelUtils.getCell(sheet, i, 2)).numberValue.toInt() |
|
|
|
increment = ExcelUtils.getIntValue(ExcelUtils.getCell(sheet, i, 3)) |
|
|
|
hourlyRate = ExcelUtils.getDecimalValue(ExcelUtils.getCell(sheet, i, 4)) |
|
|
|
hourlyRate = evaluator.evaluate(ExcelUtils.getCell(sheet, i, 4)).numberValue.toBigDecimal() |
|
|
|
} |
|
|
|
saveAndFlush(salary) |
|
|
|
// println("Lower Limit: " + ExcelUtils.getIntValue(ExcelUtils.getCell(sheet, i, 1))) |
|
|
|