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
65cd588a
Commit
65cd588a
authored
Jun 10, 2019
by
vikram singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"MT - 5 code changes implementation of showing employee data by
clicking on grid."
parent
75c2d0cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
11 deletions
+42
-11
EmployeeService.java
...n/java/com/nisum/myteam/service/impl/EmployeeService.java
+35
-10
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+7
-1
No files found.
src/main/java/com/nisum/myteam/service/impl/EmployeeService.java
View file @
65cd588a
...
...
@@ -342,16 +342,41 @@ public class EmployeeService implements IEmployeeService {
return
employeeRepo
.
findByEmployeeIdIn
(
empIdsSet
);
}
@Override
public
List
<
BillableEmployee
>
getEmployeeDetailsByFGAndBillability
(
String
fGroup
,
String
billableStatus
)
{
Map
<
String
,
Resource
>
resourceMap
=
resourceService
.
findByBillableStatus
(
billableStatus
).
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getEmployeeId
(),
e
->
e
));
return
employeeRepo
.
findByEmpStatusAndFunctionalGroup
(
ResourceStatus
.
ACTIVE
.
getStatus
(),
fGroup
).
stream
().
filter
(
e
->
resourceMap
.
keySet
().
contains
(
e
.
getEmployeeId
())).
map
(
e
->
mappingBillableEmployee
(
e
,
fGroup
,
resourceMap
)).
collect
(
Collectors
.
toList
());
}
private
BillableEmployee
mappingBillableEmployee
(
Employee
e
,
String
fGroup
,
Map
<
String
,
Resource
>
resourceMap
)
{
Resource
resource
=
resourceMap
.
get
(
e
.
getEmployeeId
());
Project
project
=
projectService
.
getProjectByProjectId
(
resource
.
getProjectId
());
return
new
BillableEmployee
(
e
.
getEmployeeId
(),
e
.
getEmployeeName
(),
e
.
getEmailId
(),
project
.
getProjectName
(),
resource
.
getBillableStatus
(),
resource
.
getBillingStartDate
(),
resource
.
getBillingEndDate
(),
fGroup
);
}
@Override
public
List
<
BillableEmployee
>
getEmployeeDetailsByFGAndBillability
(
String
fGroup
,
String
billableStatus
)
{
BillableEmployee
billableEmployee
=
new
BillableEmployee
();
List
<
BillableEmployee
>
resultantEmployees
=
new
ArrayList
<
BillableEmployee
>();
List
<
Employee
>
employeesByFG
=
employeeRepo
.
findByEmpStatusAndFunctionalGroup
(
ResourceStatus
.
ACTIVE
.
getStatus
(),
fGroup
);
for
(
Employee
employee:
employeesByFG
)
{
Resource
resourceObj
=
resourceService
.
getLatestResourceByEmpId
(
employee
.
getEmployeeId
());
if
(
resourceObj
!=
null
&&
resourceObj
.
getBillableStatus
().
equals
(
billableStatus
))
{
Project
project
=
projectService
.
getProjectByProjectId
(
resourceObj
.
getProjectId
());
billableEmployee
.
setEmployeeId
(
resourceObj
.
getEmployeeId
());
billableEmployee
.
setEmployeeName
(
employee
.
getEmployeeName
());
billableEmployee
.
setEmailId
(
employee
.
getEmailId
());
billableEmployee
.
setProjectName
(
project
.
getProjectName
());
billableEmployee
.
setBillingStartDate
(
resourceObj
.
getBillingStartDate
());
billableEmployee
.
setBillableStatus
(
resourceObj
.
getBillableStatus
());
billableEmployee
.
setBillingEndDate
(
resourceObj
.
getBillingEndDate
());
billableEmployee
.
setFunctionalGroup
(
fGroup
);
resultantEmployees
.
add
(
billableEmployee
);
}
// else if(resourceObj==null ) {
// billableEmployee.setEmployeeId(employee.getEmployeeId());
// billableEmployee.setEmployeeName(employee.getEmployeeName());
// billableEmployee.setEmailId(employee.getEmailId());
// billableEmployee.setFunctionalGroup(fGroup);
// resultantEmployees.add(billableEmployee);
//
// }
}
return
resultantEmployees
;
//Map<String,Resource> resourceMap=resourceService.findByBillableStatus(billableStatus).stream().collect(Collectors.toMap(e->e.getEmployeeId(), e->e));
//return employeeRepo.findByEmpStatusAndFunctionalGroup(ResourceStatus.ACTIVE.getStatus(), fGroup).stream().filter(e->resourceMap.keySet().contains(e.getEmployeeId())).map(e-> mappingBillableEmployee(e,fGroup,resourceMap)).collect(Collectors.toList());
}
}
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
65cd588a
package
com
.
nisum
.
myteam
.
service
.
impl
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
...
...
@@ -886,11 +887,14 @@ public class ResourceService implements IResourceService {
return
allocationList
;
}
@Override
public
Set
<
Resource
>
findByBillableStatus
(
String
billableStatus
)
{
return
resourceRepo
.
findByBillableStatus
(
billableStatus
).
stream
().
filter
(
r
->
r
.
getBillingEndDate
().
after
(
new
Date
())).
collect
(
Collectors
.
toSet
());
}
}
//class
...
...
@@ -949,4 +953,6 @@ public class ResourceService implements IResourceService {
return finalResourcesList;
}
*/
\ 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