Pārlūkot izejas kodu

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

develop
MSI\2Fi pirms 5 mēnešiem
vecāks
revīzija
84dab9a464
1 mainītis faili ar 11 papildinājumiem un 6 dzēšanām
  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 Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt