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
9f4c0f11
Commit
9f4c0f11
authored
Jun 10, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Billability by functional group service call
parent
570708e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
55 deletions
+73
-55
ReportsController.java
...n/java/com/nisum/myteam/controller/ReportsController.java
+58
-46
AllocationChangeController.js
.../webapp/WEB-INF/controllers/AllocationChangeController.js
+7
-7
ChartsController.js
src/main/webapp/WEB-INF/controllers/ChartsController.js
+5
-2
custom-theme.css
src/main/webapp/WEB-INF/css/custom-theme.css
+3
-0
No files found.
src/main/java/com/nisum/myteam/controller/ReportsController.java
View file @
9f4c0f11
package
com
.
nisum
.
myteam
.
controller
;
import
static
org
.
springframework
.
data
.
mongodb
.
core
.
aggregation
.
Aggregation
.
group
;
...
...
@@ -319,49 +320,63 @@ public class ReportsController {
return
new
ResponseEntity
<>(
empList
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/billabilityByFunctionalGroup"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ReportVo
billabilityReportByFunctionalGroup
(){
ReportVo
reportVo
=
new
ReportVo
();
Map
<
String
,
Object
>
billableData
=
new
HashMap
();
Map
<
String
,
Object
>
nonBillableData
=
new
HashMap
();
List
<
Object
>
billableCount
=
new
ArrayList
<>();
List
<
Object
>
nonBillableCount
=
new
ArrayList
<>();
billableData
.
put
(
"name"
,
"Billable"
);
nonBillableData
.
put
(
"name"
,
"Non Billable"
);
for
(
String
functionalGroup:
reportVo
.
getCategoriesList
()){
Map
<
String
,
Object
>
billableObj
=
new
HashMap
();
Map
<
String
,
Object
>
nonbillableObj
=
new
HashMap
();
Integer
billableC
=
0
;
Integer
nonBillableC
=
0
;
float
billper
;
float
nonBillPer
;
List
<
Employee
>
employeeList
=
employeeService
.
getAllEmployees
().
stream
().
filter
(
e
->
e
.
getFunctionalGroup
().
equals
(
functionalGroup
)).
collect
(
Collectors
.
toList
());
for
(
Employee
employee:
employeeList
){
Resource
resource
=
resourceService
.
getLatestResourceByEmpId
(
employee
.
getEmployeeId
());
if
(
resource
!=
null
&&
resource
.
getBillableStatus
().
equals
(
"Billable"
)){
billableC
++;
}
else
{
nonBillableC
++;
}
}
billper
=
((
billableC
/
(
float
)
employeeList
.
size
())*
100
);
nonBillPer
=
nonBillableC
/(
float
)
employeeList
.
size
()*
100
;
billableObj
.
put
(
"percent"
,
billper
);
billableObj
.
put
(
"y"
,
billableC
);
nonbillableObj
.
put
(
"percent"
,
nonBillPer
);
nonbillableObj
.
put
(
"y"
,
nonBillableC
);
billableCount
.
add
(
billableObj
);
nonBillableCount
.
add
(
nonbillableObj
);
}
billableData
.
put
(
"data"
,
billableCount
);
nonBillableData
.
put
(
"data"
,
nonBillableCount
);
reportVo
.
getSeriesDataList
().
add
(
billableData
);
reportVo
.
getSeriesDataList
().
add
(
nonBillableData
);
return
reportVo
;
@RequestMapping
(
value
=
"/billabilityByFunctionalGroup"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ReportVo
billabilityReportByFunctionalGroup
(){
ReportVo
reportVo
=
new
ReportVo
();
Map
<
String
,
Object
>
billableData
=
new
HashMap
();
Map
<
String
,
Object
>
nonBillableData
=
new
HashMap
();
Map
<
String
,
Object
>
traineeData
=
new
HashMap
();
List
<
Object
>
billableCount
=
new
ArrayList
<>();
List
<
Object
>
nonBillableCount
=
new
ArrayList
<>();
List
<
Object
>
traineeCount
=
new
ArrayList
<>();
billableData
.
put
(
"name"
,
"Billable"
);
nonBillableData
.
put
(
"name"
,
"Non-Billable"
);
traineeData
.
put
(
"name"
,
"Trainee"
);
for
(
String
functionalGroup:
reportVo
.
getCategoriesList
()){
Map
<
String
,
Object
>
billableObj
=
new
HashMap
();
Map
<
String
,
Object
>
nonbillableObj
=
new
HashMap
();
// Map<String,Object> traineeObj = new HashMap();
Integer
billableC
=
0
;
Integer
nonBillableC
=
0
;
Integer
traineeC
=
0
;
// float traineePer;
float
billper
;
float
nonBillPer
;
List
<
Employee
>
employeeList
=
employeeService
.
getAllEmployees
().
stream
().
filter
(
e
->
e
.
getFunctionalGroup
().
equals
(
functionalGroup
)).
collect
(
Collectors
.
toList
());
for
(
Employee
employee:
employeeList
){
Resource
resource
=
resourceService
.
getLatestResourceByEmpId
(
employee
.
getEmployeeId
());
if
(
resource
!=
null
&&
resource
.
getBillableStatus
().
equals
(
"Billable"
)){
billableC
++;
}
else
if
(
resource
!=
null
&&
resource
.
getBillableStatus
().
equals
(
"Trainee"
))
{
traineeC
++;
}
else
{
nonBillableC
++;
}
}
billper
=
((
billableC
/
(
float
)(
employeeList
.
size
()
-
traineeC
))*
100
);
nonBillPer
=
nonBillableC
/(
float
)
(
employeeList
.
size
()-
traineeC
)*
100
;
// traineePer = traineeC / (float) employeeList.size()*100;
billableObj
.
put
(
"percent"
,
billper
);
billableObj
.
put
(
"y"
,
billableC
);
nonbillableObj
.
put
(
"percent"
,
nonBillPer
);
nonbillableObj
.
put
(
"y"
,
nonBillableC
);
// traineeObj.put("percent", traineePer);
// traineeObj.put("y", traineeC);
billableCount
.
add
(
billableObj
);
nonBillableCount
.
add
(
nonbillableObj
);
traineeCount
.
add
(
traineeC
);
}
billableData
.
put
(
"data"
,
billableCount
);
nonBillableData
.
put
(
"data"
,
nonBillableCount
);
traineeData
.
put
(
"data"
,
traineeCount
);
reportVo
.
getSeriesDataList
().
add
(
billableData
);
reportVo
.
getSeriesDataList
().
add
(
nonBillableData
);
reportVo
.
getSeriesDataList
().
add
(
traineeData
);
return
reportVo
;
}
...
...
@@ -436,9 +451,6 @@ public class ReportsController {
seriesDetails
.
add
(
reportSeriesRecord
);
}
System
.
out
.
println
(
seriesDetails
);
reportData
.
setCategoriesList
(
catagories
);
reportData
.
setSeriesDataList
(
seriesDetails
);
return
new
ResponseEntity
<>(
reportData
,
HttpStatus
.
OK
);
...
...
src/main/webapp/WEB-INF/controllers/AllocationChangeController.js
View file @
9f4c0f11
...
...
@@ -18,13 +18,13 @@ myApp.controller("allocationChangeReportController",function($scope,exportUiGrid
enableFiltering
:
true
,
enableHorizontalScrollbar
:
1
,
columnDefs
:
[
{
field
:
'employeeId'
,
displayName
:
'Emp
loyee
Id'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
width
:
100
},
{
field
:
'employeeName'
,
displayName
:
'Emp
loyee
Name'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
200
},
{
name
:
' prevAccountName'
,
displayName
:
'Prev
ious Client'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
fals
e
,
width
:
100
},
{
field
:
'prevProjectName'
,
displayName
:
'Prev
ious
Project'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
150
},
{
name
:
'prevBillableStatus'
,
displayName
:
'Prev
ious
Billability'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
100
},
{
name
:
'prevBillingStartDate'
,
displayName
:
'Prev
ious
Billing Start Date'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
150
},
{
name
:
'prevBillingEndDate'
,
displayName
:
'Prev
ious
Billing Start Date'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
150
},
{
field
:
'employeeId'
,
displayName
:
'Emp Id'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
width
:
100
},
{
field
:
'employeeName'
,
displayName
:
'Emp Name'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
200
},
{
name
:
' prevAccountName'
,
displayName
:
'Prev
Client'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
tru
e
,
width
:
100
},
{
field
:
'prevProjectName'
,
displayName
:
'Prev Project'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
150
},
{
name
:
'prevBillableStatus'
,
displayName
:
'Prev Billability'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
100
},
{
name
:
'prevBillingStartDate'
,
displayName
:
'Prev Billing Start Date'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
150
},
{
name
:
'prevBillingEndDate'
,
displayName
:
'Prev Billing Start Date'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
150
},
{
name
:
'currentAccountName'
,
displayName
:
'Current Client'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
100
},
{
name
:
'currentBillableStatus'
,
displayName
:
'Current Billability'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
100
},
{
field
:
'currentProjectName'
,
displayName
:
'Current Project'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
150
},
...
...
src/main/webapp/WEB-INF/controllers/ChartsController.js
View file @
9f4c0f11
...
...
@@ -91,10 +91,13 @@ myApp.directive('hcPieChart', function () {
$scope
.
getMyTeamDetails
=
function
(
seriesName
,
category
,
optionName
,
title
){
if
(
title
.
trim
()
==
'Employees Overview Report'
){
if
(
title
.
trim
()
==
'Billability By Functional Group'
){
if
(
category
==
'I&A'
){
category
=
'I%26A'
;
}
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"
/reports/fetchEmployeeDetailsByFG?fGroup="
+
option
Name
url
:
appConfig
.
appUri
+
"
reports/fetchEmployeeDetailsByFGAndBillability?fGroup="
+
category
+
"&billableStatus="
+
series
Name
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
gridOptions
.
data
=
response
.
data
;
if
(
response
.
data
.
length
>
10
){
...
...
src/main/webapp/WEB-INF/css/custom-theme.css
View file @
9f4c0f11
...
...
@@ -512,6 +512,9 @@ i.fa.fa-refresh:hover {
height: auto !important;
max-height: calc(350px - 20px);
} */
.ui-grid-icon-cancel
{
color
:
black
;
}
md-toolbar
._md-toolbar-transitions
{
min-height
:
50px
!important
;
}
...
...
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