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
f3e83121
Commit
f3e83121
authored
Jun 10, 2019
by
Vijay Akula
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added logger in the services
parent
6574f8fd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
27 deletions
+18
-27
ReportsController.java
...n/java/com/nisum/myteam/controller/ReportsController.java
+7
-13
DashboardService.java
.../java/com/nisum/myteam/service/impl/DashboardService.java
+8
-8
EmployeeDataService.java
...va/com/nisum/myteam/service/impl/EmployeeDataService.java
+3
-0
EmployeeService.java
...n/java/com/nisum/myteam/service/impl/EmployeeService.java
+0
-6
0_2019-05-14_2019-05-14.pdf
src/main/webapp/WEB-INF/reports/0_2019-05-14_2019-05-14.pdf
+0
-0
No files found.
src/main/java/com/nisum/myteam/controller/ReportsController.java
View file @
f3e83121
...
...
@@ -26,8 +26,11 @@ import org.springframework.http.HttpStatus;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
...
...
@@ -35,7 +38,6 @@ import java.util.stream.Collectors;
import
static
org
.
springframework
.
data
.
mongodb
.
core
.
aggregation
.
Aggregation
.*;
//import com.nisum.myteam.model.dao.Resource;
@RestController
@RequestMapping
(
"/reports"
)
...
...
@@ -218,6 +220,7 @@ public class ReportsController {
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
Map
<
String
,
List
<
GroupByCount
>>>>
getEmployeesByFunctionalGroup1
()
throws
MyTeamException
{
ProjectionOperation
projectToMatchModel
=
project
()
.
andExpression
(
"functionalGroup"
).
as
(
"name"
).
andExpression
(
"y"
)
.
as
(
"y"
);
...
...
@@ -308,6 +311,7 @@ public class ReportsController {
return
new
ResponseEntity
<>(
empList
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/billabilityByFunctionalGroup"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
...
...
@@ -354,7 +358,6 @@ public class ReportsController {
}
//Not Ok Response
@RequestMapping
(
value
=
"/getBillabilityDetailsByAccount"
,
method
=
RequestMethod
.
GET
,
...
...
@@ -362,7 +365,6 @@ public class ReportsController {
public
ResponseEntity
<
ColumnChartData
>
getBillabilityDetailsByAccount
()
throws
MyTeamException
{
ProjectionOperation
projectToMatchModel
=
project
()
.
andExpression
(
"account"
).
as
(
"categories"
)
.
andExpression
(
"billableStatus"
).
as
(
"seriesName"
)
...
...
@@ -388,12 +390,7 @@ public class ReportsController {
List
<
String
>
catagories
=
new
ArrayList
();
List
<
ReportSeriesRecord
>
seriesDetails
=
new
ArrayList
<
ReportSeriesRecord
>();
//List<Account> accounts = employeeService.getAccounts();
List
<
Account
>
accounts
=
accountService
.
getAllAccounts
();
List
<
Account
>
accounts
=
accountService
.
getAllAccounts
();
ColumnChartData
reportData
=
new
ColumnChartData
();
for
(
String
status
:
statusList
)
{
catagories
=
new
ArrayList
();
...
...
@@ -426,14 +423,11 @@ public class ReportsController {
}
System
.
out
.
println
(
seriesDetails
);
reportData
.
setCategoriesList
(
catagories
);
reportData
.
setSeriesDataList
(
seriesDetails
);
return
new
ResponseEntity
<>(
reportData
,
HttpStatus
.
OK
);
}
}
src/main/java/com/nisum/myteam/service/impl/DashboardService.java
View file @
f3e83121
...
...
@@ -111,18 +111,18 @@ public class DashboardService implements IDashboardService {
@Override
public
List
<
EmployeeDashboardVO
>
getDashBoardData
(){
List
<
EmployeeDashboardVO
>
employeeDashboard
=
new
ArrayList
<>();
List
<
Employee
>
allEmployees
=
employeeService
.
getAllEmployees
();
List
<
ResourceVO
>
resources
=
resourceService
.
getAllResourcesVO
();
List
<
EmployeeDashboardVO
>
employeeDashboard
List
=
new
ArrayList
<>();
List
<
Employee
>
allEmployees
List
=
employeeService
.
getAllEmployees
();
List
<
ResourceVO
>
resources
List
=
resourceService
.
getAllResourcesVO
();
for
(
Employee
employee:
allEmployees
){
for
(
Employee
employee:
allEmployees
List
){
EmployeeDashboardVO
employeeDashboardVO
=
new
EmployeeDashboardVO
();
BeanUtils
.
copyProperties
(
employee
,
employeeDashboardVO
);
employeeDashboard
.
add
(
employeeDashboardVO
);
employeeDashboard
List
.
add
(
employeeDashboardVO
);
}
employeeDashboard
.
stream
().
forEach
(
emp
->
{
List
<
ResourceVO
>
latestResourceList
=
resources
.
stream
().
employeeDashboard
List
.
stream
().
forEach
(
emp
->
{
List
<
ResourceVO
>
latestResourceList
=
resources
List
.
stream
().
filter
(
res
->
(
res
.
getEmployeeId
().
equals
(
emp
.
getEmployeeId
())&&
res
.
getBillingEndDate
().
after
(
new
Date
()))).
collect
(
Collectors
.
toList
());
if
(!
latestResourceList
.
isEmpty
()){
ResourceVO
latestResource
=
latestResourceList
.
get
(
0
);
...
...
@@ -139,6 +139,6 @@ public class DashboardService implements IDashboardService {
}
}
});
return
employeeDashboard
;
return
employeeDashboard
List
;
}
}
src/main/java/com/nisum/myteam/service/impl/EmployeeDataService.java
View file @
f3e83121
...
...
@@ -14,6 +14,7 @@ import java.util.List;
import
javax.transaction.Transactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -27,6 +28,7 @@ import com.nisum.myteam.utils.MyTeamUtils;
@Component
@Transactional
@Slf4j
public
class
EmployeeDataService
implements
IEmployeeDataService
{
@Autowired
...
...
@@ -93,6 +95,7 @@ public class EmployeeDataService implements IEmployeeDataService {
long
totalseconds
=
0
;
int
countHours
=
0
;
List
<
EmpLoginData
>
listOfEmpLoginData
=
new
ArrayList
<>();
log
.
info
(
"The Query going to execute::"
+
query
);
try
(
Connection
connection
=
dbConnection
.
getDBConnection
();
Statement
statement
=
connection
.
createStatement
();
ResultSet
resultSet
=
statement
.
executeQuery
(
query
.
toString
()))
{
...
...
src/main/java/com/nisum/myteam/service/impl/EmployeeService.java
View file @
f3e83121
...
...
@@ -290,10 +290,7 @@ public class EmployeeService implements IEmployeeService {
public
boolean
verifyEmployeeRole
(
String
empId
,
String
roleIdReq
)
{
boolean
flag
=
false
;
log
.
info
(
"The employeeId::"
+
empId
);
Employee
employee
=
getEmployeeById
(
empId
);
log
.
info
(
"Employee::::in EmployeeService::"
+
employee
);
String
roleName
=
employee
.
getRole
();
log
.
info
(
"The employee role::"
+
roleName
);
...
...
@@ -302,9 +299,7 @@ public class EmployeeService implements IEmployeeService {
if
(
ApplicationRole
.
FUNCTIONAL_MANAGER
.
getRoleName
().
equalsIgnoreCase
(
roleName
)
||
ApplicationRole
.
DELIVERY_LEAD
.
getRoleName
().
equalsIgnoreCase
(
roleName
))
{
flag
=
true
;
log
.
info
(
"in if block"
);
}
else
{
log
.
info
(
"in else block"
);
Set
<
String
>
roleSet
=
employeeRoleService
.
empRolesMapInfoByEmpId
(
empId
);
if
(
null
!=
roleSet
&&
!
roleSet
.
isEmpty
()
&&
MyTeamUtils
.
INT_ZERO
<
roleSet
.
size
())
{
if
(
roleSet
.
contains
(
roleIdReq
))
{
...
...
@@ -316,7 +311,6 @@ public class EmployeeService implements IEmployeeService {
}
log
.
info
(
"before return flag::"
+
flag
);
return
flag
;
}
...
...
src/main/webapp/WEB-INF/reports/0_2019-05-14_2019-05-14.pdf
deleted
100644 → 0
View file @
6574f8fd
File deleted
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