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
Expand all
Hide 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
package
com
.
nisum
.
myteam
.
model
.
dao
;
package
com
.
nisum
.
myteam
.
model
.
dao
;
import
com.nisum.myteam.model.AuditFields
;
import
com.nisum.myteam.model.AuditFields
;
import
lombok.*
;
import
lombok.*
;
import
org.bson.types.ObjectId
;
import
org.bson.types.ObjectId
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.format.annotation.DateTimeFormat.ISO
;
import
org.springframework.format.annotation.DateTimeFormat.ISO
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
@Setter
@Setter
@Getter
@Getter
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
@ToString
@ToString
@Document
(
collection
=
"resourceAllocation"
)
@Document
(
collection
=
"resourceAllocation"
)
public
class
Resource
extends
AuditFields
implements
Serializable
{
public
class
Resource
extends
AuditFields
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
ObjectId
id
;
private
ObjectId
id
;
private
String
employeeId
;
private
String
employeeId
;
private
String
projectId
;
private
String
projectId
;
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
private
String
billableStatus
;
private
String
billableStatus
;
@DateTimeFormat
(
iso
=
ISO
.
DATE
,
pattern
=
"yyyy-MM-dd'T'HH:mm:ss.SSSX"
)
@DateTimeFormat
(
iso
=
ISO
.
DATE
,
pattern
=
"yyyy-MM-dd'T'HH:mm:ss.SSSX"
)
private
Date
billingStartDate
;
private
Date
billingStartDate
;
@DateTimeFormat
(
iso
=
ISO
.
DATE
,
pattern
=
"yyyy-MM-dd'T'HH:mm:ss.SSSX"
)
@DateTimeFormat
(
iso
=
ISO
.
DATE
,
pattern
=
"yyyy-MM-dd'T'HH:mm:ss.SSSX"
)
private
Date
billingEndDate
;
private
Date
billingEndDate
;
private
String
resourceRole
;
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 {
...
@@ -165,6 +165,7 @@ public class ResourceService implements IResourceService {
resourceBench
.
setBillingStartDate
(
MyTeamDateUtils
.
getDayMoreThanDate
(
resourceReq
.
getBillingEndDate
()));
resourceBench
.
setBillingStartDate
(
MyTeamDateUtils
.
getDayMoreThanDate
(
resourceReq
.
getBillingEndDate
()));
resourceBench
.
setBillingEndDate
(
projectService
.
getProjectByProjectId
(
MyTeamUtils
.
BENCH_PROJECT_ID
).
getProjectEndDate
());
resourceBench
.
setBillingEndDate
(
projectService
.
getProjectByProjectId
(
MyTeamUtils
.
BENCH_PROJECT_ID
).
getProjectEndDate
());
resourceBench
.
setBillableStatus
(
MyTeamUtils
.
BENCH_BILLABILITY_STATUS
);
resourceBench
.
setBillableStatus
(
MyTeamUtils
.
BENCH_BILLABILITY_STATUS
);
resourceBench
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
CREATE
);
resourceBench
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
CREATE
);
resourceRepo
.
save
(
resourceBench
);
resourceRepo
.
save
(
resourceBench
);
}
else
if
(
latestAllocation
!=
null
&&
latestAllocation
.
getProjectId
().
equalsIgnoreCase
(
MyTeamUtils
.
BENCH_PROJECT_ID
)){
}
else
if
(
latestAllocation
!=
null
&&
latestAllocation
.
getProjectId
().
equalsIgnoreCase
(
MyTeamUtils
.
BENCH_PROJECT_ID
)){
...
@@ -924,10 +925,29 @@ public class ResourceService implements IResourceService {
...
@@ -924,10 +925,29 @@ public class ResourceService implements IResourceService {
return
resourceRepo
.
findByBillableStatus
(
billableStatus
).
stream
().
filter
(
r
->
r
.
getBillingEndDate
().
after
(
new
Date
())).
collect
(
Collectors
.
toSet
());
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
);
}
//class
this
.
updateExistedResource
(
existingresource
);
// isResourceAvailableinBenchbygraterthanEndDate=
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
This diff is collapsed.
Click to expand it.
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