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
393c6ba3
Commit
393c6ba3
authored
Jul 31, 2018
by
Rajeshekar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the jar issue and manage projects not working in prod server
parent
aafbaa63
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
52 deletions
+65
-52
build.gradle
build.gradle
+1
-1
EmployeeDataService.java
...in/java/com/nisum/mytime/service/EmployeeDataService.java
+62
-49
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+2
-2
No files found.
build.gradle
View file @
393c6ba3
...
@@ -56,7 +56,7 @@ dependencies {
...
@@ -56,7 +56,7 @@ dependencies {
compile
(
'jcifs:jcifs:1.3.17'
)
compile
(
'jcifs:jcifs:1.3.17'
)
compile
(
'javax.servlet:servlet-api'
)
compile
(
'javax.servlet:servlet-api'
)
compile
(
'com.github.ozlerhakan:poiji:1.11'
)
compile
(
'com.github.ozlerhakan:poiji:1.11'
)
testC
ompile
group:
'com.microsoft.sqlserver'
,
name:
'mssql-jdbc'
,
version:
'6.1.0.jre8'
c
ompile
group:
'com.microsoft.sqlserver'
,
name:
'mssql-jdbc'
,
version:
'6.1.0.jre8'
compile
(
'org.springframework.boot:spring-boot-starter-web'
)
compile
(
'org.springframework.boot:spring-boot-starter-web'
)
compile
(
'io.springfox:springfox-swagger2:2.7.0'
)
compile
(
'io.springfox:springfox-swagger2:2.7.0'
)
compile
(
'io.springfox:springfox-swagger-ui:2.7.0'
)
compile
(
'io.springfox:springfox-swagger-ui:2.7.0'
)
...
...
src/main/java/com/nisum/mytime/service/EmployeeDataService.java
View file @
393c6ba3
...
@@ -23,59 +23,72 @@ import com.nisum.mytime.utils.MyTimeUtils;
...
@@ -23,59 +23,72 @@ import com.nisum.mytime.utils.MyTimeUtils;
@Transactional
@Transactional
public
class
EmployeeDataService
{
public
class
EmployeeDataService
{
@Autowired
@Autowired
DbConnection
dbConnection
;
DbConnection
dbConnection
;
public
List
<
EmpLoginData
>
fetchEmployeeLoginsBasedOnDates
(
long
employeeId
,
String
fromDate
,
String
toDate
)
public
List
<
EmpLoginData
>
fetchEmployeeLoginsBasedOnDates
(
long
employeeId
,
throws
MyTimeException
{
String
fromDate
,
String
toDate
)
throws
MyTimeException
{
long
start_ms
=
System
.
currentTimeMillis
();
long
start_ms
=
System
.
currentTimeMillis
();
String
querys
=
null
;
String
querys
=
null
;
if
(
employeeId
==
0
)
if
(
employeeId
==
0
)
querys
=
MyTimeUtils
.
ABESENT_STATUS_QUERY
+
"'"
+
fromDate
+
"'"
+
MyTimeUtils
.
ABESENT_STATUS_QUERY1
+
"'"
querys
=
MyTimeUtils
.
ABESENT_STATUS_QUERY
+
"'"
+
fromDate
+
"'"
+
toDate
+
"'"
+
MyTimeUtils
.
ABESENT_STATUS_QUERY3
;
+
MyTimeUtils
.
ABESENT_STATUS_QUERY1
+
"'"
+
toDate
+
"'"
else
+
MyTimeUtils
.
ABESENT_STATUS_QUERY3
;
querys
=
MyTimeUtils
.
ABESENT_STATUS_QUERY
+
"'"
+
fromDate
+
"'"
+
MyTimeUtils
.
ABESENT_STATUS_QUERY1
+
"'"
else
+
toDate
+
"'"
+
MyTimeUtils
.
ABESENT_STATUS_QUERY2
+
employeeId
+
MyTimeUtils
.
ABESENT_STATUS_QUERY3
;
querys
=
MyTimeUtils
.
ABESENT_STATUS_QUERY
+
"'"
+
fromDate
+
"'"
int
countHours
=
0
;
+
MyTimeUtils
.
ABESENT_STATUS_QUERY1
+
"'"
+
toDate
+
"'"
List
<
EmpLoginData
>
listOfEmpLoginData
=
new
ArrayList
<>();
+
MyTimeUtils
.
ABESENT_STATUS_QUERY2
+
employeeId
+
MyTimeUtils
.
ABESENT_STATUS_QUERY3
;
int
countHours
=
0
;
List
<
EmpLoginData
>
listOfEmpLoginData
=
new
ArrayList
<>();
try
(
Connection
connection
=
dbConnection
.
getDBConnection
();
try
(
Connection
connection
=
dbConnection
.
getDBConnection
();
Statement
statement
=
connection
.
createStatement
();
Statement
statement
=
connection
.
createStatement
();
ResultSet
resultSet
=
statement
.
executeQuery
(
querys
.
toString
()))
{
ResultSet
resultSet
=
statement
while
(
resultSet
.
next
())
{
.
executeQuery
(
querys
.
toString
()))
{
EmpLoginData
empLoginData
=
new
EmpLoginData
();
while
(
resultSet
.
next
())
{
empLoginData
.
setEmployeeId
(
resultSet
.
getString
(
"EmployeeCode"
));
EmpLoginData
empLoginData
=
new
EmpLoginData
();
empLoginData
.
setEmployeeName
(
resultSet
.
getString
(
"FirstName"
));
empLoginData
.
setEmployeeId
(
resultSet
.
getString
(
"EmployeeCode"
));
empLoginData
.
setDateOfLogin
(
resultSet
.
getDate
(
"FirstLogin"
).
toString
());
empLoginData
.
setEmployeeName
(
resultSet
.
getString
(
"FirstName"
));
empLoginData
.
setFirstLogin
(
resultSet
.
getTime
(
"FirstLogin"
).
toString
());
empLoginData
.
setDateOfLogin
(
empLoginData
.
setLastLogout
(
resultSet
.
getTime
(
"LastLogin"
).
toString
());
resultSet
.
getDate
(
"FirstLogin"
).
toString
());
Time
from
=
resultSet
.
getTime
(
"FirstLogin"
);
empLoginData
.
setFirstLogin
(
Time
to
=
resultSet
.
getTime
(
"LastLogin"
);
resultSet
.
getTime
(
"FirstLogin"
).
toString
());
long
milliseconds
=
to
.
getTime
()
-
from
.
getTime
();
empLoginData
.
setLastLogout
(
int
seconds
=
(
int
)
milliseconds
/
1000
;
resultSet
.
getTime
(
"LastLogin"
).
toString
());
int
hours
=
seconds
/
3600
;
Time
from
=
resultSet
.
getTime
(
"FirstLogin"
);
int
minutes
=
(
seconds
%
3600
)
/
60
;
Time
to
=
resultSet
.
getTime
(
"LastLogin"
);
seconds
=
(
seconds
%
3600
)
%
60
;
long
milliseconds
=
to
.
getTime
()
-
from
.
getTime
();
int
seconds
=
(
int
)
milliseconds
/
1000
;
int
hours
=
seconds
/
3600
;
int
minutes
=
(
seconds
%
3600
)
/
60
;
seconds
=
(
seconds
%
3600
)
%
60
;
empLoginData
.
setTotalLoginTime
(
hours
+
":"
+
minutes
+
":"
+
seconds
);
empLoginData
.
setTotalLoginTime
(
empLoginData
.
setTotalLoginTime
(
hours
+
":"
+
minutes
+
":"
+
seconds
);
hours
+
":"
+
minutes
+
":"
+
seconds
);
Date
d
=
MyTimeUtils
.
tdf
.
parse
(
empLoginData
.
getTotalLoginTime
());
empLoginData
.
setTotalLoginTime
(
countHours
+=
d
.
getTime
();
hours
+
":"
+
minutes
+
":"
+
seconds
);
listOfEmpLoginData
.
add
(
empLoginData
);
Date
d
=
MyTimeUtils
.
tdf
}
.
parse
(
empLoginData
.
getTotalLoginTime
());
if
(!
listOfEmpLoginData
.
isEmpty
())
{
countHours
+=
d
.
getTime
();
listOfEmpLoginData
.
get
(
0
)
listOfEmpLoginData
.
add
(
empLoginData
);
.
setTotalAvgTime
(
MyTimeUtils
.
tdf
.
format
(
countHours
/
listOfEmpLoginData
.
size
()));
}
}
if
(!
listOfEmpLoginData
.
isEmpty
())
{
listOfEmpLoginData
.
get
(
0
).
setTotalAvgTime
(
MyTimeUtils
.
tdf
.
format
(
countHours
/
listOfEmpLoginData
.
size
()));
}
MyTimeLogger
.
getInstance
().
info
(
MyTimeLogger
.
getInstance
()
" Time Taken fecth Employee data based on Dates ::: "
+
(
System
.
currentTimeMillis
()
-
start_ms
));
.
info
(
" Time Taken fecth Employee data based on Dates ::: "
+
(
System
.
currentTimeMillis
()
-
start_ms
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
MyTimeLogger
.
getInstance
().
error
(
e
.
getMessage
());
e
.
printStackTrace
();
throw
new
MyTimeException
(
e
.
getMessage
());
MyTimeLogger
.
getInstance
().
error
(
e
.
getMessage
());
}
return
listOfEmpLoginData
;
throw
new
MyTimeException
(
e
.
getMessage
());
}
}
return
listOfEmpLoginData
;
}
}
}
\ No newline at end of file
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
393c6ba3
...
@@ -928,11 +928,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
...
@@ -928,11 +928,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
document
.
getElementById
(
'domain'
).
focus
();
document
.
getElementById
(
'domain'
).
focus
();
}
}
else
if
(
deliveryLeadsSelectedList
.
employeeName
==
undefined
||
deliveryLeadsSelectedList
.
employeeName
==
""
){
else
if
(
deliveryLeadsSelectedList
.
employeeName
==
undefined
||
deliveryLeadsSelectedList
.
employeeName
==
""
){
$scope
.
alertMsg
=
"Please select a Delivery Lead"
;
$scope
.
alertMsg
=
"Please select a Delivery Lead"
;
document
.
getElementById
(
'deliveryLead'
).
focus
();
document
.
getElementById
(
'deliveryLead'
).
focus
();
}
}
else
if
(
projectStatus
==
undefined
){
else
if
(
projectStatus
==
undefined
){
$scope
.
alertMsg
=
"Please select a Project Status"
;
$scope
.
alertMsg
=
"Please select a Project Status"
;
document
.
getElementById
(
'projectStatus'
).
focus
();
document
.
getElementById
(
'projectStatus'
).
focus
();
}
}
else
{
else
{
...
...
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