Commit a108af67 authored by Vijay Akula's avatar Vijay Akula

Resolved the dashboard page

parent 465732ba
package com.nisum.myteam.controller; package com.nisum.myteam.controller;
import static org.springframework.data.mongodb.core.aggregation.Aggregation.group; import com.nisum.myteam.exception.handler.MyTeamException;
import static org.springframework.data.mongodb.core.aggregation.Aggregation.newAggregation; import com.nisum.myteam.model.ColumnChartData;
import static org.springframework.data.mongodb.core.aggregation.Aggregation.project; import com.nisum.myteam.model.GroupByCount;
import static org.springframework.data.mongodb.core.aggregation.Aggregation.sort; import com.nisum.myteam.model.ReportSeriesRecord;
import com.nisum.myteam.model.dao.Account;
import java.text.ParseException; import com.nisum.myteam.model.dao.Employee;
import java.text.SimpleDateFormat; import com.nisum.myteam.model.dao.ResourceAllocation;
import java.util.ArrayList; import com.nisum.myteam.service.IEmployeeService;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
...@@ -31,33 +25,26 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -31,33 +25,26 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.nisum.myteam.exception.handler.MyTeamException; import java.text.ParseException;
import com.nisum.myteam.model.dao.Account; import java.text.SimpleDateFormat;
import com.nisum.myteam.model.dao.Billing; import java.util.*;
import com.nisum.myteam.model.ColumnChartData;
import com.nisum.myteam.model.dao.Employee; import static org.springframework.data.mongodb.core.aggregation.Aggregation.*;
import com.nisum.myteam.model.GroupByCount;
import com.nisum.myteam.model.ReportSeriesRecord; //import com.nisum.myteam.model.dao.Resource;
import com.nisum.myteam.model.dao.Resource;
import com.nisum.myteam.service.IEmployeeService;
import com.nisum.myteam.service.IResourceService;
@RestController @RestController
@RequestMapping("/reports") @RequestMapping("/reports")
public class ReportsController { public class ReportsController {
@Autowired @Autowired
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
@Autowired
private IResourceService resourceService;
@Autowired @Autowired
private IEmployeeService employeeService; private IEmployeeService employeeService;
//Ok Response
@RequestMapping(value = "/getEmployeesByFunctionalGroup1", @RequestMapping(value = "/getEmployeesByFunctionalGroup1",
method = RequestMethod.GET, method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE) produces = MediaType.APPLICATION_JSON_VALUE)
...@@ -85,6 +72,8 @@ public class ReportsController { ...@@ -85,6 +72,8 @@ public class ReportsController {
return new ResponseEntity<>(result, HttpStatus.OK); return new ResponseEntity<>(result, HttpStatus.OK);
} }
//Ok Response
@RequestMapping(value = "/getEmployeesByFunctionalGroupForReport", @RequestMapping(value = "/getEmployeesByFunctionalGroupForReport",
method = RequestMethod.GET, method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE) produces = MediaType.APPLICATION_JSON_VALUE)
...@@ -115,6 +104,8 @@ public class ReportsController { ...@@ -115,6 +104,8 @@ public class ReportsController {
return new ResponseEntity<>(reportData, HttpStatus.OK); return new ResponseEntity<>(reportData, HttpStatus.OK);
} }
//Not Ok Response
@RequestMapping(value = "/getBillabilityDetailsByAccount", @RequestMapping(value = "/getBillabilityDetailsByAccount",
method = RequestMethod.GET, method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE) produces = MediaType.APPLICATION_JSON_VALUE)
...@@ -133,7 +124,7 @@ public class ReportsController { ...@@ -133,7 +124,7 @@ public class ReportsController {
// Convert the aggregation result into a List // Convert the aggregation result into a List
AggregationResults<ColumnChartData> groupResults = mongoTemplate AggregationResults<ColumnChartData> groupResults = mongoTemplate
.aggregate(aggregate, Billing.class, .aggregate(aggregate, ResourceAllocation.class,
ColumnChartData.class); ColumnChartData.class);
List<ColumnChartData> result = groupResults.getMappedResults(); List<ColumnChartData> result = groupResults.getMappedResults();
List<String> statusList = new ArrayList(); List<String> statusList = new ArrayList();
...@@ -155,11 +146,11 @@ public class ReportsController { ...@@ -155,11 +146,11 @@ public class ReportsController {
for (ColumnChartData columnChartData : result) { for (ColumnChartData columnChartData : result) {
if (columnChartData.getCategories() != null if (columnChartData.getCategories() != null
&& columnChartData.getSeriesName() != null && columnChartData.getSeriesName() != null
& columnChartData.getCategories() & columnChartData.getCategories()
.equalsIgnoreCase( .equalsIgnoreCase(
acct.getAccountName()) acct.getAccountName())
&& columnChartData.getSeriesName() && columnChartData.getSeriesName()
.equalsIgnoreCase(status)) { .equalsIgnoreCase(status)) {
seriesDataExists = true; seriesDataExists = true;
seriesData[i] = columnChartData.getCount(); seriesData[i] = columnChartData.getCount();
} }
...@@ -181,6 +172,8 @@ public class ReportsController { ...@@ -181,6 +172,8 @@ public class ReportsController {
return new ResponseEntity<>(reportData, HttpStatus.OK); return new ResponseEntity<>(reportData, HttpStatus.OK);
} }
//ok response
@RequestMapping(value = "/getBillabilityDetailsByMonth", @RequestMapping(value = "/getBillabilityDetailsByMonth",
method = RequestMethod.GET, method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE) produces = MediaType.APPLICATION_JSON_VALUE)
...@@ -244,11 +237,10 @@ public class ReportsController { ...@@ -244,11 +237,10 @@ public class ReportsController {
// Convert the aggregation result into a List // Convert the aggregation result into a List
AggregationResults<ColumnChartData> groupResults1 = mongoTemplate AggregationResults<ColumnChartData> groupResults1 = mongoTemplate
.aggregate(agg1, Billing.class, .aggregate(agg1, ResourceAllocation.class,
ColumnChartData.class); ColumnChartData.class);
List<ColumnChartData> result1 = groupResults1.getMappedResults(); List<ColumnChartData> result1 = groupResults1.getMappedResults();
// List<ColumnChartData> result2 = groupResults.getMappedResults();
List<String> statusList = new ArrayList(); List<String> statusList = new ArrayList();
statusList.add("Billable"); statusList.add("Billable");
statusList.add("Shadow"); statusList.add("Shadow");
...@@ -259,7 +251,7 @@ public class ReportsController { ...@@ -259,7 +251,7 @@ public class ReportsController {
for (ColumnChartData columnChartData : result1) { for (ColumnChartData columnChartData : result1) {
if (columnChartData.getBillableStatus() != null if (columnChartData.getBillableStatus() != null
&& columnChartData.getBillableStatus() && columnChartData.getBillableStatus()
.equalsIgnoreCase(status)) { .equalsIgnoreCase(status)) {
ReportSeriesRecord record = (ReportSeriesRecord) m ReportSeriesRecord record = (ReportSeriesRecord) m
.get(status); .get(status);
record.getData()[i] = columnChartData.getCount(); record.getData()[i] = columnChartData.getCount();
...@@ -276,6 +268,7 @@ public class ReportsController { ...@@ -276,6 +268,7 @@ public class ReportsController {
return new ResponseEntity<>(reportData, HttpStatus.OK); return new ResponseEntity<>(reportData, HttpStatus.OK);
} }
//ok response
@RequestMapping(value = "/getEmployeesByFunctionalGroup", @RequestMapping(value = "/getEmployeesByFunctionalGroup",
method = RequestMethod.GET, method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE) produces = MediaType.APPLICATION_JSON_VALUE)
...@@ -319,29 +312,29 @@ public class ReportsController { ...@@ -319,29 +312,29 @@ public class ReportsController {
return new ResponseEntity<>(empList, HttpStatus.OK); return new ResponseEntity<>(empList, HttpStatus.OK);
} }
@RequestMapping(value = "/fetchEmployeeDetailsByAccountBillability", // @RequestMapping(value = "/fetchEmployeeDetailsByAccountBillability",
method = RequestMethod.GET, // method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE) // produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<Resource>> fetchEmployeeDetailsByAccountBillability( // public ResponseEntity<List<ResourceAllocation>> fetchEmployeeDetailsByAccountBillability(
@RequestParam("account") String account, // @RequestParam("account") String account,
@RequestParam("billabilityStatus") String billabilityStatus) // @RequestParam("billabilityStatus") String billabilityStatus)
throws MyTeamException { // throws MyTeamException {
List<Resource> empList = new ArrayList<>(); // List<ResourceAllocation> resourcesList = new ArrayList<>();
if (account != null && !account.isEmpty()) { // if (account != null && !account.isEmpty()) {
empList = resourceService.findByAccountAndActiveAndBillableStatus( // resourcesList = resourceService.findByAccountAndActiveAndBillableStatus(
account, true, billabilityStatus); // account, true, billabilityStatus);
} // }
return new ResponseEntity<>(empList, HttpStatus.OK); // return new ResponseEntity<>(resourcesList, HttpStatus.OK);
} // }
@RequestMapping(value = "/fetchEmployeeDetailsByDateBillability", @RequestMapping(value = "/fetchEmployeeDetailsByDateBillability",
method = RequestMethod.GET, method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE) produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<Billing>> fetchEmployeeDetailsByDateBillability( public ResponseEntity<List<ResourceAllocation>> fetchEmployeeDetailsByDateBillability(
@RequestParam("billabilityStatus") String billabilityStatus, @RequestParam("billabilityStatus") String billabilityStatus,
@RequestParam("reportDate") String reportDateString) @RequestParam("reportDate") String reportDateString)
throws MyTeamException { throws MyTeamException {
List<Billing> empList = new ArrayList<>(); List<ResourceAllocation> empList = new ArrayList<>();
if (reportDateString != null && !reportDateString.isEmpty()) { if (reportDateString != null && !reportDateString.isEmpty()) {
String pattern = "MM-dd-yyyy"; String pattern = "MM-dd-yyyy";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
...@@ -364,7 +357,7 @@ public class ReportsController { ...@@ -364,7 +357,7 @@ public class ReportsController {
criteriaV1.orOperator(criteriaV21, criteriaV22)); criteriaV1.orOperator(criteriaV21, criteriaV22));
Query query = new Query(); Query query = new Query();
query.addCriteria(criteriaV221); query.addCriteria(criteriaV221);
empList = mongoTemplate.find(query, Billing.class); empList = mongoTemplate.find(query, ResourceAllocation.class);
} }
return new ResponseEntity<>(empList, HttpStatus.OK); return new ResponseEntity<>(empList, HttpStatus.OK);
} }
......
...@@ -236,9 +236,9 @@ public class ResourceAllocationController { ...@@ -236,9 +236,9 @@ public class ResourceAllocationController {
//@RequestMapping(value = "/getEmployeeBillingDetailsAll" //@RequestMapping(value = "/getEmployeeBillingDetailsAll"
@RequestMapping(value = "/resources/billing", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/resources/billing", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<ResourceAllocation>> getAllBillingsForEmployee(@RequestParam("employeeId") String employeeId) public ResponseEntity<List<ResourceVO>> getAllBillingsForEmployee(@RequestParam("employeeId") String employeeId)
throws MyTeamException { throws MyTeamException {
List<ResourceAllocation> resourceAllocList = resourceAllocService.getBillingsForEmployee(employeeId); List<ResourceVO> resourceAllocList = resourceAllocService.getBillingsForEmployee(employeeId);
return new ResponseEntity<>(resourceAllocList, HttpStatus.OK); return new ResponseEntity<>(resourceAllocList, HttpStatus.OK);
} }
......
...@@ -30,7 +30,7 @@ public class EmployeeDashboardVO { ...@@ -30,7 +30,7 @@ public class EmployeeDashboardVO {
private String shift; private String shift;
private String projectId; private String projectId;
private String projectName; private String projectName;
private String account; private String accountName;
private String managerId; private String managerId;
private String managerName; private String managerName;
private String experience; private String experience;
...@@ -42,10 +42,19 @@ public class EmployeeDashboardVO { ...@@ -42,10 +42,19 @@ public class EmployeeDashboardVO {
private String empSubStatus; private String empSubStatus;
private String employmentType; private String employmentType;
private String domain; private String domain;
@DateTimeFormat(iso = ISO.DATE)
private Date projectStartDate;
@DateTimeFormat(iso = ISO.DATE) @DateTimeFormat(iso = ISO.DATE)
private Date startDate; private Date projectEndDate;
@DateTimeFormat(iso = ISO.DATE) @DateTimeFormat(iso = ISO.DATE)
private Date endDate; private Date billingStartDate;
@DateTimeFormat(iso = ISO.DATE)
private Date billingEndDate;
private boolean active; private boolean active;
private boolean projectAssigned; private boolean projectAssigned;
private boolean hasB1Visa; private boolean hasB1Visa;
......
...@@ -31,4 +31,13 @@ public class MyProjectAllocationVO { ...@@ -31,4 +31,13 @@ public class MyProjectAllocationVO {
private List<HashMap<String, String>> deliveryLeadIds; private List<HashMap<String, String>> deliveryLeadIds;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
private Date projectStartDate;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
private Date projectEndDate;
private String projectStatus;
} }
...@@ -37,4 +37,16 @@ public class ResourceVO { ...@@ -37,4 +37,16 @@ public class ResourceVO {
private String resourceRole; private String resourceRole;
private String mobileNo; private String mobileNo;
private String accountName;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSX")
private Date projectStartDate;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSX")
private Date projectEndDate;
private String projectStatus;
} }
...@@ -26,6 +26,8 @@ public interface EmployeeRepo ...@@ -26,6 +26,8 @@ public interface EmployeeRepo
List<Employee> findByEmployeeIdIn(Set<String> empIdsSet); List<Employee> findByEmployeeIdIn(Set<String> empIdsSet);
List<Employee> findByEmpSubStatusOrderByEmployeeNameAsc(String subStatus); List<Employee> findByEmpSubStatusOrderByEmployeeNameAsc(String subStatus);
List<Employee> findByEmpStatusAndShiftLikeOrderByEmployeeIdDesc(String status,String shift);
} }
...@@ -50,4 +50,6 @@ public interface IEmployeeService { ...@@ -50,4 +50,6 @@ public interface IEmployeeService {
public List<Employee> getAllEmployees(); public List<Employee> getAllEmployees();
public List<Employee> getEmployeesByEmpStatusAndShift(String empStatus, String shift);
} }
...@@ -2,13 +2,12 @@ package com.nisum.myteam.service; ...@@ -2,13 +2,12 @@ package com.nisum.myteam.service;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.nisum.myteam.model.dao.Resource;
@Service @Service
public interface IEmployeeShiftService { public interface IEmployeeShiftService {
public void addEmployeeShift(Resource resource, String loginEmpId); //public void addEmployeeShift(Resource resource, String loginEmpId);
void updateEmployeeShift(Resource existingTeammate, String loginEmpId); //void updateEmployeeShift(Resource existingTeammate, String loginEmpId);
} }
package com.nisum.myteam.service; package com.nisum.myteam.service;
import com.nisum.myteam.exception.handler.MyTeamException; import com.nisum.myteam.exception.handler.MyTeamException;
import com.nisum.myteam.model.dao.*; import com.nisum.myteam.model.dao.Account;
import com.nisum.myteam.model.dao.EmpLoginData;
import com.nisum.myteam.model.dao.Project;
import com.nisum.myteam.model.dao.ResourceAllocation;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -33,15 +36,12 @@ public interface IProjectService { ...@@ -33,15 +36,12 @@ public interface IProjectService {
List<Project> getProjectsUnderDeliveryLead(String managerId) throws MyTeamException; List<Project> getProjectsUnderDeliveryLead(String managerId) throws MyTeamException;
public Resource addNewBeanchAllocation(Employee employee, String loginEmpId); // public Resource addNewBeanchAllocation(Employee employee, String loginEmpId);
List<EmpLoginData> employeeLoginsBasedOnDate(long id, String fromDate, String toDate) throws MyTeamException; List<EmpLoginData> employeeLoginsBasedOnDate(long id, String fromDate, String toDate) throws MyTeamException;
String generatePdfReport(long id, String fromDate, String toDate) throws MyTeamException; String generatePdfReport(long id, String fromDate, String toDate) throws MyTeamException;
//public List<HashMap<Object, Object>> getProjectsForEmployee(String empId);
public Set<String> accountsAssignedToDl(String empId); public Set<String> accountsAssignedToDl(String empId);
public List<HashMap<Object, Object>> deliveryLeadProjects(String empId) throws MyTeamException; public List<HashMap<Object, Object>> deliveryLeadProjects(String empId) throws MyTeamException;
...@@ -58,7 +58,7 @@ public interface IProjectService { ...@@ -58,7 +58,7 @@ public interface IProjectService {
public List<Project> getProjectsForDeliveryLead(String deliveryLeadId); public List<Project> getProjectsForDeliveryLead(String deliveryLeadId);
List<Resource> getResourcesUnderProject(String empId); List<ResourceAllocation> getResourcesUnderProject(String empId);
} }
...@@ -5,9 +5,7 @@ import com.nisum.myteam.model.dao.Employee; ...@@ -5,9 +5,7 @@ import com.nisum.myteam.model.dao.Employee;
import com.nisum.myteam.model.dao.ResourceAllocation; import com.nisum.myteam.model.dao.ResourceAllocation;
import com.nisum.myteam.model.vo.MyProjectAllocationVO; import com.nisum.myteam.model.vo.MyProjectAllocationVO;
import com.nisum.myteam.model.vo.ResourceVO; import com.nisum.myteam.model.vo.ResourceVO;
import org.bson.types.ObjectId;
import java.util.HashMap;
import java.util.List; import java.util.List;
public interface IResourceAllocationService { public interface IResourceAllocationService {
...@@ -39,7 +37,6 @@ public interface IResourceAllocationService { ...@@ -39,7 +37,6 @@ public interface IResourceAllocationService {
List<ResourceVO> getActiveResources(String empId); List<ResourceVO> getActiveResources(String empId);
// List<Resource> getResourcesForShift(String shift); // List<Resource> getResourcesForShift(String shift);
public List<ResourceVO> getResourcesForProject(String projectId, String statusFlag); public List<ResourceVO> getResourcesForProject(String projectId, String statusFlag);
...@@ -47,13 +44,12 @@ public interface IResourceAllocationService { ...@@ -47,13 +44,12 @@ public interface IResourceAllocationService {
public List<ResourceAllocation> getResourcesUnderDeliveryLead(String empId); public List<ResourceAllocation> getResourcesUnderDeliveryLead(String empId);
public List<ResourceAllocation> getBillingsForEmployee(String empId); public List<ResourceVO> getBillingsForEmployee(String empId);
public List<ResourceAllocation> getBillingsForProject(String empId, String projectId); public List<ResourceAllocation> getBillingsForProject(String empId, String projectId);
public List<MyProjectAllocationVO> getWorkedProjectsForResource(String empId); public List<MyProjectAllocationVO> getWorkedProjectsForResource(String empId);
...@@ -61,6 +57,8 @@ public interface IResourceAllocationService { ...@@ -61,6 +57,8 @@ public interface IResourceAllocationService {
public List<ResourceAllocation> getAllResources(); public List<ResourceAllocation> getAllResources();
public List<ResourceVO> getAllResourcesVO();
public void deleteResourcesUnderProject(String projectId); public void deleteResourcesUnderProject(String projectId);
......
...@@ -12,37 +12,37 @@ import java.util.List; ...@@ -12,37 +12,37 @@ import java.util.List;
@Service @Service
public interface IResourceService { public interface IResourceService {
Resource addResource(Resource projectTeamMate, String loginEmpId) throws MyTeamException; // Resource addResource(Resource projectTeamMate, String loginEmpId) throws MyTeamException;
//
String updateResource(Resource projectTeamMate, String loginEmpId) throws MyTeamException; // String updateResource(Resource projectTeamMate, String loginEmpId) throws MyTeamException;
//
Resource deleteResource(String empId, String projectId, ObjectId id, String loginEmpId); // Resource deleteResource(String empId, String projectId, ObjectId id, String loginEmpId);
//
Resource save(Resource resource); // Resource save(Resource resource);
//
void addResources(Employee employee, String loginEmpId); // void addResources(Employee employee, String loginEmpId);
//
void inactivateResource(Employee employeeReq, Employee employeeUpdated, String loginEmpId); // void inactivateResource(Employee employeeReq, Employee employeeUpdated, String loginEmpId);
//
List<Resource> findByAccountAndActiveAndBillableStatus(String account, boolean status, String billableStatus); // List<Resource> findByAccountAndActiveAndBillableStatus(String account, boolean status, String billableStatus);
//
List<Resource> getResourcesSortByStartDate(String employeeId); // List<Resource> getResourcesSortByStartDate(String employeeId);
//
List<Resource> getResourcesForProject(String projectId, String status); // List<Resource> getResourcesForProject(String projectId, String status);
//
List<Resource> getResourcesForEmployee(String empId); // List<Resource> getResourcesForEmployee(String empId);
//
List<Resource> getResourcesForProject(String projectId); // List<Resource> getResourcesForProject(String projectId);
//
List<Resource> getActiveResources(String empId); // List<Resource> getActiveResources(String empId);
//
List<Resource> getResourcesForActiveProjects(); // List<Resource> getResourcesForActiveProjects();
//
List<Resource> getResourcesForShift(String shift); // List<Resource> getResourcesForShift(String shift);
//
public List<Resource> getResourcesUnderDeliveryLead(String empId); // public List<Resource> getResourcesUnderDeliveryLead(String empId);
//
public HashMap<String, Object> verifyResourceAssignedToAnyProject(Resource projectTeamMate, String loginEmpId) throws MyTeamException; // public HashMap<String, Object> verifyResourceAssignedToAnyProject(Resource projectTeamMate, String loginEmpId) throws MyTeamException;
} }
...@@ -4,6 +4,7 @@ import com.nisum.myteam.model.dao.Employee; ...@@ -4,6 +4,7 @@ import com.nisum.myteam.model.dao.Employee;
import com.nisum.myteam.model.dao.Project; import com.nisum.myteam.model.dao.Project;
import com.nisum.myteam.model.dao.ResourceAllocation; import com.nisum.myteam.model.dao.ResourceAllocation;
import com.nisum.myteam.model.vo.EmployeeDashboardVO; import com.nisum.myteam.model.vo.EmployeeDashboardVO;
import com.nisum.myteam.model.vo.ResourceVO;
import com.nisum.myteam.service.IDashboardService; import com.nisum.myteam.service.IDashboardService;
import com.nisum.myteam.service.IEmployeeService; import com.nisum.myteam.service.IEmployeeService;
import com.nisum.myteam.service.IProjectService; import com.nisum.myteam.service.IProjectService;
...@@ -34,31 +35,35 @@ public class DashboardService implements IDashboardService { ...@@ -34,31 +35,35 @@ public class DashboardService implements IDashboardService {
List<Employee> allEmployees = employeeService.getAllEmployees(); List<Employee> allEmployees = employeeService.getAllEmployees();
List<EmployeeDashboardVO> employeeDashboard = new ArrayList<>(); List<EmployeeDashboardVO> employeeDashboard = new ArrayList<>();
Map<String, Object> teamMatesMap = new HashMap(); Map<String, Object> resourcesMap = new HashMap();
Map<String, Object> teamMatesStatusMap = new HashMap(); Map<String, Object> teamMatesStatusMap = new HashMap();
// Find all active employees // Find all active employees
List<ResourceAllocation> resources = resourceService.getAllResources(); //List<ResourceAllocation> resources = resourceService.getAllResources();
for (ResourceAllocation resource : resources) { List<ResourceVO> resources = resourceService.getAllResourcesVO();
for (ResourceVO resource : resources) {
//if (resource.isActive()) { //if (resource.isActive()) {
if (resource.getBillingEndDate().compareTo(new Date())>0) { if (resource.getBillingEndDate().compareTo(new Date()) > 0) {
Project project = projectService.getProjectByProjectId(resource.getProjectId()); Project project = projectService.getProjectByProjectId(resource.getProjectId());
if (project != null && project.getStatus() != null if (project != null && project.getStatus() != null
&& !"Completed".equalsIgnoreCase(project.getStatus())) { && !"Completed".equalsIgnoreCase(project.getStatus())) {
Object projectTeamMate = teamMatesMap Object projectResource = resourcesMap.get(resource.getEmployeeId());
.get(resource.getEmployeeId());
if (projectTeamMate == null) { if (projectResource == null) {
List listOfObjects = new ArrayList<>(); List listOfObjects = new ArrayList<>();
listOfObjects.add(resource); listOfObjects.add(resource);
// A person can have multiple active projects with billability // A person can have multiple active projects with billability
teamMatesMap.put(resource.getEmployeeId(), listOfObjects); resourcesMap.put(resource.getEmployeeId(), listOfObjects);
} else { } else {
List existingRecordsInMap = (List) teamMatesMap List existingRecordsInMap = (List) resourcesMap
.get(resource.getEmployeeId()); .get(resource.getEmployeeId());
existingRecordsInMap.add(resource); existingRecordsInMap.add(resource);
teamMatesMap.put(resource.getEmployeeId(), resourcesMap.put(resource.getEmployeeId(),
existingRecordsInMap); existingRecordsInMap);
} }
...@@ -66,13 +71,13 @@ public class DashboardService implements IDashboardService { ...@@ -66,13 +71,13 @@ public class DashboardService implements IDashboardService {
} }
} }
for (Employee emp : allEmployees) { for (Employee emp : allEmployees) {
if (teamMatesMap.containsKey(emp.getEmployeeId())) { if (resourcesMap.containsKey(emp.getEmployeeId())) {
Object value = teamMatesMap.get(emp.getEmployeeId()); Object value = resourcesMap.get(emp.getEmployeeId());
if (value instanceof List) { if (value instanceof List) {
List listOfTeamMates = (List) value; List listOfTeamMates = (List) value;
String billableStatus = "NA"; String billableStatus = "NA";
for (Object obj : listOfTeamMates) { for (Object obj : listOfTeamMates) {
ResourceAllocation projectTeamMate = (ResourceAllocation) obj; ResourceVO projectTeamMate = (ResourceVO) obj;
String status = projectTeamMate.getBillableStatus(); String status = projectTeamMate.getBillableStatus();
if (status == null) { if (status == null) {
status = "NA"; status = "NA";
......
...@@ -7,7 +7,6 @@ import org.springframework.data.mongodb.core.query.Query; ...@@ -7,7 +7,6 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.nisum.myteam.model.dao.EmployeeShift; import com.nisum.myteam.model.dao.EmployeeShift;
import com.nisum.myteam.model.dao.Resource;
import com.nisum.myteam.repository.EmployeeShiftRepo; import com.nisum.myteam.repository.EmployeeShiftRepo;
import com.nisum.myteam.service.IEmployeeShiftService; import com.nisum.myteam.service.IEmployeeShiftService;
import com.nisum.myteam.utils.MyTeamUtils; import com.nisum.myteam.utils.MyTeamUtils;
...@@ -24,29 +23,29 @@ public class EmployeeShiftService implements IEmployeeShiftService { ...@@ -24,29 +23,29 @@ public class EmployeeShiftService implements IEmployeeShiftService {
@Autowired @Autowired
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
@Override // @Override
public void addEmployeeShift(Resource resource, String loginEmpId) { // public void addEmployeeShift(Resource resource, String loginEmpId) {
EmployeeShift empShift = new EmployeeShift(); // EmployeeShift empShift = new EmployeeShift();
empShift.setEmployeeName(resource.getEmployeeName()); // empShift.setEmployeeName(resource.getEmployeeName());
empShift.setEmployeeId(resource.getEmployeeId()); // empShift.setEmployeeId(resource.getEmployeeId());
empShift.setShift(resource.getShift()); // empShift.setShift(resource.getShift());
empShift.setActive(resource.isActive()); // empShift.setActive(resource.isActive());
empShift.setAuditFields(loginEmpId, MyTeamUtils.CREATE); // empShift.setAuditFields(loginEmpId, MyTeamUtils.CREATE);
empShiftsRepo.save(empShift); // empShiftsRepo.save(empShift);
log.info("The Employee Shift has been Persisted ::" + empShift); // log.info("The Employee Shift has been Persisted ::" + empShift);
} // }
public void updateEmployeeShift(Resource resource, String loginEmpId) { // public void updateEmployeeShift(Resource resource, String loginEmpId) {
Query getQuery = new Query(); // Query getQuery = new Query();
getQuery.addCriteria(new Criteria().andOperator(Criteria.where("active").is(true), // getQuery.addCriteria(new Criteria().andOperator(Criteria.where("active").is(true),
Criteria.where("employeeId").is(resource.getEmployeeId()))); // Criteria.where("employeeId").is(resource.getEmployeeId())));
EmployeeShift existingEmpShift = mongoTemplate.findOne(getQuery, EmployeeShift.class); // EmployeeShift existingEmpShift = mongoTemplate.findOne(getQuery, EmployeeShift.class);
if (existingEmpShift != null) { // if (existingEmpShift != null) {
existingEmpShift.setActive(false); // existingEmpShift.setActive(false);
existingEmpShift.setAuditFields(loginEmpId, MyTeamUtils.UPDATE); // existingEmpShift.setAuditFields(loginEmpId, MyTeamUtils.UPDATE);
mongoTemplate.save(existingEmpShift); // mongoTemplate.save(existingEmpShift);
log.info("The shift has been updated::" + existingEmpShift); // log.info("The shift has been updated::" + existingEmpShift);
} // }
} // }
} }
...@@ -193,6 +193,54 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -193,6 +193,54 @@ public class ResourceAllocationService implements IResourceAllocationService {
} }
public List<ResourceVO> getAllResourcesVO() {
return getAllResources().stream().map(resource -> {
ResourceVO resourceVO = new ResourceVO();
resourceVO.setId(resource.getId());
resourceVO.setProjectId(resource.getProjectId());
resourceVO.setEmployeeId(resource.getEmployeeId());
Employee employee = employeeService.getEmployeeById(resource.getEmployeeId());
if (employee != null) {
resourceVO.setEmployeeName(employee.getEmployeeName());
resourceVO.setDesignation(employee.getDesignation());
resourceVO.setEmailId(employee.getEmailId());
resourceVO.setMobileNo(employee.getMobileNumber());
}
Project project = projectService.getProjectByProjectId(resource.getProjectId());
if (project != null) {
resourceVO.setProjectName(project.getProjectName());
resourceVO.setProjectStartDate(project.getProjectStartDate());
resourceVO.setProjectEndDate(project.getProjectEndDate());
resourceVO.setProjectStatus(project.getStatus());
if (project.getAccountId() != null) {
Account account = accountService.getAccountById(project.getAccountId());
if (account != null) {
resourceVO.setAccountName(account.getAccountName());
}
}
}
//Account account=accountService.getAccountById(domainService.getDomainById(project.getProjectId()).getAccountId());
resourceVO.setBillableStatus(resource.getBillableStatus());
resourceVO.setBillingStartDate(resource.getBillingStartDate());
resourceVO.setBillingEndDate(resource.getBillingEndDate());
resourceVO.setResourceRole(resource.getResourceRole());
if (resource.getBillingEndDate().compareTo(new Date()) > 0) {
resourceVO.setResourceStatus(ResourceStatus.ACTIVE.getStatus());
} else {
resourceVO.setResourceStatus(ResourceStatus.IN_ACTIVE.getStatus());
}
return resourceVO;
}).collect(Collectors.toList());
}
public List<ResourceAllocation> getResourcesSortByBillingStartDate(String employeeId) { public List<ResourceAllocation> getResourcesSortByBillingStartDate(String employeeId) {
Query query = prepareQuery(employeeId, MyTeamUtils.BILLING_START_DATE); Query query = prepareQuery(employeeId, MyTeamUtils.BILLING_START_DATE);
return mongoTemplate.find(query, ResourceAllocation.class); return mongoTemplate.find(query, ResourceAllocation.class);
...@@ -334,6 +382,9 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -334,6 +382,9 @@ public class ResourceAllocationService implements IResourceAllocationService {
MyProjectAllocationVO myProject = new MyProjectAllocationVO(); MyProjectAllocationVO myProject = new MyProjectAllocationVO();
myProject.setProjectId(project.getProjectId()); myProject.setProjectId(project.getProjectId());
myProject.setProjectName(project.getProjectName()); myProject.setProjectName(project.getProjectName());
myProject.setProjectStartDate(project.getProjectStartDate());
myProject.setProjectEndDate(project.getProjectEndDate());
myProject.setProjectStatus(project.getStatus());
myProject.setAccountName(account.getAccountName()); myProject.setAccountName(account.getAccountName());
myProject.setBillableStatus(resourceAlloc.getBillableStatus()); myProject.setBillableStatus(resourceAlloc.getBillableStatus());
...@@ -377,17 +428,17 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -377,17 +428,17 @@ public class ResourceAllocationService implements IResourceAllocationService {
@Override @Override
public List<ResourceAllocation> getBillingsForEmployee(String empId) { public List<ResourceVO> getBillingsForEmployee(String empId) {
// List<Billing> billingsList = billingRepo.findByEmployeeId(empId); List<ResourceVO> finalList=new ArrayList<>();
List<ResourceAllocation> resourcesList = resourceAllocationRepo.findByEmployeeId(empId); List<ResourceAllocation> resourcesList = resourceAllocationRepo.findByEmployeeId(empId);
if (resourcesList == null || resourcesList.size() == 0) { if (resourcesList != null && resourcesList.size() > 0) {
return resourcesList;
} else {
log.info("The resources billing list before sorting::" + resourcesList); log.info("The resources billing list before sorting::" + resourcesList);
//return billingsList.stream().sorted(Comparator.comparing(Billing::getCreatedOn).reversed()).collect(Collectors.toList()); //return billingsList.stream().sorted(Comparator.comparing(Billing::getCreatedOn).reversed()).collect(Collectors.toList());
return resourcesList.stream().sorted(Comparator.comparing(ResourceAllocation::getBillingStartDate).reversed()).collect(Collectors.toList()); List<ResourceAllocation> sortedList = resourcesList.stream().sorted(Comparator.comparing(ResourceAllocation::getBillingStartDate).reversed()).collect(Collectors.toList());
finalList= convertResourcesToResourcesVO(sortedList);
} }
return finalList;
} }
@Override @Override
...@@ -434,6 +485,59 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -434,6 +485,59 @@ public class ResourceAllocationService implements IResourceAllocationService {
} }
private List<ResourceVO> convertResourcesToResourcesVO(List<ResourceAllocation> resourcesList) {
List<ResourceVO> finalList = new ArrayList<>();
if (resourcesList != null && resourcesList.size() > 0) {
finalList = resourcesList.stream().map(resource -> {
ResourceVO resourceVO = new ResourceVO();
resourceVO.setId(resource.getId());
resourceVO.setProjectId(resource.getProjectId());
resourceVO.setEmployeeId(resource.getEmployeeId());
Employee employee = employeeService.getEmployeeById(resource.getEmployeeId());
if (employee != null) {
resourceVO.setEmployeeName(employee.getEmployeeName());
resourceVO.setDesignation(employee.getDesignation());
resourceVO.setEmailId(employee.getEmailId());
resourceVO.setMobileNo(employee.getMobileNumber());
}
Project project = projectService.getProjectByProjectId(resource.getProjectId());
if (project != null) {
resourceVO.setProjectName(project.getProjectName());
resourceVO.setProjectStartDate(project.getProjectStartDate());
resourceVO.setProjectEndDate(project.getProjectEndDate());
resourceVO.setProjectStatus(project.getStatus());
if (project.getAccountId() != null) {
Account account = accountService.getAccountById(project.getAccountId());
if (account != null) {
resourceVO.setAccountName(account.getAccountName());
}
}
}
//Account account=accountService.getAccountById(domainService.getDomainById(project.getProjectId()).getAccountId());
resourceVO.setBillableStatus(resource.getBillableStatus());
resourceVO.setBillingStartDate(resource.getBillingStartDate());
resourceVO.setBillingEndDate(resource.getBillingEndDate());
resourceVO.setResourceRole(resource.getResourceRole());
if (resource.getBillingEndDate().compareTo(new Date()) > 0) {
resourceVO.setResourceStatus(ResourceStatus.ACTIVE.getStatus());
} else {
resourceVO.setResourceStatus(ResourceStatus.IN_ACTIVE.getStatus());
}
return resourceVO;
}).collect(Collectors.toList());
}
return finalList;
}
} }
......
...@@ -67,7 +67,6 @@ public class ResourceService implements IResourceService { ...@@ -67,7 +67,6 @@ public class ResourceService implements IResourceService {
return resourceRepo.save(resource); return resourceRepo.save(resource);
} }
@Override
public Resource addResource(Resource resourceReq, String loginEmpId) throws MyTeamException { public Resource addResource(Resource resourceReq, String loginEmpId) throws MyTeamException {
// calling a method // calling a method
...@@ -111,7 +110,7 @@ public class ResourceService implements IResourceService { ...@@ -111,7 +110,7 @@ public class ResourceService implements IResourceService {
billingService.addBilling(billings, loginEmpId); billingService.addBilling(billings, loginEmpId);
empShiftService.addEmployeeShift(resourceReq, loginEmpId); //empShiftService.addEmployeeShift(resourceReq, loginEmpId);
// calling method // calling method
addOrUpdateTeamMateRole(resourceReq.getRole(), resourceReq.getProjectId(), resourceReq.getEmployeeId(), false, addOrUpdateTeamMateRole(resourceReq.getRole(), resourceReq.getProjectId(), resourceReq.getEmployeeId(), false,
...@@ -120,7 +119,6 @@ public class ResourceService implements IResourceService { ...@@ -120,7 +119,6 @@ public class ResourceService implements IResourceService {
return resourcePersisted; return resourcePersisted;
} }
@Override
public String updateResource(Resource resourceReq, String loginEmpId) throws MyTeamException { public String updateResource(Resource resourceReq, String loginEmpId) throws MyTeamException {
// String result = null; // String result = null;
MyTeamResultDTO myResultDto = new MyTeamResultDTO(); MyTeamResultDTO myResultDto = new MyTeamResultDTO();
...@@ -303,7 +301,7 @@ public class ResourceService implements IResourceService { ...@@ -303,7 +301,7 @@ public class ResourceService implements IResourceService {
|| (resourceReq.getShift() != null) || (resourceReq.getShift() != null)
&& !resourceReq.getShift().equalsIgnoreCase(existingResource.getShift())) { && !resourceReq.getShift().equalsIgnoreCase(existingResource.getShift())) {
empShiftService.updateEmployeeShift(existingResource, loginEmpId); //empShiftService.updateEmployeeShift(existingResource, loginEmpId);
existingResource.setShift(resourceReq.getShift()); existingResource.setShift(resourceReq.getShift());
Employee employeeDB = employeeRepo.findByEmployeeId(resourceReq.getEmployeeId()); Employee employeeDB = employeeRepo.findByEmployeeId(resourceReq.getEmployeeId());
...@@ -336,7 +334,7 @@ public class ResourceService implements IResourceService { ...@@ -336,7 +334,7 @@ public class ResourceService implements IResourceService {
} }
@Override // @Override
public Resource deleteResource(String empId, String projectId, ObjectId id, String loginEmpId) { public Resource deleteResource(String empId, String projectId, ObjectId id, String loginEmpId) {
Resource existingResource = resourceRepo.findById(id); Resource existingResource = resourceRepo.findById(id);
existingResource.setActive(false); existingResource.setActive(false);
...@@ -384,7 +382,7 @@ public class ResourceService implements IResourceService { ...@@ -384,7 +382,7 @@ public class ResourceService implements IResourceService {
// audit // audit
// fields // fields
Resource resource=resourceRepo.save(resourceBench); Resource resource=resourceRepo.save(resourceBench);
empShiftService.updateEmployeeShift(existingResource, loginEmpId); //empShiftService.updateEmployeeShift(existingResource, loginEmpId);
return resource; return resource;
} }
...@@ -471,43 +469,43 @@ public class ResourceService implements IResourceService { ...@@ -471,43 +469,43 @@ public class ResourceService implements IResourceService {
// return null; // return null;
} }
public void inactivateResource(Employee employeeReq, Employee employeeUpdated, String loginEmpId) { //public void inactivateResource(Employee employeeReq, Employee employeeUpdated, String loginEmpId) {
// inactive the employee from the assigned project // // inactive the employee from the assigned project
if (employeeReq.getEmpStatus().equals(MyTeamUtils.IN_ACTIVE_SPACE) && employeeReq.getEndDate() != null // if (employeeReq.getEmpStatus().equals(MyTeamUtils.IN_ACTIVE_SPACE) && employeeReq.getEndDate() != null
&& employeeReq.getEndDate().compareTo(new Date()) <= 0) { // && employeeReq.getEndDate().compareTo(new Date()) <= 0) {
//
List<Resource> resourcesList = resourceRepo.findByEmployeeIdAndActive(employeeReq.getEmployeeId(), true); // List<Resource> resourcesList = resourceRepo.findByEmployeeIdAndActive(employeeReq.getEmployeeId(), true);
if (resourcesList.size() == 1) { // if (resourcesList.size() == 1) {
Resource resource = resourcesList.get(0); // Resource resource = resourcesList.get(0);
resource.setActive(false); // resource.setActive(false);
resource.setEndDate(employeeReq.getEndDate()); // resource.setEndDate(employeeReq.getEndDate());
//
List<Billing> billingList = billingService.getActiveBillings(resource.getEmployeeId(), // List<Billing> billingList = billingService.getActiveBillings(resource.getEmployeeId(),
resource.getProjectId()); // resource.getProjectId());
if (billingList != null && !billingList.isEmpty()) { // if (billingList != null && !billingList.isEmpty()) {
billingService.addBillingtoResource(billingList.get(0), employeeUpdated, loginEmpId); // billingService.addBillingtoResource(billingList.get(0), employeeUpdated, loginEmpId);
} // }
resource.setAuditFields(loginEmpId, MyTeamUtils.UPDATE); // resource.setAuditFields(loginEmpId, MyTeamUtils.UPDATE);
resourceRepo.save(resource); // resourceRepo.save(resource);
empShiftService.updateEmployeeShift(resource, loginEmpId); // empShiftService.updateEmployeeShift(resource, loginEmpId);
} // }
} // }
} // }
@Override // @Override
public List<Resource> findByAccountAndActiveAndBillableStatus(String account, boolean status, public List<Resource> findByAccountAndActiveAndBillableStatus(String account, boolean status,
String billableStatus) { String billableStatus) {
return resourceRepo.findByAccountAndActiveAndBillableStatus(account, status, billableStatus); return resourceRepo.findByAccountAndActiveAndBillableStatus(account, status, billableStatus);
} }
@Override // @Override
public List<Resource> getResourcesSortByStartDate(String employeeId) { public List<Resource> getResourcesSortByStartDate(String employeeId) {
Query query = prepareQuery(employeeId, MyTeamUtils.START_DATE); Query query = prepareQuery(employeeId, MyTeamUtils.START_DATE);
return mongoTemplate.find(query, Resource.class); return mongoTemplate.find(query, Resource.class);
} }
@Override // @Override
public List<Resource> getResourcesForProject(String projectId, String statusFlag) { public List<Resource> getResourcesForProject(String projectId, String statusFlag) {
List<Resource> resourcesList = new ArrayList<>(); List<Resource> resourcesList = new ArrayList<>();
List<Resource> resourceListPersisted = resourceRepo.findByProjectId(projectId); List<Resource> resourceListPersisted = resourceRepo.findByProjectId(projectId);
...@@ -526,7 +524,7 @@ public class ResourceService implements IResourceService { ...@@ -526,7 +524,7 @@ public class ResourceService implements IResourceService {
return resourcesList; return resourcesList;
} }
@Override // @Override
public List<Resource> getResourcesForEmployee(String empId) { public List<Resource> getResourcesForEmployee(String empId) {
return resourceRepo.findByEmployeeId(empId); return resourceRepo.findByEmployeeId(empId);
} }
...@@ -539,7 +537,7 @@ public class ResourceService implements IResourceService { ...@@ -539,7 +537,7 @@ public class ResourceService implements IResourceService {
return resourceRepo.findAll(); return resourceRepo.findAll();
} }
@Override // @Override
public List<Resource> getActiveResources(String empId) { public List<Resource> getActiveResources(String empId) {
List<Resource> resourcesList = new ArrayList<>(); List<Resource> resourcesList = new ArrayList<>();
List<Resource> resourcesListPers = resourceRepo.findByEmployeeId(empId); List<Resource> resourcesListPers = resourceRepo.findByEmployeeId(empId);
...@@ -551,7 +549,7 @@ public class ResourceService implements IResourceService { ...@@ -551,7 +549,7 @@ public class ResourceService implements IResourceService {
return resourcesList; return resourcesList;
} }
@Override // @Override
public List<Resource> getResourcesForActiveProjects() { public List<Resource> getResourcesForActiveProjects() {
List<Project> projects = projectService.getAllProjects(); List<Project> projects = projectService.getAllProjects();
List<Resource> resourceList = new ArrayList<>(); List<Resource> resourceList = new ArrayList<>();
...@@ -565,7 +563,7 @@ public class ResourceService implements IResourceService { ...@@ -565,7 +563,7 @@ public class ResourceService implements IResourceService {
return resourceList; return resourceList;
} }
@Override // @Override
public List<Resource> getResourcesForShift(String shift) { public List<Resource> getResourcesForShift(String shift) {
List<Resource> resourcesListPers = null; List<Resource> resourcesListPers = null;
List<Resource> resourcesList = new ArrayList<>(); List<Resource> resourcesList = new ArrayList<>();
...@@ -588,7 +586,7 @@ public class ResourceService implements IResourceService { ...@@ -588,7 +586,7 @@ public class ResourceService implements IResourceService {
@Override // @Override
public List<Resource> getResourcesUnderDeliveryLead(String deliveryLeadId) { public List<Resource> getResourcesUnderDeliveryLead(String deliveryLeadId) {
List<String> projectIdsList = new ArrayList<>(); List<String> projectIdsList = new ArrayList<>();
List<Resource> resourcesList = new ArrayList<>(); List<Resource> resourcesList = new ArrayList<>();
...@@ -614,7 +612,7 @@ public class ResourceService implements IResourceService { ...@@ -614,7 +612,7 @@ public class ResourceService implements IResourceService {
@Override // @Override
public HashMap<String,Object> verifyResourceAssignedToAnyProject(Resource resourceReq, String loginEmpId) throws MyTeamException { public HashMap<String,Object> verifyResourceAssignedToAnyProject(Resource resourceReq, String loginEmpId) throws MyTeamException {
boolean flag = false; boolean flag = false;
String projectName = null; String projectName = null;
......
...@@ -31,11 +31,11 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -31,11 +31,11 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
columnDefs : [ columnDefs : [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: false, enableSorting: false,enableFiltering:true, width:100,cellTemplate: getEmpDetTemplate}, {field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: false, enableSorting: false,enableFiltering:true, width:100,cellTemplate: getEmpDetTemplate},
{field : 'employeeName',displayName: 'Employee Name ', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:200}, {field : 'employeeName',displayName: 'Employee Name ', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:200},
{field : 'account',displayName: 'Client', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100}, {field : 'accountName',displayName: 'Client', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'domain',displayName: 'Domain', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100}, {field : 'domain',displayName: 'Domain', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false,enableFiltering:false,width:150}, {field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false,enableFiltering:false,width:150},
{field : 'startDate',displayName: 'Billing Start Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150}, {field : 'billingStartDate',displayName: 'Billing Start Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'endDate',displayName: 'Billing End Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150}, {field : 'billingEndDate',displayName: 'Billing End Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'empStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:80}, {field : 'empStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:80},
{field : 'empSubStatus',displayName: 'Sub Status', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:120,cellClass:function(grid,row,col){ {field : 'empSubStatus',displayName: 'Sub Status', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:120,cellClass:function(grid,row,col){
...@@ -208,11 +208,12 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -208,11 +208,12 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
{field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150}, {field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'projectStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150}, {field : 'projectStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150},
{field : 'projectEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"' ,minWidth : 100,width: 150}, {field : 'projectEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"' ,minWidth : 100,width: 150},
{field : 'resourceStatus',displayName: 'Status', enableColumnMenu: false,enableSorting: false,minWidth : 100,width: 150} {field : 'projectStatus',displayName: 'Status', enableColumnMenu: false,enableSorting: false,minWidth : 100,width: 150}
] ]
}; };
$scope.gridOptionsEmpLocationDetails = { $scope.gridOptionsEmpLocationDetails = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10, paginationPageSize : 10,
...@@ -257,7 +258,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -257,7 +258,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
enableCellEditOnFocus: true, enableCellEditOnFocus: true,
columnDefs : [ columnDefs : [
{field : 'projectName',displayName: 'Project', enableColumnMenu: true, enableSorting: true,minWidth : 100,width: 150}, {field : 'projectName',displayName: 'Project', enableColumnMenu: true, enableSorting: true,minWidth : 100,width: 150},
{field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150}, {field : 'accountName',displayName: 'Account', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field: 'billingStartDate',displayName: 'Start Date', {field: 'billingStartDate',displayName: 'Start Date',
cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150 cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150
}, },
...@@ -267,7 +268,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -267,7 +268,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150 cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150
}, },
{field : 'comments',displayName: 'Comments', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150}, {field : 'comments',displayName: 'Comments', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'active',displayName: 'Active',enableColumnMenu: false, enableSorting: false,cellTemplate:getCellActiveTemplateBilling,enableCellEdit: false,minWidth : 100,width: 150} {field : 'resourceStatus',displayName: 'Status',enableColumnMenu: false, enableSorting: false,cellTemplate:getCellActiveTemplateBilling,enableCellEdit: false,minWidth : 100,width: 150}
] ]
}; };
......
...@@ -16,10 +16,8 @@ function($mdDateLocaleProvider) { ...@@ -16,10 +16,8 @@ function($mdDateLocaleProvider) {
//TODO: Replace this appUri with the domain name created //TODO: Replace this appUri with the domain name created
myApp.constant('appConfig', { myApp.constant('appConfig', {
appName: "MyTime", appName: "MyTime",
<<<<<<< Updated upstream
=======
//appUri: "http://10.3.45.11:8080/myTeam/", //appUri: "http://10.3.45.11:8080/myTeam/",
>>>>>>> Stashed changes
appUri: "http://localhost:8080/myTeam/", appUri: "http://localhost:8080/myTeam/",
version:"1.0", version:"1.0",
empStartId:16001, empStartId:16001,
......
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