|
|
@@ -173,9 +173,11 @@ open class MailReminderService( |
|
|
|
var isNaughty = false |
|
|
|
val missingDates = mutableListOf<LocalDate>() |
|
|
|
goodStaffsList.forEach { (key, value) -> |
|
|
|
if (!value.contains(it.id!!)) { |
|
|
|
isNaughty = true |
|
|
|
missingDates.add(key) |
|
|
|
if(it.joinDate == null || it.joinDate <= key) { |
|
|
|
if (!value.contains(it.id!!)) { |
|
|
|
isNaughty = true |
|
|
|
missingDates.add(key) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!isNaughty) return@forEach |
|
|
@@ -324,15 +326,18 @@ open class MailReminderService( |
|
|
|
Pair(date, matchedStaffIds) |
|
|
|
}.sortedBy { it.first } |
|
|
|
// creating the email content |
|
|
|
// println(goodStaffsList) |
|
|
|
val intro = StringBuilder("${teamLead.name}, Staffs Missing Timesheet in the Table Below: ($firstDay-$today) \n") |
|
|
|
val tableData = mutableListOf<TableRow>() |
|
|
|
teamMembers.forEach { |
|
|
|
var isNaughty = false |
|
|
|
val missingDates = mutableListOf<LocalDate>() |
|
|
|
goodStaffsList.forEach { (key, value) -> |
|
|
|
if (!value.contains(it.id!!)) { |
|
|
|
isNaughty = true |
|
|
|
missingDates.add(key) |
|
|
|
if(it.joinDate == null || it.joinDate <= key){ |
|
|
|
if (!value.contains(it.id!!)) { |
|
|
|
isNaughty = true |
|
|
|
missingDates.add(key) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!isNaughty) return@forEach |
|
|
|