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
d07ece5c
Commit
d07ece5c
authored
Feb 14, 2020
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Effective login hours changes in UI
parent
1e50d0c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
41 deletions
+44
-41
EffectiveLoginTimeScheduler.java
...m/nisum/myteam/schedular/EffectiveLoginTimeScheduler.java
+1
-1
MyDetailsController.js
src/main/webapp/WEB-INF/controllers/MyDetailsController.js
+18
-15
ReporteesController.js
src/main/webapp/WEB-INF/controllers/ReporteesController.js
+22
-22
employee.html
src/main/webapp/WEB-INF/templates/employee.html
+1
-1
reportees.html
src/main/webapp/WEB-INF/templates/reportees.html
+2
-2
No files found.
src/main/java/com/nisum/myteam/schedular/EffectiveLoginTimeScheduler.java
View file @
d07ece5c
...
@@ -29,7 +29,7 @@ public class EffectiveLoginTimeScheduler {
...
@@ -29,7 +29,7 @@ public class EffectiveLoginTimeScheduler {
List
<
Employee
>
allEmployees
=
employeeService
.
getActiveEmployees
();
List
<
Employee
>
allEmployees
=
employeeService
.
getActiveEmployees
();
for
(
Employee
employee:
allEmployees
){
for
(
Employee
employee:
allEmployees
){
EffectiveLoginData
effectiveLoginData
=
EffectiveLoginData
effectiveLoginData
=
effectiveLoginTimeService
.
calculateEffectiveLoginTimeForEmpAndSave
(
employee
x
);
effectiveLoginTimeService
.
calculateEffectiveLoginTimeForEmpAndSave
(
employee
);
}
}
}
}
}
}
src/main/webapp/WEB-INF/controllers/MyDetailsController.js
View file @
d07ece5c
...
@@ -6,10 +6,11 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
...
@@ -6,10 +6,11 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
$scope
.
avgLoginHrs
=
""
;
$scope
.
avgLoginHrs
=
""
;
// Date picker related code
// Date picker related code
var
today
=
new
Date
();
var
today
=
new
Date
();
var
priorDt
=
new
Date
(
today
.
getTime
()
-
(
30
*
24
*
60
*
60
*
1000
));
var
dateLessThanToday
=
new
Date
(
today
.
getTime
()
-
(
1
*
24
*
60
*
60
*
1000
));
$scope
.
maxDate
=
today
;
var
priorDt
=
new
Date
(
dateLessThanToday
.
getTime
()
-
(
30
*
24
*
60
*
60
*
1000
));
$scope
.
maxDate
=
dateLessThanToday
;
$scope
.
fromDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
toDate
=
t
oday
;
$scope
.
toDate
=
dateLessThanT
oday
;
$scope
.
gridOptions
=
{
$scope
.
gridOptions
=
{
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
...
@@ -17,10 +18,10 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
...
@@ -17,10 +18,10 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
pageNumber
:
1
,
pageNumber
:
1
,
pageSize
:
10
,
pageSize
:
10
,
columnDefs
:
[
columnDefs
:
[
{
field
:
'date
OfLogin'
,
displayName
:
'Date'
,
enableColumnMenu
:
true
,
enableSorting
:
true
},
{
field
:
'date
'
,
displayName
:
'Date'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
cellFilter
:
'date:"dd-MMM-yyyy"'
},
{
field
:
'
firstLogin
'
,
displayName
:
'Login Time'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'
loginTime
'
,
displayName
:
'Login Time'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'l
astLogout
'
,
displayName
:
'Logout Time'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'l
ogoutTime
'
,
displayName
:
'Logout Time'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'
totalLoginTime'
,
displayName
:
'Total Hours(HH:MM:SS)
'
,
enableColumnMenu
:
false
,
enableSorting
:
false
}
{
field
:
'
durationAtWorkPlace'
,
displayName
:
'Duration at Work Place
'
,
enableColumnMenu
:
false
,
enableSorting
:
false
}
]
]
};
};
$scope
.
gridOptions
.
data
=
[];
$scope
.
gridOptions
.
data
=
[];
...
@@ -32,13 +33,15 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
...
@@ -32,13 +33,15 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
var
empId
=
$scope
.
empId
;
var
empId
=
$scope
.
empId
;
$http
({
$http
({
method
:
"GET"
,
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"
attendance/employeeLoginsBasedOnDate?empId="
+
empId
+
"&fromDate="
+
fromDate
+
"&toDate="
+
toDate
url
:
appConfig
.
appUri
+
"
effectiveLogin?employeeId="
+
empId
+
"&fromDate="
+
fromDate
+
"&toDate="
+
toDate
}).
then
(
function
mySuccess
(
response
)
{
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
gridOptions
.
data
=
response
.
data
.
reverse
();
console
.
log
(
response
)
if
(
response
.
data
.
length
>
0
){
var
loginDataList
=
response
.
data
.
data
;
$scope
.
avgLoginHrs
=
response
.
data
[
response
.
data
.
length
-
1
].
totalAvgTime
+
" Hrs"
;
$scope
.
gridOptions
.
data
=
loginDataList
;
if
(
loginDataList
.
length
>
0
){
$scope
.
avgLoginHrs
=
response
.
data
.
averageTime
+
" Hrs"
;
}
}
if
(
response
.
data
.
length
>
10
){
if
(
loginDataList
.
length
>
10
){
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
}
}
else
{
else
{
...
@@ -52,7 +55,7 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
...
@@ -52,7 +55,7 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
$scope
.
refreshPage
=
function
(){
$scope
.
refreshPage
=
function
(){
$scope
.
fromDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
toDate
=
t
oday
;
$scope
.
toDate
=
dateLessThanT
oday
;
$scope
.
getEmployeeData
();
$scope
.
getEmployeeData
();
};
};
...
@@ -71,7 +74,7 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
...
@@ -71,7 +74,7 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
if
(
difference
<
0
){
if
(
difference
<
0
){
showAlert
(
'From Date should not be greater than To Date'
);
showAlert
(
'From Date should not be greater than To Date'
);
$scope
.
fromDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
toDate
=
t
oday
;
$scope
.
toDate
=
dateLessThanT
oday
;
}
else
{
}
else
{
$scope
.
fromDate
=
dateValue
;
$scope
.
fromDate
=
dateValue
;
$scope
.
toDate
=
toDat
;
$scope
.
toDate
=
toDat
;
...
@@ -82,7 +85,7 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
...
@@ -82,7 +85,7 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
if
(
differene
<
0
){
if
(
differene
<
0
){
showAlert
(
'To Date should not be less than From Date'
);
showAlert
(
'To Date should not be less than From Date'
);
$scope
.
fromDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
toDate
=
t
oday
;
$scope
.
toDate
=
dateLessThanT
oday
;
}
else
{
}
else
{
$scope
.
fromDate
=
fromDat
;
$scope
.
fromDate
=
fromDat
;
$scope
.
toDate
=
dateValue
;
$scope
.
toDate
=
dateValue
;
...
...
src/main/webapp/WEB-INF/controllers/ReporteesController.js
View file @
d07ece5c
...
@@ -4,18 +4,18 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
...
@@ -4,18 +4,18 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
$scope
.
empName
=
myFactory
.
getEmpName
();
$scope
.
empName
=
myFactory
.
getEmpName
();
$scope
.
empEmailId
=
myFactory
.
getEmpEmailId
();
$scope
.
empEmailId
=
myFactory
.
getEmpEmailId
();
$scope
.
role
=
myFactory
.
getEmpRole
();
$scope
.
role
=
myFactory
.
getEmpRole
();
$scope
.
avgLoginHrs
=
""
;
//
$scope.avgLoginHrs = "";
$scope
.
isVisible
=
false
;
$scope
.
isVisible
=
false
;
$scope
.
searchId
=
""
;
$scope
.
searchId
=
""
;
$scope
.
hidethis
=
false
;
$scope
.
hidethis
=
false
;
// Date picker related code
// Date picker related code
var
today
=
new
Date
();
var
today
=
new
Date
();
var
priorDt
=
today
;
var
priorDt
=
new
Date
(
today
.
getTime
()
-
(
1
*
24
*
60
*
60
*
1000
));
;
$scope
.
maxDate
=
today
;
$scope
.
maxDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
toDate
=
today
;
$scope
.
toDate
=
priorDt
;
$scope
.
gridOptions
=
{
$scope
.
gridOptions
=
{
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
...
@@ -24,12 +24,12 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
...
@@ -24,12 +24,12 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
pageSize
:
10
,
pageSize
:
10
,
enableFiltering
:
true
,
enableFiltering
:
true
,
columnDefs
:
[
columnDefs
:
[
{
field
:
'employeeId'
,
displayName
:
'Employee ID'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
field
:
'employeeId'
,
displayName
:
'Employee ID'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
150
},
{
field
:
'
employeeN
ame'
,
displayName
:
'Employee Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'
n
ame'
,
displayName
:
'Employee Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'date
OfLogin'
,
displayName
:
'Date'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
enableFiltering
:
false
},
{
field
:
'date
'
,
displayName
:
'Date'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
enableFiltering
:
false
,
cellFilter
:
'date:"dd-MMM-yyyy"'
},
{
field
:
'
firstLogin
'
,
displayName
:
'Login Time'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
},
{
field
:
'
loginTime
'
,
displayName
:
'Login Time'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
},
{
field
:
'l
astLogout
'
,
displayName
:
'Logout Time'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
},
{
field
:
'l
ogoutTime
'
,
displayName
:
'Logout Time'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
},
{
field
:
'
totalLoginTime'
,
displayName
:
'Total Hours(HH:MM:SS)
'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
}
{
field
:
'
durationAtWorkPlace'
,
displayName
:
'Duration at Work Place
'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
}
]
]
};
};
$scope
.
gridOptions
.
data
=
[];
$scope
.
gridOptions
.
data
=
[];
...
@@ -41,7 +41,7 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
...
@@ -41,7 +41,7 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
$scope
.
refreshPage
=
function
(){
$scope
.
refreshPage
=
function
(){
$scope
.
searchId
=
""
;
$scope
.
searchId
=
""
;
$scope
.
fromDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
toDate
=
today
;
$scope
.
toDate
=
priorDt
;
$scope
.
gridOptions
.
data
=
[];
$scope
.
gridOptions
.
data
=
[];
$scope
.
isVisible
=
false
;
$scope
.
isVisible
=
false
;
$scope
.
setPageDefaults
();
$scope
.
setPageDefaults
();
...
@@ -168,26 +168,26 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
...
@@ -168,26 +168,26 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
function
getData
(
empId
,
fromDate
,
toDate
,
type
){
function
getData
(
empId
,
fromDate
,
toDate
,
type
){
$http
({
$http
({
method
:
"GET"
,
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"
attendance/employeeLoginsBasedOnDate?empId="
+
empId
+
"&fromDate="
+
fromDate
+
"&toDate="
+
toDate
url
:
appConfig
.
appUri
+
"
effectiveLogin?employeeId="
+
empId
+
"&fromDate="
+
fromDate
+
"&toDate="
+
toDate
}).
then
(
function
mySuccess
(
response
)
{
}).
then
(
function
mySuccess
(
response
)
{
var
recs
=
response
.
data
;
var
recs
=
response
.
data
.
data
;
if
(
recs
.
length
==
0
&&
type
==
"onclick"
){
if
(
recs
.
length
==
0
&&
type
==
"onclick"
){
showAlert
(
'No data available'
);
showAlert
(
'No data available'
);
setFieldsEmpty
();
setFieldsEmpty
();
}
else
{
}
else
{
if
(
empId
==
0
){
if
(
empId
==
0
){
$scope
.
isVisible
=
false
;
$scope
.
isVisible
=
false
;
$scope
.
gridOptions
.
data
=
re
sponse
.
data
;
$scope
.
gridOptions
.
data
=
re
cs
;
}
else
{
}
else
{
if
(
re
sponse
.
data
.
length
>
0
){
if
(
re
cs
.
length
>
0
){
$scope
.
isVisible
=
true
;
$scope
.
isVisible
=
true
;
$scope
.
avgLoginHrs
=
response
.
data
[
0
].
totalAvgTime
+
" Hrs"
;
//
$scope.avgLoginHrs = response.data[0].totalAvgTime +" Hrs";
}
}
$scope
.
gridOptions
.
data
=
re
sponse
.
data
;
$scope
.
gridOptions
.
data
=
re
cs
;
}
}
}
}
if
(
re
sponse
.
data
.
length
>
10
){
if
(
re
cs
.
length
>
10
){
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
}
}
else
{
else
{
...
@@ -206,7 +206,7 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
...
@@ -206,7 +206,7 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
if
(
difference
<
0
){
if
(
difference
<
0
){
showAlert
(
'From Date should not be greater than To Date'
);
showAlert
(
'From Date should not be greater than To Date'
);
$scope
.
fromDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
toDate
=
today
;
$scope
.
toDate
=
priorDt
;
}
else
{
}
else
{
$scope
.
fromDate
=
dateValue
;
$scope
.
fromDate
=
dateValue
;
$scope
.
toDate
=
toDat
;
$scope
.
toDate
=
toDat
;
...
@@ -217,7 +217,7 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
...
@@ -217,7 +217,7 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
if
(
differene
<
0
){
if
(
differene
<
0
){
showAlert
(
'To Date should not be less than From Date'
);
showAlert
(
'To Date should not be less than From Date'
);
$scope
.
fromDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
toDate
=
today
;
$scope
.
toDate
=
priorDt
;
}
else
{
}
else
{
$scope
.
fromDate
=
fromDat
;
$scope
.
fromDate
=
fromDat
;
$scope
.
toDate
=
dateValue
;
$scope
.
toDate
=
dateValue
;
...
@@ -243,10 +243,10 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
...
@@ -243,10 +243,10 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
function
setFieldsEmpty
(){
function
setFieldsEmpty
(){
$scope
.
searchId
=
""
;
$scope
.
searchId
=
""
;
$scope
.
fromDate
=
priorDt
;
$scope
.
fromDate
=
priorDt
;
$scope
.
toDate
=
today
;
$scope
.
toDate
=
priorDt
;
$scope
.
gridOptions
.
data
=
[];
$scope
.
gridOptions
.
data
=
[];
$scope
.
isVisible
=
false
;
$scope
.
isVisible
=
false
;
$scope
.
avgLoginHrs
=
""
;
//
$scope.avgLoginHrs = "";
}
}
function
treatAsUTC
(
date
)
{
function
treatAsUTC
(
date
)
{
...
...
src/main/webapp/WEB-INF/templates/employee.html
View file @
d07ece5c
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"form-inline col-lg-12 col-sm-12"
>
<div
class=
"form-inline col-lg-12 col-sm-12"
>
<label
class=
"control-label"
for=
"avgHrs"
>
<label
class=
"control-label"
for=
"avgHrs"
>
Average
Login hours
:
</label>
{{avgLoginHrs}}
Average
hours at Workplace
:
</label>
{{avgLoginHrs}}
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
...
src/main/webapp/WEB-INF/templates/reportees.html
View file @
d07ece5c
...
@@ -55,13 +55,13 @@
...
@@ -55,13 +55,13 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<!--
<div class="form-group">
<div class="form-inline col-lg-12" ng-show="isVisible"
<div class="form-inline col-lg-12" ng-show="isVisible"
style="margin-left: 3%;">
style="margin-left: 3%;">
<label class="control-label" for="avgHrs"> Average Login
<label class="control-label" for="avgHrs"> Average Login
hours: </label>{{avgLoginHrs}}
hours: </label>{{avgLoginHrs}}
</div>
</div>
</div>
</div>
-->
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"form-inline col-lg-12"
>
<div
class=
"form-inline col-lg-12"
>
<div
id=
"gridTest"
ui-grid=
"gridOptions"
ui-grid-pagination
<div
id=
"gridTest"
ui-grid=
"gridOptions"
ui-grid-pagination
...
...
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