| @@ -135,7 +135,8 @@ open class MailReminderService( | |||||
| } | } | ||||
| // val timesheet = timesheetRepository.findByDeletedFalseAndRecordDateBetweenOrderByRecordDate(filteredLastMonthDays.first(),filteredLastMonthDays.last()) | // val timesheet = timesheetRepository.findByDeletedFalseAndRecordDateBetweenOrderByRecordDate(filteredLastMonthDays.first(),filteredLastMonthDays.last()) | ||||
| val staffs = staffRepository.findAllByEmployTypeAndDeletedFalseAndDepartDateIsNull(FULLTIME) | val staffs = staffRepository.findAllByEmployTypeAndDeletedFalseAndDepartDateIsNull(FULLTIME) | ||||
| val teams = teamRepository.findAll().filter { team -> team.deleted == false && ( team.code == "WY" || team.code == "TW") } | |||||
| val teams = teamRepository.findAll().filter { team -> team.deleted == false && ( team.code == "WY" || team.code == "TW" || team.code == "CH" || team.code == "MN" || team.code == "MC" ) } | |||||
| // val teams = teamRepository.findAll().filter { team -> team.deleted == false } | |||||
| for (team in teams) { | for (team in teams) { | ||||
| // if (team.id?.toInt() != 5) continue // remove this when finishes | // if (team.id?.toInt() != 5) continue // remove this when finishes | ||||
| @@ -224,7 +225,8 @@ open class MailReminderService( | |||||
| } | } | ||||
| // val timesheet = timesheetRepository.findByDeletedFalseAndRecordDateBetweenOrderByRecordDate(firstDay, today) | // val timesheet = timesheetRepository.findByDeletedFalseAndRecordDateBetweenOrderByRecordDate(firstDay, today) | ||||
| val staffs = staffRepository.findAllByEmployTypeAndDeletedFalseAndDepartDateIsNull(FULLTIME) | val staffs = staffRepository.findAllByEmployTypeAndDeletedFalseAndDepartDateIsNull(FULLTIME) | ||||
| val teams = teamRepository.findAll().filter { team -> team.deleted == false && ( team.code == "WY" || team.code == "TW" )} | |||||
| val teams = teamRepository.findAll().filter { team -> team.deleted == false && ( team.code == "WY" || team.code == "TW" || team.code == "CH" || team.code == "MN" || team.code == "MC" )} | |||||
| // val teams = teamRepository.findAll().filter { team -> team.deleted == false } | |||||
| val dateList = generateSequence(firstDay) { it.plusDays(1) } | val dateList = generateSequence(firstDay) { it.plusDays(1) } | ||||
| .takeWhile { it <= today } | .takeWhile { it <= today } | ||||
| @@ -333,7 +335,15 @@ open class MailReminderService( | |||||
| ) | ) | ||||
| } | } | ||||
| // val timesheet = timesheetRepository.findByDeletedFalseAndRecordDateBetweenOrderByRecordDate(sevenDaysBefore, fourDaysBefore) | // val timesheet = timesheetRepository.findByDeletedFalseAndRecordDateBetweenOrderByRecordDate(sevenDaysBefore, fourDaysBefore) | ||||
| val staffs = staffRepository.findAllByEmployTypeAndDeletedFalseAndDepartDateIsNull(FULLTIME).filter { staff: Staff? -> staff?.team?.code == "WY" || staff?.team?.code == "TW" } // FT? FT? etc | |||||
| val staffs = staffRepository.findAllByEmployTypeAndDeletedFalseAndDepartDateIsNull(FULLTIME).filter { | |||||
| staff: Staff? -> | |||||
| staff?.team?.code == "WY" || | |||||
| staff?.team?.code == "TW" || | |||||
| staff?.team?.code == "MN" || | |||||
| staff?.team?.code == "MC" || | |||||
| staff?.team?.code == "CH" | |||||
| } // FT? FT? etc | |||||
| // val staffs = staffRepository.findAllByEmployTypeAndDeletedFalseAndDepartDateIsNull(FULLTIME) | |||||
| val staffIds: List<Long> = staffs.map { it.id as Long } | val staffIds: List<Long> = staffs.map { it.id as Long } | ||||
| // val timesheetByIdAndRecord = timesheet.groupBy { it.staff?.id to it.recordDate } | // val timesheetByIdAndRecord = timesheet.groupBy { it.staff?.id to it.recordDate } | ||||