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
0310f4ea
Commit
0310f4ea
authored
Jun 24, 2019
by
Md Suleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added validation while moving resource to proposed to engage
parent
38550d04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+31
-0
SubStatusService.java
.../java/com/nisum/myteam/service/impl/SubStatusService.java
+1
-1
No files found.
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
0310f4ea
...
...
@@ -143,6 +143,10 @@ public class ResourceService implements IResourceService {
if
(
resource
!=
null
)
{
if
(!
resource
.
getStatus
().
equalsIgnoreCase
(
MyTeamUtils
.
STATUS_RELEASED
)){
if
(
validateResourceForProposedToEngage
(
resourceReq
)){
this
.
updateExistedResource
(
resourceReq
);
return
;
}
if
(
isDatesAvailableForAllocation
(
resourceReq
))
{
Resource
prevAllocation
=
getFirstOfListOrNull
(
resourceRepo
.
findByEmployeeId
(
resourceReq
.
getEmployeeId
()).
stream
().
filter
(
a
->
a
.
getBillingEndDate
().
compareTo
(
MyTeamDateUtils
.
getDayLessThanDate
(
resource
.
getBillingStartDate
()))==
0
).
collect
(
Collectors
.
toList
()));
...
...
@@ -156,8 +160,12 @@ public class ResourceService implements IResourceService {
nextAllocation
.
setBillingStartDate
(
MyTeamDateUtils
.
getDayMoreThanDate
(
resourceReq
.
getBillingEndDate
()));
this
.
updateExistedResource
(
nextAllocation
);
}
// resource.setBillableStatus(resourceReq.getBillableStatus());
// resource.setBillingStartDate(resourceReq.getBillingStartDate());
// resource.setBillingEndDate(resourceReq.getBillingEndDate());
this
.
updateExistedResource
(
resourceReq
);
}
}
else
{
respMap
.
put
(
"statusCode"
,
811
);
respMap
.
put
(
"message"
,
"Resource is already released from you, And you can't update this allocation"
);
...
...
@@ -328,6 +336,29 @@ public class ResourceService implements IResourceService {
return
isAssigned
;
}
public
boolean
validateResourceForProposedToEngage
(
Resource
resourceReq
){
String
message
=
""
;
boolean
isValid
=
false
;
Resource
resource
=
resourceRepo
.
findById
(
resourceReq
.
getId
());
if
(
resource
!=
null
){
List
<
Resource
>
resourceList
=
resourceRepo
.
findByEmployeeId
(
resourceReq
.
getEmployeeId
());
Resource
lastAllocation
=
this
.
getLatestAllocation
(
resourceList
.
stream
().
filter
(
a
->
a
.
getBillingEndDate
().
compareTo
(
resource
.
getBillingStartDate
())<
0
&&
!
a
.
getProjectId
().
equalsIgnoreCase
(
MyTeamUtils
.
BENCH_PROJECT_ID
)).
collect
(
Collectors
.
toList
()));
if
(
resource
.
getStatus
().
equals
(
MyTeamUtils
.
STATUS_PROPOSED
)
&&
resourceReq
.
getStatus
().
equals
(
MyTeamUtils
.
STATUS_ENGAGED
)){
if
(!
lastAllocation
.
getStatus
().
equals
(
MyTeamUtils
.
STATUS_RELEASED
)){
message
=
"Resource is not released form last allocation"
;
}
else
{
isValid
=
true
;
}
}
respMap
.
put
(
"statusCode"
,
810
);
respMap
.
put
(
"message"
,
message
);
}
return
isValid
;
}
public
boolean
validateResourceBillingEndDateAgainstBench
(
Resource
resourceReq
){
boolean
isValid
=
true
;
String
message
=
""
;
...
...
src/main/java/com/nisum/myteam/service/impl/SubStatusService.java
View file @
0310f4ea
...
...
@@ -58,7 +58,7 @@ public class SubStatusService implements ISubStatusService {
@Override
public
EmployeeSubStatus
endSubStatus
(
EmployeeSubStatus
subStatus
){
EmployeeSubStatus
currentSubStatus
=
getCurrentSubStatus
(
subStatus
.
getEmployeeID
());
if
(
currentSubStatus
.
getId
().
equals
(
subStatus
.
getId
())
){
if
(
currentSubStatus
!=
null
){
subStatus
.
setToDate
(
MyTeamDateUtils
.
getDayLessThanDate
(
new
Date
()));
updateExistingEmplyeeSubStatus
(
subStatus
);
}
...
...
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