Commit d7162062 authored by Prayas Jain's avatar Prayas Jain

Merge branch 'FEATURE/NEW_ENHANCEMENT_MYTEAM' of gitlab.mynisum.com:hr/mytime...

Merge branch 'FEATURE/NEW_ENHANCEMENT_MYTEAM' of gitlab.mynisum.com:hr/mytime into FEATURE/NEW_ENHANCEMENT_MYTEAM
parents 00214a68 f30949f1
...@@ -52,7 +52,7 @@ public class ResourceAllocationController { ...@@ -52,7 +52,7 @@ public class ResourceAllocationController {
if (!resourceAllocService.isResourceAssignedToAnyProject(resourceAllocationReq)) { if (!resourceAllocService.isResourceAssignedToAnyProject(resourceAllocationReq)) {
ResourceAllocation resourcePersisted = resourceAllocService.addResourceAllocation(resourceAllocationReq, loginEmpId); ResourceAllocation resourcePersisted = resourceAllocService.addResourceAllocation(resourceAllocationReq, loginEmpId);
ResponseDetails createResponseDetails = new ResponseDetails(new Date(), 601, "Resource has been created", ResponseDetails createResponseDetails = new ResponseDetails(new Date(), 800, "Resource has been created",
"Resource description", null, request.getContextPath(), "details", resourcePersisted); "Resource description", null, request.getContextPath(), "details", resourcePersisted);
return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK); return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK);
...@@ -61,12 +61,12 @@ public class ResourceAllocationController { ...@@ -61,12 +61,12 @@ public class ResourceAllocationController {
} }
} }
ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, resourceAllocService.respMap.get("message").toString(), ResponseDetails responseDetails = new ResponseDetails(new Date(), resourceAllocService.respMap.get("statusCode").toString(), resourceAllocService.respMap.get("message").toString(),
"Error message desc", null, request.getRequestURI(), "Resource details", resourceAllocationReq); "Error message desc", null, request.getRequestURI(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK); return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
} }
ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Employee Id", ResponseDetails responseDetails = new ResponseDetails(new Date(), 820, "Please provide the valid Employee Id",
"Employee Id is not valid", null, request.getRequestURI(), "Resource details", resourceAllocationReq); "Employee Id is not valid", null, request.getRequestURI(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK); return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
...@@ -85,11 +85,11 @@ public class ResourceAllocationController { ...@@ -85,11 +85,11 @@ public class ResourceAllocationController {
resourceAllocService.updateResource(resourceAllocationReq, loginEmpId); resourceAllocService.updateResource(resourceAllocationReq, loginEmpId);
} }
ResponseDetails createResponseDetails = new ResponseDetails(new Date(), 601, resourceAllocService.respMap.get("message").toString(), ResponseDetails createResponseDetails = new ResponseDetails(new Date(), resourceAllocService.respMap.get("statusCode").toString(), resourceAllocService.respMap.get("message").toString(),
"Resource description", null, request.getContextPath(), "Resource details", resourceAllocationReq); "Resource description", null, request.getContextPath(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK); return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK);
} }
ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Employee Id", ResponseDetails responseDetails = new ResponseDetails(new Date(), 820, "Please provide the valid Employee Id",
"Employee Id is not valid", null, request.getRequestURI(), "Resource details", resourceAllocationReq); "Employee Id is not valid", null, request.getRequestURI(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK); return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
} }
......
...@@ -14,6 +14,7 @@ import java.util.List; ...@@ -14,6 +14,7 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
public class MyProjectAllocationVO { public class MyProjectAllocationVO {
private String projectId;
private String projectName; private String projectName;
private String accountName; private String accountName;
...@@ -28,6 +29,6 @@ public class MyProjectAllocationVO { ...@@ -28,6 +29,6 @@ public class MyProjectAllocationVO {
private String shift; private String shift;
private String resourceStatus; private String resourceStatus;
private List<HashMap<String, String>> deliverLeadIds; private List<HashMap<String, String>> deliveryLeadIds;
} }
...@@ -59,6 +59,7 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -59,6 +59,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
isExists = true; isExists = true;
} }
respMap.put("statusCode", 810);
respMap.put("message", "Resource Not Found"); respMap.put("message", "Resource Not Found");
return isExists; return isExists;
} }
...@@ -68,6 +69,7 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -68,6 +69,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
if (resourceAlloc != null) { if (resourceAlloc != null) {
ResourceAllocation resourcePers = resourceAllocationRepo.save(resourceAlloc); ResourceAllocation resourcePers = resourceAllocationRepo.save(resourceAlloc);
respMap.put("statusCode", 801);
respMap.put("message", "resource has been updated"); respMap.put("message", "resource has been updated");
respMap.put("resourceObj", resourcePers); respMap.put("resourceObj", resourcePers);
...@@ -104,12 +106,14 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -104,12 +106,14 @@ public class ResourceAllocationService implements IResourceAllocationService {
if (!resourceAllocation.getBillingStartDate().after(project.getProjectStartDate())) { if (!resourceAllocation.getBillingStartDate().after(project.getProjectStartDate())) {
log.info("Billing start date should be after Project start date"); log.info("Billing start date should be after Project start date");
respMap.put("statusCode", 811);
respMap.put("message", "Billing start date should be after Project start date"); respMap.put("message", "Billing start date should be after Project start date");
isValid = false; isValid = false;
} }
if (!resourceAllocation.getBillingStartDate().before(resourceAllocation.getBillingEndDate())) { if (!resourceAllocation.getBillingStartDate().before(resourceAllocation.getBillingEndDate())) {
log.info("Billing start date should be before Billing End Date."); log.info("Billing start date should be before Billing End Date.");
respMap.put("statusCode", 812);
respMap.put("message", "Billing start date should be before Billing End Date."); respMap.put("message", "Billing start date should be before Billing End Date.");
isValid = false; isValid = false;
} }
...@@ -118,6 +122,7 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -118,6 +122,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
if (!resourceAllocation.getBillingEndDate().before(project.getProjectEndDate())) { if (!resourceAllocation.getBillingEndDate().before(project.getProjectEndDate())) {
log.info("Billing end date should be before Project End Date."); log.info("Billing end date should be before Project End Date.");
respMap.put("statusCode", 813);
respMap.put("message", "Billing end date should be before Project End Date."); respMap.put("message", "Billing end date should be before Project End Date.");
isValid = false; isValid = false;
} }
...@@ -138,6 +143,7 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -138,6 +143,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
+ projectService.getProjectByProjectId(resource.getProjectId()).getProjectName() + projectService.getProjectByProjectId(resource.getProjectId()).getProjectName()
+ " project should not be before Date of Joining ( " + empDoj + ")."; + " project should not be before Date of Joining ( " + empDoj + ").";
isValid = false; isValid = false;
respMap.put("statusCode", 814);
respMap.put("message", message); respMap.put("message", message);
} }
return isValid; return isValid;
...@@ -160,6 +166,7 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -160,6 +166,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
+ projectService.getProjectByProjectId(resourceAllocPrev.getProjectId()).getProjectName() + projectService.getProjectByProjectId(resourceAllocPrev.getProjectId()).getProjectName()
+ " Project" + " from " + resourceAllocPrev.getBillingStartDate() + "to " + resourceAllocPrev.getBillingEndDate(); + " Project" + " from " + resourceAllocPrev.getBillingStartDate() + "to " + resourceAllocPrev.getBillingEndDate();
isAssigned = true; isAssigned = true;
respMap.put("statusCode", 815);
respMap.put("message", message); respMap.put("message", message);
} }
return isAssigned; return isAssigned;
...@@ -168,6 +175,7 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -168,6 +175,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
public void updateResource(ResourceAllocation resourceAllocReq, String loginEmpId) throws MyTeamException { public void updateResource(ResourceAllocation resourceAllocReq, String loginEmpId) throws MyTeamException {
ResourceAllocation resourceAllocationPers = resourceAllocationRepo.save(resourceAllocReq); ResourceAllocation resourceAllocationPers = resourceAllocationRepo.save(resourceAllocReq);
respMap.put("statusCode", 801;
respMap.put("message", "Resource updated successfully"); respMap.put("message", "Resource updated successfully");
respMap.put("resourceObj", resourceAllocationPers); respMap.put("resourceObj", resourceAllocationPers);
...@@ -288,6 +296,7 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -288,6 +296,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
employee = employeeService.getEmployeeById(resourceAlloc.getEmployeeId()); employee = employeeService.getEmployeeById(resourceAlloc.getEmployeeId());
MyProjectAllocationVO myProject = new MyProjectAllocationVO(); MyProjectAllocationVO myProject = new MyProjectAllocationVO();
myProject.setProjectId(project.getProjectId());
myProject.setProjectName(project.getProjectName()); myProject.setProjectName(project.getProjectName());
myProject.setAccountName(account.getAccountName()); myProject.setAccountName(account.getAccountName());
...@@ -302,7 +311,7 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -302,7 +311,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
} }
if (project.getDeliveryLeadIds() != null) { if (project.getDeliveryLeadIds() != null) {
myProject.setDeliverLeadIds(employeeService.getDeliveryManagerMap(project.getDeliveryLeadIds())); myProject.setDeliveryLeadIds(employeeService.getDeliveryManagerMap(project.getDeliveryLeadIds()));
} }
myProjectList.add(myProject); myProjectList.add(myProject);
} }
......
...@@ -14,7 +14,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -14,7 +14,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
$scope.employees = []; $scope.employees = [];
$scope.projects = []; $scope.projects = [];
var getCellTemplate = '<div class="ui-grid-cell-contents"><a href="#" ng-click="grid.appScope.getRowData(row,\'View\')">{{COL_FIELD}}</a></div>'; var getCellTemplate = '<div class="ui-grid-cell-contents"><a href="#" ng-click="grid.appScope.getRowData(row,\'View\')">{{COL_FIELD}}</a></div>';
var getCellActiveTemplate='<div ng-show="COL_FIELD==true"><p class="col-lg-12">Active</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">In Active</p></div>'; //var getCellActiveTemplate='<div ng-show="COL_FIELD==true"><p class="col-lg-12">Active</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">In Active</p></div>';
//var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-2x" aria-hidden="true" style="font-size:1.5em;colormargin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')">{{COL_FIELD}}</i></i></p>'; //var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-2x" aria-hidden="true" style="font-size:1.5em;colormargin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')">{{COL_FIELD}}</i></i></p>';
// var getCellActiveTemplate='<div >COL_FIELD<p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>'; // var getCellActiveTemplate='<div >COL_FIELD<p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
...@@ -26,13 +26,13 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -26,13 +26,13 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
enableFiltering:true, enableFiltering:true,
columnDefs : [ columnDefs : [
{field : 'projectName',displayName: 'Project',cellTemplate:getCellTemplate, enableColumnMenu: true, enableSorting: true,enableFiltering:true}, {field : 'projectName',displayName: 'Project',cellTemplate:getCellTemplate, enableColumnMenu: true, enableSorting: true,enableFiltering:true},
{field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false,enableFiltering:true}, {field : 'accountName',displayName: 'Account', enableColumnMenu: false, enableSorting: false,enableFiltering:true},
{field : 'deliveryLeadIds',displayName: 'Delivery Lead',cellTemplate:'<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>', enableColumnMenu: false, enableSorting: false,enableFiltering:false}, {field : 'deliveryLeadIds',displayName: 'Delivery Lead',cellTemplate:'<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>', enableColumnMenu: false, enableSorting: false,enableFiltering:false},
{field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false,enableFiltering:false}, {field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false,enableFiltering:false},
{field : 'projectStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false}, {field : 'billingStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false},
{field : 'projectEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false}, {field : 'billingEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false},
{field : 'shift',displayName: 'Shift', enableColumnMenu: false, enableSorting: false,enableFiltering:false}, {field : 'shift',displayName: 'Shift', enableColumnMenu: false, enableSorting: false,enableFiltering:false},
{field : 'status',displayName: 'Status', enableColumnMenu: false,cellTemplate:getCellActiveTemplate,enableSorting: false,enableFiltering:false} {field : 'resourceStatus',displayName: 'Status', enableColumnMenu: false,enableSorting: false,enableFiltering:false}
] ]
}; };
$scope.gridOptions.data = $scope.records; $scope.gridOptions.data = $scope.records;
...@@ -64,7 +64,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -64,7 +64,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
$scope.getMyProjectAllocations = function(){ $scope.getMyProjectAllocations = function(){
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "getMyProjectAllocations?employeeId="+myFactory.getEmpId() url : appConfig.appUri + "resources/getMyProjectAllocations?employeeId="+myFactory.getEmpId()
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data.records; $scope.gridOptions.data = response.data.records;
if(response.data.records.length > 10){ if(response.data.records.length > 10){
...@@ -117,7 +117,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m ...@@ -117,7 +117,7 @@ myApp.controller("myProjectAllocationsController",function($scope, myFactory, $m
columnDefs : [ columnDefs : [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width:100}, {field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width:100},
{field : 'employeeName',displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false}, {field : 'employeeName',displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false},
{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: false}, {field : 'resourceRole',displayName: 'Role', enableColumnMenu: false, enableSorting: false},
// {field : 'emailId',displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false}, // {field : 'emailId',displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false},
// {field : 'experience',displayName: 'Exp', enableColumnMenu: true, enableSorting: true,width:80}, // {field : 'experience',displayName: 'Exp', enableColumnMenu: true, enableSorting: true,width:80},
{field : 'designation',displayName: 'Designation ', enableColumnMenu: false, enableSorting: false}, {field : 'designation',displayName: 'Designation ', enableColumnMenu: false, enableSorting: false},
......
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