Commit 13fe6835 authored by Rajeshekar's avatar Rajeshekar

[Rajeshekar] MT-48:Capture Date of Joining and Date of Birth and show

Date of Joining in Dashboard
MT-51: Capture the project team mate status with dates
parent ae8613d6
...@@ -20,24 +20,25 @@ import lombok.ToString; ...@@ -20,24 +20,25 @@ import lombok.ToString;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ToString @ToString
@Document(collection = "TeamMateBilling") @Document(collection = "BillingDetails")
public class TeamMateBilling implements Serializable { public class BillingDetails implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
private ObjectId id; private ObjectId id;
private String employeeId; private String employeeId;
private String employeeName; private String employeeName;
private String projectId; private String projectId;
private String projectName; private String projectName;
@DateTimeFormat(iso = ISO.DATE) private String billableStatus;
private Date billingStartDate; @DateTimeFormat(iso = ISO.DATE)
@DateTimeFormat(iso = ISO.DATE) private Date billingStartDate;
private Date billingEndDate; @DateTimeFormat(iso = ISO.DATE)
private String comments; private Date billingEndDate;
private boolean active; private String comments;
@DateTimeFormat(iso = ISO.DATE) private boolean active;
private Date createDate; @DateTimeFormat(iso = ISO.DATE)
private Date createDate;
} }
...@@ -5,6 +5,8 @@ import java.util.Date; ...@@ -5,6 +5,8 @@ import java.util.Date;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
...@@ -17,7 +19,7 @@ import lombok.ToString; ...@@ -17,7 +19,7 @@ import lombok.ToString;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ToString @ToString
@Document(collection = "EmployeeRoles") @Document(collection = "EmployeeDetails")
public class EmployeeRoles implements Serializable { public class EmployeeRoles implements Serializable {
/** /**
...@@ -43,6 +45,10 @@ public class EmployeeRoles implements Serializable { ...@@ -43,6 +45,10 @@ public class EmployeeRoles implements Serializable {
private String functionalGroup; private String functionalGroup;
private String empStatus; private String empStatus;
private String employmentType; private String employmentType;
@DateTimeFormat(iso = ISO.DATE)
private Date dateOfJoining;
@DateTimeFormat(iso = ISO.DATE)
private Date dateOfBirth;
private Date createdOn; private Date createdOn;
private Date lastModifiedOn; private Date lastModifiedOn;
......
...@@ -18,20 +18,19 @@ import lombok.ToString; ...@@ -18,20 +18,19 @@ import lombok.ToString;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ToString @ToString
@Document(collection = "Projects") @Document(collection = "Team")
public class Project implements Serializable { public class Project implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@Id
@Id private ObjectId id;
private ObjectId id; private String projectId;
private String projectId; private String projectName;
private String projectName; private String managerId;
private String managerId; private String managerName;
private String managerName; private String account;
private String account; private String status;
private String status; private List<String> employeeIds;
private List<String> employeeIds;
} }
...@@ -20,31 +20,31 @@ import lombok.ToString; ...@@ -20,31 +20,31 @@ import lombok.ToString;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ToString @ToString
@Document(collection = "ProjectTeamMate") @Document(collection = "TeamDetails")
public class ProjectTeamMate implements Serializable { public class ProjectTeamMate implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id
private ObjectId id;
private String employeeId;
private String employeeName;
private String emailId;
private String role;
private String shift;
private String projectId;
private String projectName;
private String account;
private String managerId;
private String managerName;
private String experience;
private String designation;
private String billableStatus;
private String mobileNumber;
@DateTimeFormat(iso = ISO.DATE)
private Date startDate;
@DateTimeFormat(iso = ISO.DATE)
private Date endDate;
private boolean active;
@Id
private ObjectId id;
private String employeeId;
private String employeeName;
private String emailId;
private String role;
private String shift;
private String projectId;
private String projectName;
private String account;
private String managerId;
private String managerName;
private String experience;
private String designation;
private String billableStatus;
private String mobileNumber;
@DateTimeFormat(iso = ISO.DATE)
private Date startDate;
@DateTimeFormat(iso = ISO.DATE)
private Date endDate;
private boolean active;
} }
...@@ -5,16 +5,16 @@ import java.util.List; ...@@ -5,16 +5,16 @@ import java.util.List;
import org.bson.types.ObjectId; import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.TeamMateBilling; import com.nisum.mytime.model.BillingDetails;
public interface TeamMatesBillingRepo extends MongoRepository<TeamMateBilling, String> { public interface TeamMatesBillingRepo extends MongoRepository<BillingDetails, String> {
List<TeamMateBilling> findByProjectId(String projectId); List<BillingDetails> findByProjectId(String projectId);
List<TeamMateBilling> findByEmployeeId(String employeeId); List<BillingDetails> findByEmployeeId(String employeeId);
TeamMateBilling findById(ObjectId id); BillingDetails findById(ObjectId id);
List<TeamMateBilling> findByEmployeeIdAndProjectId(String employeeId, String projectId); List<BillingDetails> findByEmployeeIdAndProjectId(String employeeId, String projectId);
} }
...@@ -5,58 +5,67 @@ import java.util.List; ...@@ -5,58 +5,67 @@ import java.util.List;
import org.bson.types.ObjectId; import org.bson.types.ObjectId;
import com.nisum.mytime.exception.handler.MyTimeException; import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.BillingDetails;
import com.nisum.mytime.model.EmpLoginData; import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.model.EmployeeDashboardVO; import com.nisum.mytime.model.EmployeeDashboardVO;
import com.nisum.mytime.model.EmployeeRoles; import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.Project; import com.nisum.mytime.model.Project;
import com.nisum.mytime.model.ProjectTeamMate; import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.model.TeamMateBilling;
public interface ProjectService { public interface ProjectService {
List<EmpLoginData> employeeLoginsBasedOnDate(long id, String fromDate, String toDate) throws MyTimeException; List<EmpLoginData> employeeLoginsBasedOnDate(long id, String fromDate,
String toDate) throws MyTimeException;
List<Project> getProjects() throws MyTimeException; List<Project> getProjects() throws MyTimeException;
Project addProject(Project project) throws MyTimeException; Project addProject(Project project) throws MyTimeException;
String generatePdfReport(long id, String fromDate, String toDate) throws MyTimeException; String generatePdfReport(long id, String fromDate, String toDate)
throws MyTimeException;
EmployeeRoles getEmployeesRole(String emailId); EmployeeRoles getEmployeesRole(String emailId);
void deleteProject(String projectId); void deleteProject(String projectId);
Project updateProject(Project project); Project updateProject(Project project);
EmployeeRoles getEmployeesRoleData(String empId); EmployeeRoles getEmployeesRoleData(String empId);
List<ProjectTeamMate> getTeamDetails(String empId); List<ProjectTeamMate> getTeamDetails(String empId);
public ProjectTeamMate addProjectTeamMate(ProjectTeamMate projectTeamMate) throws MyTimeException; public ProjectTeamMate addProjectTeamMate(ProjectTeamMate projectTeamMate)
throws MyTimeException;
ProjectTeamMate updateTeammate(ProjectTeamMate projectTeamMate); ProjectTeamMate updateTeammate(ProjectTeamMate projectTeamMate);
void deleteTeammate(String empId, String projectId,ObjectId id); void deleteTeammate(String empId, String projectId, ObjectId id);
List<Project> getProjects(String managerId) throws MyTimeException; List<Project> getProjects(String managerId) throws MyTimeException;
List<ProjectTeamMate> getMyTeamDetails(String empId); List<ProjectTeamMate> getMyTeamDetails(String empId);
List<EmployeeRoles> getUnAssignedEmployees(); List<EmployeeRoles> getUnAssignedEmployees();
List<ProjectTeamMate> getShiftDetails(String shift);
List<ProjectTeamMate> getAllProjectDetails();
List<ProjectTeamMate> getProjectDetails(String projectId);
public List<ProjectTeamMate> getMyProjectAllocations(String empId);
List<TeamMateBilling> getEmployeeBillingDetails(String empId,String projectId);
TeamMateBilling addEmployeeBillingDetails(TeamMateBilling teamMate); List<ProjectTeamMate> getShiftDetails(String shift);
TeamMateBilling updateEmployeeBilling(TeamMateBilling teamMate); List<ProjectTeamMate> getAllProjectDetails();
public List<EmployeeDashboardVO> getEmployeesDashBoard(); List<ProjectTeamMate> getProjectDetails(String projectId);
public List<ProjectTeamMate> getMyProjectAllocations(String empId);
List<BillingDetails> getEmployeeBillingDetails(String empId,
String projectId);
BillingDetails addEmployeeBillingDetails(BillingDetails teamMate);
BillingDetails updateEmployeeBilling(BillingDetails teamMate);
void deleteEmployeeBilling(BillingDetails teamMate);
public List<EmployeeDashboardVO> getEmployeesDashBoard();
List<BillingDetails> getEmployeeActiveBillingDetails(String empId,
String projectId);
} }
...@@ -129,6 +129,8 @@ public class UserServiceImpl implements UserService { ...@@ -129,6 +129,8 @@ public class UserServiceImpl implements UserService {
update.set("empLocation", employeeRoles.getEmpLocation()); update.set("empLocation", employeeRoles.getEmpLocation());
update.set("domain", employeeRoles.getDomain()); update.set("domain", employeeRoles.getDomain());
update.set("designation", employeeRoles.getDesignation()); update.set("designation", employeeRoles.getDesignation());
update.set("dateOfBirth", employeeRoles.getDateOfBirth());
update.set("dateOfJoining", employeeRoles.getDateOfJoining());
update.set("lastModifiedOn", new Date()); update.set("lastModifiedOn", new Date());
FindAndModifyOptions options = new FindAndModifyOptions(); FindAndModifyOptions options = new FindAndModifyOptions();
options.returnNew(true); options.returnNew(true);
......
...@@ -63,6 +63,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -63,6 +63,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.parentData.empStatus = row.entity.empStatus; $scope.parentData.empStatus = row.entity.empStatus;
$scope.parentData.employmentType = row.entity.employmentType; $scope.parentData.employmentType = row.entity.employmentType;
$scope.parentData.domain = row.entity.domain; $scope.parentData.domain = row.entity.domain;
$scope.parentData.dateOfJoining = row.entity.dateOfJoining;
$scope.parentData.dateOfBirth = row.entity.dateOfBirth;
if(action == "Update") if(action == "Update")
$scope.assignRole(action, $scope.parentData); $scope.assignRole(action, $scope.parentData);
else if(action == "Delete") else if(action == "Delete")
...@@ -246,6 +249,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -246,6 +249,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.employmentType = dataToPass.employmentType; $scope.employmentType = dataToPass.employmentType;
$scope.domain = dataToPass.domain; $scope.domain = dataToPass.domain;
$scope.designation = dataToPass.designation; $scope.designation = dataToPass.designation;
$scope.dateOfJoining = new Date(dataToPass.dateOfJoining);
$scope.dateOfBirth = new Date(dataToPass.dateOfBirth);;
$scope.isDisabled = true; $scope.isDisabled = true;
} }
$scope.domains = myFactory.getDomains(); $scope.domains = myFactory.getDomains();
...@@ -381,7 +386,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -381,7 +386,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
document.getElementById('empRole').focus(); document.getElementById('empRole').focus();
}else{ }else{
$scope.alertMsg = ""; $scope.alertMsg = "";
var record = {"employeeId":$scope.empId, "employeeName": $scope.empName, "emailId": $scope.empEmail, "role": $scope.empRole, "empLocation": $scope.empLocation,"designation": $scope.designation,"functionalGroup": $scope.functionalGroup,"empStatus": $scope.empStatus,"employmentType": $scope.employmentType,"domain": $scope.domain};
var record = {"employeeId":$scope.empId, "employeeName": $scope.empName, "emailId": $scope.empEmail, "role": $scope.empRole, "empLocation": $scope.empLocation,"designation": $scope.designation,"functionalGroup": $scope.functionalGroup,"empStatus": $scope.empStatus,"employmentType": $scope.employmentType,"domain": $scope.domain,"dateOfJoining":$scope.dateOfJoining,"dateOfBirth":$scope.dateOfBirth};
addOrUpdateRole(record, $scope.templateTitle); addOrUpdateRole(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500); $timeout(function(){updateGrid($scope.templateTitle, record)},500);
} }
......
...@@ -93,7 +93,6 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window ...@@ -93,7 +93,6 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
method : "GET", method : "GET",
url : appConfig.appUri + "user/getMasterData" url : appConfig.appUri + "user/getMasterData"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
myFactory.setTechnologies(response.data);
myFactory.setEmployementTypes(response.data['EmpType']); myFactory.setEmployementTypes(response.data['EmpType']);
myFactory.setFunctionalgroups(response.data['FunctionalGrp']) myFactory.setFunctionalgroups(response.data['FunctionalGrp'])
myFactory.setEmployeeStatus(response.data['EmployeeStatus']); myFactory.setEmployeeStatus(response.data['EmployeeStatus']);
......
...@@ -17,6 +17,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -17,6 +17,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
"designation":"", "designation":"",
"billableStatus":"", "billableStatus":"",
"mobileNumber":"", "mobileNumber":"",
"startDate":"",
"endDate":"",
"action":"" "action":""
}; };
$scope.employees = []; $scope.employees = [];
...@@ -85,6 +87,9 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -85,6 +87,9 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$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.mobileNumber = row.entity.mobileNumber; $scope.parentData.mobileNumber = row.entity.mobileNumber;
$scope.parentData.startDate = row.entity.startDate;
$scope.parentData.endDate = row.entity.endDate;
if(action == "Update"){ if(action == "Update"){
$scope.updateEmployee(action, $scope.parentData); $scope.updateEmployee(action, $scope.parentData);
} }
...@@ -326,6 +331,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -326,6 +331,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$scope.mobileNumber = dataToPass.mobileNumber; $scope.mobileNumber = dataToPass.mobileNumber;
$scope.experience = dataToPass.experience; $scope.experience = dataToPass.experience;
$scope.designation = dataToPass.designation; $scope.designation = dataToPass.designation;
$scope.startDate = new Date(dataToPass.startDate);
$scope.endDate = new Date(dataToPass.endDate);
$scope.isDisabled = true; $scope.isDisabled = true;
$scope.projectModel = { $scope.projectModel = {
'projectName': dataToPass.projectName, 'projectName': dataToPass.projectName,
...@@ -389,6 +396,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -389,6 +396,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
type: 'info' type: 'info'
}); });
}; };
$scope.toggleBillability = function() { $scope.toggleBillability = function() {
$scope.showBillable = !$scope.showBillable; $scope.showBillable = !$scope.showBillable;
}; };
...@@ -405,6 +413,10 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -405,6 +413,10 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
}else if(action == "Update"){ }else if(action == "Update"){
urlRequest = appConfig.appUri+ "projectTeam/updateEmployeeBilling"; urlRequest = appConfig.appUri+ "projectTeam/updateEmployeeBilling";
} }
else if(action == "Delete"){
urlRequest = appConfig.appUri+ "projectTeam/deleteEmployeeBilling";
}
var req = { var req = {
method : 'POST', method : 'POST',
url : urlRequest, url : urlRequest,
...@@ -421,6 +433,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -421,6 +433,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
url : appConfig.appUri + "/projectTeam/getEmployeeBillingDetails?employeeId="+record.employeeId+"&projectId="+record.projectId url : appConfig.appUri + "/projectTeam/getEmployeeBillingDetails?employeeId="+record.employeeId+"&projectId="+record.projectId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
...@@ -428,11 +441,11 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -428,11 +441,11 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
if(action == "Add"){ if(action == "Add"){
$scope.toggleBillability(); $scope.toggleBillability();
} }
alert("Billability added successfully!!!") alert("Billability details modifed successfully!!!")
//showAlert("Billability added successfully!!!"); //showAlert("Billability added successfully!!!");
}, function myError(response){ }, function myError(response){
$scope.result = "Error"; $scope.result = "Error";
alert("Error Adding billability!!!") alert("Error modifying billability!!!")
//showAlert("Error Adding billability!!!"); //showAlert("Error Adding billability!!!");
}); });
}; };
...@@ -446,6 +459,15 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -446,6 +459,15 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$scope.gridOptions.data[index].editrow = false; $scope.gridOptions.data[index].editrow = false;
addOrUpdateBilling(row,"Update"); addOrUpdateBilling(row,"Update");
}; };
$scope.deleteRow = function (row) {
//get the index of selected row
var index = $scope.gridOptions.data.indexOf(row);
//Remove the edit mode when user click on Save button
$scope.gridOptions.data[index].editrow = false;
addOrUpdateBilling(row,"Delete");
};
var getCellActiveTemplateBilling='<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 getCellActiveTemplateBilling='<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.gridOptions = { $scope.gridOptions = {
...@@ -480,6 +502,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -480,6 +502,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
columnDefs : [ columnDefs : [
{name : 'id',displayName: 'Id', enableColumnMenu: false, enableSorting: false,cellTemplate: '<div>{{rowRenderIndex + 1}}</div>',enableCellEdit: false}, {name : 'id',displayName: 'Id', enableColumnMenu: false, enableSorting: false,cellTemplate: '<div>{{rowRenderIndex + 1}}</div>',enableCellEdit: false},
// {field : 'billingStartDate',displayName: 'Start Date', enableColumnMenu: false,enableSorting: false,cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD|date:"dd-MMM-yyyy"}}</div> <div ng-if="row.entity.editrow"><input ng-class="\'colt\' + col.index" datepicker-popup is-open="false" ng-model="COL_FIELD" /></div>'}, // {field : 'billingStartDate',displayName: 'Start Date', enableColumnMenu: false,enableSorting: false,cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD|date:"dd-MMM-yyyy"}}</div> <div ng-if="row.entity.editrow"><input ng-class="\'colt\' + col.index" datepicker-popup is-open="false" ng-model="COL_FIELD" /></div>'},
{field : 'billableStatus',displayName: 'Billable Status', enableColumnMenu: false, enableSorting: false},
{ {
field: 'billingStartDate', field: 'billingStartDate',
displayName: 'Start Date', displayName: 'Start Date',
...@@ -502,6 +526,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -502,6 +526,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
cellTemplate: '<div><button ng-show="!row.entity.editrow" ng-click="grid.appScope.edit(row.entity)"><i class="fa fa-edit"></i></button>' + //Edit Button cellTemplate: '<div><button ng-show="!row.entity.editrow" ng-click="grid.appScope.edit(row.entity)"><i class="fa fa-edit"></i></button>' + //Edit Button
'<button ng-show="row.entity.editrow" ng-click="grid.appScope.saveRow(row.entity)"><i class="fa fa-floppy-o"></i></button>' +//Save Button '<button ng-show="row.entity.editrow" ng-click="grid.appScope.saveRow(row.entity)"><i class="fa fa-floppy-o"></i></button>' +//Save Button
'<button ng-show="row.entity.editrow" ng-click="grid.appScope.cancelEdit(row.entity)"><i class="fa fa-times"></i></button>' + //Cancel Button '<button ng-show="row.entity.editrow" ng-click="grid.appScope.cancelEdit(row.entity)"><i class="fa fa-times"></i></button>' + //Cancel Button
'<button ng-show="!row.entity.editrow" ng-click="grid.appScope.deleteRow(row.entity)"><i class="fa fa-minus-circle"></i></button>' +//Delete Button
'</div>', width: 100 '</div>', width: 100
} }
],rowStyle: function(row){/* ],rowStyle: function(row){/*
...@@ -597,13 +622,13 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -597,13 +622,13 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$scope.alertMsg = "Employee is already assigned to the selected project"; $scope.alertMsg = "Employee is already assigned to the selected project";
} else { } else {
$scope.alertMsg = ""; $scope.alertMsg = "";
var record = {"employeeId":employeeModel.employeeId, "employeeName":employeeModel.employeeName, "emailId": employeeModel.emailId, "role": employeeModel.role, "designation":employeeModel.designation,"shift": employeeModel.shift,"projectId":projectModel.projectId,"projectName":projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"mobileNumber":employeeModel.mobileNumber,"active":true}; var record = {"employeeId":employeeModel.employeeId, "employeeName":employeeModel.employeeName, "emailId": employeeModel.emailId, "role": employeeModel.role, "designation":employeeModel.designation,"shift": employeeModel.shift,"projectId":projectModel.projectId,"projectName":projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"mobileNumber":employeeModel.mobileNumber,"active":true,"billableStatus":$scope.empBillableStatus,"startDate":$scope.startDate,"endDate":$scope.endDate};
addOrUpdateRole(record, $scope.templateTitle); addOrUpdateRole(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500); $timeout(function(){updateGrid($scope.templateTitle, record)},500);
} }
}else{ }else{
$scope.alertMsg = ""; $scope.alertMsg = "";
var record = {"id":$scope.id,"employeeId":$scope.employeeId, "employeeName":$scope.employeeName, "emailId": $scope.emailId, "role": $scope.role, "shift": $scope.shift,"projectId":$scope.projectModel.projectId,"projectName":$scope.projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"designation":$scope.empDesignation,"billableStatus":$scope.empBillableStatus,"experience":$scope.experience,"mobileNumber":$scope.mobileNumber}; var record = {"id":$scope.id,"employeeId":$scope.employeeId, "employeeName":$scope.employeeName, "emailId": $scope.emailId, "role": $scope.role, "shift": $scope.shift,"projectId":$scope.projectModel.projectId,"projectName":$scope.projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"designation":$scope.empDesignation,"billableStatus":$scope.empBillableStatus,"experience":$scope.experience,"mobileNumber":$scope.mobileNumber,"startDate":$scope.startDate,"endDate":$scope.endDate};
addOrUpdateRole(record, $scope.templateTitle); addOrUpdateRole(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500); $timeout(function(){updateGrid($scope.templateTitle, record)},500);
} }
......
...@@ -35,6 +35,14 @@ ...@@ -35,6 +35,14 @@
<md-select ng-model="empBillableStatus" md-selected-text="getSelectedBillableStatus()" id="empBillableStatus"> <md-select ng-model="empBillableStatus" md-selected-text="getSelectedBillableStatus()" id="empBillableStatus">
<md-optgroup label="billable statuses"> <md-option ng-value="billableStatus" <md-optgroup label="billable statuses"> <md-option ng-value="billableStatus"
ng-repeat="billableStatus in billableStatuses">{{billableStatus}}</md-option> </md-optgroup> </md-select> ng-repeat="billableStatus in billableStatuses">{{billableStatus}}</md-option> </md-optgroup> </md-select>
<md-datepicker ng-model="startDate" md-placeholder="Start Date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
<md-datepicker ng-model="endDate" md-placeholder="Projected End Date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
<!-- <input type="text" class="form-control" id="experience" <!-- <input type="text" class="form-control" id="experience"
name="experience" ng-model="experience" placeholder="Experience" /><br> name="experience" ng-model="experience" placeholder="Experience" /><br>
<input type="text" class="form-control" id="mobileNumber" <input type="text" class="form-control" id="mobileNumber"
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<div class="row col-lg-12" style="margin-left: -25px;"> <div class="row col-lg-12" style="margin-left: -25px;">
<div class="col-xs-4" style="margin-left: 0px;"> <div class="col-xs-4" style="margin-left: 0px;">
<md-button class="md-raised" ng-click="toggleBillability()" style="width:220px;background: cadetblue;color:white;">Add Billability </md-button> <!-- <md-button class="md-raised" ng-click="toggleBillability()" style="width:220px;background: cadetblue;color:white;">Add Billability </md-button> -->
</div> </div>
</div> </div>
......
...@@ -93,6 +93,24 @@ ...@@ -93,6 +93,24 @@
<md-optgroup label="Employment Status"> <md-option ng-value="status" <md-optgroup label="Employment Status"> <md-option ng-value="status"
ng-repeat="status in empStatuses">{{status}}</md-option> </md-optgroup> </md-select> ng-repeat="status in empStatuses">{{status}}</md-option> </md-optgroup> </md-select>
</td> </td>
</tr>
<tr>
<td colspan="4">
<b >Date of Joining</b></td>
<td colspan="8"> <md-datepicker ng-model="dateOfJoining" md-placeholder="Date of Joining"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
</td>
</tr>
<tr>
<td colspan="4">
<b >Date of Birth</b></td>
<td colspan="8"> <md-datepicker ng-model="dateOfBirth" md-placeholder="Date of Birth"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="12"> <td colspan="12">
...@@ -103,7 +121,10 @@ ...@@ -103,7 +121,10 @@
</tr> </tr>
</table> </table>
<!-- <!-- <md-datepicker ng-model="expiryDate" md-placeholder="Expiry date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
<div class="row col-lg-12 col-xs-12"> <div class="row col-lg-12 col-xs-12">
<div class="col-lg-5 col-xs-6" > <div class="col-lg-5 col-xs-6" >
<p> <p>
......
<md-dialog aria-label="Role Template" style="width:520px;height:440px;" ng-init="getProjects()"> <md-dialog aria-label="Role Template" style="width:520px;height:800px;" ng-init="getProjects()">
<form ng-cloak name="myForm"> <form ng-cloak name="myForm">
<md-toolbar> <md-toolbar>
<div class="md-toolbar-tools" <div class="md-toolbar-tools"
...@@ -25,6 +25,17 @@ ...@@ -25,6 +25,17 @@
<output>Email Id : {{employeeModel.emailId}}</output> <output>Email Id : {{employeeModel.emailId}}</output>
<output>Role : {{employeeModel.role}}</output> <output>Role : {{employeeModel.role}}</output>
<output>Designation : {{employeeModel.designation}}</output> <output>Designation : {{employeeModel.designation}}</output>
<md-select ng-model="empBillableStatus" md-selected-text="getSelectedBillableStatus()" id="empBillableStatus">
<md-optgroup label="billable statuses"> <md-option ng-value="billableStatus"
ng-repeat="billableStatus in billableStatuses">{{billableStatus}}</md-option> </md-optgroup> </md-select>
<md-datepicker ng-model="startDate" md-placeholder="Start Date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker></br>
<md-datepicker ng-model="endDate" md-placeholder="Projected End Date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
<div role="alert"> <div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span> <span class="error" style="color: red;">{{alertMsg}}</span>
......
...@@ -229,7 +229,37 @@ ...@@ -229,7 +229,37 @@
</div> </div>
<div class="row col-lg-12 col-xs-12">
<div class="col-lg-5 col-xs-6">
<p>
<b>Date of Joining</b>
</p>
</div>
<div class="col-lg-7 col-xs-6">
<p>
<b>:</b> {{profile.dateOfJoining | date:'dd-MMM-yyyy'}}
</p>
</div>
</div>
<div class="row col-lg-12 col-xs-12">
<div class="col-lg-5 col-xs-6">
<p>
<b>Date of Birth</b>
</p>
</div>
<div class="col-lg-7 col-xs-6">
<p>
<b>:</b> {{profile.dateOfBirth | date:'dd-MMM-yyyy'}}
</p>
</div>
</div>
</div>
</div> </div>
<div class="col-lg-2" style="cursor: pointer; float: left;"> <div class="col-lg-2" style="cursor: pointer; float: left;">
<md-button class="md-raised md-primary" <md-button class="md-raised md-primary"
......
...@@ -58,7 +58,8 @@ public class ProjectControllerTest { ...@@ -58,7 +58,8 @@ public class ProjectControllerTest {
EmployeeRoles employeesRole = new EmployeeRoles( EmployeeRoles employeesRole = new EmployeeRoles(
"5976ef15874c902c98b8a05d", null, null, "user@nisum.com", null, "5976ef15874c902c98b8a05d", null, null, "user@nisum.com", null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, new Date(2017 - 11 - 12), new Date(2017 - 12 - 12)); null, null, new Date(2017 - 11 - 12), new Date(2017 - 12 - 12),
null, null);
when(userService.getEmployeesRole("user@nisum.com")) when(userService.getEmployeesRole("user@nisum.com"))
.thenReturn(employeesRole); .thenReturn(employeesRole);
mockMvc.perform( mockMvc.perform(
...@@ -131,7 +132,8 @@ public class ProjectControllerTest { ...@@ -131,7 +132,8 @@ public class ProjectControllerTest {
EmployeeRoles employeesRole = new EmployeeRoles( EmployeeRoles employeesRole = new EmployeeRoles(
"5976ef15874c902c98b8a05d", "16127", null, null, null, null, "5976ef15874c902c98b8a05d", "16127", null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, new Date(2017 - 11 - 18), new Date(2017 - 12 - 18)); null, new Date(2017 - 11 - 18), new Date(2017 - 12 - 18), null,
null);
when(userService.getEmployeesRoleData("16127")) when(userService.getEmployeesRoleData("16127"))
.thenReturn(employeesRole); .thenReturn(employeesRole);
mockMvc.perform( mockMvc.perform(
......
...@@ -27,7 +27,7 @@ import com.nisum.mytime.controller.ProjectTeamController; ...@@ -27,7 +27,7 @@ import com.nisum.mytime.controller.ProjectTeamController;
import com.nisum.mytime.model.EmployeeRoles; import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.Project; import com.nisum.mytime.model.Project;
import com.nisum.mytime.model.ProjectTeamMate; import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.model.TeamMateBilling; import com.nisum.mytime.model.BillingDetails;
import com.nisum.mytime.service.ProjectService; import com.nisum.mytime.service.ProjectService;
import com.nisum.mytime.service.UserService; import com.nisum.mytime.service.UserService;
...@@ -56,7 +56,8 @@ public class ProjectTeamControllerTest { ...@@ -56,7 +56,8 @@ public class ProjectTeamControllerTest {
EmployeeRoles employeesRole = new EmployeeRoles( EmployeeRoles employeesRole = new EmployeeRoles(
"5976ef15874c902c98b8a05d", null, null, null, null, null, null, "5976ef15874c902c98b8a05d", null, null, null, null, null, null,
null, null, null, null, null, null, "user@nisum.com", null, null, null, null, null, null, null, "user@nisum.com", null,
null, null, new Date(2017 - 11 - 20), new Date(2107 - 12 - 23)); null, null, new Date(2017 - 11 - 20), new Date(2107 - 12 - 23),
null, null);
when(userService.getEmployeesRole("user@nisum.com")) when(userService.getEmployeesRole("user@nisum.com"))
.thenReturn(employeesRole); .thenReturn(employeesRole);
mockMvc.perform( mockMvc.perform(
...@@ -91,7 +92,7 @@ public class ProjectTeamControllerTest { ...@@ -91,7 +92,7 @@ public class ProjectTeamControllerTest {
"vsingh@nisum.com", "Manager", null, "09:00-06:00", "Java/J2EE", "vsingh@nisum.com", "Manager", null, "09:00-06:00", "Java/J2EE",
"Testing", "8755672341", "8800543678", "vsingh@gmail.com", null, "Testing", "8755672341", "8800543678", "vsingh@gmail.com", null,
null, null, null, null, new Date(2017 - 11 - 29), null, null, null, null, new Date(2017 - 11 - 29),
new Date(2017 - 12 - 20)); new Date(2017 - 12 - 20), null, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
String jsonString = mapper.writeValueAsString(employeesRoles2); String jsonString = mapper.writeValueAsString(employeesRoles2);
when(userService.updateEmployeeRole(any())).thenReturn(employeesRoles2); when(userService.updateEmployeeRole(any())).thenReturn(employeesRoles2);
...@@ -115,7 +116,8 @@ public class ProjectTeamControllerTest { ...@@ -115,7 +116,8 @@ public class ProjectTeamControllerTest {
EmployeeRoles employeesRole = new EmployeeRoles( EmployeeRoles employeesRole = new EmployeeRoles(
"5976ef15874c902c98b8a05d", "16127", null, null, null, null, "5976ef15874c902c98b8a05d", "16127", null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, new Date(2017 - 11 - 20), new Date(2107 - 12 - 23)); null, new Date(2017 - 11 - 20), new Date(2107 - 12 - 23), null,
null);
when(userService.getEmployeesRoleData("16127")) when(userService.getEmployeesRoleData("16127"))
.thenReturn(employeesRole); .thenReturn(employeesRole);
mockMvc.perform( mockMvc.perform(
...@@ -273,7 +275,7 @@ public class ProjectTeamControllerTest { ...@@ -273,7 +275,7 @@ public class ProjectTeamControllerTest {
@Test @Test
public void testgetEmployeeBillingDetails() throws Exception { public void testgetEmployeeBillingDetails() throws Exception {
List<TeamMateBilling> billings = CreateTeamMateBilling(); List<BillingDetails> billings = CreateTeamMateBilling();
System.out.println(billings); System.out.println(billings);
when(projectService.getEmployeeBillingDetails("16127", "101")) when(projectService.getEmployeeBillingDetails("16127", "101"))
.thenReturn(billings); .thenReturn(billings);
...@@ -283,10 +285,10 @@ public class ProjectTeamControllerTest { ...@@ -283,10 +285,10 @@ public class ProjectTeamControllerTest {
verify(projectService).getEmployeeBillingDetails("16127", "101"); verify(projectService).getEmployeeBillingDetails("16127", "101");
} }
private List<TeamMateBilling> CreateTeamMateBilling() { private List<BillingDetails> CreateTeamMateBilling() {
List<TeamMateBilling> data = new ArrayList<>(); List<BillingDetails> data = new ArrayList<>();
TeamMateBilling team1 = new TeamMateBilling(); BillingDetails team1 = new BillingDetails();
team1.setId(new ObjectId("5976ef15874c902c98b8a05d")); team1.setId(new ObjectId("5976ef15874c902c98b8a05d"));
team1.setEmployeeId("16127"); team1.setEmployeeId("16127");
team1.setEmployeeName("Employee1"); team1.setEmployeeName("Employee1");
...@@ -297,7 +299,7 @@ public class ProjectTeamControllerTest { ...@@ -297,7 +299,7 @@ public class ProjectTeamControllerTest {
team1.setActive(true); team1.setActive(true);
data.add(team1); data.add(team1);
TeamMateBilling team2 = new TeamMateBilling(); BillingDetails team2 = new BillingDetails();
team2.setId(new ObjectId("1976ef15874c902c98b8a05d")); team2.setId(new ObjectId("1976ef15874c902c98b8a05d"));
team2.setEmployeeId("16128"); team2.setEmployeeId("16128");
team2.setEmployeeName("Employee2"); team2.setEmployeeName("Employee2");
......
...@@ -55,7 +55,8 @@ public class UserControllerTest { ...@@ -55,7 +55,8 @@ public class UserControllerTest {
EmployeeRoles employeesRole = new EmployeeRoles( EmployeeRoles employeesRole = new EmployeeRoles(
"5976ef15874c902c98b8a05d", null, null, "user@nisum.com", null, "5976ef15874c902c98b8a05d", null, null, "user@nisum.com", null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, new Date(2017 - 11 - 20), new Date(2017 - 12 - 23)); null, null, new Date(2017 - 11 - 20), new Date(2017 - 12 - 23),
null, null);
when(userService.getEmployeesRole("user@nisum.com")) when(userService.getEmployeesRole("user@nisum.com"))
.thenReturn(employeesRole); .thenReturn(employeesRole);
mockMvc.perform( mockMvc.perform(
...@@ -71,7 +72,7 @@ public class UserControllerTest { ...@@ -71,7 +72,7 @@ public class UserControllerTest {
"user1@nisum.com", "HR", "Human Resource Lead", "06:00-09:00", "user1@nisum.com", "HR", "Human Resource Lead", "06:00-09:00",
"Java/J2EE", "Spring", "8767893452", "5687234567", "Java/J2EE", "Spring", "8767893452", "5687234567",
"user1@gmail.com", null, null, null, null, null, "user1@gmail.com", null, null, null, null, null,
new Date(2017 - 11 - 20), new Date(2017 - 12 - 23)); new Date(2017 - 11 - 20), new Date(2017 - 12 - 23), null, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
String jsonString = mapper.writeValueAsString(employeeRole); String jsonString = mapper.writeValueAsString(employeeRole);
when(userService.assigingEmployeeRole(anyObject())) when(userService.assigingEmployeeRole(anyObject()))
...@@ -90,7 +91,7 @@ public class UserControllerTest { ...@@ -90,7 +91,7 @@ public class UserControllerTest {
"user2@nisum.com", "Manager", "Senior Software Engineer", "user2@nisum.com", "Manager", "Senior Software Engineer",
"09:00am-06:00am", "php", "Hibernate", "9878678956", "09:00am-06:00am", "php", "Hibernate", "9878678956",
"9989782210", "user2@gmail.com", null, null, null, null, null, "9989782210", "user2@gmail.com", null, null, null, null, null,
new Date(2017 - 11 - 20), new Date(2017 - 12 - 23)); new Date(2017 - 11 - 20), new Date(2017 - 12 - 23), null, null);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
String jsonString = mapper.writeValueAsString(employeeRole2); String jsonString = mapper.writeValueAsString(employeeRole2);
when(userService.updateEmployeeRole(anyObject())) when(userService.updateEmployeeRole(anyObject()))
...@@ -124,7 +125,8 @@ public class UserControllerTest { ...@@ -124,7 +125,8 @@ public class UserControllerTest {
EmployeeRoles employeesRole = new EmployeeRoles( EmployeeRoles employeesRole = new EmployeeRoles(
"5976ef15874c902c98b8a05d", "16127", null, null, null, null, "5976ef15874c902c98b8a05d", "16127", null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, new Date(2017 - 11 - 13), new Date(2017 - 12 - 20)); null, new Date(2017 - 11 - 13), new Date(2017 - 12 - 20), null,
null);
when(userService.getEmployeesRoleData("16127")) when(userService.getEmployeesRoleData("16127"))
.thenReturn(employeesRole); .thenReturn(employeesRole);
mockMvc.perform(get("/user/getEmployeeRoleData").param("empId", "16127") mockMvc.perform(get("/user/getEmployeeRoleData").param("empId", "16127")
...@@ -140,7 +142,8 @@ public class UserControllerTest { ...@@ -140,7 +142,8 @@ public class UserControllerTest {
EmployeeRoles employeesRole = new EmployeeRoles( EmployeeRoles employeesRole = new EmployeeRoles(
"5976ef15874c902c98b8a05d", "16209", null, null, null, null, "5976ef15874c902c98b8a05d", "16209", null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, new Date(2017 - 11 - 13), new Date(2017 - 12 - 20)); null, new Date(2017 - 11 - 13), new Date(2017 - 12 - 20), null,
null);
when(userService.getEmployeeRoleDataForSearchCriteria("dummy@nisum.com", when(userService.getEmployeeRoleDataForSearchCriteria("dummy@nisum.com",
"emailId")).thenReturn(employeesRole); "emailId")).thenReturn(employeesRole);
mockMvc.perform(get("/user/getEmployeeRoleDataForSearchCriteria") mockMvc.perform(get("/user/getEmployeeRoleDataForSearchCriteria")
...@@ -160,7 +163,8 @@ public class UserControllerTest { ...@@ -160,7 +163,8 @@ public class UserControllerTest {
EmployeeRoles employeesRole = new EmployeeRoles( EmployeeRoles employeesRole = new EmployeeRoles(
"5976ef15874c902c98b8a05d", "16209", null, null, null, null, "5976ef15874c902c98b8a05d", "16209", null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, new Date(2017 - 11 - 13), new Date(2017 - 12 - 20)); null, new Date(2017 - 11 - 13), new Date(2017 - 12 - 20), null,
null);
when(userService.getEmployeeRoleDataForSearchCriteria( when(userService.getEmployeeRoleDataForSearchCriteria(
"Mahesh Kumar Gutam", "employeeName")) "Mahesh Kumar Gutam", "employeeName"))
.thenReturn(employeesRole); .thenReturn(employeesRole);
...@@ -247,7 +251,8 @@ public class UserControllerTest { ...@@ -247,7 +251,8 @@ public class UserControllerTest {
"msrivastava@nisum.com", "Employee", "Software Engineer", "msrivastava@nisum.com", "Employee", "Software Engineer",
"09:00-06:00", "Java/J2EE", "Spring", "8765588388", "09:00-06:00", "Java/J2EE", "Spring", "8765588388",
"9978567723", "msrivastava@gmail.com", null, null, null, null, "9978567723", "msrivastava@gmail.com", null, null, null, null,
null, new Date(2017 - 01 - 01), new Date(2017 - 03 - 01)); null, new Date(2017 - 01 - 01), new Date(2017 - 03 - 01), null,
null);
System.out.println(employeeRole); System.out.println(employeeRole);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
String jsonString = mapper.writeValueAsString(employeeRole); String jsonString = mapper.writeValueAsString(employeeRole);
......
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