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
c8931b7f
Commit
c8931b7f
authored
Jun 11, 2019
by
vikram singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"Added Service for Account by billability."
parent
a3ec008a
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
2541 additions
and
2487 deletions
+2541
-2487
ReportsController.java
...n/java/com/nisum/myteam/controller/ReportsController.java
+426
-418
Reports.java
src/main/java/com/nisum/myteam/model/Reports.java
+30
-0
IEmployeeService.java
src/main/java/com/nisum/myteam/service/IEmployeeService.java
+0
-3
IReportService.java
src/main/java/com/nisum/myteam/service/IReportService.java
+18
-9
EmployeeService.java
...n/java/com/nisum/myteam/service/impl/EmployeeService.java
+0
-37
ReportService.java
...ain/java/com/nisum/myteam/service/impl/ReportService.java
+164
-116
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+954
-958
ChartsController.js
src/main/webapp/WEB-INF/controllers/ChartsController.js
+256
-256
custom-theme.css
src/main/webapp/WEB-INF/css/custom-theme.css
+668
-665
charts.html
src/main/webapp/WEB-INF/templates/charts.html
+25
-25
No files found.
src/main/java/com/nisum/myteam/controller/ReportsController.java
View file @
c8931b7f
...
...
@@ -35,7 +35,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.
BillableEmployee
;
import
com.nisum.myteam.model.
Reports
;
import
com.nisum.myteam.model.ColumnChartData
;
import
com.nisum.myteam.model.GroupByCount
;
import
com.nisum.myteam.model.ReportSeriesRecord
;
...
...
@@ -266,29 +266,27 @@ public class ReportsController {
@RequestMapping
(
value
=
"/fetchEmployeeDetailsByFGAndBillability"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
BillableEmployee
>>
getEmployeesByFGAndBillability
(
public
ResponseEntity
<
List
<
Reports
>>
getEmployeesByFGAndBillability
(
@RequestParam
(
"fGroup"
)
String
fGroup
,
@RequestParam
(
"billableStatus"
)
String
billableStatus
)
throws
MyTeamException
{
List
<
BillableEmployee
>
empList
=
new
ArrayList
<>();
empList
=
employeeService
.
getEmployeeDetailsByFGAndBillability
(
fGroup
,
billableStatus
);
List
<
Reports
>
empList
=
null
;
empList
=
reportService
.
getEmployeeDetailsByFGAndBillability
(
fGroup
,
billableStatus
);
return
new
ResponseEntity
<>(
empList
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/fetchEmployeeDetailsByAccountBillability"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
ResourceVO
>>
fetchEmployeeDetailsByAccountBillability
(
@RequestParam
(
"account"
)
String
account
,
@RequestParam
(
"billabilityStatus"
)
String
billabilityStatus
)
throws
MyTeamException
{
List
<
ResourceVO
>
resourcesList
=
new
ArrayList
<>();
if
(
account
!=
null
&&
!
account
.
isEmpty
())
{
resourcesList
=
resourceService
.
getAllResourcesVO
();
}
return
new
ResponseEntity
<>(
resourcesList
,
HttpStatus
.
OK
);
}
// @RequestMapping(value = "/fetchEmployeeDetailsByAccountBillability",
// method = RequestMethod.GET,
// produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<List<ResourceVO>> fetchEmployeeDetailsByAccountBillability(
// @RequestParam("account") String account,
// @RequestParam("billabilityStatus") String billabilityStatus)
// throws MyTeamException {
// List<ResourceVO> resourcesList = new ArrayList<>();
// if (account != null && !account.isEmpty()) {
// resourcesList = resourceService.getAllResourcesVO();
//
// }
// return new ResponseEntity<>(resourcesList, HttpStatus.OK);
// }
@RequestMapping
(
value
=
"/fetchEmployeeDetailsByDateBillability"
,
...
...
@@ -370,9 +368,6 @@ public class ReportsController {
List
<
String
>
catagories
=
new
ArrayList
();
List
<
ReportSeriesRecord
>
seriesDetails
=
new
ArrayList
<
ReportSeriesRecord
>();
//List<Account> accounts = employeeService.getAccounts();
List
<
Account
>
accounts
=
accountService
.
getAllAccounts
();
...
...
@@ -412,7 +407,20 @@ public class ReportsController {
return
new
ResponseEntity
<>(
reportData
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/fetchEmployeeDetailsByAccountBillability"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
Reports
>>
fetchEmployeeDetailsByAccountBillability
(
@RequestParam
(
"account"
)
String
account
,
@RequestParam
(
"billabilityStatus"
)
String
billabilityStatus
)
throws
MyTeamException
{
List
<
Reports
>
resourcesList
=
new
ArrayList
<>();
if
(
account
!=
null
&&
!
account
.
isEmpty
())
{
resourcesList
=
reportService
.
getEmployeeDetailsByAccountBillability
(
account
,
billabilityStatus
);
}
return
new
ResponseEntity
<>(
resourcesList
,
HttpStatus
.
OK
);
}
}
src/main/java/com/nisum/myteam/model/Reports.java
0 → 100644
View file @
c8931b7f
package
com
.
nisum
.
myteam
.
model
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.ToString
;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public
class
Reports
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
employeeId
;
private
String
employeeName
;
private
String
emailId
;
private
String
projectName
;
private
String
billableStatus
;
private
Date
billingStartDate
;
private
Date
billingEndDate
;
private
String
functionalGroup
;
}
src/main/java/com/nisum/myteam/service/IEmployeeService.java
View file @
c8931b7f
package
com
.
nisum
.
myteam
.
service
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.BillableEmployee
;
import
com.nisum.myteam.model.dao.Account
;
import
com.nisum.myteam.model.dao.Employee
;
import
org.springframework.stereotype.Service
;
...
...
@@ -53,6 +52,4 @@ public interface IEmployeeService {
public
List
<
Employee
>
getEmployeesByEmpStatusAndShift
(
String
empStatus
,
String
shift
);
List
<
BillableEmployee
>
getEmployeeDetailsByFGAndBillability
(
String
fGroup
,
String
billableStatus
);
}
src/main/java/com/nisum/myteam/service/IReportService.java
View file @
c8931b7f
package
com
.
nisum
.
myteam
.
service
;
import
java.util.List
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.Reports
;
import
com.nisum.myteam.model.vo.ReportVo
;
import
com.nisum.myteam.model.vo.ResourceVO
;
public
interface
IReportService
{
public
ReportVo
getBarChartReport
(
String
byType
)
throws
MyTeamException
;
public
List
<
Reports
>
getEmployeeDetailsByFGAndBillability
(
String
fGroup
,
String
billableStatus
)
throws
MyTeamException
;
public
List
<
Reports
>
getEmployeeDetailsByAccountBillability
(
String
account
,
String
billabilityStatus
)
throws
MyTeamException
;
}
\ No newline at end of file
src/main/java/com/nisum/myteam/service/impl/EmployeeService.java
View file @
c8931b7f
...
...
@@ -20,7 +20,6 @@ import org.springframework.data.mongodb.core.query.Update;
import
org.springframework.stereotype.Service
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.BillableEmployee
;
import
com.nisum.myteam.model.dao.Account
;
import
com.nisum.myteam.model.dao.Domain
;
import
com.nisum.myteam.model.dao.Employee
;
...
...
@@ -343,40 +342,4 @@ public class EmployeeService implements IEmployeeService {
}
@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/ReportService.java
View file @
c8931b7f
package
com
.
nisum
.
myteam
.
service
.
impl
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.Reports
;
import
com.nisum.myteam.model.dao.Account
;
import
com.nisum.myteam.model.dao.Employee
;
import
com.nisum.myteam.model.dao.Project
;
import
com.nisum.myteam.model.dao.Resource
;
import
com.nisum.myteam.model.vo.ReportVo
;
import
com.nisum.myteam.model.vo.ResourceVO
;
import
com.nisum.myteam.service.IReportService
;
import
com.nisum.myteam.statuscodes.ResourceStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -15,6 +20,9 @@ import java.util.stream.Collectors;
@Service
public
class
ReportService
implements
IReportService
{
private
static
final
String
Shadow
=
"Shadow"
;
private
static
final
String
Reserved
=
"Reserved"
;
@Autowired
private
EmployeeService
employeeService
;
...
...
@@ -113,4 +121,44 @@ public class ReportService implements IReportService {
return
employeeList
;
}
@Override
public
List
<
Reports
>
getEmployeeDetailsByFGAndBillability
(
String
fGroup
,
String
billableStatus
)
throws
MyTeamException
{
List
<
Employee
>
employeesByFG
=
employeeService
.
getEmployeesByFunctionalGrp
(
fGroup
);
return
resultantEmployeeWithBillability
(
employeesByFG
,
billableStatus
);
}
@Override
public
List
<
Reports
>
getEmployeeDetailsByAccountBillability
(
String
accountName
,
String
billabilityStatus
)
throws
MyTeamException
{
return
resultantEmployeeWithBillability
(
getEmployeeByAccounts
(
accountName
),
billabilityStatus
);
}
private
List
<
Reports
>
resultantEmployeeWithBillability
(
List
<
Employee
>
employees
,
String
billableStatus
)
{
List
<
Reports
>
resultantEmployees
=
new
ArrayList
<
Reports
>();
for
(
Employee
employee:
employees
)
{
Resource
resourceObj
=
resourceService
.
getLatestResourceByEmpId
(
employee
.
getEmployeeId
());
if
(
resourceObj
.
getBillableStatus
().
equals
(
billableStatus
)
||(
billableStatus
.
equals
(
"Non-Billable"
)
&&
(
resourceObj
.
getBillableStatus
().
equals
(
Shadow
)||
resourceObj
.
getBillableStatus
().
equals
(
Reserved
))))
{
resultantEmployees
.
add
(
mappingReports
(
employee
,
resourceObj
)
);
}
}
return
resultantEmployees
;
}
private
Reports
mappingReports
(
Employee
employee
,
Resource
resourceObj
){
Reports
Reports
=
new
Reports
();
Project
project
=
projectService
.
getProjectByProjectId
(
resourceObj
.
getProjectId
());
Reports
.
setEmployeeId
(
resourceObj
.
getEmployeeId
());
Reports
.
setEmployeeName
(
employee
.
getEmployeeName
());
Reports
.
setEmailId
(
employee
.
getEmailId
());
Reports
.
setProjectName
(
project
.
getProjectName
());
Reports
.
setBillingStartDate
(
resourceObj
.
getBillingStartDate
());
Reports
.
setBillableStatus
(
resourceObj
.
getBillableStatus
());
Reports
.
setBillingEndDate
(
resourceObj
.
getBillingEndDate
());
Reports
.
setFunctionalGroup
(
employee
.
getFunctionalGroup
());
return
Reports
;
}
}
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
c8931b7f
...
...
@@ -690,12 +690,8 @@ public class ResourceService implements IResourceService {
@Override
public
Resource
getLatestResourceByEmpId
(
String
employeeId
)
{
List
<
Resource
>
resourceList
=
resourceRepo
.
findByEmployeeId
(
employeeId
).
stream
().
filter
(
r
->
r
.
getBillingEndDate
().
after
(
new
Date
())).
collect
(
Collectors
.
toList
());
if
(!
resourceList
.
isEmpty
())
return
resourceList
.
get
(
0
);
else
return
null
;
return
getLatestAllocation
(
resourceRepo
.
findByEmployeeId
(
employeeId
));
}
...
...
src/main/webapp/WEB-INF/controllers/ChartsController.js
View file @
c8931b7f
...
...
@@ -175,7 +175,7 @@ myApp.directive('hcPieChart', function () {
Highcharts
.
chart
(
element
[
0
],
{
chart
:
{
type
:
chartName
,
height
:
(
9
/
16
*
100
)
+
'%'
height
:
'300px'
},
title
:
{
text
:
title
...
...
src/main/webapp/WEB-INF/css/custom-theme.css
View file @
c8931b7f
...
...
@@ -663,3 +663,6 @@ cursor: pointer;
.allocation-change-report
{
height
:
calc
(
85vh
-
168px
)
!important
;
}
.utilization-report
{
height
:
calc
(
86vh
-
346px
)
!important
;
}
src/main/webapp/WEB-INF/templates/charts.html
View file @
c8931b7f
...
...
@@ -13,7 +13,7 @@
<div
class=
"row col-lg-12"
>
<div
id=
"gridTest"
ui-grid=
"gridOptions"
ui-grid-pagination
ui-grid-exporter
class=
"myGrid
"
style=
"width:100%;height:186px;margin-left:0px;"
>
class=
"myGrid
utilization-report"
>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
data available
</div>
</div>
...
...
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