Commit 465732ba authored by Prayas Jain's avatar Prayas Jain

Updated_Project_Page

parent 773f36fc
...@@ -48,7 +48,7 @@ public class EmployeeController { ...@@ -48,7 +48,7 @@ public class EmployeeController {
public ResponseEntity<?> createEmployee( @RequestBody Employee employeeReq, public ResponseEntity<?> createEmployee( @RequestBody Employee employeeReq,
@PathVariable(value = "empId") String loginEmpId, HttpServletRequest request) throws MyTeamException { @PathVariable(value = "empId") String loginEmpId, HttpServletRequest request) throws MyTeamException {
if (!empService.isEmployeeExistsById(loginEmpId)) { if (empService.isEmployeeExistsById(loginEmpId)) {
Employee employeePersisted = empService.createEmployee(employeeReq, loginEmpId); Employee employeePersisted = empService.createEmployee(employeeReq, loginEmpId);
ResponseDetails createRespDetails = new ResponseDetails(new Date(), 901, "Employee has been created", ResponseDetails createRespDetails = new ResponseDetails(new Date(), 901, "Employee has been created",
......
...@@ -382,8 +382,8 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -382,8 +382,8 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
} }
$http(req).then(function mySuccess(response) { $http(req).then(function mySuccess(response) {
$scope.result = "Success"; $scope.result = "Success";
if(response.data =='Account already exist'){ if(response.data.message =='An Account is already existed'){
$scope.alertMsg=response.data; $scope.alertMsg=response.data.message;
}else{ }else{
$scope.alertMsg=""; $scope.alertMsg="";
} }
......
...@@ -22,7 +22,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -22,7 +22,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
enableFiltering: true, enableFiltering: true,
columnDefs : [ columnDefs : [
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true,enableFiltering: true, width:120,cellClass: 'grid-align'}, {field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true,enableFiltering: true, width:120,cellClass: 'grid-align'},
{field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: true, enableSorting: true,enableFiltering: true,cellClass: 'grid-align',width:130}, {field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: true, enableSorting: true,enableFiltering: true,cellClass: 'grid-align',width:180},
{field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false,cellClass: 'grid-align'}, {field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false,cellClass: 'grid-align'},
{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){
...@@ -40,7 +40,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -40,7 +40,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
return 'red'; return 'red';
} }
}}, }},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false,enableFiltering: true,cellClass: 'grid-align', width:140}, {field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false,enableFiltering: true,cellClass: 'grid-align', width:180},
{field : 'baseTechnology',displayName: 'Skill', enableColumnMenu: false, enableSorting: false,enableFiltering: false,cellClass: 'grid-align'}, {field : 'baseTechnology',displayName: 'Skill', enableColumnMenu: false, enableSorting: false,enableFiltering: false,cellClass: 'grid-align'},
{field : 'designation',displayName: 'Designation', enableColumnMenu: false, enableSorting: true,enableFiltering: false,cellClass: 'grid-align'}, {field : 'designation',displayName: 'Designation', enableColumnMenu: false, enableSorting: true,enableFiltering: false,cellClass: 'grid-align'},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false,enableFiltering: false, width:100,cellClass: 'grid-align'} {name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false,enableFiltering: false, width:100,cellClass: 'grid-align'}
...@@ -673,6 +673,11 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -673,6 +673,11 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
} }
$http(req).then(function mySuccess(response) { $http(req).then(function mySuccess(response) {
$scope.result = "Success"; $scope.result = "Success";
if(response.data.message == "An Employee is already existed by the Id"){
$scope.alertMsg=response.data.message;
}else{
$scope.alertMsg="";
}
}, function myError(response){ }, function myError(response){
$scope.result = "Error"; $scope.result = "Error";
}); });
......
...@@ -194,7 +194,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -194,7 +194,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
$scope.showOrHidePV="Show"; $scope.showOrHidePV="Show";
} }
}; };
var getCellActiveTemplate='<div ng-show="COL_FIELD==true"><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 ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
$scope.gridOptionsProjectAllocatons = { $scope.gridOptionsProjectAllocatons = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
...@@ -208,7 +208,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -208,7 +208,7 @@ 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 : 'status',displayName: 'Active', enableColumnMenu: false,cellTemplate:getCellActiveTemplate,enableSorting: false,minWidth : 100,width: 150} {field : 'resourceStatus',displayName: 'Status', enableColumnMenu: false,enableSorting: false,minWidth : 100,width: 150}
] ]
}; };
......
...@@ -369,7 +369,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -369,7 +369,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
var loginEmpId = myFactory.getEmpId(); var loginEmpId = myFactory.getEmpId();
urlRequest = appConfig.appUri+ "resources?loginEmpId="+loginEmpId; urlRequest = appConfig.appUri+ "resources?loginEmpId="+loginEmpId;
var req = { var req = {
method : 'POST', method : 'DELETE',
url : urlRequest, url : urlRequest,
headers : { headers : {
"Content-type" : "application/json" "Content-type" : "application/json"
...@@ -688,18 +688,18 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -688,18 +688,18 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.parentData.employeeName = row.entity.employeeName; $scope.parentData.employeeName = row.entity.employeeName;
$scope.parentData.emailId = row.entity.emailId; $scope.parentData.emailId = row.entity.emailId;
$scope.parentData.id = row.entity.id; $scope.parentData.id = row.entity.id;
$scope.parentData.role = row.entity.role; $scope.parentData.role = row.entity.resourceRole;
$scope.parentData.shift = row.entity.shift; //$scope.parentData.shift = row.entity.shift;
$scope.parentData.projectId = row.entity.projectId; $scope.parentData.projectId = row.entity.projectId;
$scope.parentData.projectName = row.entity.projectName; $scope.parentData.projectName = row.entity.projectName;
$scope.parentData.experience = row.entity.experience; //$scope.parentData.experience = row.entity.experience;
$scope.parentData.designation = row.entity.designation; $scope.parentData.designation = row.entity.designation;
$scope.parentData.billableStatus = row.entity.billableStatus; $scope.parentData.billableStatus = row.entity.billableStatus;
$scope.parentData.shift = row.entity.shift; //$scope.parentData.shift = row.entity.shift;
$scope.parentData.mobileNumber = row.entity.mobileNumber; //$scope.parentData.mobileNumber = row.entity.mobileNumber;
$scope.parentData.employeeModel = {} $scope.parentData.employeeModel = {}
$scope.parentData.newBillingStartDate = row.entity.billingStartDate; $scope.parentData.newBillingStartDate = row.entity.billingStartDate;
$scope.parentData.startDate = new Date(row.entity.startDate); //$scope.parentData.startDate = new Date(row.entity.startDate);
$scope.parentData.endDate = new Date(row.entity.billingEndDate); $scope.parentData.endDate = new Date(row.entity.billingEndDate);
console.log($scope.parentData) console.log($scope.parentData)
if(action == "UpdateTeam"){ if(action == "UpdateTeam"){
...@@ -759,15 +759,15 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -759,15 +759,15 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
// $scope.employeeModel.employeeName = userData.employeeName; // $scope.employeeModel.employeeName = userData.employeeName;
// $scope.employeeModel.emailId = userData.emailId; // $scope.employeeModel.emailId = userData.emailId;
$scope.empBillableStatus = userData.billableStatus; $scope.empBillableStatus = userData.billableStatus;
if(userData.resourceRole == "Individual Contributor"){ if(userData.role == "Individual Contributor"){
$scope.employeeRole = "Employee"; $scope.employeeRole = "Employee";
}else{ }else{
$scope.employeeRole = "Lead"; $scope.employeeRole = "Lead";
} }
//$scope.employeeRole = userData.role; //$scope.employeeRole = userData.role;
$scope.employeeShift = userData.shift; //$scope.employeeShift = userData.shift;
$scope.newBillingStartDate = new Date(userData.newBillingStartDate); $scope.newBillingStartDate = new Date(userData.newBillingStartDate);
$scope.startDate = new Date(userData.startDate); //$scope.startDate = new Date(userData.startDate);
$scope.endDate = new Date(userData.endDate); $scope.endDate = new Date(userData.endDate);
//$scope.addTab(); //$scope.addTab();
//$('#home').addClass('md-scroll-mask'); //$('#home').addClass('md-scroll-mask');
...@@ -1170,6 +1170,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1170,6 +1170,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
} }
$scope.validateFields = function (action) { $scope.validateFields = function (action) {
console.log(new Date($scope.parentData.newBillingStartDate));
console.log($scope.newBillingStartDate);
var project = $scope.projectId; var project = $scope.projectId;
var projectName = $scope.projectName; var projectName = $scope.projectName;
var account = $scope.account; var account = $scope.account;
...@@ -1204,10 +1206,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1204,10 +1206,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
return false; return false;
} }
else if(!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate))){ else if(!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate))){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date"; $scope.alertMsg = $scope.empBillableStatus + " start date should be in between project start date and end date";
} }
else if (!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){ else if (!(($scope.newBillingStartDate >= $scope.parentData.newBillingStartDate) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date"; $scope.alertMsg = $scope.empBillableStatus + " start date should be in between previous Billing start date and end date";
}else if($scope.endDate > new Date(dataToPass.projectEndDate)){ }else if($scope.endDate > new Date(dataToPass.projectEndDate)){
$scope.alertMsg = "End date should not exceed project end date"; $scope.alertMsg = "End date should not exceed project end date";
} }
...@@ -1356,27 +1358,29 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1356,27 +1358,29 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}; };
$scope.DataUpdate = function () { $scope.DataUpdate = function () {
var data = $scope.parentData; var data = $scope.parentData;
if (data.resourceRole == "Individual Contributor") { if (data.role == "Individual Contributor") {
var roleselected = "Employee"; var roleselected = "Employee";
} else { } else {
roleselected = data.role; roleselected = data.role;
} }
$scope.previousData = { $scope.previousData = {
Role: roleselected, Role: roleselected,
Shift: data.shift, //Shift: data.shift,
Billabilitystatus: data.billableStatus, Billabilitystatus: data.billableStatus,
newBilligStartDate: new Date(data.newBillingStartDate), newBilligStartDate: new Date(data.newBillingStartDate),
Startdate: data.startDate, //Startdate: data.startDate,
Enddate: data.endDate Enddate: data.endDate
}, },
$scope.currentData = { $scope.currentData = {
Role: $scope.employeeRole, Role: $scope.employeeRole,
Shift: $scope.employeeShift, // Shift: $scope.employeeShift,
Billabilitystatus: $scope.empBillableStatus, Billabilitystatus: $scope.empBillableStatus,
newBilligStartDate: $scope.newBillingStartDate, newBilligStartDate: $scope.newBillingStartDate,
Startdate: $scope.startDate, //Startdate: $scope.startDate,
Enddate: $scope.endDate Enddate: $scope.endDate
} }
console.log($scope.previousData)
console.log($scope.currentData)
var predata = JSON.stringify($scope.previousData); var predata = JSON.stringify($scope.previousData);
var curdata = JSON.stringify($scope.currentData); var curdata = JSON.stringify($scope.currentData);
if (predata == curdata) { if (predata == curdata) {
...@@ -1513,13 +1517,13 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1513,13 +1517,13 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$http(req).then(function mySuccess(response) { $http(req).then(function mySuccess(response) {
$scope.result = "Success"; $scope.result = "Success";
var titleOfModel = "Attention"; var titleOfModel = "Attention";
if(response.data.records!=null){ if(response.data.message == "Resource has been created"){
$scope.objectId = response.data.records; //$scope.objectId = response.data.records;
titleOfModel = ""; titleOfModel = "";
$timeout(function(){ $timeout(function () {
updateGrid(action,record); getProjectDetails($scope.projectId, $scope.status);
removeTab('Add'); removeTab('Add');
},500); }, 500);
$mdDialog.show($mdDialog.alert({ $mdDialog.show($mdDialog.alert({
skipHide: true, skipHide: true,
...@@ -1573,7 +1577,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1573,7 +1577,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
} }
$http(req).then(function mySuccess(response) { $http(req).then(function mySuccess(response) {
$scope.result = "Success"; $scope.result = "Success";
if(response.data.message == "TeamMate updated successfuly"){ if(response.data.message == "Resource updated successfully"){
$timeout(function () { $timeout(function () {
getProjectDetails($scope.projectId, $scope.status); getProjectDetails($scope.projectId, $scope.status);
removeTab('Add'); removeTab('Add');
......
...@@ -27,11 +27,11 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog ...@@ -27,11 +27,11 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog
pageSize:10, pageSize:10,
columnDefs : [ columnDefs : [
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true, width:120}, {field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true, width:120},
{field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false}, {field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: false, enableSorting: true},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false}, {field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false},
//{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: false, width:100}, //{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: false, width:100},
{field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false}, {field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false},
{field : 'mobileNumber',displayName: 'Mobile No', enableColumnMenu: false, enableSorting: false} {field : 'mobileNo',displayName: 'Mobile No', enableColumnMenu: false, enableSorting: false}
// {name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, width:100} // {name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, width:100}
] ]
}; };
......
...@@ -498,7 +498,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -498,7 +498,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$scope.objectId = response.data.id; $scope.objectId = response.data.id;
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "billing/project/" + record.projectId + "? employeeId=" +record.employeeId url : appConfig.appUri + "resources/billing/project/" + record.projectId + "? employeeId=" +record.employeeId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
...@@ -623,7 +623,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -623,7 +623,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
}; };
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "billing/project/" + dataToPass.projectId + "? employeeId=" +dataToPass.employeeId url : appConfig.appUri + "resources/billing/project/" + dataToPass.projectId + "? employeeId=" +dataToPass.employeeId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
}, function myError(response) { }, function myError(response) {
......
...@@ -358,7 +358,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid ...@@ -358,7 +358,7 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.isDisabled = true; $scope.isDisabled = true;
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "getUnAssignedEmployees" url : appConfig.appUri + "resources/unAssignedEmployees"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
//$scope.teamdetails=response.data; //$scope.teamdetails=response.data;
//$scope.gridOptions.data.push(response.data); //$scope.gridOptions.data.push(response.data);
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
ng-value="status" ng-repeat="status in empStatuses">{{status}}</md-option> ng-value="status" ng-repeat="status in empStatuses">{{status}}</md-option>
</md-optgroup> </md-select></td> </md-optgroup> </md-select></td>
</tr> </tr>
<tr ng-show="empStatus == 'Active'"> <tr ng-show="empStatus == 'Active' && templateTitle != 'Add' " >
<td colspan="4"><b>Select Sub Status :</b></td> <td colspan="4"><b>Select Sub Status :</b></td>
<td colspan="8"><md-select ng-model="empSubStatus" name ="empSubStatus" <td colspan="8"><md-select ng-model="empSubStatus" name ="empSubStatus"
ng-model ="empSubStatus" placeholder ="Select a Sub Status Type" id="empSubStatus"> ng-model ="empSubStatus" placeholder ="Select a Sub Status Type" id="empSubStatus">
......
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