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
dd147301
Unverified
Commit
dd147301
authored
Aug 08, 2018
by
mshaik-nisum-com
Committed by
GitHub
Aug 08, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #133 from nisum-inc/FEATURE/MT-122_2_My_Project_Allocations
MT-122_2 :SNS :: My_Project_Allocations
parents
4d14eb7e
3dd7c83b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
6 deletions
+66
-6
ProjectTeamController.java
...va/com/nisum/mytime/controller/ProjectTeamController.java
+9
-6
ProjectService.java
src/main/java/com/nisum/mytime/service/ProjectService.java
+1
-0
ProjectServiceImpl.java
...ain/java/com/nisum/mytime/service/ProjectServiceImpl.java
+54
-0
MyTimeUtils.java
src/main/java/com/nisum/mytime/utils/MyTimeUtils.java
+2
-0
No files found.
src/main/java/com/nisum/mytime/controller/ProjectTeamController.java
View file @
dd147301
package
com
.
nisum
.
mytime
.
controller
;
import
java.util.ArrayList
;
import
java.util.
Arrays
;
import
java.util.
HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -25,6 +25,7 @@ import com.nisum.mytime.model.ProjectTeamMate;
import
com.nisum.mytime.repository.EmployeeVisaRepo
;
import
com.nisum.mytime.service.ProjectService
;
import
com.nisum.mytime.service.UserService
;
import
com.nisum.mytime.utils.MyTimeUtils
;
@RestController
@RequestMapping
(
"/projectTeam"
)
...
...
@@ -215,7 +216,8 @@ public class ProjectTeamController {
@RequestMapping
(
value
=
"/getProjectDetails"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
ProjectTeamMate
>>
getProjectDetails
(
@RequestParam
(
"projectId"
)
String
projectId
,
@RequestParam
(
"status"
)
String
status
)
@RequestParam
(
"projectId"
)
String
projectId
,
@RequestParam
(
value
=
"status"
,
required
=
false
,
defaultValue
=
MyTimeUtils
.
ACTIVE
)
String
status
)
throws
MyTimeException
{
List
<
ProjectTeamMate
>
employeesRoles
=
projectService
.
getProjectDetails
(
projectId
,
status
);
...
...
@@ -225,12 +227,13 @@ public class ProjectTeamController {
@RequestMapping
(
value
=
"/getMyProjectAllocations"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
ProjectTeamMate
>>
getMyProjectAllocations
(
public
ResponseEntity
<
List
<
HashMap
<
Object
,
Object
>
>>
getMyProjectAllocations
(
@RequestParam
(
"employeeId"
)
String
employeeId
)
throws
MyTimeException
{
List
<
ProjectTeamMate
>
projectAllocations
=
projectService
.
getMyProjectAllocations
(
employeeId
);
return
new
ResponseEntity
<>(
projectAllocations
,
HttpStatus
.
OK
);
// List<ProjectTeamMate> projectAllocations = projectService
// .getMyProjectAllocations(employeeId);
List
<
HashMap
<
Object
,
Object
>>
empPrjtsInfo
=
projectService
.
projectsInfoByEmpId
(
employeeId
);
return
new
ResponseEntity
<>(
empPrjtsInfo
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/getEmployeeBillingDetails"
,
...
...
src/main/java/com/nisum/mytime/service/ProjectService.java
View file @
dd147301
...
...
@@ -87,4 +87,5 @@ public interface ProjectService {
public
String
addProjectTeamMateWithCheck
(
ProjectTeamMate
projectTeamMate
)
throws
MyTimeException
;
public
List
<
HashMap
<
Object
,
Object
>>
projectsInfoByEmpId
(
String
empId
);
}
src/main/java/com/nisum/mytime/service/ProjectServiceImpl.java
View file @
dd147301
...
...
@@ -1024,4 +1024,58 @@ public class ProjectServiceImpl implements ProjectService {
return
"TeamMate added successfuly"
;
}
@Override
public
List
<
HashMap
<
Object
,
Object
>>
projectsInfoByEmpId
(
String
empId
){
HashMap
<
Object
,
Object
>
projectMap
=
null
;
List
<
HashMap
<
Object
,
Object
>>
projectList
=
new
ArrayList
<>();
Project
project
=
null
;
Account
account
=
null
;
Domains
domain
=
null
;
List
<
ProjectTeamMate
>
projectAllocations
=
getMyProjectAllocations
(
empId
);
if
(
null
!=
projectAllocations
&&
!
projectAllocations
.
isEmpty
()
&&
MyTimeUtils
.
INT_ZERO
<
projectAllocations
.
size
())
{
for
(
ProjectTeamMate
ptm
:
projectAllocations
)
{
projectMap
=
new
HashMap
<>();
project
=
projectRepo
.
findByProjectId
(
ptm
.
getProjectId
());
account
=
accountRepo
.
findByAccountId
(
ptm
.
getAccountId
());
domain
=
domainRepo
.
findByDomainId
(
ptm
.
getDomainId
());
projectMap
.
put
(
"id"
,
project
.
getId
());
projectMap
.
put
(
"projectId"
,
project
.
getProjectId
());
projectMap
.
put
(
"projectName"
,
project
.
getProjectName
());
if
(
domain
!=
null
)
projectMap
.
put
(
"domain"
,
domain
.
getDomainName
());
if
(
account
!=
null
)
projectMap
.
put
(
"account"
,
account
.
getAccountName
());
projectMap
.
put
(
"accountId"
,
account
!=
null
?
account
.
getAccountId
():
ptm
.
getAccountId
());
projectMap
.
put
(
"domainId"
,
domain
!=
null
?
domain
.
getDomainId
()
:
ptm
.
getDomainId
()
);
projectMap
.
put
(
"status"
,
project
.
getStatus
()!=
null
?
project
.
getStatus
():
""
);
projectMap
.
put
(
"employeeIds"
,
ptm
.
getEmployeeId
());
projectMap
.
put
(
"projectStartDate"
,
project
.
getProjectStartDate
());
projectMap
.
put
(
"projectEndDate"
,
project
.
getProjectEndDate
());
projectMap
.
put
(
"shift"
,
ptm
.
getShift
());
projectMap
.
put
(
"billableStatus"
,
ptm
.
getBillableStatus
());
if
(
project
.
getDeliveryLeadIds
()
!=
null
)
{
projectMap
.
put
(
"deliveryLeadIds"
,
getEmployeeData
(
project
.
getDeliveryLeadIds
()));
}
if
(
project
.
getManagerIds
()
!=
null
)
{
projectMap
.
put
(
"managerIds"
,
getEmployeeData
(
project
.
getManagerIds
()));
}
projectList
.
add
(
projectMap
);
}
}
return
projectList
;
}
}
src/main/java/com/nisum/mytime/utils/MyTimeUtils.java
View file @
dd147301
...
...
@@ -108,4 +108,6 @@ public class MyTimeUtils {
public
final
static
String
BENCH_PROJECT_ID
=
"Nisum0000"
;
public
final
static
String
BENCH_BILLABILITY_STATUS
=
"Non-Billable"
;
public
final
static
int
INT_ZERO
=
0
;
}
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