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
1b16b517
Commit
1b16b517
authored
Jul 09, 2019
by
Vijay Akula
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update on resource status engaged validation
parent
071b0d85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+26
-5
No files found.
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
1b16b517
...
@@ -216,11 +216,11 @@ public class ResourceService implements IResourceService {
...
@@ -216,11 +216,11 @@ public class ResourceService implements IResourceService {
respMap
.
put
(
"message"
,
"Billing start date should be after previous allocation billing end date in this project"
);
respMap
.
put
(
"message"
,
"Billing start date should be after previous allocation billing end date in this project"
);
isValid
=
false
;
isValid
=
false
;
}
}
if
(
prevAllocation
.
getBillableStatus
().
equalsIgnoreCase
(
resourceReq
.
getBillableStatus
()))
{
//
if (prevAllocation.getBillableStatus().equalsIgnoreCase(resourceReq.getBillableStatus())) {
respMap
.
put
(
"statusCode"
,
811
);
//
respMap.put("statusCode", 811);
respMap
.
put
(
"message"
,
"Resource is already in "
+
prevAllocation
.
getBillableStatus
()
+
" status only"
);
//
respMap.put("message", "Resource is already in " + prevAllocation.getBillableStatus() + " status only");
isValid
=
false
;
//
isValid = false;
}
//
}
}
}
return
isValid
;
return
isValid
;
}
}
...
@@ -318,6 +318,9 @@ public class ResourceService implements IResourceService {
...
@@ -318,6 +318,9 @@ public class ResourceService implements IResourceService {
}
else
if
(!
isDatesAvailableForAllocation
(
resourceReq
)){
}
else
if
(!
isDatesAvailableForAllocation
(
resourceReq
)){
message
=
respMap
.
get
(
"message"
).
toString
();
message
=
respMap
.
get
(
"message"
).
toString
();
isAssigned
=
false
;
isAssigned
=
false
;
}
else
if
(!
isReleased
(
resourceReq
)){
message
=
respMap
.
get
(
"message"
).
toString
();
isAssigned
=
false
;
}
}
respMap
.
put
(
"statusCode"
,
815
);
respMap
.
put
(
"statusCode"
,
815
);
respMap
.
put
(
"message"
,
message
);
respMap
.
put
(
"message"
,
message
);
...
@@ -368,6 +371,24 @@ public class ResourceService implements IResourceService {
...
@@ -368,6 +371,24 @@ public class ResourceService implements IResourceService {
return
isValid
;
return
isValid
;
}
}
public
boolean
isReleased
(
Resource
resourceReq
){
boolean
released
=
false
;
List
<
Resource
>
resourceList
=
resourceRepo
.
findByEmployeeId
(
resourceReq
.
getEmployeeId
());
Resource
currentAllocation
=
getCurrentAllocationIfNotReturnNull
(
resourceReq
.
getEmployeeId
());
if
(
currentAllocation
==
null
){
Resource
latestAllocation
=
getLatestAllocation
(
resourceList
.
stream
().
filter
(
r
->
r
.
getBillingEndDate
().
compareTo
(
resourceReq
.
getBillingStartDate
())
<
0
).
collect
(
Collectors
.
toList
()));
if
(
latestAllocation
!=
null
&&
latestAllocation
.
getStatus
().
equals
(
MyTeamUtils
.
STATUS_ENGAGED
)){
//not released
respMap
.
put
(
"statusCode"
,
810
);
respMap
.
put
(
"message"
,
"Resource is not released from "
+
projectService
.
getProjectByProjectId
(
latestAllocation
.
getProjectId
()).
getProjectName
());
}
else
{
released
=
true
;
}
}
return
released
;
}
public
boolean
validateResourceBillingEndDateAgainstBench
(
Resource
resourceReq
){
public
boolean
validateResourceBillingEndDateAgainstBench
(
Resource
resourceReq
){
boolean
isValid
=
true
;
boolean
isValid
=
true
;
String
message
=
""
;
String
message
=
""
;
...
...
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