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
2f87e72c
Commit
2f87e72c
authored
Aug 29, 2018
by
Muneer Alam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MT-07: Adding Trainee as a status in the dropdown list of Add Team mate screen
parent
260287c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
41 deletions
+12
-41
ProjectServiceImpl.java
...ain/java/com/nisum/mytime/service/ProjectServiceImpl.java
+12
-41
No files found.
src/main/java/com/nisum/mytime/service/ProjectServiceImpl.java
View file @
2f87e72c
...
...
@@ -25,8 +25,6 @@ import org.springframework.data.mongodb.core.query.Update;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
com.mongodb.BasicDBObject
;
import
com.mongodb.DBCollection
;
import
com.nisum.mytime.controller.DomainController
;
import
com.nisum.mytime.exception.handler.MyTimeException
;
import
com.nisum.mytime.model.Account
;
...
...
@@ -97,13 +95,11 @@ public class ProjectServiceImpl implements ProjectService {
@Override
public
List
<
EmpLoginData
>
employeeLoginsBasedOnDate
(
long
id
,
String
fromDate
,
String
toDate
)
throws
MyTimeException
{
return
employeeDataBaseService
.
fetchEmployeeLoginsBasedOnDates
(
id
,
fromDate
,
toDate
);
return
employeeDataBaseService
.
fetchEmployeeLoginsBasedOnDates
(
id
,
fromDate
,
toDate
);
}
@Override
public
String
generatePdfReport
(
long
id
,
String
fromDate
,
String
toDate
)
throws
MyTimeException
{
public
String
generatePdfReport
(
long
id
,
String
fromDate
,
String
toDate
)
throws
MyTimeException
{
return
pdfReportGenerator
.
generateEmployeeReport
(
id
,
fromDate
,
toDate
);
}
...
...
@@ -281,10 +277,8 @@ public class ProjectServiceImpl implements ProjectService {
FindAndModifyOptions
options
=
new
FindAndModifyOptions
();
options
.
returnNew
(
true
);
options
.
upsert
(
true
);
Project
projectDB
=
mongoTemplate
.
findAndModify
(
query
,
update
,
options
,
Project
.
class
);
List
<
ProjectTeamMate
>
employeeDetails
=
projectTeamMatesRepo
.
findByProjectId
(
project
.
getProjectId
());
Project
projectDB
=
mongoTemplate
.
findAndModify
(
query
,
update
,
options
,
Project
.
class
);
List
<
ProjectTeamMate
>
employeeDetails
=
projectTeamMatesRepo
.
findByProjectId
(
project
.
getProjectId
());
if
(
employeeDetails
!=
null
&&
projectDB
!=
null
)
{
for
(
ProjectTeamMate
emp
:
employeeDetails
)
{
// emp.setManagerId(projectDB.getManagerId());
...
...
@@ -312,14 +306,11 @@ public class ProjectServiceImpl implements ProjectService {
List
<
ProjectTeamMate
>
listOfTeamMates
=
new
ArrayList
<>();
// return projectTeamMatesRepo.findById(empId);
// Query query = new Query(Criteria.where("deliveryLeadIds").("empId"));
List
<
Project
>
projects
=
projectRepo
.
findByDeliveryLeadIds
(
empId
);
// mongoTemplate.find(query,
// Project.class);
List
<
Project
>
projects
=
projectRepo
.
findByDeliveryLeadIds
(
empId
);
// mongoTemplate.find(query, Project.class);
for
(
Project
project
:
projects
)
projectsId
.
add
(
project
.
getProjectId
());
Query
query1
=
new
Query
(
Criteria
.
where
(
"projectId"
).
in
(
projectsId
));
List
<
ProjectTeamMate
>
projectMateList
=
mongoTemplate
.
find
(
query1
,
ProjectTeamMate
.
class
);
List
<
ProjectTeamMate
>
projectMateList
=
mongoTemplate
.
find
(
query1
,
ProjectTeamMate
.
class
);
for
(
ProjectTeamMate
projectTeamMate
:
projectMateList
)
{
if
(!
projectTeamMate
.
getEmployeeId
().
equals
(
empId
))
listOfTeamMates
.
add
(
projectTeamMate
);
...
...
@@ -494,7 +485,9 @@ public class ProjectServiceImpl implements ProjectService {
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
projectTeamMate
.
getNewBillingStartDate
());
cal
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
if
(
existingTeammate
.
getNewBillingStartDate
().
getDate
()
==
projectTeamMate
.
getNewBillingStartDate
().
getDate
())
{
Date
startDate
=
existingTeammate
.
getNewBillingStartDate
()
!=
null
?
existingTeammate
.
getNewBillingStartDate
()
:
existingTeammate
.
getStartDate
();
if
(
startDate
.
getDate
()
==
projectTeamMate
.
getNewBillingStartDate
().
getDate
())
{
billingDetails
.
setBillingEndDate
(
DateUtils
.
truncate
(
projectTeamMate
.
getNewBillingStartDate
(),
Calendar
.
DATE
));
}
else
{
billingDetails
.
setBillingEndDate
(
DateUtils
.
truncate
(
cal
.
getTime
(),
Calendar
.
DATE
));
...
...
@@ -858,11 +851,9 @@ public class ProjectServiceImpl implements ProjectService {
cal
.
setTime
(
d
);
cal
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
Date
oneDayLess
=
cal
.
getTime
();
if
(
null
!=
teamMate
.
getNewBillingStartDate
()){
if
(
teamMate
.
getNewBillingStartDate
().
getDate
()
==
projectTeamMate
.
getNewBillingStartDate
().
getDate
())
{
Date
startDate
=
teamMate
.
getNewBillingStartDate
()
!=
null
?
teamMate
.
getNewBillingStartDate
()
:
teamMate
.
getStartDate
();
if
(
startDate
.
getDate
()
==
projectTeamMate
.
getNewBillingStartDate
().
getDate
()){
teamMate
.
setEndDate
(
DateUtils
.
truncate
(
projectTeamMate
.
getEndDate
(),
Calendar
.
DATE
));
}
}
else
{
teamMate
.
setEndDate
(
DateUtils
.
truncate
(
oneDayLess
,
Calendar
.
DATE
));
}
...
...
@@ -955,53 +946,33 @@ public class ProjectServiceImpl implements ProjectService {
}
}
for
(
EmployeeRoles
emp
:
allEmployees
)
{
if
(
emp
.
getEmployeeId
()
!=
null
&&
emp
.
getEmployeeId
().
equalsIgnoreCase
(
"16112"
))
{
System
.
out
.
println
(
emp
);
}
if
(
teamMatesMap
.
containsKey
(
emp
.
getEmployeeId
()))
{
System
.
out
.
println
(
"***************** Empl alrady assigned"
);
Object
value
=
teamMatesMap
.
get
(
emp
.
getEmployeeId
());
if
(
value
instanceof
List
)
{
List
listOfTeamMates
=
(
List
)
value
;
String
billableStatus
=
"NA"
;
for
(
Object
obj
:
listOfTeamMates
)
{
ProjectTeamMate
projectTeamMate
=
(
ProjectTeamMate
)
obj
;
String
status
=
projectTeamMate
.
getBillableStatus
();
if
(
status
==
null
)
{
status
=
"NA"
;
}
System
.
out
.
println
(
"---------------------------"
);
EmployeeDashboardVO
empVo
=
new
EmployeeDashboardVO
();
System
.
out
.
println
(
emp
);
BeanUtils
.
copyProperties
(
emp
,
empVo
);
BeanUtils
.
copyProperties
(
projectTeamMate
,
empVo
,
"employeeId"
,
"employeeName"
,
"emailId"
,
"role"
,
"designation"
,
"mobileNumber"
);
employeeDashboard
.
add
(
empVo
);
}
}
}
else
{
EmployeeDashboardVO
empVo
=
new
EmployeeDashboardVO
();
System
.
out
.
println
(
emp
);
BeanUtils
.
copyProperties
(
emp
,
empVo
);
empVo
.
setBillableStatus
(
"UA"
);
empVo
.
setProjectAssigned
(
false
);
employeeDashboard
.
add
(
empVo
);
}
System
.
out
.
println
(
"&&&&&&&&&&"
);
// System.out.println(empVo);
System
.
out
.
println
(
"---------------------------"
);
}
return
employeeDashboard
;
}
...
...
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