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
33b8a8f7
Commit
33b8a8f7
authored
Aug 12, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added endpoint for open pool and edit functionality in onbehalf feature
parent
7559e41a
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
23 deletions
+114
-23
ResourceController.java
.../java/com/nisum/myteam/controller/ResourceController.java
+12
-0
IResourceService.java
src/main/java/com/nisum/myteam/service/IResourceService.java
+2
-0
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+33
-0
OpenPoolController.js
src/main/webapp/WEB-INF/controllers/OpenPoolController.js
+2
-6
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+64
-14
custom-theme.css
src/main/webapp/WEB-INF/css/custom-theme.css
+1
-3
No files found.
src/main/java/com/nisum/myteam/controller/ResourceController.java
View file @
33b8a8f7
...
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@RestController
@RequestMapping
...
...
@@ -131,6 +132,17 @@ public class ResourceController {
"List of Resources for a project"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/resources/openPool/active"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getResourcesForOpenPool
(
HttpServletRequest
request
)
throws
MyTeamException
{
List
<
ResourceVO
>
resourcesList
=
resourceService
.
getResourcesForOpenPool
(
MyTeamUtils
.
BENCH_PROJECT_ID
,
MyTeamUtils
.
ACTIVE
).
stream
()
.
sorted
((
o1
,
o2
)
->
o1
.
getEmployeeName
().
trim
().
compareTo
(
o2
.
getEmployeeName
().
trim
()))
.
collect
(
Collectors
.
toList
());
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Resources have been retrieved successfully"
,
"List of Resources for a project"
,
resourcesList
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/resources/getMyProjectAllocations"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getMyProjectAllocations
(
...
...
src/main/java/com/nisum/myteam/service/IResourceService.java
View file @
33b8a8f7
...
...
@@ -71,6 +71,8 @@ public interface IResourceService {
Resource
getCurrentAllocation
(
String
employeeId
);
List
<
ResourceVO
>
getResourcesForOpenPool
(
String
projectId
,
String
statusFlag
);
// List<Resource> getAllResourcesForProject(String projectId, String status);
...
...
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
33b8a8f7
...
...
@@ -166,6 +166,7 @@ public class ResourceService implements IResourceService {
nextAllocation
.
setBillingStartDate
(
MyTeamDateUtils
.
getDayMoreThanDate
(
resourceReq
.
getBillingEndDate
()));
this
.
updateExistedResource
(
nextAllocation
);
}
resource
.
setOnBehalfOf
(
resourceReq
.
getOnBehalfOf
());
resource
.
setBillableStatus
(
resourceReq
.
getBillableStatus
());
resource
.
setBillingStartDate
(
resourceReq
.
getBillingStartDate
());
resource
.
setBillingEndDate
(
resourceReq
.
getBillingEndDate
());
...
...
@@ -680,6 +681,38 @@ public class ResourceService implements IResourceService {
}
return
resourcesList
;
}
@Override
public
List
<
ResourceVO
>
getResourcesForOpenPool
(
String
projectId
,
String
statusFlag
)
{
List
<
ResourceVO
>
resourcesList
=
new
ArrayList
<>();
for
(
Resource
resource
:
resourceRepo
.
findByProjectId
(
projectId
))
{
Date
billingEndDate
=
resource
.
getBillingEndDate
();
Date
todayDate
=
new
Date
();
if
(
billingEndDate
!=
null
)
{
Employee
employee
=
employeeService
.
getEmployeeById
(
resource
.
getEmployeeId
());
if
(
employee
.
getEmpStatus
().
equalsIgnoreCase
(
MyTeamUtils
.
ACTIVE
)
&&
billingEndDate
.
compareTo
(
todayDate
)>
0
)
{
ResourceVO
resourceVO
=
new
ResourceVO
();
resourceVO
.
setId
(
resource
.
getId
());
resourceVO
.
setProjectId
(
resource
.
getProjectId
());
resourceVO
.
setProjectName
(
projectService
.
getProjectByProjectId
(
resource
.
getProjectId
()).
getProjectName
());
resourceVO
.
setResourceRole
(
resource
.
getResourceRole
());
resourceVO
.
setBillingStartDate
(
resource
.
getBillingStartDate
());
resourceVO
.
setBillingEndDate
(
resource
.
getBillingEndDate
());
resourceVO
.
setBillableStatus
(
resource
.
getBillableStatus
());
resourceVO
.
setEmployeeId
(
resource
.
getEmployeeId
());
resourceVO
.
setStatus
(
resource
.
getStatus
());
resourceVO
.
setOnBehalfOf
(
resource
.
getOnBehalfOf
()!=
null
?
employeeService
.
getEmployeeById
(
resource
.
getOnBehalfOf
()).
getEmployeeName
():
""
);
resourceVO
.
setEmailId
(
employee
.
getEmailId
());
resourceVO
.
setEmployeeName
(
employee
.
getEmployeeName
());
resourceVO
.
setDesignation
(
employee
.
getDesignation
());
resourcesList
.
add
(
resourceVO
);
}
}
}
return
resourcesList
;
}
@Override
...
...
src/main/webapp/WEB-INF/controllers/OpenPoolController.js
View file @
33b8a8f7
...
...
@@ -76,14 +76,10 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
}
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
'resources/
project/Nisum0000?status=A
ctive'
url
:
appConfig
.
appUri
+
'resources/
openPool/a
ctive'
}).
then
(
function
mySuccess
(
response
)
{
$mdDialog
.
hide
();
today
.
setHours
(
0
,
0
,
0
,
0
);
var
openPoolRecords
=
response
.
data
.
records
.
filter
(
function
(
employee
)
{
return
employee
.
billingEndDate
>=
today
;
});
$scope
.
gridOptions
.
data
=
openPoolRecords
;
$scope
.
gridOptions
.
data
=
response
.
data
.
records
;
if
(
response
.
data
.
records
.
length
>
10
){
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
}
...
...
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
33b8a8f7
This diff is collapsed.
Click to expand it.
src/main/webapp/WEB-INF/css/custom-theme.css
View file @
33b8a8f7
...
...
@@ -657,9 +657,6 @@ cursor: pointer;
.manage-employee-efforts
{
height
:
calc
(
100vh
-
260px
)
!important
;
}
.manage-open-pool
{
height
:
calc
(
100vh
-
230px
)
!important
;
}
.md-datepicker-input-mask
{
height
:
0px
;
}
...
...
@@ -690,6 +687,7 @@ cursor: pointer;
.substatus-dropdown
md-datepicker
{
padding
:
0
;
}
.substatus-dropdown
>
md-select
{
margin
:
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