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
49d725f8
Commit
49d725f8
authored
May 21, 2019
by
Vijay Akula
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed the references of ResourceAlloc to resources in all other files
parent
066543e3
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
158 additions
and
161 deletions
+158
-161
ReportsController.java
...n/java/com/nisum/myteam/controller/ReportsController.java
+8
-9
ResourceController.java
.../java/com/nisum/myteam/controller/ResourceController.java
+31
-31
Resource.java
src/main/java/com/nisum/myteam/model/dao/Resource.java
+1
-1
ResourceRepo.java
src/main/java/com/nisum/myteam/repository/ResourceRepo.java
+6
-7
IProjectService.java
src/main/java/com/nisum/myteam/service/IProjectService.java
+2
-2
IResourceService.java
src/main/java/com/nisum/myteam/service/IResourceService.java
+12
-12
DashboardService.java
.../java/com/nisum/myteam/service/impl/DashboardService.java
+3
-4
EmployeeService.java
...n/java/com/nisum/myteam/service/impl/EmployeeService.java
+1
-1
ProjectService.java
...in/java/com/nisum/myteam/service/impl/ProjectService.java
+8
-8
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+86
-86
No files found.
src/main/java/com/nisum/myteam/controller/ReportsController.java
View file @
49d725f8
...
...
@@ -4,12 +4,11 @@ import com.nisum.myteam.exception.handler.MyTeamException;
import
com.nisum.myteam.model.ColumnChartData
;
import
com.nisum.myteam.model.GroupByCount
;
import
com.nisum.myteam.model.ReportSeriesRecord
;
import
com.nisum.myteam.model.dao.Account
;
import
com.nisum.myteam.model.dao.Employee
;
import
com.nisum.myteam.model.dao.Resource
Allocation
;
import
com.nisum.myteam.model.dao.Resource
;
import
com.nisum.myteam.model.vo.ResourceVO
;
import
com.nisum.myteam.service.IEmployeeService
;
import
com.nisum.myteam.service.IResource
Allocation
Service
;
import
com.nisum.myteam.service.IResourceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
...
...
@@ -47,7 +46,7 @@ public class ReportsController {
private
IEmployeeService
employeeService
;
@Autowired
private
IResource
Allocation
Service
resourceService
;
private
IResourceService
resourceService
;
//Ok Response
@RequestMapping
(
value
=
"/getEmployeesByFunctionalGroup1"
,
...
...
@@ -132,7 +131,7 @@ public class ReportsController {
// Convert the aggregation result into a List
AggregationResults<ColumnChartData> groupResults = mongoTemplate.aggregate(aggregate, Resource
Allocation
.class,
AggregationResults<ColumnChartData> groupResults = mongoTemplate.aggregate(aggregate, Resource.class,
ColumnChartData.class);
List<ColumnChartData> result = groupResults.getMappedResults();
List<String> statusList = new ArrayList();
...
...
@@ -246,7 +245,7 @@ public class ReportsController {
// Convert the aggregation result into a List
AggregationResults
<
ColumnChartData
>
groupResults1
=
mongoTemplate
.
aggregate
(
agg1
,
Resource
Allocation
.
class
,
.
aggregate
(
agg1
,
Resource
.
class
,
ColumnChartData
.
class
);
List
<
ColumnChartData
>
result1
=
groupResults1
.
getMappedResults
();
...
...
@@ -341,11 +340,11 @@ public class ReportsController {
@RequestMapping
(
value
=
"/fetchEmployeeDetailsByDateBillability"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
Resource
Allocation
>>
fetchEmployeeDetailsByDateBillability
(
public
ResponseEntity
<
List
<
Resource
>>
fetchEmployeeDetailsByDateBillability
(
@RequestParam
(
"billabilityStatus"
)
String
billabilityStatus
,
@RequestParam
(
"reportDate"
)
String
reportDateString
)
throws
MyTeamException
{
List
<
Resource
Allocation
>
empList
=
new
ArrayList
<>();
List
<
Resource
>
empList
=
new
ArrayList
<>();
if
(
reportDateString
!=
null
&&
!
reportDateString
.
isEmpty
())
{
String
pattern
=
"MM-dd-yyyy"
;
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
pattern
);
...
...
@@ -368,7 +367,7 @@ public class ReportsController {
criteriaV1
.
orOperator
(
criteriaV21
,
criteriaV22
));
Query
query
=
new
Query
();
query
.
addCriteria
(
criteriaV221
);
empList
=
mongoTemplate
.
find
(
query
,
Resource
Allocation
.
class
);
empList
=
mongoTemplate
.
find
(
query
,
Resource
.
class
);
}
return
new
ResponseEntity
<>(
empList
,
HttpStatus
.
OK
);
}
...
...
src/main/java/com/nisum/myteam/controller/ResourceController.java
View file @
49d725f8
This diff is collapsed.
Click to expand it.
src/main/java/com/nisum/myteam/model/dao/Resource.java
View file @
49d725f8
...
...
@@ -17,7 +17,7 @@ import java.util.Date;
@NoArgsConstructor
@ToString
@Document
(
collection
=
"resourceAllocation"
)
public
class
Resource
Allocation
extends
AuditFields
implements
Serializable
{
public
class
Resource
extends
AuditFields
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
src/main/java/com/nisum/myteam/repository/ResourceRepo.java
View file @
49d725f8
...
...
@@ -2,22 +2,21 @@ package com.nisum.myteam.repository;
import
com.nisum.myteam.model.dao.Resource
;
import
com.nisum.myteam.model.dao.ResourceAllocation
;
import
org.bson.types.ObjectId
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
java.util.List
;
public
interface
Resource
Allocation
Repo
extends
MongoRepository
<
Resource
Allocation
,
String
>
{
public
interface
ResourceRepo
extends
MongoRepository
<
Resource
,
String
>
{
List
<
Resource
Allocation
>
findByProjectId
(
String
projectId
);
List
<
Resource
>
findByProjectId
(
String
projectId
);
List
<
Resource
Allocation
>
findByEmployeeId
(
String
employeeId
);
List
<
Resource
>
findByEmployeeId
(
String
employeeId
);
Resource
Allocation
findById
(
ObjectId
id
);
Resource
findById
(
ObjectId
id
);
List
<
Resource
Allocation
>
findByEmployeeIdAndProjectId
(
String
employeeId
,
String
projectId
);
List
<
Resource
>
findByEmployeeIdAndProjectId
(
String
employeeId
,
String
projectId
);
// List<Resource> findByEmployeeIdAndActive(String employeeId, boolean status);
...
...
src/main/java/com/nisum/myteam/service/IProjectService.java
View file @
49d725f8
...
...
@@ -4,7 +4,7 @@ import com.nisum.myteam.exception.handler.MyTeamException;
import
com.nisum.myteam.model.dao.Account
;
import
com.nisum.myteam.model.dao.EmpLoginData
;
import
com.nisum.myteam.model.dao.Project
;
import
com.nisum.myteam.model.dao.Resource
Allocation
;
import
com.nisum.myteam.model.dao.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -58,7 +58,7 @@ public interface IProjectService {
public
List
<
Project
>
getProjectsForDeliveryLead
(
String
deliveryLeadId
);
List
<
Resource
Allocation
>
getResourcesUnderProject
(
String
empId
);
List
<
Resource
>
getResourcesUnderProject
(
String
empId
);
}
src/main/java/com/nisum/myteam/service/IResourceService.java
View file @
49d725f8
...
...
@@ -2,40 +2,40 @@ package com.nisum.myteam.service;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.dao.Employee
;
import
com.nisum.myteam.model.dao.Resource
Allocation
;
import
com.nisum.myteam.model.dao.Resource
;
import
com.nisum.myteam.model.vo.EmployeeShiftsVO
;
import
com.nisum.myteam.model.vo.MyProjectAllocationVO
;
import
com.nisum.myteam.model.vo.ResourceVO
;
import
java.util.List
;
public
interface
IResource
Allocation
Service
{
public
interface
IResourceService
{
Resource
Allocation
addResourceAllocation
(
ResourceAllocation
resourceAllocation
,
String
loginEmpId
)
throws
MyTeamException
;
Resource
addResource
(
Resource
resourceAllocation
,
String
loginEmpId
)
throws
MyTeamException
;
public
void
updateExistedResource
Alloc
(
ResourceAllocation
resourceAlloc
)
throws
MyTeamException
;
public
void
updateExistedResource
(
Resource
resourceAlloc
)
throws
MyTeamException
;
public
void
insertNewResource
AllocWithNewStatus
(
ResourceAllocation
resourceAllocReq
,
String
loginEmpId
)
throws
MyTeamException
;
public
void
insertNewResource
WithNewStatus
(
Resource
resourceAllocReq
,
String
loginEmpId
)
throws
MyTeamException
;
void
deleteResource
(
Resource
Allocation
resource
,
String
loginEmpId
);
void
deleteResource
(
Resource
resource
,
String
loginEmpId
);
List
<
Resource
Allocation
>
getAllResourcesForAllActiveProjects
();
List
<
Resource
>
getAllResourcesForAllActiveProjects
();
List
<
Resource
Allocation
>
getResourcesSortByBillingStartDate
(
String
employeeId
);
List
<
Resource
>
getResourcesSortByBillingStartDate
(
String
employeeId
);
List
<
ResourceVO
>
getActiveResources
(
String
empId
);
public
List
<
ResourceVO
>
getResourcesForProject
(
String
projectId
,
String
statusFlag
);
public
List
<
Resource
Allocation
>
getResourcesUnderDeliveryLead
(
String
empId
);
public
List
<
Resource
>
getResourcesUnderDeliveryLead
(
String
empId
);
public
List
<
ResourceVO
>
getBillingsForEmployee
(
String
empId
);
public
List
<
Resource
Allocation
>
getBillingsForProject
(
String
empId
,
String
projectId
);
public
List
<
Resource
>
getBillingsForProject
(
String
empId
,
String
projectId
);
public
List
<
MyProjectAllocationVO
>
getWorkedProjectsForResource
(
String
empId
);
...
...
@@ -43,13 +43,13 @@ public interface IResourceAllocationService {
public
List
<
Employee
>
getUnAssignedEmployees
();
public
List
<
Resource
Allocation
>
getAllResources
();
public
List
<
Resource
>
getAllResources
();
public
List
<
ResourceVO
>
getAllResourcesVO
();
public
void
deleteResourcesUnderProject
(
String
projectId
);
public
Resource
Allocation
addResourceToBenchProject
(
Employee
employee
,
String
loginEmpId
)
throws
MyTeamException
;
public
Resource
addResourceToBenchProject
(
Employee
employee
,
String
loginEmpId
)
throws
MyTeamException
;
public
List
<
EmployeeShiftsVO
>
getResourcesForShift
(
String
shift
);
...
...
src/main/java/com/nisum/myteam/service/impl/DashboardService.java
View file @
49d725f8
...
...
@@ -2,13 +2,12 @@ package com.nisum.myteam.service.impl;
import
com.nisum.myteam.model.dao.Employee
;
import
com.nisum.myteam.model.dao.Project
;
import
com.nisum.myteam.model.dao.ResourceAllocation
;
import
com.nisum.myteam.model.vo.EmployeeDashboardVO
;
import
com.nisum.myteam.model.vo.ResourceVO
;
import
com.nisum.myteam.service.IDashboardService
;
import
com.nisum.myteam.service.IEmployeeService
;
import
com.nisum.myteam.service.IProjectService
;
import
com.nisum.myteam.service.IResource
Allocation
Service
;
import
com.nisum.myteam.service.IResourceService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -24,7 +23,7 @@ public class DashboardService implements IDashboardService {
private
IEmployeeService
employeeService
;
@Autowired
private
IResource
Allocation
Service
resourceService
;
private
IResourceService
resourceService
;
@Autowired
private
IProjectService
projectService
;
...
...
@@ -39,7 +38,7 @@ public class DashboardService implements IDashboardService {
Map
<
String
,
Object
>
teamMatesStatusMap
=
new
HashMap
();
// Find all active employees
//List<Resource
Allocation
> resources = resourceService.getAllResources();
//List<Resource> resources = resourceService.getAllResources();
List
<
ResourceVO
>
resources
=
resourceService
.
getAllResourcesVO
();
...
...
src/main/java/com/nisum/myteam/service/impl/EmployeeService.java
View file @
49d725f8
...
...
@@ -49,7 +49,7 @@ public class EmployeeService implements IEmployeeService {
private
IEmployeeLocationService
empLocationService
;
@Autowired
private
IResource
Allocation
Service
resourceService
;
private
IResourceService
resourceService
;
@Override
public
Employee
createEmployee
(
Employee
employee
,
String
loginEmpId
)
throws
MyTeamException
{
...
...
src/main/java/com/nisum/myteam/service/impl/ProjectService.java
View file @
49d725f8
...
...
@@ -40,7 +40,7 @@ public class ProjectService implements IProjectService {
private
IDomainService
domainService
;
@Autowired
private
Resource
AllocationService
resourceAlloc
Service
;
private
Resource
Service
resource
Service
;
@Autowired
private
IEmployeeService
employeeService
;
...
...
@@ -130,7 +130,7 @@ public class ProjectService implements IProjectService {
Project
project
=
projectRepo
.
findByProjectId
(
projectId
);
projectRepo
.
delete
(
project
);
resource
Alloc
Service
.
deleteResourcesUnderProject
(
projectId
);
resourceService
.
deleteResourcesUnderProject
(
projectId
);
}
...
...
@@ -198,19 +198,19 @@ public class ProjectService implements IProjectService {
}
@Override
public
List
<
Resource
Allocation
>
getResourcesUnderProject
(
String
empId
)
{
public
List
<
Resource
>
getResourcesUnderProject
(
String
empId
)
{
List
<
String
>
projectsIdsList
=
new
ArrayList
<>();
List
<
Resource
Allocation
>
resourcesList
=
new
ArrayList
<>();
List
<
Resource
>
resourcesList
=
new
ArrayList
<>();
List
<
Project
>
projectsList
=
projectRepo
.
findByDeliveryLeadIds
(
empId
);
for
(
Project
project
:
projectsList
)
projectsIdsList
.
add
(
project
.
getProjectId
());
Query
query
=
new
Query
(
Criteria
.
where
(
"projectId"
).
in
(
projectsIdsList
));
List
<
Resource
Allocation
>
resourcesListPersisted
=
mongoTemplate
.
find
(
query
,
ResourceAllocation
.
class
);
List
<
Resource
>
resourcesListPersisted
=
mongoTemplate
.
find
(
query
,
Resource
.
class
);
for
(
Resource
Allocation
resource
:
resourcesListPersisted
)
{
for
(
Resource
resource
:
resourcesListPersisted
)
{
if
(!
resource
.
getEmployeeId
().
equals
(
empId
))
resourcesList
.
add
(
resource
);
}
...
...
@@ -247,7 +247,7 @@ public class ProjectService implements IProjectService {
}
private
String
validateAgainstDOJ
(
Resource
Allocation
resource
)
{
private
String
validateAgainstDOJ
(
Resource
resource
)
{
String
response
=
null
;
Date
empDoj
=
employeeService
.
getEmployeeById
(
resource
.
getEmployeeId
()).
getDateOfJoining
();
if
(
resource
.
getBillingStartDate
().
compareTo
(
empDoj
)
<
0
)
{
...
...
@@ -405,7 +405,7 @@ public class ProjectService implements IProjectService {
// public Resource addNewBeanchAllocation(Employee employee, String loginEmpId) {
// Resource
Allocation
resourcePersisted = null;
// Resource resourcePersisted = null;
// Resource resourceBench = new Resource();
// resourceBench.setAccount(MyTeamUtils.BENCH_ACCOUNT);
// resourceBench.setBillableStatus(MyTeamUtils.BENCH_BILLABILITY_STATUS);
...
...
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
49d725f8
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