|
@@ -5741,6 +5741,7 @@ open class ReportService( |
|
|
"select " + |
|
|
"select " + |
|
|
"s.staffId, " + |
|
|
"s.staffId, " + |
|
|
"s.name, " + |
|
|
"s.name, " + |
|
|
|
|
|
"s.departDate, " + |
|
|
"COALESCE(s.email, '') as email, " + |
|
|
"COALESCE(s.email, '') as email, " + |
|
|
"t.code as team, " + |
|
|
"t.code as team, " + |
|
|
"lmd.lastRecordDate " + |
|
|
"lmd.lastRecordDate " + |
|
@@ -5752,7 +5753,17 @@ open class ReportService( |
|
|
"order by lmd.lastrecorddate " |
|
|
"order by lmd.lastrecorddate " |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
val results = jdbcDao.queryForList(sql.toString(), mapOf("searchDate" to date.format(formatter))).map { |
|
|
|
|
|
|
|
|
val results = jdbcDao.queryForList(sql.toString(), mapOf("searchDate" to date.format(formatter))) |
|
|
|
|
|
.filter{ |
|
|
|
|
|
val departDate = it["departDate"] as? java.sql.Date |
|
|
|
|
|
if (departDate != null) { |
|
|
|
|
|
val currentDate = Date.from(LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant()) |
|
|
|
|
|
departDate.after(currentDate) |
|
|
|
|
|
} else { |
|
|
|
|
|
false // Exclude entries with null departDate |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
.map { |
|
|
result -> |
|
|
result -> |
|
|
StaffLastRecordData( |
|
|
StaffLastRecordData( |
|
|
result["staffId"] as String, |
|
|
result["staffId"] as String, |
|
@@ -5907,7 +5918,11 @@ open class ReportService( |
|
|
val gradeCell = row.createCell(4) |
|
|
val gradeCell = row.createCell(4) |
|
|
val positionCell = row.createCell(5) |
|
|
val positionCell = row.createCell(5) |
|
|
val salaryPointCell = row.createCell(6) |
|
|
val salaryPointCell = row.createCell(6) |
|
|
val emailCell = row.createCell(7) |
|
|
|
|
|
|
|
|
val lowerLimitCell = row.createCell(7) |
|
|
|
|
|
val upperLimitCell = row.createCell(8) |
|
|
|
|
|
val hourlyRateCell = row.createCell(9) |
|
|
|
|
|
val emailCell = row.createCell(10) |
|
|
|
|
|
val activeCell = row.createCell(11) |
|
|
|
|
|
|
|
|
staffIdCell.apply { |
|
|
staffIdCell.apply { |
|
|
setCellValue(it.getValue("staffId") as String) |
|
|
setCellValue(it.getValue("staffId") as String) |
|
@@ -5946,11 +5961,44 @@ open class ReportService( |
|
|
cellStyle = blackFontStyle |
|
|
cellStyle = blackFontStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
lowerLimitCell.apply{ |
|
|
|
|
|
setCellValue((it.getValue("lowerLimit") as Int).toString()) |
|
|
|
|
|
cellStyle = blackFontStyle |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
upperLimitCell.apply{ |
|
|
|
|
|
setCellValue((it.getValue("upperLimit") as Int).toString()) |
|
|
|
|
|
cellStyle = blackFontStyle |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
hourlyRateCell.apply{ |
|
|
|
|
|
setCellValue((it.getValue("hourlyRate") as BigDecimal).toString()) |
|
|
|
|
|
cellStyle = blackFontStyle |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
emailCell.apply { |
|
|
emailCell.apply { |
|
|
setCellValue(it.getValue("email") as String) |
|
|
setCellValue(it.getValue("email") as String) |
|
|
cellStyle = blackFontStyle |
|
|
cellStyle = blackFontStyle |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
activeCell.apply { |
|
|
|
|
|
var active: Boolean |
|
|
|
|
|
var uniCode: String |
|
|
|
|
|
val departDate = it["departDate"] as? java.sql.Date |
|
|
|
|
|
|
|
|
|
|
|
if (departDate != null) { |
|
|
|
|
|
val currentDate = Date.from(LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant()) |
|
|
|
|
|
active = departDate.after(currentDate) |
|
|
|
|
|
} else { |
|
|
|
|
|
active = true // Exclude entries with null departDate |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
uniCode = if (active) "\u2713" else "\u2717" |
|
|
|
|
|
|
|
|
|
|
|
setCellValue(uniCode) |
|
|
|
|
|
cellStyle = blackFontStyle |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
startRowIndex++ |
|
|
startRowIndex++ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|