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
84958702
Commit
84958702
authored
Jun 03, 2019
by
Md Suleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated dashboard logic
parent
9c90c6a1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
9 deletions
+53
-9
DashboardController.java
...java/com/nisum/myteam/controller/DashboardController.java
+1
-1
Employee.java
src/main/java/com/nisum/myteam/model/dao/Employee.java
+2
-2
IDashboardService.java
...main/java/com/nisum/myteam/service/IDashboardService.java
+1
-0
DashboardService.java
.../java/com/nisum/myteam/service/impl/DashboardService.java
+42
-0
EmployeeService.java
...n/java/com/nisum/myteam/service/impl/EmployeeService.java
+1
-1
app.js
src/main/webapp/WEB-INF/js/app.js
+2
-2
login.html
src/main/webapp/WEB-INF/templates/login.html
+4
-3
No files found.
src/main/java/com/nisum/myteam/controller/DashboardController.java
View file @
84958702
...
...
@@ -27,7 +27,7 @@ public class DashboardController {
@RequestMapping
(
value
=
"/resources/getEmployeesDashBoard"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getEmployeesDashBoard
(
HttpServletRequest
request
)
throws
MyTeamException
{
List
<
EmployeeDashboardVO
>
employeeDashBoardList
=
dashboardService
.
get
EmployeesDashBoard
();
List
<
EmployeeDashboardVO
>
employeeDashBoardList
=
dashboardService
.
get
DashBoardData
();
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Resources have been retrieved successfully"
,
"List of Resources for dashboard"
,
employeeDashBoardList
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
...
...
src/main/java/com/nisum/myteam/model/dao/Employee.java
View file @
84958702
...
...
@@ -64,8 +64,8 @@ public class Employee implements Serializable {
@ExcelCellName
(
"Primary Skill"
)
private
String
baseTechnology
;
@ExcelCellName
(
"Domain"
)
private
String
domain
;
//
@ExcelCellName("Domain")
//
private String domain;
@ExcelCellName
(
"Location"
)
private
String
empLocation
;
...
...
src/main/java/com/nisum/myteam/service/IDashboardService.java
View file @
84958702
...
...
@@ -6,4 +6,5 @@ import java.util.List;
public
interface
IDashboardService
{
public
List
<
EmployeeDashboardVO
>
getEmployeesDashBoard
();
public
List
<
EmployeeDashboardVO
>
getDashBoardData
();
}
src/main/java/com/nisum/myteam/service/impl/DashboardService.java
View file @
84958702
package
com
.
nisum
.
myteam
.
service
.
impl
;
import
com.nisum.myteam.model.dao.Account
;
import
com.nisum.myteam.model.dao.Domain
;
import
com.nisum.myteam.model.dao.Employee
;
import
com.nisum.myteam.model.dao.Project
;
import
com.nisum.myteam.model.vo.EmployeeDashboardVO
;
...
...
@@ -14,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
@Slf4j
...
...
@@ -28,6 +31,12 @@ public class DashboardService implements IDashboardService {
@Autowired
private
IProjectService
projectService
;
@Autowired
private
DomainService
domainService
;
@Autowired
private
AccountService
accountService
;
@Override
public
List
<
EmployeeDashboardVO
>
getEmployeesDashBoard
()
{
//List<Employee> allEmployees = employeeRepo.findAll();
...
...
@@ -99,4 +108,37 @@ public class DashboardService implements IDashboardService {
}
return
employeeDashboard
;
}
@Override
public
List
<
EmployeeDashboardVO
>
getDashBoardData
(){
List
<
EmployeeDashboardVO
>
employeeDashboard
=
new
ArrayList
<>();
List
<
Employee
>
allEmployees
=
employeeService
.
getAllEmployees
();
List
<
ResourceVO
>
resources
=
resourceService
.
getAllResourcesVO
();
for
(
Employee
employee:
allEmployees
){
EmployeeDashboardVO
employeeDashboardVO
=
new
EmployeeDashboardVO
();
BeanUtils
.
copyProperties
(
employee
,
employeeDashboardVO
);
employeeDashboard
.
add
(
employeeDashboardVO
);
}
employeeDashboard
.
stream
().
forEach
(
emp
->
{
List
<
ResourceVO
>
latestResourceList
=
resources
.
stream
().
filter
(
res
->
(
res
.
getEmployeeId
().
equals
(
emp
.
getEmployeeId
())&&
res
.
getBillingEndDate
().
after
(
new
Date
()))).
collect
(
Collectors
.
toList
());
if
(!
latestResourceList
.
isEmpty
()){
ResourceVO
latestResource
=
latestResourceList
.
get
(
0
);
Project
resourceProject
=
projectService
.
getProjectByProjectId
(
latestResource
.
getProjectId
());
if
(!
resourceProject
.
getStatus
().
equals
(
"Completed"
)){
emp
.
setProjectId
(
resourceProject
.
getProjectId
());
emp
.
setProjectName
(
resourceProject
.
getProjectName
());
emp
.
setBillingStartDate
(
latestResource
.
getBillingStartDate
());
emp
.
setBillingEndDate
(
latestResource
.
getBillingEndDate
());
Domain
domain
=
domainService
.
getDomainById
(
resourceProject
.
getDomainId
());
Account
account
=
accountService
.
getAccountById
(
resourceProject
.
getAccountId
());
emp
.
setAccountName
(
account
.
getAccountName
());
emp
.
setDomain
(
domain
.
getDomainName
());
}
}
});
return
employeeDashboard
;
}
}
src/main/java/com/nisum/myteam/service/impl/EmployeeService.java
View file @
84958702
...
...
@@ -81,7 +81,7 @@ public class EmployeeService implements IEmployeeService {
update
.
set
(
"empSubStatus"
,
employeeReq
.
getEmpSubStatus
());
update
.
set
(
"employmentType"
,
employeeReq
.
getEmploymentType
());
update
.
set
(
"empLocation"
,
employeeReq
.
getEmpLocation
());
update
.
set
(
"domain"
,
employeeReq
.
getDomain
());
//
update.set("domain", employeeReq.getDomain());
update
.
set
(
"designation"
,
employeeReq
.
getDesignation
());
update
.
set
(
"dateOfBirth"
,
employeeReq
.
getDateOfBirth
());
update
.
set
(
"dateOfJoining"
,
employeeReq
.
getDateOfJoining
());
...
...
src/main/webapp/WEB-INF/js/app.js
View file @
84958702
...
...
@@ -17,8 +17,8 @@ function($mdDateLocaleProvider) {
myApp
.
constant
(
'appConfig'
,
{
appName
:
"MyTime"
,
appUri
:
"http://10.3.45.11:8080/myTeam/"
,
//
appUri: "http://localhost:8080/myTeam/",
//
appUri: "http://10.3.45.11:8080/myTeam/",
appUri
:
"http://localhost:8080/myTeam/"
,
version
:
"1.0"
,
empStartId
:
16001
,
empEndId
:
99999
,
...
...
src/main/webapp/WEB-INF/templates/login.html
View file @
84958702
...
...
@@ -16,7 +16,8 @@
function
renderButton
()
{
gapi
.
load
(
'auth2'
,
function
()
{
gapi
.
auth2
.
init
({
client_id
:
"951338644595-32q4i4n2rv4jevvteq77m7jpcq9sbrec.apps.googleusercontent.com"
,
//client_id: "951338644595-32q4i4n2rv4jevvteq77m7jpcq9sbrec.apps.googleusercontent.com",
client_id
:
"685521475239-ujm7l2hkgrltk7loi8efl0ed702asm2r.apps.googleusercontent.com"
,
hosted_domain
:
'nisum.com'
});
});
...
...
@@ -33,8 +34,8 @@
</script>
<script
src=
"https://apis.google.com/js/platform.js?onload=renderButton"
></script>
<!--<meta name="google-signin-client_id" content="10230597574-gv1bg8nehm0a63n9hh5mu9um563uqaq1.apps.googleusercontent.com">-->
<
!--<meta name="google-signin-client_id" content="685521475239-ujm7l2hkgrltk7loi8efl0ed702asm2r.apps.googleusercontent.com">--
>
<
meta
name=
"google-signin-client_id"
content=
"951338644595-32q4i4n2rv4jevvteq77m7jpcq9sbrec.apps.googleusercontent.com"
>
<
meta
name=
"google-signin-client_id"
content=
"685521475239-ujm7l2hkgrltk7loi8efl0ed702asm2r.apps.googleusercontent.com"
>
<
!--<meta name="google-signin-client_id" content="951338644595-32q4i4n2rv4jevvteq77m7jpcq9sbrec.apps.googleusercontent.com">--
>
...
...
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