Bladeren bron

Update the email reminder to filter out staff that join date is after the recordDate

develop
MSI\2Fi 5 maanden geleden
bovenliggende
commit
84dab9a464
1 gewijzigde bestanden met toevoegingen van 11 en 6 verwijderingen
  1. +11
    -6
      src/main/java/com/ffii/tsms/modules/common/mail/service/MailReminderService.kt

+ 11
- 6
src/main/java/com/ffii/tsms/modules/common/mail/service/MailReminderService.kt Bestand weergeven

@@ -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


Laden…
Annuleren
Opslaan