Commit 30c018f4 authored by vikram singh's avatar vikram singh

"added service for move to open pool"

parent 889da4fd
......@@ -39,5 +39,6 @@ public class Resource extends AuditFields implements Serializable {
private Date billingEndDate;
private String resourceRole;
private String status;
}
......@@ -165,6 +165,7 @@ public class ResourceService implements IResourceService {
resourceBench.setBillingStartDate(MyTeamDateUtils.getDayMoreThanDate(resourceReq.getBillingEndDate()));
resourceBench.setBillingEndDate(projectService.getProjectByProjectId(MyTeamUtils.BENCH_PROJECT_ID).getProjectEndDate());
resourceBench.setBillableStatus(MyTeamUtils.BENCH_BILLABILITY_STATUS);
resourceBench.setAuditFields(loginEmpId, MyTeamUtils.CREATE);
resourceRepo.save(resourceBench);
}else if(latestAllocation != null && latestAllocation.getProjectId().equalsIgnoreCase(MyTeamUtils.BENCH_PROJECT_ID)){
......@@ -924,10 +925,29 @@ public class ResourceService implements IResourceService {
return resourceRepo.findByBillableStatus(billableStatus).stream().filter(r -> r.getBillingEndDate().after(new Date())).collect(Collectors.toSet());
}
public Resource sendResourceToOpenPool(Resource resource,String loginId) {
Resource existingresource = resourceRepo.findById(resource.getId());
existingresource.setStatus(MyTeamUtils.RELEASED_STATUS);
this.updateExistedResource(existingresource);
// isResourceAvailableinBenchbygraterthanEndDate=
}//class
Resource benchResource = new Resource();
benchResource.setProjectId(MyTeamUtils.BENCH_PROJECT_ID);
benchResource.setEmployeeId(resource.getEmployeeId());
benchResource.setResourceRole(resource.getResourceRole());
benchResource.setBillingStartDate(MyTeamDateUtils.getDayMoreThanDate(resource.getBillingEndDate()));
benchResource.setBillingEndDate(projectService.getProjectByProjectId(MyTeamUtils.BENCH_PROJECT_ID).getProjectEndDate());
benchResource.setBillableStatus(MyTeamUtils.BENCH_BILLABILITY_STATUS);
benchResource.setStatus(MyTeamUtils.RELEASED_STATUS);
benchResource.setAuditFields(loginId, MyTeamUtils.CREATE);
Resource resourcePers = resourceRepo.save(benchResource);
respMap.put("statusCode", 801);
respMap.put("message", "Resource is moved to Bench Successfully");
return resourcePers;
}
}
//class
......
......@@ -11,6 +11,9 @@ public class MyTeamUtils {
//public final static String driverUrl = "jdbc:ucanaccess://";
//public final static String msdriveUrl ="jdbc:sqlserver://";
public final static String RELEASED_STATUS="Released";
public final static String Engaged_STATUS="Engaged";
public final static DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public final static DateFormat tdf = new SimpleDateFormat("HH:mm");
public final static DateFormat dfmt = new SimpleDateFormat("yyyy-MM-dd");
......
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