Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
9cbf52a4
Commit
9cbf52a4
authored
Jun 25, 2019
by
Vijay Akula
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enabled scheduled annotation for sending mail
parent
dbfd4b25
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
LeaveNotificationScheduler.java
...om/nisum/myteam/schedular/LeaveNotificationScheduler.java
+8
-8
application.properties
src/main/resources/application.properties
+2
-2
No files found.
src/main/java/com/nisum/myteam/schedular/LeaveNotificationScheduler.java
View file @
9cbf52a4
...
...
@@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Component
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
javax.mail.MessagingException
;
import
java.io.IOException
;
import
java.time.LocalDateTime
;
...
...
@@ -58,7 +58,7 @@ public class LeaveNotificationScheduler {
private
SubStatusService
subStatusService
;
//
@Scheduled(cron = "${email.leave.notification.shift1.cron}")
@Scheduled
(
cron
=
"${email.leave.notification.shift1.cron}"
)
public
void
scheduleLeaveMailForShift1Empls
()
throws
IOException
,
MessagingException
,
MyTeamException
{
//Shift 1(9:00 AM - 6:00 PM)
logger
.
info
(
Shifts
.
SHIFT1
.
getShiftType
()
+
" :: Execution Time - {}"
,
dateTimeFormatter
.
format
(
LocalDateTime
.
now
()));
...
...
@@ -66,7 +66,7 @@ public class LeaveNotificationScheduler {
}
//
@Scheduled(cron = "${email.leave.notification.shift2.cron}")
@Scheduled
(
cron
=
"${email.leave.notification.shift2.cron}"
)
public
void
scheduleLeaveMailForShift2Empls
()
throws
IOException
,
MessagingException
,
MyTeamException
{
//Shift-2(2:00 PM - 11:00 PM)--General Shift
logger
.
info
(
Shifts
.
SHIFT2
.
getShiftType
()
+
" :: Execution Time - {}"
,
dateTimeFormatter
.
format
(
LocalDateTime
.
now
()));
...
...
@@ -74,7 +74,7 @@ public class LeaveNotificationScheduler {
}
//
@Scheduled(cron = "${email.leave.notification.shift3.cron}")
@Scheduled
(
cron
=
"${email.leave.notification.shift3.cron}"
)
public
void
scheduleLeaveMailForShift3Empls
()
throws
IOException
,
MessagingException
,
MyTeamException
{
//Shift 3(10:00 PM - 6:00 AM)
logger
.
info
(
Shifts
.
SHIFT3
.
getShiftType
()
+
" :: Execution Time - {}"
,
dateTimeFormatter
.
format
(
LocalDateTime
.
now
()));
...
...
@@ -82,7 +82,7 @@ public class LeaveNotificationScheduler {
}
//
@Scheduled(cron = "${email.leave.notification.shift4.cron}")
@Scheduled
(
cron
=
"${email.leave.notification.shift4.cron}"
)
public
void
scheduleLeaveMailForShift4Empls
()
throws
IOException
,
MessagingException
,
MyTeamException
{
//Shift 4(7:30 AM - 3:30 PM)
logger
.
info
(
Shifts
.
SHIFT4
.
getShiftType
()
+
" :: Execution Time - {}"
,
dateTimeFormatter
.
format
(
LocalDateTime
.
now
()));
...
...
@@ -90,7 +90,7 @@ public class LeaveNotificationScheduler {
}
//
@Scheduled(cron = "${email.leave.notification.shift5.cron}")
@Scheduled
(
cron
=
"${email.leave.notification.shift5.cron}"
)
public
void
scheduleLeaveMailForShift5Empls
()
throws
IOException
,
MessagingException
,
MyTeamException
{
//Shift 5(11:30 AM - 7:30 PM)
logger
.
info
(
Shifts
.
SHIFT5
.
getShiftType
()
+
" :: Execution Time - {}"
,
dateTimeFormatter
.
format
(
LocalDateTime
.
now
()));
...
...
@@ -104,13 +104,13 @@ public class LeaveNotificationScheduler {
Map
<
String
,
Object
>
model
=
new
HashMap
<
String
,
Object
>();
String
currentDate
=
dateTimeFormatter
.
format
(
LocalDateTime
.
now
());
String
functionalGroupName
;
final
String
mailSubject
=
environment
.
getProperty
(
"email.leave.notification.subject"
).
concat
(
"for the day::"
).
concat
(
MyTeamDateUtils
.
FormatTodaysDate
(
));
final
String
mailSubject
=
String
.
valueOf
(
"Date::"
).
concat
(
MyTeamDateUtils
.
FormatTodaysDate
()
+
"::"
).
concat
(
environment
.
getProperty
(
"email.leave.notification.subject"
));
Employee
employee
;
String
empSubStatus
;
try
{
if
(!
MyTeamDateUtils
.
isTodayHoliday
(
environment
.
getProperty
(
"email.holidays.list.2019"
,
""
)))
{
if
(!
MyTeamDateUtils
.
isTodayHoliday
(
environment
.
getProperty
(
"email.holidays.list.2019"
,
"
14-01-2019,21-03-2019,19-04-2019,05-06-2019,12-08-2019,15-08-2019,02-09-2019,02-10-2019,08-10-2019,25-12-2019
"
)))
{
List
<
AttendenceData
>
attendenceList
=
attendanceService
.
getAttendanciesReport
(
currentDate
,
shift
);
List
<
AttendenceData
>
absentiesList
=
attendenceList
.
stream
()
...
...
src/main/resources/application.properties
View file @
9cbf52a4
...
...
@@ -65,5 +65,5 @@ email.project.notification.subject=Project EndDate Email Notification
email.project.notification.cron
=
00 00 15 * * 1-5
spring.profiles.active
=
development
spring.profiles.active
=
production
message
=
this is from default configuration
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment