Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
d19eb1de
Commit
d19eb1de
authored
Jun 04, 2018
by
Rajeshekar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MT-51: Added Dashboard show billable details
parent
b89c156d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
137 additions
and
103 deletions
+137
-103
ProjectTeamController.java
...va/com/nisum/mytime/controller/ProjectTeamController.java
+11
-0
EmployeeRoles.java
src/main/java/com/nisum/mytime/model/EmployeeRoles.java
+48
-48
ProjectService.java
src/main/java/com/nisum/mytime/service/ProjectService.java
+2
-0
ProjectServiceImpl.java
...ain/java/com/nisum/mytime/service/ProjectServiceImpl.java
+20
-0
DashboardController.js
src/main/webapp/WEB-INF/controllers/DashboardController.js
+33
-37
employeeDetails.html
src/main/webapp/WEB-INF/templates/employeeDetails.html
+8
-5
ProjectControllerTest.java
...om/nisum/mytime/controllertest/ProjectControllerTest.java
+2
-2
ProjectTeamControllerTest.java
...isum/mytime/controllertest/ProjectTeamControllerTest.java
+4
-4
UserControllerTest.java
...a/com/nisum/mytime/controllertest/UserControllerTest.java
+9
-7
No files found.
src/main/java/com/nisum/mytime/controller/ProjectTeamController.java
View file @
d19eb1de
...
@@ -220,6 +220,17 @@ public class ProjectTeamController {
...
@@ -220,6 +220,17 @@ public class ProjectTeamController {
return
new
ResponseEntity
<>(
billings
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
billings
,
HttpStatus
.
OK
);
}
}
@RequestMapping
(
value
=
"/getEmployeeBillingDetailsAll"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
BillingDetails
>>
getEmployeeBillingDetailsAll
(
@RequestParam
(
"employeeId"
)
String
employeeId
)
throws
MyTimeException
{
List
<
BillingDetails
>
billings
=
projectService
.
getEmployeeBillingDetailsAll
(
employeeId
);
return
new
ResponseEntity
<>(
billings
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/addEmployeeBilling"
,
method
=
RequestMethod
.
POST
,
@RequestMapping
(
value
=
"/addEmployeeBilling"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
...
...
src/main/java/com/nisum/mytime/model/EmployeeRoles.java
View file @
d19eb1de
...
@@ -24,74 +24,74 @@ import lombok.ToString;
...
@@ -24,74 +24,74 @@ import lombok.ToString;
@Document
(
collection
=
"EmployeeDetails"
)
@Document
(
collection
=
"EmployeeDetails"
)
public
class
EmployeeRoles
implements
Serializable
{
public
class
EmployeeRoles
implements
Serializable
{
/**
private
static
final
long
serialVersionUID
=
1L
;
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
private
String
id
;
@ExcelCellName
(
"Employee ID"
)
@ExcelCellName
(
"Employee ID"
)
private
String
employeeId
;
private
String
employeeId
;
@ExcelCellName
(
"Employee Name"
)
@ExcelCellName
(
"Employee Name"
)
private
String
employeeName
;
private
String
employeeName
;
@ExcelCellName
(
"Email ID"
)
@ExcelCellName
(
"Email ID"
)
private
String
emailId
;
private
String
emailId
;
@ExcelCellName
(
"Role"
)
@ExcelCellName
(
"Role"
)
private
String
role
;
private
String
role
;
@ExcelCellName
(
"Designation"
)
@ExcelCellName
(
"Designation"
)
private
String
designation
;
private
String
designation
;
@ExcelCellName
(
"Shift"
)
@ExcelCellName
(
"Shift"
)
private
String
shift
;
private
String
shift
;
@ExcelCellName
(
"Primary Skill"
)
@ExcelCellName
(
"Primary Skill"
)
private
String
baseTechnology
;
private
String
baseTechnology
;
@ExcelCellName
(
"Domain"
)
@ExcelCellName
(
"Domain"
)
private
String
domain
;
private
String
domain
;
@ExcelCellName
(
"Location"
)
@ExcelCellName
(
"Location"
)
private
String
empLocation
;
private
String
empLocation
;
@ExcelCellName
(
"Skills"
)
@ExcelCellName
(
"Skills"
)
private
String
technologyKnown
;
private
String
technologyKnown
;
@ExcelCellName
(
"Primary Mobile"
)
@ExcelCellName
(
"Primary Mobile"
)
private
String
mobileNumber
;
private
String
mobileNumber
;
@ExcelCellName
(
"Alternate Mobile"
)
@ExcelCellName
(
"Alternate Mobile"
)
private
String
alternateMobileNumber
;
private
String
alternateMobileNumber
;
@ExcelCellName
(
"Personal Email"
)
@ExcelCellName
(
"Personal Email"
)
private
String
personalEmailId
;
private
String
personalEmailId
;
@ExcelCellName
(
"Functional Group"
)
@ExcelCellName
(
"Functional Group"
)
private
String
functionalGroup
;
private
String
functionalGroup
;
@ExcelCellName
(
"Employment Status"
)
@ExcelCellName
(
"Employment Status"
)
private
String
empStatus
;
private
String
empStatus
;
@ExcelCellName
(
"Employment Type"
)
@ExcelCellName
(
"Employment Type"
)
private
String
employmentType
;
private
String
employmentType
;
@ExcelCellName
(
"Date Of Joining"
)
@ExcelCellName
(
"Date Of Joining"
)
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
private
Date
dateOfJoining
;
private
Date
dateOfJoining
;
@ExcelCellName
(
"Date Of Birth"
)
@ExcelCellName
(
"Date Of Birth"
)
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
private
Date
dateOfBirth
;
private
Date
dateOfBirth
;
@ExcelCellName
(
"Created
"
)
@ExcelCellName
(
"Gender
"
)
private
Date
createdOn
;
private
String
gender
;
@ExcelCellName
(
"Last Modified"
)
@ExcelCellName
(
"Created"
)
private
Date
lastModifiedOn
;
private
Date
createdOn
;
@ExcelCellName
(
"Last Modified"
)
private
Date
lastModifiedOn
;
}
}
src/main/java/com/nisum/mytime/service/ProjectService.java
View file @
d19eb1de
...
@@ -70,4 +70,6 @@ public interface ProjectService {
...
@@ -70,4 +70,6 @@ public interface ProjectService {
String
projectId
);
String
projectId
);
List
<
BillingDetails
>
getEmployeeActiveNisumBench
(
String
empId
);
List
<
BillingDetails
>
getEmployeeActiveNisumBench
(
String
empId
);
List
<
BillingDetails
>
getEmployeeBillingDetailsAll
(
String
empId
);
}
}
src/main/java/com/nisum/mytime/service/ProjectServiceImpl.java
View file @
d19eb1de
...
@@ -351,6 +351,26 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -351,6 +351,26 @@ public class ProjectServiceImpl implements ProjectService {
return
billingsSorted
;
return
billingsSorted
;
}
}
@Override
public
List
<
BillingDetails
>
getEmployeeBillingDetailsAll
(
String
empId
)
{
List
<
BillingDetails
>
billings
=
teamMatesBillingRepo
.
findByEmployeeId
(
empId
);
List
<
BillingDetails
>
billingsSorted
=
billings
;
try
{
billingsSorted
=
(
billings
==
null
||
billings
.
size
()
==
0
)
?
billings
:
billings
.
stream
()
.
sorted
(
Comparator
.
comparing
(
BillingDetails:
:
getCreateDate
)
.
reversed
())
.
collect
(
Collectors
.
toList
());
}
catch
(
Exception
e
)
{
// TODO: handle exception
}
return
billingsSorted
;
}
@Override
@Override
public
List
<
BillingDetails
>
getEmployeeActiveBillingDetails
(
String
empId
,
public
List
<
BillingDetails
>
getEmployeeActiveBillingDetails
(
String
empId
,
String
projectId
)
{
String
projectId
)
{
...
...
src/main/webapp/WEB-INF/controllers/DashboardController.js
View file @
d19eb1de
...
@@ -11,35 +11,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
...
@@ -11,35 +11,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
"action"
:
""
"action"
:
""
};
};
/*private String employeeId;
private String employeeName;
private String emailId;
private String baseTechnology;
private String technologyKnown;
private String alternateMobileNumber;
private String personalEmailId;
private Date createdOn;
private Date lastModifiedOn;
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;
private boolean projectAssigned;
private boolean hasB1Visa;
private boolean hasH1Visa;
private boolean hasPassport*/
$scope
.
managers
=
[];
$scope
.
managers
=
[];
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>'
;
...
@@ -167,6 +139,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
...
@@ -167,6 +139,7 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
function
ViewEmpController
(
$scope
,
$mdDialog
,
dataToPass
)
{
function
ViewEmpController
(
$scope
,
$mdDialog
,
dataToPass
)
{
$scope
.
profile
=
dataToPass
;
$scope
.
profile
=
dataToPass
;
$scope
.
showOrHidePA
=
"Show"
;
$scope
.
showOrHidePA
=
"Show"
;
$scope
.
showOrHidePV
=
"Show"
;
$scope
.
showOrHidePV
=
"Show"
;
$scope
.
showOrHideBD
=
"Show"
;
$scope
.
showOrHideBD
=
"Show"
;
...
@@ -198,8 +171,8 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
...
@@ -198,8 +171,8 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
{
field
:
'account'
,
displayName
:
'Account'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'account'
,
displayName
:
'Account'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'managerName'
,
displayName
:
'Manager Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'managerName'
,
displayName
:
'Manager Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'billableStatus'
,
displayName
:
'Billability'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'billableStatus'
,
displayName
:
'Billability'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'startDate'
,
displayName
:
'Start Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'startDate'
,
displayName
:
'Start Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
cellFilter
:
'date:"dd-MMM-yyyy"'
},
{
field
:
'endDate'
,
displayName
:
'End Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'endDate'
,
displayName
:
'End Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
cellFilter
:
'date:"dd-MMM-yyyy"'
},
{
field
:
'active'
,
displayName
:
'Active'
,
enableColumnMenu
:
false
,
cellTemplate
:
getCellActiveTemplate
,
enableSorting
:
false
}
{
field
:
'active'
,
displayName
:
'Active'
,
enableColumnMenu
:
false
,
cellTemplate
:
getCellActiveTemplate
,
enableSorting
:
false
}
]
]
};
};
...
@@ -237,22 +210,45 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
...
@@ -237,22 +210,45 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
},
},
{
{
field
:
'billingEndDate'
,
field
:
'billingEndDate'
,
displayName
:
'End Date'
displayName
:
'End Date'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
},
},
{
field
:
'comments'
,
displayName
:
'Comments'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'comments'
,
displayName
:
'Comments'
,
enableColumnMenu
:
false
,
enableSorting
:
false
},
{
field
:
'active'
,
displayName
:
'Active'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
cellTemplate
:
getCellActiveTemplateBilling
,
enableCellEdit
:
false
}
{
field
:
'active'
,
displayName
:
'Active'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
cellTemplate
:
getCellActiveTemplateBilling
,
enableCellEdit
:
false
}
]
]
};
};
$http
({
$scope
.
gridOptionsProjectAllocatons
.
data
=
$scope
.
dataToPass
;
method
:
"GET"
,
$scope
.
gridOptionsEmpBillability
.
data
=
$scope
.
dataToPass
;
url
:
appConfig
.
appUri
+
"projectTeam/getEmployeeBillingDetailsAll?employeeId="
+
$scope
.
profile
.
employeeId
}).
then
(
function
mySuccess
(
response
)
{
//alert("response"+response);
// alert("response"+response.data);
$scope
.
gridOptionsEmpBillability
.
data
=
response
.
data
;
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
});
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"projectTeam/getMyProjectAllocations?employeeId="
+
$scope
.
profile
.
employeeId
}).
then
(
function
mySuccess
(
response
)
{
//alert("response"+response);
// alert("response"+response.data);
$scope
.
gridOptionsProjectAllocatons
.
data
=
response
.
data
;
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
});
//$scope.gridOptionsProjectAllocatons.data = $scope.dataToPass;
//$scope.gridOptionsEmpBillability.data = $scope.dataToPass;
// $scope.gridOptionsVisaDetails.data = $scope.dataToPass;
$scope
.
cancel
=
function
()
{
$scope
.
cancel
=
function
()
{
$mdDialog
.
hide
();
$mdDialog
.
hide
();
};
};
$scope
.
toggleBillability
=
function
()
{
$scope
.
toggleBillability
=
function
()
{
$scope
.
showBillable
=
!
$scope
.
showBillable
;
$scope
.
showBillable
=
!
$scope
.
showBillable
;
if
(
$scope
.
showOrHideBD
==
"Show"
){
if
(
$scope
.
showOrHideBD
==
"Show"
){
$scope
.
showOrHideBD
=
"Hide"
;
$scope
.
showOrHideBD
=
"Hide"
;
}
else
{
}
else
{
$scope
.
showOrHideBD
=
"Show"
;
$scope
.
showOrHideBD
=
"Show"
;
...
...
src/main/webapp/WEB-INF/templates/employeeDetails.html
View file @
d19eb1de
...
@@ -179,9 +179,10 @@
...
@@ -179,9 +179,10 @@
</div>
</div>
</div>
</div>
</div><br/><br/>
</div><br/><br/>
<div
id=
"gridEmpVisa"
ui-grid=
"gridOptionsVisaDetails"
<div
id=
"gridEmpVisa"
ui-grid=
"gridOptionsVisaDetails"
class=
"myGrid"
style=
"width:99%;height:200px;"
>
class=
"myGrid"
style=
"width:99%;height:200px;"
>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
<div
class=
"watermark"
ng-show=
"!gridOptions
VisaDetails
.data.length"
>
No
data available
</div>
data available
</div>
</div>
</div>
</div>
</div>
...
@@ -195,7 +196,7 @@
...
@@ -195,7 +196,7 @@
<div
id=
"gridProjectAllocatons"
ui-grid=
"gridOptionsProjectAllocatons"
<div
id=
"gridProjectAllocatons"
ui-grid=
"gridOptionsProjectAllocatons"
class=
"myGrid"
style=
"width:99%;height:200px;"
ng-show=
"showProjectAllocations"
>
class=
"myGrid"
style=
"width:99%;height:200px;"
ng-show=
"showProjectAllocations"
>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
<div
class=
"watermark"
ng-show=
"!gridOptions
ProjectAllocatons
.data.length"
>
No
data available
</div>
data available
</div>
</div>
</div>
</div>
</div>
...
@@ -203,18 +204,20 @@
...
@@ -203,18 +204,20 @@
</fieldset>
</fieldset>
<fieldset>
<fieldset>
<legend
style=
"font-size: 18px;"
>
Billability Details
<i
style=
"margin-top:3px;color:blue;cursor:pointer;font-size: 14px;"
ng-click=
"toggleBillability()"
>
{{showOrHideBD}}
</i></legend>
<legend
style=
"font-size: 18px;"
>
Billability Details
<i
style=
"margin-top:3px;color:blue;cursor:pointer;font-size: 14px;"
ng-click=
"toggleBillability()"
>
{{showOrHideBD}}
</i></legend>
<div
class=
"row col-lg-12"
style=
"margin-left: 0px;"
>
<div
id=
"gridEmpBillability"
ui-grid=
"gridOptionsEmpBillability"
<div
id=
"gridEmpBillability"
ui-grid=
"gridOptionsEmpBillability"
class=
"myGrid"
style=
"width:99%;height:200px;"
ng-show=
"showBillable"
>
class=
"myGrid"
style=
"width:99%;height:200px;"
ng-show=
"showBillable"
>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
<div
class=
"watermark"
ng-show=
"!gridOptions
EmpBillability
.data.length"
>
No
data available
</div>
data available
</div>
</div>
</div>
</div>
<br/><br/>
<br/><br/>
</fieldset>
</fieldset>
</div>
</div>
</div>
</div>
</div>
</div>
</md-dialog-content>
</md-dialog-content>
...
...
src/test/java/com/nisum/mytime/controllertest/ProjectControllerTest.java
View file @
d19eb1de
...
@@ -59,7 +59,7 @@ public class ProjectControllerTest {
...
@@ -59,7 +59,7 @@ public class ProjectControllerTest {
"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
);
null
,
null
,
null
);
when
(
userService
.
getEmployeesRole
(
"user@nisum.com"
))
when
(
userService
.
getEmployeesRole
(
"user@nisum.com"
))
.
thenReturn
(
employeesRole
);
.
thenReturn
(
employeesRole
);
mockMvc
.
perform
(
mockMvc
.
perform
(
...
@@ -133,7 +133,7 @@ public class ProjectControllerTest {
...
@@ -133,7 +133,7 @@ public class ProjectControllerTest {
"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
,
null
,
new
Date
(
2017
-
11
-
18
),
new
Date
(
2017
-
12
-
18
),
null
,
null
);
null
,
null
);
when
(
userService
.
getEmployeesRoleData
(
"16127"
))
when
(
userService
.
getEmployeesRoleData
(
"16127"
))
.
thenReturn
(
employeesRole
);
.
thenReturn
(
employeesRole
);
mockMvc
.
perform
(
mockMvc
.
perform
(
...
...
src/test/java/com/nisum/mytime/controllertest/ProjectTeamControllerTest.java
View file @
d19eb1de
...
@@ -24,10 +24,10 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
...
@@ -24,10 +24,10 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.nisum.mytime.controller.ProjectTeamController
;
import
com.nisum.mytime.controller.ProjectTeamController
;
import
com.nisum.mytime.model.BillingDetails
;
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.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
;
...
@@ -57,7 +57,7 @@ public class ProjectTeamControllerTest {
...
@@ -57,7 +57,7 @@ public class ProjectTeamControllerTest {
"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
);
null
,
null
,
null
);
when
(
userService
.
getEmployeesRole
(
"user@nisum.com"
))
when
(
userService
.
getEmployeesRole
(
"user@nisum.com"
))
.
thenReturn
(
employeesRole
);
.
thenReturn
(
employeesRole
);
mockMvc
.
perform
(
mockMvc
.
perform
(
...
@@ -92,7 +92,7 @@ public class ProjectTeamControllerTest {
...
@@ -92,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
),
null
,
null
);
new
Date
(
2017
-
12
-
20
),
null
,
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
);
...
@@ -117,7 +117,7 @@ public class ProjectTeamControllerTest {
...
@@ -117,7 +117,7 @@ public class ProjectTeamControllerTest {
"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
,
null
,
new
Date
(
2017
-
11
-
20
),
new
Date
(
2107
-
12
-
23
),
null
,
null
);
null
,
null
);
when
(
userService
.
getEmployeesRoleData
(
"16127"
))
when
(
userService
.
getEmployeesRoleData
(
"16127"
))
.
thenReturn
(
employeesRole
);
.
thenReturn
(
employeesRole
);
mockMvc
.
perform
(
mockMvc
.
perform
(
...
...
src/test/java/com/nisum/mytime/controllertest/UserControllerTest.java
View file @
d19eb1de
...
@@ -56,7 +56,7 @@ public class UserControllerTest {
...
@@ -56,7 +56,7 @@ public class UserControllerTest {
"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
);
null
,
null
,
null
);
when
(
userService
.
getEmployeesRole
(
"user@nisum.com"
))
when
(
userService
.
getEmployeesRole
(
"user@nisum.com"
))
.
thenReturn
(
employeesRole
);
.
thenReturn
(
employeesRole
);
mockMvc
.
perform
(
mockMvc
.
perform
(
...
@@ -72,7 +72,8 @@ public class UserControllerTest {
...
@@ -72,7 +72,8 @@ 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
),
null
,
null
);
new
Date
(
2017
-
11
-
20
),
new
Date
(
2017
-
12
-
23
),
null
,
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
()))
...
@@ -91,7 +92,8 @@ public class UserControllerTest {
...
@@ -91,7 +92,8 @@ 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
),
null
,
null
);
new
Date
(
2017
-
11
-
20
),
new
Date
(
2017
-
12
-
23
),
null
,
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
()))
...
@@ -126,7 +128,7 @@ public class UserControllerTest {
...
@@ -126,7 +128,7 @@ public class UserControllerTest {
"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
,
null
,
new
Date
(
2017
-
11
-
13
),
new
Date
(
2017
-
12
-
20
),
null
,
null
);
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"
)
...
@@ -143,7 +145,7 @@ public class UserControllerTest {
...
@@ -143,7 +145,7 @@ public class UserControllerTest {
"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
,
null
,
new
Date
(
2017
-
11
-
13
),
new
Date
(
2017
-
12
-
20
),
null
,
null
);
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"
)
...
@@ -164,7 +166,7 @@ public class UserControllerTest {
...
@@ -164,7 +166,7 @@ public class UserControllerTest {
"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
,
null
,
new
Date
(
2017
-
11
-
13
),
new
Date
(
2017
-
12
-
20
),
null
,
null
);
null
,
null
);
when
(
userService
.
getEmployeeRoleDataForSearchCriteria
(
when
(
userService
.
getEmployeeRoleDataForSearchCriteria
(
"Mahesh Kumar Gutam"
,
"employeeName"
))
"Mahesh Kumar Gutam"
,
"employeeName"
))
.
thenReturn
(
employeesRole
);
.
thenReturn
(
employeesRole
);
...
@@ -252,7 +254,7 @@ public class UserControllerTest {
...
@@ -252,7 +254,7 @@ public class UserControllerTest {
"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
,
null
,
new
Date
(
2017
-
01
-
01
),
new
Date
(
2017
-
03
-
01
),
null
,
null
);
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment