Commit c8931b7f authored by vikram singh's avatar vikram singh

"Added Service for Account by billability."

parent a3ec008a
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;
}
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);
}
package com.nisum.myteam.service;
import com.nisum.myteam.exception.handler.MyTeamException;
import com.nisum.myteam.model.vo.ReportVo;
public interface IReportService {
public ReportVo getBarChartReport(String byType) throws MyTeamException;
}
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
......@@ -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());
}
}
<html>
<body>
<div class="md-padding"
id="popupContainer" ng-controller="chartsController">
<div class="text-right">
Report Type:<select ng-model="report" #ref ng-change="clickMe(report)" ng-options="report.Name for report in reports"></select>
</div>
<hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart>
<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;">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
</div>
</div>
</body>
<html>
<body>
<div class="md-padding"
id="popupContainer" ng-controller="chartsController">
<div class="text-right">
Report Type:<select ng-model="report" #ref ng-change="clickMe(report)" ng-options="report.Name for report in reports"></select>
</div>
<hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart>
<div class="row col-lg-12">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-exporter
class="myGrid utilization-report">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
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