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
7047b86e
Unverified
Commit
7047b86e
authored
Aug 08, 2018
by
mshaik-nisum-com
Committed by
GitHub
Aug 08, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #136 from nisum-inc/FEATURE/AddingAccountIdForBench
AddingAccountIdForBench
parents
68a63202
2d03c66b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
25 deletions
+3
-25
ProjectServiceImpl.java
...ain/java/com/nisum/mytime/service/ProjectServiceImpl.java
+3
-25
No files found.
src/main/java/com/nisum/mytime/service/ProjectServiceImpl.java
View file @
7047b86e
...
@@ -352,7 +352,6 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -352,7 +352,6 @@ public class ProjectServiceImpl implements ProjectService {
@Override
@Override
public
ProjectTeamMate
updateTeammate
(
ProjectTeamMate
projectTeamMate
)
{
public
ProjectTeamMate
updateTeammate
(
ProjectTeamMate
projectTeamMate
)
{
//ProjectTeamMate existingTeammate1 = projectTeamMatesRepo.findById(projectTeamMate.getId());
ProjectTeamMate
existingTeammate
=
projectTeamMatesRepo
ProjectTeamMate
existingTeammate
=
projectTeamMatesRepo
.
findByEmployeeIdAndProjectId
(
projectTeamMate
.
getEmployeeId
(),
.
findByEmployeeIdAndProjectId
(
projectTeamMate
.
getEmployeeId
(),
projectTeamMate
.
getProjectId
());
projectTeamMate
.
getProjectId
());
...
@@ -367,19 +366,12 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -367,19 +366,12 @@ public class ProjectServiceImpl implements ProjectService {
billingDetails
.
setBillableStatus
(
MyTimeUtils
.
BENCH_BILLABILITY_STATUS
);
billingDetails
.
setBillableStatus
(
MyTimeUtils
.
BENCH_BILLABILITY_STATUS
);
if
(
listBD
!=
null
&&
!
listBD
.
isEmpty
())
{
if
(
listBD
!=
null
&&
!
listBD
.
isEmpty
())
{
BillingDetails
billingDetailsExisting
=
listBD
.
get
(
0
);
BillingDetails
billingDetailsExisting
=
listBD
.
get
(
0
);
/*Date d = new Date();
d.setDate(d.getDate() - 1);
billingDetailsExisting.setBillingEndDate(d);*/
Date
actualEndDate
=
projectTeamMate
.
getEndDate
();
Date
actualEndDate
=
projectTeamMate
.
getEndDate
();
billingDetailsExisting
.
setBillingEndDate
(
actualEndDate
);
billingDetailsExisting
.
setBillingEndDate
(
actualEndDate
);
billingDetailsExisting
.
setActive
(
false
);
billingDetailsExisting
.
setActive
(
false
);
updateEmployeeBilling
(
billingDetailsExisting
);
updateEmployeeBilling
(
billingDetailsExisting
);
}
}
//billingDetails.setBillingStartDate(new Date());
Date
sd
=
projectTeamMate
.
getEndDate
();
Date
sd
=
projectTeamMate
.
getEndDate
();
//sd.setDate(sd.getDate()+1);
billingDetails
.
setBillingStartDate
(
sd
);
billingDetails
.
setBillingStartDate
(
sd
);
billingDetails
.
setAccount
(
MyTimeUtils
.
BENCH_ACCOUNT
);
billingDetails
.
setAccount
(
MyTimeUtils
.
BENCH_ACCOUNT
);
billingDetails
.
setActive
(
true
);
billingDetails
.
setActive
(
true
);
...
@@ -392,7 +384,9 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -392,7 +384,9 @@ public class ProjectServiceImpl implements ProjectService {
projectTeamMatesRepo
.
save
(
existingTeammate
);
projectTeamMatesRepo
.
save
(
existingTeammate
);
ProjectTeamMate
newBenchAllocation
=
new
ProjectTeamMate
();
ProjectTeamMate
newBenchAllocation
=
new
ProjectTeamMate
();
newBenchAllocation
.
setAccountId
(
projectTeamMate
.
getAccountId
());
Project
project
=
projectRepo
.
findByProjectId
(
MyTimeUtils
.
BENCH_PROJECT_ID
);
if
(
project
!=
null
)
newBenchAllocation
.
setAccountId
(
project
.
getAccountId
());
newBenchAllocation
.
setBillableStatus
(
MyTimeUtils
.
BENCH_BILLABILITY_STATUS
);
newBenchAllocation
.
setBillableStatus
(
MyTimeUtils
.
BENCH_BILLABILITY_STATUS
);
newBenchAllocation
.
setDesignation
(
existingTeammate
.
getDesignation
());
newBenchAllocation
.
setDesignation
(
existingTeammate
.
getDesignation
());
newBenchAllocation
.
setEmailId
(
existingTeammate
.
getEmailId
());
newBenchAllocation
.
setEmailId
(
existingTeammate
.
getEmailId
());
...
@@ -400,12 +394,9 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -400,12 +394,9 @@ public class ProjectServiceImpl implements ProjectService {
newBenchAllocation
.
setActive
(
true
);
newBenchAllocation
.
setActive
(
true
);
newBenchAllocation
.
setEmployeeName
(
existingTeammate
.
getEmployeeName
());
newBenchAllocation
.
setEmployeeName
(
existingTeammate
.
getEmployeeName
());
newBenchAllocation
.
setProjectId
(
MyTimeUtils
.
BENCH_PROJECT_ID
);
newBenchAllocation
.
setProjectId
(
MyTimeUtils
.
BENCH_PROJECT_ID
);
//newBenchAllocation.setStartDate(new Date());
newBenchAllocation
.
setStartDate
(
sd
);
newBenchAllocation
.
setStartDate
(
sd
);
Project
p
=
projectRepo
.
findByProjectId
(
MyTimeUtils
.
BENCH_PROJECT_ID
);
Project
p
=
projectRepo
.
findByProjectId
(
MyTimeUtils
.
BENCH_PROJECT_ID
);
newBenchAllocation
.
setProjectName
(
p
.
getProjectName
());
newBenchAllocation
.
setProjectName
(
p
.
getProjectName
());
// newBenchAllocation.setManagerId(p.getManagerId());
// newBenchAllocation.setManagerName(p.getManagerName());
projectTeamMatesRepo
.
save
(
newBenchAllocation
);
projectTeamMatesRepo
.
save
(
newBenchAllocation
);
updateShiftDetails
(
existingTeammate
);
updateShiftDetails
(
existingTeammate
);
return
existingTeammate
;
return
existingTeammate
;
...
@@ -413,9 +404,6 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -413,9 +404,6 @@ public class ProjectServiceImpl implements ProjectService {
}
else
}
else
{
{
/*ProjectTeamMate existingTeammate = projectTeamMatesRepo
.findByEmployeeIdAndProjectId(projectTeamMate.getEmployeeId(),
projectTeamMate.getProjectId());*/
existingTeammate
.
setProjectId
(
projectTeamMate
.
getProjectId
());
existingTeammate
.
setProjectId
(
projectTeamMate
.
getProjectId
());
existingTeammate
.
setProjectName
(
projectTeamMate
.
getProjectName
());
existingTeammate
.
setProjectName
(
projectTeamMate
.
getProjectName
());
existingTeammate
.
setRole
(
projectTeamMate
.
getRole
());
existingTeammate
.
setRole
(
projectTeamMate
.
getRole
());
...
@@ -428,12 +416,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -428,12 +416,7 @@ public class ProjectServiceImpl implements ProjectService {
projectTeamMate
.
getBillableStatus
()))
{
projectTeamMate
.
getBillableStatus
()))
{
if
(
listBD
!=
null
&&
!
listBD
.
isEmpty
())
{
if
(
listBD
!=
null
&&
!
listBD
.
isEmpty
())
{
BillingDetails
billingDetails
=
listBD
.
get
(
0
);
BillingDetails
billingDetails
=
listBD
.
get
(
0
);
/*
* Date d = new Date(); d.setDate(d.getDate() - 1);
*/
Date
d
=
projectTeamMate
.
getNewBillingStartDate
();
Date
d
=
projectTeamMate
.
getNewBillingStartDate
();
//d.setDate(d.getDate() - 1);
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
d
);
cal
.
setTime
(
d
);
cal
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
cal
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
...
@@ -457,11 +440,7 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -457,11 +440,7 @@ public class ProjectServiceImpl implements ProjectService {
billings
.
setProjectName
(
projectTeamMate
.
getProjectName
());
billings
.
setProjectName
(
projectTeamMate
.
getProjectName
());
billings
.
setBillableStatus
(
projectTeamMate
.
getBillableStatus
());
billings
.
setBillableStatus
(
projectTeamMate
.
getBillableStatus
());
billings
.
setActive
(
true
);
billings
.
setActive
(
true
);
// TODO
Date
d
=
projectTeamMate
.
getNewBillingStartDate
();
Date
d
=
projectTeamMate
.
getNewBillingStartDate
();
// d.setDate(d.getDate() + 1);
//billings.setBillingStartDate(DateUtils.truncate(d, Calendar.DATE));
//billings.setBillingStartDate(DateUtils.truncate(projectTeamMate.getStartDate(), Calendar.DATE)); // checking
billings
.
setBillingStartDate
(
DateUtils
.
truncate
(
d
,
Calendar
.
DATE
));
billings
.
setBillingStartDate
(
DateUtils
.
truncate
(
d
,
Calendar
.
DATE
));
existingTeammate
.
setNewBillingStartDate
(
existingTeammate
.
setNewBillingStartDate
(
DateUtils
.
truncate
(
d
,
Calendar
.
DATE
));
DateUtils
.
truncate
(
d
,
Calendar
.
DATE
));
...
@@ -469,7 +448,6 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -469,7 +448,6 @@ public class ProjectServiceImpl implements ProjectService {
.
truncate
(
projectTeamMate
.
getEndDate
(),
Calendar
.
DATE
));
.
truncate
(
projectTeamMate
.
getEndDate
(),
Calendar
.
DATE
));
billings
.
setCreateDate
(
new
Date
());
billings
.
setCreateDate
(
new
Date
());
addEmployeeBillingDetails
(
billings
);
addEmployeeBillingDetails
(
billings
);
// TODO
}
else
//without changing the Billability status
}
else
//without changing the Billability status
{
{
if
(
listBD
!=
null
&&
!
listBD
.
isEmpty
())
{
if
(
listBD
!=
null
&&
!
listBD
.
isEmpty
())
{
...
...
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