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
30c018f4
Commit
30c018f4
authored
Jun 13, 2019
by
vikram singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"added service for move to open pool"
parent
889da4fd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
255 additions
and
231 deletions
+255
-231
Resource.java
src/main/java/com/nisum/myteam/model/dao/Resource.java
+44
-43
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+24
-4
MyTeamUtils.java
src/main/java/com/nisum/myteam/utils/MyTeamUtils.java
+187
-184
No files found.
src/main/java/com/nisum/myteam/model/dao/Resource.java
View file @
30c018f4
...
...
@@ -39,5 +39,6 @@ public class Resource extends AuditFields implements Serializable {
private
Date
billingEndDate
;
private
String
resourceRole
;
private
String
status
;
}
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
30c018f4
...
...
@@ -165,6 +165,7 @@ public class ResourceService implements IResourceService {
resourceBench
.
setBillingStartDate
(
MyTeamDateUtils
.
getDayMoreThanDate
(
resourceReq
.
getBillingEndDate
()));
resourceBench
.
setBillingEndDate
(
projectService
.
getProjectByProjectId
(
MyTeamUtils
.
BENCH_PROJECT_ID
).
getProjectEndDate
());
resourceBench
.
setBillableStatus
(
MyTeamUtils
.
BENCH_BILLABILITY_STATUS
);
resourceBench
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
CREATE
);
resourceRepo
.
save
(
resourceBench
);
}
else
if
(
latestAllocation
!=
null
&&
latestAllocation
.
getProjectId
().
equalsIgnoreCase
(
MyTeamUtils
.
BENCH_PROJECT_ID
)){
...
...
@@ -924,10 +925,29 @@ public class ResourceService implements IResourceService {
return
resourceRepo
.
findByBillableStatus
(
billableStatus
).
stream
().
filter
(
r
->
r
.
getBillingEndDate
().
after
(
new
Date
())).
collect
(
Collectors
.
toSet
());
}
public
Resource
sendResourceToOpenPool
(
Resource
resource
,
String
loginId
)
{
Resource
existingresource
=
resourceRepo
.
findById
(
resource
.
getId
());
existingresource
.
setStatus
(
MyTeamUtils
.
RELEASED_STATUS
);
this
.
updateExistedResource
(
existingresource
);
// isResourceAvailableinBenchbygraterthanEndDate=
}
//class
Resource
benchResource
=
new
Resource
();
benchResource
.
setProjectId
(
MyTeamUtils
.
BENCH_PROJECT_ID
);
benchResource
.
setEmployeeId
(
resource
.
getEmployeeId
());
benchResource
.
setResourceRole
(
resource
.
getResourceRole
());
benchResource
.
setBillingStartDate
(
MyTeamDateUtils
.
getDayMoreThanDate
(
resource
.
getBillingEndDate
()));
benchResource
.
setBillingEndDate
(
projectService
.
getProjectByProjectId
(
MyTeamUtils
.
BENCH_PROJECT_ID
).
getProjectEndDate
());
benchResource
.
setBillableStatus
(
MyTeamUtils
.
BENCH_BILLABILITY_STATUS
);
benchResource
.
setStatus
(
MyTeamUtils
.
RELEASED_STATUS
);
benchResource
.
setAuditFields
(
loginId
,
MyTeamUtils
.
CREATE
);
Resource
resourcePers
=
resourceRepo
.
save
(
benchResource
);
respMap
.
put
(
"statusCode"
,
801
);
respMap
.
put
(
"message"
,
"Resource is moved to Bench Successfully"
);
return
resourcePers
;
}
}
//class
...
...
src/main/java/com/nisum/myteam/utils/MyTeamUtils.java
View file @
30c018f4
...
...
@@ -11,6 +11,9 @@ public class MyTeamUtils {
//public final static String driverUrl = "jdbc:ucanaccess://";
//public final static String msdriveUrl ="jdbc:sqlserver://";
public
final
static
String
RELEASED_STATUS
=
"Released"
;
public
final
static
String
Engaged_STATUS
=
"Engaged"
;
public
final
static
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
public
final
static
DateFormat
tdf
=
new
SimpleDateFormat
(
"HH:mm"
);
public
final
static
DateFormat
dfmt
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
...
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