Commit 7a6fdf36 authored by Prayas Jain's avatar Prayas Jain

Added Utilization Reports Enhancements

parent 2dae5af4
...@@ -165,9 +165,8 @@ public class EmployeeService implements IEmployeeService { ...@@ -165,9 +165,8 @@ public class EmployeeService implements IEmployeeService {
// } // }
@Override @Override
@Transactional
public Employee updateEmployee(Employee employeeReq, String loginEmpId) throws ParseException { public Employee updateEmployee(Employee employeeReq, String loginEmpId) throws ParseException {
response.put("messege" , "Employee has been updated");
// update all emp details to inactive if employee is inactive // update all emp details to inactive if employee is inactive
Query query = new Query(Criteria.where("employeeId").is(employeeReq.getEmployeeId())); Query query = new Query(Criteria.where("employeeId").is(employeeReq.getEmployeeId()));
Update update = new Update(); Update update = new Update();
...@@ -245,7 +244,7 @@ public class EmployeeService implements IEmployeeService { ...@@ -245,7 +244,7 @@ public class EmployeeService implements IEmployeeService {
if(employeeReq.getEmpStatus().equals("In Active")){ if(employeeReq.getEmpStatus().equals("In Active")){
resourceService.makeResourceInactive(employeeReq.getEmployeeId(),employeeReq.getEndDate()); resourceService.makeResourceInactive(employeeReq.getEmployeeId(),employeeReq.getEndDate());
} }
response.put("messege" , "Employee has been updated");
return employeeUpdated; return employeeUpdated;
} }
......
...@@ -1142,15 +1142,16 @@ public class ResourceService implements IResourceService { ...@@ -1142,15 +1142,16 @@ public class ResourceService implements IResourceService {
@Override @Override
public Resource makeResourceInactive(String employeeId,Date endDate){ public Resource makeResourceInactive(String employeeId,Date endDate){
Resource latestAllocation = this.getLatestResourceByEmpId(employeeId); Resource futureAllocation = resourceRepo.findOneByEmployeeIdAndStatus(employeeId, MyTeamUtils.STATUS_PROPOSED);
Resource currentAllocation = this.getCurrentAllocationIfNotReturnNull(employeeId); Resource currentAllocation = resourceRepo.findOneByEmployeeIdAndStatus(employeeId, MyTeamUtils.STATUS_ENGAGED);
if(Objects.nonNull(latestAllocation) && latestAllocation.getBillingStartDate().compareTo(new Date())>0){ if(Objects.nonNull(futureAllocation)){
resourceRepo.delete(latestAllocation); resourceRepo.delete(futureAllocation);
} }
if(Objects.nonNull(currentAllocation)) {
currentAllocation.setBillingEndDate(endDate); currentAllocation.setBillingEndDate(endDate);
latestAllocation.setBillingEndDate(endDate); currentAllocation.setStatus(MyTeamUtils.STATUS_RELEASED);
resourceRepo.save(currentAllocation); resourceRepo.save(currentAllocation);
resourceRepo.save(latestAllocation); }
return null; return null;
} }
} }
\ No newline at end of file
...@@ -16,7 +16,7 @@ myApp.directive('hcPieChart', function () { ...@@ -16,7 +16,7 @@ myApp.directive('hcPieChart', function () {
if(reportType && searchedDate) { if(reportType && searchedDate) {
scope.errorMessage =false; scope.errorMessage =false;
if(reportType == "Monthly Trends"){ if(reportType == "Monthly Trends"){
getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element," Billability Monthly Trends"); getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element,"Billability Monthly Trends");
} }
else { else {
if(reportType=='I&A'){ if(reportType=='I&A'){
...@@ -54,7 +54,8 @@ myApp.directive('hcPieChart', function () { ...@@ -54,7 +54,8 @@ myApp.directive('hcPieChart', function () {
method: "GET", method: "GET",
url: appConfig.appUri + "functionalGroups/getAllFunctionalGroups" url: appConfig.appUri + "functionalGroups/getAllFunctionalGroups"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.reportTypeList = $scope.reportTypeList.concat(response.data.records); let functionalGrpsList = $scope.reportTypeList.concat(response.data.records);
$scope.reportTypeList = functionalGrpsList.filter(e => e !== 'Delivery Org' && e !== 'Global Mobility');
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
...@@ -126,7 +127,8 @@ myApp.directive('hcPieChart', function () { ...@@ -126,7 +127,8 @@ myApp.directive('hcPieChart', function () {
$scope.getMyTeamDetails = function(seriesName, category, optionName,title){ $scope.getMyTeamDetails = function(seriesName, category, optionName,title){
let searchedDate = getFormattedDate($scope.searchedReportDate); let searchedDate = getFormattedDate($scope.searchedReportDate);
if(title.trim() == 'Billability For All Functional Group'){ if(title.trim() == 'Billability For All Functional Group On '+searchedDate ||
title.trim() == 'Billability For All Functional Group On Today' ){
if(category=='I&A'){ if(category=='I&A'){
category = 'I%26A'; category = 'I%26A';
} }
...@@ -145,7 +147,8 @@ myApp.directive('hcPieChart', function () { ...@@ -145,7 +147,8 @@ myApp.directive('hcPieChart', function () {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
}); });
}else if(title.trim() == 'Billability For Account'){ }else if(title.trim() == 'Billability For Account On '+ searchedDate ||
title.trim() == 'Billability For Account On Today'){
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "reports/fetchEmployeeDetailsByAccountBillability?account="+category+"&billabilityStatus="+seriesName+"&onDate="+searchedDate url : appConfig.appUri + "reports/fetchEmployeeDetailsByAccountBillability?account="+category+"&billabilityStatus="+seriesName+"&onDate="+searchedDate
...@@ -284,6 +287,14 @@ myApp.directive('hcPieChart', function () { ...@@ -284,6 +287,14 @@ myApp.directive('hcPieChart', function () {
function getEmployeeDetails(scope,uri,chart,element,title){ function getEmployeeDetails(scope,uri,chart,element,title){
var result = []; var result = [];
var categoriesList = []; var categoriesList = [];
let displayTitle = '';
if(title === 'Billability Monthly Trends') {
displayTitle = title;
}
else {
displayTitle = getFormattedDate(scope.searchedReportDate) == getFormattedDate(new Date()) ? title+ " On Today" : title+ " On " +getFormattedDate(scope.searchedReportDate);
}
Highcharts.ajax({ Highcharts.ajax({
url: uri, url: uri,
success: function(data) { success: function(data) {
...@@ -294,7 +305,7 @@ var categoriesList = []; ...@@ -294,7 +305,7 @@ var categoriesList = [];
result = data; result = data;
categoriesList = data; categoriesList = data;
} }
scope.drawChart(element,chart,result,title,categoriesList); scope.drawChart(element,chart,result,displayTitle,categoriesList);
} }
}); });
} }
......
...@@ -715,14 +715,17 @@ cursor: pointer; ...@@ -715,14 +715,17 @@ cursor: pointer;
.manage-open-pool { .manage-open-pool {
height: calc(100vh - 239px) !important; height: calc(100vh - 239px) !important;
} }
.add-space { .select-report-date-container {
margin: 20px 0 10px 0; margin: 20px 0 10px 0;
}
.select-report-date-container > div {
margin: 25px 0 10px 0;
} }
.search-report-date { .search-report-date {
padding-left:0; padding-left:0;
} }
.search-report-date .md-datepicker-input-container { .search-report-date .md-datepicker-input-container {
width: 74%; width: 72%;
margin:0; margin:0;
} }
...@@ -732,18 +735,13 @@ margin: 20px 0 10px 0; ...@@ -732,18 +735,13 @@ margin: 20px 0 10px 0;
.report-type-selectbox{ .report-type-selectbox{
padding-right:0; padding-right:0;
} }
.date-container {
margin-top: 25px;
}
.select-report-type md-select { .select-report-type md-select {
margin:0; margin:0;
} }
.report-type-label { .report-type-label {
padding-right: 0; padding-right: 0;
} }
.report-search-date-label {
padding: 0 0 0 8px;
}
.search-report-btn { .search-report-btn {
margin-left:15px; margin-left:15px;
padding:4px; padding:4px;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class ="col-lg-6 col-md-6"> <div class ="col-lg-6 col-md-6">
<hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart> <hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart>
</div> </div>
<div class="col-lg-6 col-md-6 add-space"> <div class="col-lg-6 col-md-6 select-report-date-container">
<div class="row add-space"> <div class="row add-space">
<div class="col-lg-4 col-md-4"></div> <div class="col-lg-4 col-md-4"></div>
<div class= "col-lg-8 col-md-8"> <div class= "col-lg-8 col-md-8">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row date-container"> <div class="row">
<div class="col-lg-4 col-md-4"></div> <div class="col-lg-4 col-md-4"></div>
<div class="col-lg-8 col-md-8 select-report-type"> <div class="col-lg-8 col-md-8 select-report-type">
<div class="row"> <div class="row">
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row date-container"> <div class="row">
<div class="col-lg-4 col-md-4"></div> <div class="col-lg-4 col-md-4"></div>
<div class="col-lg-8 col-md-3"> <div class="col-lg-8 col-md-3">
<div class="row"> <div class="row">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment