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
47de521f
Commit
47de521f
authored
Jul 23, 2018
by
Rajashekar jadala
Committed by
tdutta-nisum-com
Jul 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MT-80_employee_role_active (#38)
parent
7802a1b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
RoleMappingService.java
...ain/java/com/nisum/mytime/service/RoleMappingService.java
+4
-1
RoleMappingServiceImpl.java
...java/com/nisum/mytime/service/RoleMappingServiceImpl.java
+2
-2
No files found.
src/main/java/com/nisum/mytime/service/RoleMappingService.java
View file @
47de521f
...
@@ -2,9 +2,12 @@ package com.nisum.mytime.service;
...
@@ -2,9 +2,12 @@ package com.nisum.mytime.service;
import
java.util.List
;
import
java.util.List
;
import
com.mongodb.WriteResult
;
import
com.nisum.mytime.exception.handler.MyTimeException
;
import
com.nisum.mytime.exception.handler.MyTimeException
;
public
interface
RoleMappingService
{
public
interface
RoleMappingService
{
void
saveUniqueEmployeeAndRole
(
List
<
String
>
employeeIds
,
String
roleId
,
String
status
)
throws
MyTimeException
;
void
saveUniqueEmployeeAndRole
(
List
<
String
>
employeeIds
,
String
roleId
)
throws
MyTimeException
;
WriteResult
deleteRole
(
String
employeeId
,
String
roleId
)
throws
MyTimeException
;
}
}
src/main/java/com/nisum/mytime/service/RoleMappingServiceImpl.java
View file @
47de521f
...
@@ -25,8 +25,7 @@ public class RoleMappingServiceImpl implements RoleMappingService {
...
@@ -25,8 +25,7 @@ public class RoleMappingServiceImpl implements RoleMappingService {
private
MongoTemplate
mongoTemplate
;
private
MongoTemplate
mongoTemplate
;
@Override
@Override
public
void
saveUniqueEmployeeAndRole
(
List
<
String
>
employeeIds
,
String
roleId
,
String
status
)
public
void
saveUniqueEmployeeAndRole
(
List
<
String
>
employeeIds
,
String
roleId
)
throws
MyTimeException
{
throws
MyTimeException
{
for
(
String
employeeId
:
employeeIds
)
{
for
(
String
employeeId
:
employeeIds
)
{
RoleMappingInfo
roleMappingInfo
=
roleMappingInfoRepo
.
findByEmployeeIdAndRoleId
(
employeeId
,
roleId
);
RoleMappingInfo
roleMappingInfo
=
roleMappingInfoRepo
.
findByEmployeeIdAndRoleId
(
employeeId
,
roleId
);
...
@@ -42,6 +41,7 @@ public class RoleMappingServiceImpl implements RoleMappingService {
...
@@ -42,6 +41,7 @@ public class RoleMappingServiceImpl implements RoleMappingService {
}
}
}
}
@Override
public
WriteResult
deleteRole
(
String
employeeId
,
String
roleId
)
throws
MyTimeException
{
public
WriteResult
deleteRole
(
String
employeeId
,
String
roleId
)
throws
MyTimeException
{
Query
query
=
new
Query
(
Criteria
.
where
(
"employeeId"
).
is
(
employeeId
).
and
(
"roleId"
).
is
(
roleId
));
Query
query
=
new
Query
(
Criteria
.
where
(
"employeeId"
).
is
(
employeeId
).
and
(
"roleId"
).
is
(
roleId
));
Update
update
=
new
Update
();
Update
update
=
new
Update
();
...
...
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