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
93d1721d
Commit
93d1721d
authored
Jul 26, 2018
by
ssathu-nisum-com
Committed by
tdutta-nisum-com
Jul 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MT-106_Addrole_option_in_addteammatescreen_Issues (#63)
parent
9eae800a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
9 deletions
+20
-9
ProjectController.java
...n/java/com/nisum/mytime/controller/ProjectController.java
+3
-1
ProjectTeamController.java
...va/com/nisum/mytime/controller/ProjectTeamController.java
+1
-1
ProjectServiceImpl.java
...ain/java/com/nisum/mytime/service/ProjectServiceImpl.java
+14
-5
UserServiceImpl.java
src/main/java/com/nisum/mytime/service/UserServiceImpl.java
+2
-2
No files found.
src/main/java/com/nisum/mytime/controller/ProjectController.java
View file @
93d1721d
...
...
@@ -40,10 +40,12 @@ public class ProjectController {
@RequestMapping
(
value
=
"/addProject"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
Project
>
addProject
(
@RequestBody
Project
projectAdded
)
throws
MyTimeException
{
String
accountName
=
""
;
String
accountId
=
projectAdded
.
getAccountId
();
// String accountName=projectAdded.getAccount();
Account
account
=
accountRepo
.
findByAccountId
(
accountId
);
String
accountName
=
account
.
getAccountName
();
if
(
account
!=
null
)
accountName
=
account
.
getAccountName
();
int
sequenceNumber
=
account
.
getAccountProjectSequence
();
account
.
setAccountProjectSequence
(
sequenceNumber
+
1
);
accountRepo
.
save
(
account
);
...
...
src/main/java/com/nisum/mytime/controller/ProjectTeamController.java
View file @
93d1721d
...
...
@@ -127,7 +127,7 @@ public class ProjectTeamController {
@RequestBody
ProjectTeamMate
teamMate
)
throws
MyTimeException
{
teamMate
.
setActive
(
true
);
// teamMate.setStartDate(new Date());
if
(
teamMate
.
getRole
().
equals
(
"Lead"
))
{
if
(
teamMate
.
getRole
()
!=
null
&&
teamMate
.
getRole
()
.
equals
(
"Lead"
))
{
Project
project
=
new
Project
();
project
.
setProjectName
(
teamMate
.
getProjectName
());
project
.
setManagerIds
(
Arrays
.
asList
(
teamMate
.
getEmployeeId
()));
...
...
src/main/java/com/nisum/mytime/service/ProjectServiceImpl.java
View file @
93d1721d
...
...
@@ -37,6 +37,7 @@ import com.nisum.mytime.model.EmployeeRoles;
import
com.nisum.mytime.model.Project
;
import
com.nisum.mytime.model.ProjectTeamMate
;
import
com.nisum.mytime.repository.AccountRepo
;
import
com.nisum.mytime.repository.DomainRepo
;
import
com.nisum.mytime.repository.EmpShiftDetailsRepo
;
import
com.nisum.mytime.repository.EmployeeRolesRepo
;
import
com.nisum.mytime.repository.ProjectRepo
;
...
...
@@ -81,6 +82,9 @@ public class ProjectServiceImpl implements ProjectService {
@Autowired
private
AccountRepo
accountRepo
;
@Autowired
private
DomainRepo
domainRepo
;
@Override
public
List
<
EmpLoginData
>
employeeLoginsBasedOnDate
(
long
id
,
String
fromDate
,
String
toDate
)
throws
MyTimeException
{
...
...
@@ -110,7 +114,11 @@ public class ProjectServiceImpl implements ProjectService {
projectMap
.
put
(
"projectId"
,
p
.
getProjectId
());
projectMap
.
put
(
"projectName"
,
p
.
getProjectName
());
Account
account
=
accountRepo
.
findByAccountId
(
p
.
getAccountId
());
projectMap
.
put
(
"account"
,
account
);
Domains
domain
=
domainRepo
.
findByDomainId
(
p
.
getDomainId
());
if
(
domain
!=
null
)
projectMap
.
put
(
"domain"
,
domain
.
getDomainName
());
if
(
account
!=
null
)
projectMap
.
put
(
"account"
,
account
.
getAccountName
());
projectMap
.
put
(
"accountId"
,
p
.
getAccountId
());
projectMap
.
put
(
"domainId"
,
p
.
getDomainId
());
projectMap
.
put
(
"status"
,
p
.
getStatus
());
...
...
@@ -200,8 +208,6 @@ public class ProjectServiceImpl implements ProjectService {
@Override
public
List
<
ProjectTeamMate
>
getTeamDetails
(
String
empId
)
{
// return projectTeamMatesRepo.findByManagerId(empId);
// MT-79:maintain the ManagerIds in List
List
<
String
>
projectsId
=
new
ArrayList
<>();
Query
query
=
new
Query
(
Criteria
.
where
(
"employeeId"
).
is
(
empId
).
and
(
"role"
).
is
(
"Lead"
));
List
<
ProjectTeamMate
>
projectMatesList
=
mongoTemplate
.
find
(
query
,
ProjectTeamMate
.
class
);
...
...
@@ -209,7 +215,10 @@ public class ProjectServiceImpl implements ProjectService {
projectsId
.
add
(
projectMate
.
getProjectId
());
Query
query1
=
new
Query
(
Criteria
.
where
(
"projectId"
).
in
(
projectsId
));
List
<
ProjectTeamMate
>
projectMateList
=
mongoTemplate
.
find
(
query1
,
ProjectTeamMate
.
class
);
// return projectTeamMatesRepo.findByManagerIds(empId);
for
(
ProjectTeamMate
projectTeamMate
:
projectMateList
)
{
if
(
projectTeamMate
.
getEmployeeId
().
equals
(
empId
))
projectMateList
.
remove
(
projectTeamMate
);
}
return
projectMateList
;
}
...
...
@@ -269,7 +278,7 @@ public class ProjectServiceImpl implements ProjectService {
}
}
}
if
(
projectTeamMate
.
getRole
().
equals
(
"Lead"
))
{
if
(
projectTeamMate
.
getRole
()
!=
null
&&
projectTeamMate
.
getRole
()
.
equals
(
"Lead"
))
{
Query
query
=
new
Query
(
Criteria
.
where
(
"employeeId"
).
is
(
projectTeamMate
.
getEmployeeId
()).
and
(
"role"
).
ne
(
"Lead"
));
List
<
ProjectTeamMate
>
projectMates
=
mongoTemplate
.
find
(
query
,
ProjectTeamMate
.
class
);
...
...
src/main/java/com/nisum/mytime/service/UserServiceImpl.java
View file @
93d1721d
...
...
@@ -475,8 +475,8 @@ public class UserServiceImpl implements UserService {
List
<
EmployeeRoles
>
employeeRoles
=
mongoTemplate
.
find
(
query
,
EmployeeRoles
.
class
);
for
(
EmployeeRoles
employeesRole
:
employeeRoles
)
{
HashMap
<
String
,
String
>
managerMap
=
new
HashMap
<>();
managerMap
.
put
(
"
i
d"
,
employeesRole
.
getEmployeeId
());
managerMap
.
put
(
"
n
ame"
,
employeesRole
.
getEmployeeName
());
managerMap
.
put
(
"
employeeI
d"
,
employeesRole
.
getEmployeeId
());
managerMap
.
put
(
"
employeeN
ame"
,
employeesRole
.
getEmployeeName
());
EmployeeList
.
add
(
managerMap
);
}
return
EmployeeList
;
...
...
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