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
e4fcbdc8
Commit
e4fcbdc8
authored
Feb 04, 2020
by
Md Suleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utilization report fixes
parent
24440c83
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
UploadXLController.java
.../java/com/nisum/myteam/controller/UploadXLController.java
+1
-1
ReportService.java
...ain/java/com/nisum/myteam/service/impl/ReportService.java
+9
-8
No files found.
src/main/java/com/nisum/myteam/controller/UploadXLController.java
View file @
e4fcbdc8
...
@@ -25,7 +25,7 @@ public class UploadXLController {
...
@@ -25,7 +25,7 @@ public class UploadXLController {
@RequestMapping
(
value
=
"/employee/fileUpload"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
@RequestMapping
(
value
=
"/employee/fileUpload"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
public
ResponseEntity
<
String
>
exportDataFromFile
(
@RequestParam
(
value
=
"file"
)
MultipartFile
file
,
public
ResponseEntity
<
String
>
exportDataFromFile
(
@RequestParam
(
value
=
"file"
)
MultipartFile
file
,
@RequestParam
(
value
=
"empId"
)
String
loginEmpId
)
throws
MyTeamException
{
@RequestParam
(
value
=
"empId"
)
String
loginEmpId
)
throws
MyTeamException
{
log
.
info
(
"Uploaded file: {} with size: {}
"
,
file
.
getOriginalFilename
(),
file
.
getSize
()
);
log
.
info
(
"Uploaded file: {} with size: {}
By employee: {}"
,
file
.
getOriginalFilename
(),
file
.
getSize
(),
loginEmpId
);
String
result
=
uploadService
.
importDataFromExcelFile
(
file
,
loginEmpId
);
String
result
=
uploadService
.
importDataFromExcelFile
(
file
,
loginEmpId
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
}
...
...
src/main/java/com/nisum/myteam/service/impl/ReportService.java
View file @
e4fcbdc8
...
@@ -66,10 +66,10 @@ public class ReportService implements IReportService {
...
@@ -66,10 +66,10 @@ public class ReportService implements IReportService {
if
(
byType
.
equals
(
"AllFunctionalOrgs"
))
{
if
(
byType
.
equals
(
"AllFunctionalOrgs"
))
{
employeeList
=
getEmployeesByFunctionalGroup
(
category
);
employeeList
=
getEmployeesByFunctionalGroup
(
category
);
}
else
if
(
byType
.
equals
(
"Account"
)){
}
else
if
(
byType
.
equals
(
"Account"
)){
employeeList
=
getEmployeeByAccounts
(
category
);
employeeList
=
getEmployeeByAccounts
(
category
,
onDate
);
}
}
else
{
else
{
employeeList
=
getEmployeesByAccAndFG
(
category
,
byType
);
employeeList
=
getEmployeesByAccAndFG
(
category
,
byType
,
onDate
);
}
}
for
(
Employee
employee:
employeeList
){
for
(
Employee
employee:
employeeList
){
Resource
resource
=
null
;
Resource
resource
=
null
;
...
@@ -103,9 +103,9 @@ public class ReportService implements IReportService {
...
@@ -103,9 +103,9 @@ public class ReportService implements IReportService {
return
reportVo
;
return
reportVo
;
}
}
private
List
<
Employee
>
getEmployeesByAccAndFG
(
String
account
,
String
functionalGroup
)
{
private
List
<
Employee
>
getEmployeesByAccAndFG
(
String
account
,
String
functionalGroup
,
Date
onDate
)
{
List
<
Employee
>
empList
;
List
<
Employee
>
empList
;
empList
=
getEmployeeByAccounts
(
account
).
stream
().
filter
(
e
->
e
.
getFunctionalGroup
().
equals
(
functionalGroup
)).
collect
(
Collectors
.
toList
());
empList
=
getEmployeeByAccounts
(
account
,
onDate
).
stream
().
filter
(
e
->
e
.
getFunctionalGroup
().
equals
(
functionalGroup
)).
collect
(
Collectors
.
toList
());
return
empList
;
return
empList
;
}
}
...
@@ -113,11 +113,12 @@ public class ReportService implements IReportService {
...
@@ -113,11 +113,12 @@ public class ReportService implements IReportService {
return
employeeService
.
getEmployeesByFunctionalGrp
(
functionalGroup
);
return
employeeService
.
getEmployeesByFunctionalGrp
(
functionalGroup
);
}
}
private
List
<
Employee
>
getEmployeeByAccounts
(
String
accountName
){
private
List
<
Employee
>
getEmployeeByAccounts
(
String
accountName
,
Date
onDate
){
List
<
Employee
>
employeeList
=
new
ArrayList
<>();
List
<
Employee
>
employeeList
=
new
ArrayList
<>();
List
<
Project
>
projects
=
projectService
.
getProjectsByAccountId
(
accountService
.
getAccountByName
(
accountName
).
getAccountId
());
List
<
Project
>
projects
=
projectService
.
getProjectsByAccountId
(
accountService
.
getAccountByName
(
accountName
).
getAccountId
());
projects
.
stream
().
forEach
(
p
->
{
projects
.
stream
().
forEach
(
p
->
{
resourceService
.
getResourceByProjectId
(
p
.
getProjectId
()).
stream
().
filter
(
r
->
resourceService
.
isAllocationActiveToday
(
r
)).
resourceService
.
getResourceByProjectId
(
p
.
getProjectId
()).
stream
().
filter
(
resource
->
resource
.
getBillingStartDate
().
compareTo
(
onDate
)
<=
0
&&
resource
.
getBillingEndDate
().
compareTo
(
onDate
)>=
0
).
forEach
(
r
->{
forEach
(
r
->{
Employee
employee
=
employeeService
.
findByEmployeeIdAndEmpStatus
(
MyTeamUtils
.
ACTIVE
,
r
.
getEmployeeId
());
Employee
employee
=
employeeService
.
findByEmployeeIdAndEmpStatus
(
MyTeamUtils
.
ACTIVE
,
r
.
getEmployeeId
());
if
(
employee
!=
null
)
if
(
employee
!=
null
)
...
@@ -139,12 +140,12 @@ public class ReportService implements IReportService {
...
@@ -139,12 +140,12 @@ public class ReportService implements IReportService {
public
List
<
Reports
>
getEmployeeDetailsByAccountBillability
(
String
accountName
,
String
billabilityStatus
,
Date
onDate
)
public
List
<
Reports
>
getEmployeeDetailsByAccountBillability
(
String
accountName
,
String
billabilityStatus
,
Date
onDate
)
throws
MyTeamException
{
throws
MyTeamException
{
return
resultantEmployeeWithBillability
(
getEmployeeByAccounts
(
accountName
),
billabilityStatus
,
onDate
);
return
resultantEmployeeWithBillability
(
getEmployeeByAccounts
(
accountName
,
onDate
),
billabilityStatus
,
onDate
);
}
}
@Override
@Override
public
List
<
Reports
>
getEmployeeDetailsByFGAccountAndBillability
(
String
fGroup
,
String
billableStatus
,
String
account
,
Date
onDate
)
throws
MyTeamException
{
public
List
<
Reports
>
getEmployeeDetailsByFGAccountAndBillability
(
String
fGroup
,
String
billableStatus
,
String
account
,
Date
onDate
)
throws
MyTeamException
{
List
<
Employee
>
empList
=
getEmployeesByAccAndFG
(
account
,
fGroup
);
List
<
Employee
>
empList
=
getEmployeesByAccAndFG
(
account
,
fGroup
,
onDate
);
return
resultantEmployeeWithBillability
(
empList
,
billableStatus
,
onDate
);
return
resultantEmployeeWithBillability
(
empList
,
billableStatus
,
onDate
);
}
}
...
...
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