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
0fb91dc6
Commit
0fb91dc6
authored
Jul 04, 2018
by
Sumith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[$umith] MT-65, MT-66 completed
parent
7a39c235
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
135 deletions
+63
-135
UserController.java
...main/java/com/nisum/mytime/controller/UserController.java
+10
-0
EmployeeRolesRepo.java
...n/java/com/nisum/mytime/repository/EmployeeRolesRepo.java
+2
-0
UserService.java
src/main/java/com/nisum/mytime/service/UserService.java
+2
-0
UserServiceImpl.java
src/main/java/com/nisum/mytime/service/UserServiceImpl.java
+14
-2
AssignRolesController.js
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
+10
-120
roles.html
src/main/webapp/WEB-INF/templates/roles.html
+25
-13
No files found.
src/main/java/com/nisum/mytime/controller/UserController.java
View file @
0fb91dc6
...
...
@@ -216,4 +216,14 @@ public class UserController {
return
new
ResponseEntity
<>(
masterDataMap
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/getEmployeeByStatus"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
EmployeeRoles
>>
getEmployeeByStatus
(
@RequestParam
(
"status"
)
String
status
)
{
List
<
EmployeeRoles
>
employeesRoles
=
userService
.
getEmployeesByStatus
(
status
);
return
new
ResponseEntity
<>(
employeesRoles
,
HttpStatus
.
OK
);
}
}
\ No newline at end of file
src/main/java/com/nisum/mytime/repository/EmployeeRolesRepo.java
View file @
0fb91dc6
...
...
@@ -17,4 +17,6 @@ public interface EmployeeRolesRepo
List
<
EmployeeRoles
>
findByEmpStatusAndFunctionalGroup
(
String
empStatus
,
String
functionalGroup
);
List
<
EmployeeRoles
>
findByEmpStatusOrderByEmployeeNameAsc
(
String
empStatus
);
}
src/main/java/com/nisum/mytime/service/UserService.java
View file @
0fb91dc6
...
...
@@ -65,4 +65,6 @@ public interface UserService {
List
<
MasterData
>
getMasterData
()
throws
MyTimeException
;
List
<
EmployeeRoles
>
getEmployeesByFunctionalGrp
(
String
functionalGrp
);
List
<
EmployeeRoles
>
getEmployeesByStatus
(
String
status
);
}
src/main/java/com/nisum/mytime/service/UserServiceImpl.java
View file @
0fb91dc6
...
...
@@ -7,6 +7,7 @@ import java.util.List;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.FindAndModifyOptions
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
...
@@ -123,8 +124,7 @@ public class UserServiceImpl implements UserService {
newBenchAllocation
.
setEmployeeName
(
employeeRoles
.
getEmployeeName
());
newBenchAllocation
.
setProjectId
(
"Nisum0000"
);
newBenchAllocation
.
setStartDate
(
employeeRoles
.
getDateOfJoining
()
!=
null
?
employeeRoles
.
getDateOfJoining
()
:
new
Date
());
?
employeeRoles
.
getDateOfJoining
()
:
new
Date
());
Project
p
=
projectRepo
.
findByProjectId
(
"Nisum0000"
);
newBenchAllocation
.
setProjectName
(
p
.
getProjectName
());
newBenchAllocation
.
setManagerId
(
p
.
getManagerId
());
...
...
@@ -423,4 +423,16 @@ public class UserServiceImpl implements UserService {
functionalGrp
);
}
@Override
public
List
<
EmployeeRoles
>
getEmployeesByStatus
(
String
status
)
{
if
(
status
.
equals
(
"both"
))
{
return
employeeRolesRepo
.
findAll
(
new
Sort
(
Sort
.
Direction
.
ASC
,
"employeeName"
));
}
else
{
return
employeeRolesRepo
.
findByEmpStatusOrderByEmployeeNameAsc
(
status
);
}
}
}
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
View file @
0fb91dc6
myApp
.
controller
(
"assignRoleController"
,
function
(
$scope
,
myFactory
,
$mdDialog
,
$http
,
appConfig
,
$timeout
){
$scope
.
records
=
[];
$scope
.
empSearchId
=
""
;
$scope
.
status
=
"Active"
;
$scope
.
parentData
=
{
"employeeId"
:
""
,
"employeeName"
:
""
,
"gender"
:
""
,
"emailId"
:
""
,
"role"
:
""
,
"designation"
:
""
,
"action"
:
""
,
"passportExpiryDate"
:
""
...
...
@@ -17,22 +16,18 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
gridOptions
=
{
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSize
:
1
0
,
paginationPageSize
:
5
0
,
pageNumber
:
1
,
pageSize
:
10
,
enableFiltering
:
true
,
columnDefs
:
[
{
field
:
'employeeId'
,
displayName
:
'Employee ID'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
120
},
{
field
:
'employeeName'
,
displayName
:
'Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'gender'
,
displayName
:
'Gender'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'mobileNumber'
,
displayName
:
'Mobile'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
},
{
field
:
'emailId'
,
displayName
:
'Email'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'baseTechnology'
,
displayName
:
'Skill'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'designation'
,
displayName
:
'Designation'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
field
:
'role'
,
displayName
:
'Role'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
100
},
//{field : 'hasPassort',displayName: 'HasPassort', enableColumnMenu: false, enableSorting: true,enableFiltering: true, width:100},
//{field : 'hasB1',displayName: 'HasB1', enableColumnMenu: false, enableSorting: true,enableFiltering: true, width:100},
{
name
:
'Actions'
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
100
}
{
field
:
'employeeId'
,
displayName
:
'Employee ID'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
120
,
cellClass
:
'grid-align'
},
{
field
:
'employeeName'
,
displayName
:
'Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
cellClass
:
'grid-align'
},
{
field
:
'mobileNumber'
,
displayName
:
'Mobile'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
cellClass
:
'grid-align'
},
{
field
:
'emailId'
,
displayName
:
'Email'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
cellClass
:
'grid-align'
},
{
field
:
'baseTechnology'
,
displayName
:
'Skill'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
,
cellClass
:
'grid-align'
},
{
field
:
'designation'
,
displayName
:
'Designation'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
cellClass
:
'grid-align'
},
{
name
:
'Actions'
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
100
,
cellClass
:
'grid-align'
}
]
};
$scope
.
gridOptions
.
data
=
$scope
.
records
;
...
...
@@ -45,18 +40,13 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
columnDefs
:
[
{
field
:
'employeeId'
,
displayName
:
'Employee ID'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
120
},
{
field
:
'employeeName'
,
displayName
:
'Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'gender'
,
displayName
:
'Gender'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
//{field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false},
{
field
:
'emailId'
,
displayName
:
'Email'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'baseTechnology'
,
displayName
:
'Skill'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'designation'
,
displayName
:
'Designation'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
//{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: true,enableFiltering: true, width:200},
{
field
:
'functionalGroup'
,
displayName
:
'Functional Org'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
120
}
// {name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false,enableFiltering: false, width:100}
]
};
//$scope.gridOptionsOrgView.data = $scope.records;
$scope
.
getRowData
=
function
(
row
,
action
){
$scope
.
parentData
.
employeeId
=
row
.
entity
.
employeeId
;
...
...
@@ -89,9 +79,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
empSearchId
=
""
;
$scope
.
getUserRoles
();
}
$scope
.
refreshPageOrg
=
function
(){
$scope
.
getOrgEmps
();
}
var
gridOptionsReport
=
{
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSize
:
10
,
...
...
@@ -101,19 +88,17 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
columnDefs
:
[
{
field
:
'employeeId'
,
displayName
:
'Employee ID'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
120
},
{
field
:
'employeeName'
,
displayName
:
'Name'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'gender'
,
displayName
:
'Gender'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'mobileNumber'
,
displayName
:
'Mobile'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
},
{
field
:
'emailId'
,
displayName
:
'Email'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'baseTechnology'
,
displayName
:
'Skill'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
true
},
{
field
:
'designation'
,
displayName
:
'Designation'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
field
:
'role'
,
displayName
:
'Role'
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
,
width
:
100
},
{
name
:
'Actions'
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
100
}
]
};
$scope
.
getUserRoles
=
function
(){
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"user/get
UserRoles"
url
:
appConfig
.
appUri
+
"user/get
EmployeeByStatus?status="
+
$scope
.
status
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
gridOptions
.
data
=
response
.
data
;
},
function
myError
(
response
)
{
...
...
@@ -121,81 +106,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
gridOptions
.
data
=
[];
});
};
$scope
.
getReportData
=
function
(){
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"reports/functioNalGroup"
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
reportData
=
response
.
data
;
alert
(
"reportData"
+
reportData
)
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
alert
(
"reportData1"
+
reportData
)
$scope
.
reportData
=
[];
});
};
$scope
.
getOrgEmps
=
function
(){
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"user/getUserRoles"
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
gridOptionsOrgView
.
data
=
response
.
data
;
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
$scope
.
gridOptionsOrgView
.
data
=
[];
});
};
$scope
.
validateEmpId
=
function
(){
var
searchId
=
$scope
.
empSearchId
;
if
(
searchId
!=
""
&&
isNaN
(
searchId
)){
showAlert
(
'Please enter only digits'
);
$scope
.
empSearchId
=
""
;
document
.
getElementById
(
'empSearchId'
).
focus
();
}
else
if
(
searchId
!=
""
&&
(
searchId
.
length
<
5
||
searchId
.
length
>
5
)){
showAlert
(
'Employee ID should be 5 digits'
);
$scope
.
empSearchId
=
""
;
document
.
getElementById
(
'empSearchId'
).
focus
();
}
else
if
(
searchId
!=
""
&&
!
checkEmpIdRange
(
searchId
)){
showAlert
(
'Employee ID should be in between '
+
appConfig
.
empStartId
+
' - '
+
appConfig
.
empEndId
);
$scope
.
empSearchId
=
""
;
document
.
getElementById
(
'empSearchId'
).
focus
();
}
};
function
checkEmpIdRange
(
searchId
){
return
parseInt
(
searchId
)
>=
appConfig
.
empStartId
&&
parseInt
(
searchId
)
<=
appConfig
.
empEndId
;
}
$scope
.
getEmployeeRole
=
function
(
type
){
var
searchId
=
$scope
.
empSearchId
;
if
(
searchId
==
""
&&
searchId
.
length
==
0
){
showAlert
(
'Employee ID is mandatory'
);
$scope
.
empSearchId
=
""
;
document
.
getElementById
(
'empSearchId'
).
focus
();
}
else
if
(
searchId
!=
""
&&
!
checkEmpIdRange
(
searchId
)){
showAlert
(
'Employee ID should be in between '
+
appConfig
.
empStartId
+
' - '
+
appConfig
.
empEndId
);
$scope
.
empSearchId
=
""
;
document
.
getElementById
(
'empSearchId'
).
focus
();
}
else
{
$scope
.
gridOptions
.
data
=
[];
getEmployeeRoleData
(
searchId
);
}
};
function
getEmployeeRoleData
(
empId
){
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"user/getEmployeeRoleData?empId="
+
empId
}).
then
(
function
mySuccess
(
response
)
{
if
(
response
.
data
!=
""
&&
response
.
data
.
length
!=
0
){
$scope
.
gridOptions
.
data
.
push
(
response
.
data
);
}
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
$scope
.
refreshPage
();
});
}
function
showAlert
(
message
)
{
$mdDialog
.
show
(
$mdDialog
.
alert
().
parent
(
...
...
@@ -370,25 +280,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
};
$scope
.
validateEmpId
=
function
(){
var
searchId
=
$scope
.
empId
;
if
(
searchId
!=
""
&&
isNaN
(
searchId
)){
$scope
.
alertMsg
=
"Please enter only digits"
;
document
.
getElementById
(
'empId'
).
focus
();
}
else
if
(
searchId
!=
""
&&
((
searchId
.
length
>
0
&&
searchId
.
length
<
5
)
||
searchId
.
length
>
5
)){
$scope
.
alertMsg
=
"Employee ID should be 5 digits"
;
document
.
getElementById
(
'empId'
).
focus
();
}
else
if
(
searchId
!=
""
&&
!
checkRoleEmpIdRange
(
searchId
)){
$scope
.
alertMsg
=
'Employee ID should be in between '
+
appConfig
.
empStartId
+
' - '
+
appConfig
.
empEndId
;
document
.
getElementById
(
'empId'
).
focus
();
}
else
if
(
searchId
!=
""
&&
checkRoleExistence
(
searchId
)){
$scope
.
alertMsg
=
'Employee ID is already assigned a role'
;
document
.
getElementById
(
'empId'
).
focus
();
}
else
{
$scope
.
alertMsg
=
""
;
}
};
function
checkRoleEmpIdRange
(
searchId
){
return
parseInt
(
searchId
)
>=
appConfig
.
empStartId
&&
parseInt
(
searchId
)
<=
appConfig
.
empEndId
;
}
...
...
@@ -428,7 +319,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
var
gender
=
$scope
.
gender
;
var
empRole
=
$scope
.
empRole
;
var
empEmail
=
$scope
.
empEmail
;
// alert("passportExpiryDate::"+$scope.passportExpiryDate)
if
(
searchId
==
""
){
$scope
.
alertMsg
=
"Employee ID is mandatory"
;
document
.
getElementById
(
'empId'
).
focus
();
...
...
src/main/webapp/WEB-INF/templates/roles.html
View file @
0fb91dc6
<style>
.grid-align
{
text-align
:
left
;
}
</style>
<div
class=
"md-padding"
style=
"width: 100%; padding: 3px 0px 0px 0px;"
id=
"popupContainer"
ng-controller=
"assignRoleController"
ng-init=
"getUserRoles()"
>
...
...
@@ -17,10 +22,26 @@
</div>
</div>
<br/>
<div
class=
"form-group col-lg-7 col-md-7 col-sm-7 col-xs-12"
></div>
<div
class=
"row col-lg-12"
style=
"margin-left: 0px;"
>
<input
type=
"radio"
ng-model=
"status"
value=
"Active"
ng-click=
"getUserRoles()"
>
Active
<input
type=
"radio"
ng-model=
"status"
value=
"In Active"
ng-click=
"getUserRoles()"
>
Inactive
<input
type=
"radio"
ng-model=
"status"
value=
"both"
ng-click=
"getUserRoles()"
>
Both
</div>
<div
class=
"row col-lg-12"
style=
"margin-left: 0px;"
>
<div
id=
"gridTest"
ui-grid=
"gridOptions"
ui-grid-pagination
class=
"myGrid"
style=
"width:99%;height:370px;margin-left:0px;"
>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
data available
</div>
</div>
</div>
<div
class=
"form-horizontal"
>
<div
class=
"form-group"
>
<div
class=
"form-inline col-lg-12"
style=
"margin-left: 10px;"
>
<div
class=
"form-group col-lg-3 col-md-4 col-sm-6 col-xs-12"
>
<
!-- <
div class="form-group col-lg-3 col-md-4 col-sm-6 col-xs-12">
<div class="input-group"
style="">
<input type="text" ng-model="empSearchId" id="empSearchId"
...
...
@@ -36,9 +57,9 @@
</button>
</span>
</div>
</div>
<
div
class=
"form-group col-lg-7 col-md-7 col-sm-7 col-xs-12"
></div
>
<div
class=
"form-group col-lg-2"
style=
"margin-
left:0
px;"
>
</div>
-->
<
!-- <div class="form-group col-lg-7 col-md-7 col-sm-7 col-xs-12"></div> --
>
<div
class=
"form-group col-lg-2"
style=
"margin-
top: 30px;margin-left: 355
px;"
>
<label
class=
""
for=
"submitBtn"
><md-button
class=
"md-raised md-primary"
style=
"width:142px;background: cadetblue;margin:0px;"
...
...
@@ -53,13 +74,4 @@
</div>
<div
class=
"row col-lg-12"
style=
"height: 15px;"
></div>
<div
class=
"row col-lg-12"
style=
"margin-left: 0px;"
>
<div
id=
"gridTest"
ui-grid=
"gridOptions"
ui-grid-pagination
class=
"myGrid"
style=
"width:99%;height:370px;margin-left:0px;"
>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
data available
</div>
</div>
</div>
</div>
\ No newline at end of file
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