Commit 7a39c235 authored by Rajeshekar's avatar Rajeshekar

MT-55: FreePool end date issue

parent 1a415bb2
......@@ -97,10 +97,11 @@ public class ReportsController {
ProjectionOperation projectToMatchModel = project()
.andExpression("functionalGroup").as("name").andExpression("y")
.as("y");
MatchOperation matchStage = Aggregation
.match(new Criteria("empStatus").is("Active"));
Aggregation agg = newAggregation(
// match(Criteria.where("employeeId").gt(10)),
group("functionalGroup").count().as("y"),
matchStage, group("functionalGroup").count().as("y"),
project("y").and("functionalGroup").previousOperation(),
projectToMatchModel,
......@@ -287,10 +288,11 @@ public class ReportsController {
ProjectionOperation projectToMatchModel = project()
.andExpression("functionalGroup").as("name").andExpression("y")
.as("y");
MatchOperation matchStage = Aggregation
.match(new Criteria("empStatus").is("Active"));
Aggregation agg = newAggregation(
// match(Criteria.where("employeeId").gt(10)),
group("functionalGroup").count().as("y"),
matchStage, group("functionalGroup").count().as("y"),
project("y").and("functionalGroup").previousOperation(),
projectToMatchModel,
......
......@@ -15,5 +15,6 @@ public interface EmployeeRolesRepo
EmployeeRoles findByEmployeeName(String employeeName);
List<EmployeeRoles> findByFunctionalGroup(String functionalGroup);
List<EmployeeRoles> findByEmpStatusAndFunctionalGroup(String empStatus,
String functionalGroup);
}
......@@ -177,7 +177,11 @@ public class ProjectServiceImpl implements ProjectService {
projectTeamMate.getEmployeeId(), "Nisum0000", true);
if (activeBenchProject != null || activeBenchProject.size() != 0) {
for (ProjectTeamMate pteamMate : activeBenchProject) {
Date d = pT.getStartDate() != null ? pT.getStartDate()
: new Date();
d.setDate(d.getDate() - 1);
pteamMate.setActive(false);
pteamMate.setEndDate(d);
projectTeamMatesRepo.save(pteamMate);
}
}
......@@ -271,8 +275,9 @@ public class ProjectServiceImpl implements ProjectService {
existingTeammate.setActive(false);
existingTeammate.setEndDate(new Date());
BillingDetails billingDetails = new BillingDetails();
billingDetails.setBillableStatus("Bench");
billingDetails.setBillableStatus("Non-Billable");
billingDetails.setBillingStartDate(new Date());
billingDetails.setAccount("Nisum");
billingDetails.setActive(true);
billingDetails.setEmployeeId(existingTeammate.getEmployeeId());
billingDetails.setEmployeeName(existingTeammate.getEmployeeName());
......@@ -291,6 +296,21 @@ public class ProjectServiceImpl implements ProjectService {
updateEmployeeBilling(billingDetailsExisting);
}
projectTeamMatesRepo.save(existingTeammate);
ProjectTeamMate newBenchAllocation = new ProjectTeamMate();
newBenchAllocation.setAccount("Nisum");
newBenchAllocation.setBillableStatus("Non-Billable");
newBenchAllocation.setDesignation(existingTeammate.getDesignation());
newBenchAllocation.setEmailId(existingTeammate.getEmailId());
newBenchAllocation.setEmployeeId(existingTeammate.getEmployeeId());
newBenchAllocation.setActive(true);
newBenchAllocation.setEmployeeName(existingTeammate.getEmployeeName());
newBenchAllocation.setProjectId("Nisum0000");
newBenchAllocation.setStartDate(new Date());
Project p = projectRepo.findByProjectId("Nisum0000");
newBenchAllocation.setProjectName(p.getProjectName());
newBenchAllocation.setManagerId(p.getManagerId());
newBenchAllocation.setManagerName(p.getManagerName());
projectTeamMatesRepo.save(newBenchAllocation);
updateShiftDetails(existingTeammate);
}
......
......@@ -184,7 +184,7 @@ public class UserServiceImpl implements UserService {
update.set("dateOfBirth", employeeRoles.getDateOfBirth());
update.set("dateOfJoining", employeeRoles.getDateOfJoining());
update.set("lastModifiedOn", new Date());
update.set("hasPassort", employeeRoles.getHasPassort());
update.set("hasPassort", employeeRoles.getHasPassort());
update.set("hasB1", employeeRoles.getHasB1());
update.set("passportExpiryDate", employeeRoles.getPassportExpiryDate());
update.set("b1ExpiryDate", employeeRoles.getB1ExpiryDate());
......@@ -419,7 +419,8 @@ public class UserServiceImpl implements UserService {
@Override
public List<EmployeeRoles> getEmployeesByFunctionalGrp(
String functionalGrp) {
return employeeRolesRepo.findByFunctionalGroup(functionalGrp);
return employeeRolesRepo.findByEmpStatusAndFunctionalGroup("Active",
functionalGrp);
}
}
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