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
Expand all
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 {
...
@@ -216,4 +216,14 @@ public class UserController {
return
new
ResponseEntity
<>(
masterDataMap
,
HttpStatus
.
OK
);
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
...
@@ -17,4 +17,6 @@ public interface EmployeeRolesRepo
List
<
EmployeeRoles
>
findByEmpStatusAndFunctionalGroup
(
String
empStatus
,
List
<
EmployeeRoles
>
findByEmpStatusAndFunctionalGroup
(
String
empStatus
,
String
functionalGroup
);
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 {
...
@@ -65,4 +65,6 @@ public interface UserService {
List
<
MasterData
>
getMasterData
()
throws
MyTimeException
;
List
<
MasterData
>
getMasterData
()
throws
MyTimeException
;
List
<
EmployeeRoles
>
getEmployeesByFunctionalGrp
(
String
functionalGrp
);
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;
...
@@ -7,6 +7,7 @@ import java.util.List;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.FindAndModifyOptions
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
@@ -123,8 +124,7 @@ public class UserServiceImpl implements UserService {
...
@@ -123,8 +124,7 @@ public class UserServiceImpl implements UserService {
newBenchAllocation
.
setEmployeeName
(
employeeRoles
.
getEmployeeName
());
newBenchAllocation
.
setEmployeeName
(
employeeRoles
.
getEmployeeName
());
newBenchAllocation
.
setProjectId
(
"Nisum0000"
);
newBenchAllocation
.
setProjectId
(
"Nisum0000"
);
newBenchAllocation
.
setStartDate
(
employeeRoles
.
getDateOfJoining
()
!=
null
newBenchAllocation
.
setStartDate
(
employeeRoles
.
getDateOfJoining
()
!=
null
?
employeeRoles
.
getDateOfJoining
()
?
employeeRoles
.
getDateOfJoining
()
:
new
Date
());
:
new
Date
());
Project
p
=
projectRepo
.
findByProjectId
(
"Nisum0000"
);
Project
p
=
projectRepo
.
findByProjectId
(
"Nisum0000"
);
newBenchAllocation
.
setProjectName
(
p
.
getProjectName
());
newBenchAllocation
.
setProjectName
(
p
.
getProjectName
());
newBenchAllocation
.
setManagerId
(
p
.
getManagerId
());
newBenchAllocation
.
setManagerId
(
p
.
getManagerId
());
...
@@ -423,4 +423,16 @@ public class UserServiceImpl implements UserService {
...
@@ -423,4 +423,16 @@ public class UserServiceImpl implements UserService {
functionalGrp
);
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
This diff is collapsed.
Click to expand it.
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;"
<div
class=
"md-padding"
style=
"width: 100%; padding: 3px 0px 0px 0px;"
id=
"popupContainer"
ng-controller=
"assignRoleController"
id=
"popupContainer"
ng-controller=
"assignRoleController"
ng-init=
"getUserRoles()"
>
ng-init=
"getUserRoles()"
>
...
@@ -17,10 +22,26 @@
...
@@ -17,10 +22,26 @@
</div>
</div>
</div>
</div>
<br/>
<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-horizontal"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"form-inline col-lg-12"
style=
"margin-left: 10px;"
>
<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"
<div class="input-group"
style="">
style="">
<input type="text" ng-model="empSearchId" id="empSearchId"
<input type="text" ng-model="empSearchId" id="empSearchId"
...
@@ -36,9 +57,9 @@
...
@@ -36,9 +57,9 @@
</button>
</button>
</span>
</span>
</div>
</div>
</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-7 col-md-7 col-sm-7 col-xs-12"></div> --
>
<div
class=
"form-group col-lg-2"
style=
"margin-
left:0
px;"
>
<div
class=
"form-group col-lg-2"
style=
"margin-
top: 30px;margin-left: 355
px;"
>
<label
class=
""
for=
"submitBtn"
><md-button
<label
class=
""
for=
"submitBtn"
><md-button
class=
"md-raised md-primary"
class=
"md-raised md-primary"
style=
"width:142px;background: cadetblue;margin:0px;"
style=
"width:142px;background: cadetblue;margin:0px;"
...
@@ -53,13 +74,4 @@
...
@@ -53,13 +74,4 @@
</div>
</div>
<div
class=
"row col-lg-12"
style=
"height: 15px;"
></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>
</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