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
a34d57f7
Commit
a34d57f7
authored
Feb 14, 2020
by
Md Suleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small fixes in effective time period
parent
5a24c359
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
EffectiveLoginTimeScheduler.java
...m/nisum/myteam/schedular/EffectiveLoginTimeScheduler.java
+2
-0
EffectiveLoginTimeService.java
.../nisum/myteam/service/impl/EffectiveLoginTimeService.java
+5
-3
application-production.properties
src/main/resources/application-production.properties
+1
-0
No files found.
src/main/java/com/nisum/myteam/schedular/EffectiveLoginTimeScheduler.java
View file @
a34d57f7
...
...
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
javax.transaction.Transactional
;
import
java.util.List
;
@Component
...
...
@@ -23,6 +24,7 @@ public class EffectiveLoginTimeScheduler {
@Scheduled
(
cron
=
"${effective.login.time.cron}"
)
@Transactional
public
void
calculateLoginTime
()
throws
MyTeamException
{
List
<
Employee
>
allEmployees
=
employeeService
.
getActiveEmployees
();
for
(
Employee
employee:
allEmployees
){
...
...
src/main/java/com/nisum/myteam/service/impl/EffectiveLoginTimeService.java
View file @
a34d57f7
...
...
@@ -9,6 +9,7 @@ import com.nisum.myteam.service.IEffectiveLoginTimeService;
import
com.nisum.myteam.utils.CommomUtil
;
import
com.nisum.myteam.utils.MyTeamLogger
;
import
com.nisum.myteam.utils.MyTeamUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.assertj.core.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -20,6 +21,7 @@ import java.sql.Time;
import
java.text.ParseException
;
import
java.util.*
;
@Slf4j
@Service
public
class
EffectiveLoginTimeService
implements
IEffectiveLoginTimeService
{
...
...
@@ -61,6 +63,8 @@ public class EffectiveLoginTimeService implements IEffectiveLoginTimeService {
effectiveLoginData
.
setEmployeeId
(
employeeLoginData
.
getEmployeeId
());
effectiveLoginData
.
setDate
(
employeeLoginData
.
getDate
());
effectiveLoginData
.
setLoginTime
(
employeeLoginData
.
getTime
().
toString
());
if
(
entryType
.
equals
(
"OUT"
))
effectiveLoginData
.
getOrphanLogin
().
add
(
"OUT-"
+
employeeLoginData
.
getTime
().
toString
());
}
if
(
entryType
.
equals
(
"IN"
)
&&
employeeLoginData
.
getEntryType
().
equals
(
"OUT"
)){
differenceTime
=
employeeLoginData
.
getTime
().
getTime
()
-
time
;
...
...
@@ -72,9 +76,7 @@ public class EffectiveLoginTimeService implements IEffectiveLoginTimeService {
entryType
=
employeeLoginData
.
getEntryType
();
}
if
(
Objects
.
nonNull
(
effectiveLoginData
)){
if
(!
Strings
.
isNullOrEmpty
(
times
.
toString
()))
times
.
deleteCharAt
(
times
.
length
()-
1
);
// effectiveLoginData.setOrphanLogin(times.toString());
log
.
info
(
"Storing effective login time for employee:{}"
,
effectiveLoginData
.
getEmployeeId
());
effectiveLoginDataRepo
.
save
(
effectiveLoginData
);
}
...
...
src/main/resources/application-production.properties
View file @
a34d57f7
...
...
@@ -69,6 +69,7 @@ email.workAnniversary.notification.from=mytime.nisum@gmail.com
email.workAnniversary.notification.subject
=
Happy Work Anniversary
email.workAnniversary.notification.cron
=
00 00 06 * * 1-7
effective.login.time.cron
=
00 05 00 * * 1-7
email.holidays.list.2020
=
01-01-2020,15-01-2020,25-03-2020,10-04-2020,25-05-2020,02-06-2020,31-07-2020,02-10-2020,26-10-2020,25-12-2020
...
...
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