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
01fb8bfb
Commit
01fb8bfb
authored
May 13, 2019
by
Vijay Akula
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commented the ResourceController in order to take requests from new controller
parent
fed165ca
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
313 additions
and
313 deletions
+313
-313
BillingController.java
...n/java/com/nisum/myteam/controller/BillingController.java
+68
-68
DashboardController.java
...java/com/nisum/myteam/controller/DashboardController.java
+1
-1
ResourceAllocationController.java
...nisum/myteam/controller/ResourceAllocationController.java
+12
-12
ResourceController.java
.../java/com/nisum/myteam/controller/ResourceController.java
+222
-222
ResourceRepo.java
src/main/java/com/nisum/myteam/repository/ResourceRepo.java
+1
-1
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+9
-9
No files found.
src/main/java/com/nisum/myteam/controller/BillingController.java
View file @
01fb8bfb
package
com
.
nisum
.
myteam
.
controller
;
//
package com.nisum.myteam.controller;
//
import
java.util.List
;
//
import java.util.List;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.HttpStatus
;
//
import org.springframework.http.HttpStatus;
import
org.springframework.http.MediaType
;
//
import org.springframework.http.MediaType;
import
org.springframework.http.ResponseEntity
;
//
import org.springframework.http.ResponseEntity;
import
org.springframework.web.bind.annotation.PathVariable
;
//
import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.RequestBody
;
//
import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
//
import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
//
import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RequestParam
;
//
import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
//
import org.springframework.web.bind.annotation.RestController;
import
com.nisum.myteam.exception.handler.MyTeamException
;
//
import com.nisum.myteam.exception.handler.MyTeamException;
import
com.nisum.myteam.model.dao.Billing
;
//
import com.nisum.myteam.model.dao.Billing;
import
com.nisum.myteam.service.IBillingService
;
//
import com.nisum.myteam.service.IBillingService;
import
lombok.extern.slf4j.Slf4j
;
//
import lombok.extern.slf4j.Slf4j;
//
@RestController
//
@RestController
@Slf4j
//
@Slf4j
public
class
BillingController
{
//
public class BillingController {
//
@Autowired
//
@Autowired
private
IBillingService
billingService
;
//
private IBillingService billingService;
//
// @RequestMapping(value = "/addEmployeeBilling"
//
// @RequestMapping(value = "/addEmployeeBilling"
@RequestMapping
(
value
=
"/billing"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
//
@RequestMapping(value = "/billing", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public
ResponseEntity
<
Billing
>
addEmployeeBilling
(
@RequestBody
Billing
billing
,
//
public ResponseEntity<Billing> addEmployeeBilling(@RequestBody Billing billing,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTeamException
{
//
@RequestParam(value = "loginEmpId") String loginEmpId) throws MyTeamException {
Billing
billingList
=
billingService
.
addBilling
(
billing
,
loginEmpId
);
//
Billing billingList = billingService.addBilling(billing, loginEmpId);
//
return
new
ResponseEntity
<>(
billingList
,
HttpStatus
.
OK
);
//
return new ResponseEntity<>(billingList, HttpStatus.OK);
}
//
}
//
// @RequestMapping(value = "/updateEmployeeBilling",
//
// @RequestMapping(value = "/updateEmployeeBilling",
@RequestMapping
(
value
=
"/billing"
,
method
=
RequestMethod
.
PUT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
//
@RequestMapping(value = "/billing", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public
ResponseEntity
<
Billing
>
updateEmployeeBilling
(
@RequestBody
Billing
billing
,
//
public ResponseEntity<Billing> updateEmployeeBilling(@RequestBody Billing billing,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTeamException
{
//
@RequestParam(value = "loginEmpId") String loginEmpId) throws MyTeamException {
Billing
billingList
=
billingService
.
updateBilling
(
billing
,
loginEmpId
);
//
Billing billingList = billingService.updateBilling(billing, loginEmpId);
return
new
ResponseEntity
<>(
billingList
,
HttpStatus
.
OK
);
//
return new ResponseEntity<>(billingList, HttpStatus.OK);
}
//
}
//
// @RequestMapping(value = "/deleteEmployeeBilling"
//
// @RequestMapping(value = "/deleteEmployeeBilling"
@RequestMapping
(
value
=
"/billing"
,
method
=
RequestMethod
.
DELETE
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
//
@RequestMapping(value = "/billing", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public
ResponseEntity
<
Billing
>
deleteEmployeeBilling
(
@RequestBody
Billing
billing
)
throws
MyTeamException
{
//
public ResponseEntity<Billing> deleteEmployeeBilling(@RequestBody Billing billing) throws MyTeamException {
billingService
.
deleteBilling
(
billing
);
//
billingService.deleteBilling(billing);
return
new
ResponseEntity
<>(
null
,
HttpStatus
.
OK
);
//
return new ResponseEntity<>(null, HttpStatus.OK);
}
//
}
//
//
//
// @RequestMapping(value = "/getEmployeeBillingDetailsAll"
//
// @RequestMapping(value = "/getEmployeeBillingDetailsAll"
@RequestMapping
(
value
=
"/billing"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
//
@RequestMapping(value = "/billing", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public
ResponseEntity
<
List
<
Billing
>>
getAllBillingsForEmployee
(
@RequestParam
(
"employeeId"
)
String
employeeId
)
//
public ResponseEntity<List<Billing>> getAllBillingsForEmployee(@RequestParam("employeeId") String employeeId)
throws
MyTeamException
{
//
throws MyTeamException {
List
<
Billing
>
billingList
=
billingService
.
getBillingsForEmployee
(
employeeId
);
//
List<Billing> billingList = billingService.getBillingsForEmployee(employeeId);
return
new
ResponseEntity
<>(
billingList
,
HttpStatus
.
OK
);
//
return new ResponseEntity<>(billingList, HttpStatus.OK);
}
//
}
//
// @RequestMapping(value = "/getEmployeeBillingDetails"
//
// @RequestMapping(value = "/getEmployeeBillingDetails"
@RequestMapping
(
value
=
"/billing/project/{projectId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
//
@RequestMapping(value = "/billing/project/{projectId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public
ResponseEntity
<
List
<
Billing
>>
getBillingsForProject
(
@PathVariable
(
"projectId"
)
String
projectId
,
//
public ResponseEntity<List<Billing>> getBillingsForProject(@PathVariable("projectId") String projectId,
@RequestParam
(
"employeeId"
)
String
employeeId
)
throws
MyTeamException
{
//
@RequestParam("employeeId") String employeeId) throws MyTeamException {
List
<
Billing
>
billingList
=
billingService
.
getBillingsForProject
(
employeeId
,
projectId
);
//
List<Billing> billingList = billingService.getBillingsForProject(employeeId, projectId);
return
new
ResponseEntity
<>(
billingList
,
HttpStatus
.
OK
);
//
return new ResponseEntity<>(billingList, HttpStatus.OK);
}
//
}
//
}
//
}
src/main/java/com/nisum/myteam/controller/DashboardController.java
View file @
01fb8bfb
...
@@ -25,7 +25,7 @@ public class DashboardController {
...
@@ -25,7 +25,7 @@ public class DashboardController {
@Autowired
@Autowired
private
IDashboardService
dashboardService
;
private
IDashboardService
dashboardService
;
@RequestMapping
(
value
=
"/resource
Allocation
/getEmployeesDashBoard"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/getEmployeesDashBoard"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getEmployeesDashBoard
(
HttpServletRequest
request
)
throws
MyTeamException
{
public
ResponseEntity
<?>
getEmployeesDashBoard
(
HttpServletRequest
request
)
throws
MyTeamException
{
List
<
EmployeeDashboardVO
>
employeeDashBoardList
=
dashboardService
.
getEmployeesDashBoard
();
List
<
EmployeeDashboardVO
>
employeeDashBoardList
=
dashboardService
.
getEmployeesDashBoard
();
...
...
src/main/java/com/nisum/myteam/controller/ResourceAllocationController.java
View file @
01fb8bfb
...
@@ -41,7 +41,7 @@ public class ResourceAllocationController {
...
@@ -41,7 +41,7 @@ public class ResourceAllocationController {
private
ResourceAllocationService
resourceAllocService
;
private
ResourceAllocationService
resourceAllocService
;
//tested in all the cases.ok
//tested in all the cases.ok
@RequestMapping
(
value
=
"/resource
Allocation
"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
createResource
(
@RequestBody
ResourceAllocation
resourceAllocationReq
,
public
ResponseEntity
<?>
createResource
(
@RequestBody
ResourceAllocation
resourceAllocationReq
,
@RequestParam
(
value
=
"loginEmpId"
,
required
=
true
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
@RequestParam
(
value
=
"loginEmpId"
,
required
=
true
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
if
(
StringUtils
.
isNotBlank
(
loginEmpId
))
{
if
(
StringUtils
.
isNotBlank
(
loginEmpId
))
{
...
@@ -73,7 +73,7 @@ public class ResourceAllocationController {
...
@@ -73,7 +73,7 @@ public class ResourceAllocationController {
}
}
//tested in all the cases.ok
//tested in all the cases.ok
@RequestMapping
(
value
=
"/resource
Allocation
"
,
method
=
RequestMethod
.
PUT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
"
,
method
=
RequestMethod
.
PUT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
updateResource
(
@RequestBody
ResourceAllocation
resourceAllocationReq
,
public
ResponseEntity
<?>
updateResource
(
@RequestBody
ResourceAllocation
resourceAllocationReq
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
...
@@ -95,7 +95,7 @@ public class ResourceAllocationController {
...
@@ -95,7 +95,7 @@ public class ResourceAllocationController {
}
}
//Tested Ok
//Tested Ok
@RequestMapping
(
value
=
"/resource
Allocation
"
,
method
=
RequestMethod
.
DELETE
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
"
,
method
=
RequestMethod
.
DELETE
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
deleteResource
(
@RequestBody
ResourceAllocation
resourceReq
,
public
ResponseEntity
<?>
deleteResource
(
@RequestBody
ResourceAllocation
resourceReq
,
@RequestParam
(
value
=
"loginEmpId"
,
required
=
true
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
@RequestParam
(
value
=
"loginEmpId"
,
required
=
true
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
if
(
StringUtils
.
isNotBlank
(
loginEmpId
))
{
if
(
StringUtils
.
isNotBlank
(
loginEmpId
))
{
...
@@ -115,7 +115,7 @@ public class ResourceAllocationController {
...
@@ -115,7 +115,7 @@ public class ResourceAllocationController {
//Ok Tested in all of the cases
//Ok Tested in all of the cases
@RequestMapping
(
value
=
"/resource
Allocation
/project/{projectId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/project/{projectId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getResourcesForProject
(
@PathVariable
(
value
=
"projectId"
,
required
=
true
)
String
projectId
,
public
ResponseEntity
<?>
getResourcesForProject
(
@PathVariable
(
value
=
"projectId"
,
required
=
true
)
String
projectId
,
@RequestParam
(
value
=
"status"
,
required
=
false
,
defaultValue
=
MyTeamUtils
.
ACTIVE
)
String
status
,
@RequestParam
(
value
=
"status"
,
required
=
false
,
defaultValue
=
MyTeamUtils
.
ACTIVE
)
String
status
,
HttpServletRequest
request
)
HttpServletRequest
request
)
...
@@ -135,7 +135,7 @@ public class ResourceAllocationController {
...
@@ -135,7 +135,7 @@ public class ResourceAllocationController {
//ok
//ok
///getMyProjectAllocations
///getMyProjectAllocations
@RequestMapping
(
value
=
"/resource
Allocation
/getMyProjectAllocations"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/getMyProjectAllocations"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getMyProjectAllocations
(
public
ResponseEntity
<?>
getMyProjectAllocations
(
@RequestParam
(
"employeeId"
)
String
employeeId
,
HttpServletRequest
request
)
throws
MyTeamException
{
@RequestParam
(
"employeeId"
)
String
employeeId
,
HttpServletRequest
request
)
throws
MyTeamException
{
...
@@ -155,7 +155,7 @@ public class ResourceAllocationController {
...
@@ -155,7 +155,7 @@ public class ResourceAllocationController {
//ok
//ok
///resourceAllocation/projects has to be changed to /resourceAllocation/activeProjects
///resourceAllocation/projects has to be changed to /resourceAllocation/activeProjects
@RequestMapping
(
value
=
"/resource
Allocation
/projects"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/projects"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getResourcesAllocatedForAllProjects
(
HttpServletRequest
request
)
throws
MyTeamException
{
public
ResponseEntity
<?>
getResourcesAllocatedForAllProjects
(
HttpServletRequest
request
)
throws
MyTeamException
{
List
<
ResourceAllocation
>
resourcesList
=
resourceAllocService
.
getAllResourcesForAllActiveProjects
();
List
<
ResourceAllocation
>
resourcesList
=
resourceAllocService
.
getAllResourcesForAllActiveProjects
();
...
@@ -167,7 +167,7 @@ public class ResourceAllocationController {
...
@@ -167,7 +167,7 @@ public class ResourceAllocationController {
//ok //Getting Current active resource record
//ok //Getting Current active resource record
@RequestMapping
(
value
=
"/resource
Allocation
/employeeId/{employeeId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/employeeId/{employeeId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getResourcesSortByProjectStartDate
(
@PathVariable
(
value
=
"employeeId"
,
required
=
true
)
String
employeeId
,
HttpServletRequest
request
)
public
ResponseEntity
<?>
getResourcesSortByProjectStartDate
(
@PathVariable
(
value
=
"employeeId"
,
required
=
true
)
String
employeeId
,
HttpServletRequest
request
)
throws
MyTeamException
{
throws
MyTeamException
{
...
@@ -186,7 +186,7 @@ public class ResourceAllocationController {
...
@@ -186,7 +186,7 @@ public class ResourceAllocationController {
//ok tested
//ok tested
@RequestMapping
(
value
=
"/resource
Allocation
/active"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/active"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getActiveResources
(
@RequestParam
(
value
=
"employeeId"
,
required
=
false
)
String
employeeId
,
HttpServletRequest
request
)
public
ResponseEntity
<?>
getActiveResources
(
@RequestParam
(
value
=
"employeeId"
,
required
=
false
)
String
employeeId
,
HttpServletRequest
request
)
throws
MyTeamException
{
throws
MyTeamException
{
if
(
StringUtils
.
isNotBlank
(
employeeId
))
{
if
(
StringUtils
.
isNotBlank
(
employeeId
))
{
...
@@ -205,7 +205,7 @@ public class ResourceAllocationController {
...
@@ -205,7 +205,7 @@ public class ResourceAllocationController {
//ok working
//ok working
@RequestMapping
(
value
=
"/resource
Allocation
/deliverylead/{deliveryLeadId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/deliverylead/{deliveryLeadId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getTeamDetails
(
@PathVariable
(
value
=
"deliveryLeadId"
,
required
=
true
)
String
deliveryLeadId
,
HttpServletRequest
request
)
public
ResponseEntity
<?>
getTeamDetails
(
@PathVariable
(
value
=
"deliveryLeadId"
,
required
=
true
)
String
deliveryLeadId
,
HttpServletRequest
request
)
throws
MyTeamException
{
throws
MyTeamException
{
...
@@ -224,7 +224,7 @@ public class ResourceAllocationController {
...
@@ -224,7 +224,7 @@ public class ResourceAllocationController {
}
}
//ok tested working
//ok tested working
@RequestMapping
(
value
=
"/resource
Allocation
/unAssignedEmployees"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/unAssignedEmployees"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getUnAssignedEmployees
(
HttpServletRequest
request
)
throws
MyTeamException
{
public
ResponseEntity
<?>
getUnAssignedEmployees
(
HttpServletRequest
request
)
throws
MyTeamException
{
List
<
Employee
>
employeesList
=
resourceAllocService
.
getUnAssignedEmployees
();
List
<
Employee
>
employeesList
=
resourceAllocService
.
getUnAssignedEmployees
();
...
@@ -235,7 +235,7 @@ public class ResourceAllocationController {
...
@@ -235,7 +235,7 @@ public class ResourceAllocationController {
//@RequestMapping(value = "/getEmployeeBillingDetailsAll"
//@RequestMapping(value = "/getEmployeeBillingDetailsAll"
@RequestMapping
(
value
=
"/resource
Allocation
/billing"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/billing"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
ResourceAllocation
>>
getAllBillingsForEmployee
(
@RequestParam
(
"employeeId"
)
String
employeeId
)
public
ResponseEntity
<
List
<
ResourceAllocation
>>
getAllBillingsForEmployee
(
@RequestParam
(
"employeeId"
)
String
employeeId
)
throws
MyTeamException
{
throws
MyTeamException
{
List
<
ResourceAllocation
>
resourceAllocList
=
resourceAllocService
.
getBillingsForEmployee
(
employeeId
);
List
<
ResourceAllocation
>
resourceAllocList
=
resourceAllocService
.
getBillingsForEmployee
(
employeeId
);
...
@@ -243,7 +243,7 @@ public class ResourceAllocationController {
...
@@ -243,7 +243,7 @@ public class ResourceAllocationController {
}
}
// @RequestMapping(value = "/getEmployeeBillingDetails"
// @RequestMapping(value = "/getEmployeeBillingDetails"
@RequestMapping
(
value
=
"/resource
Allocation
/billing/project/{projectId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/resource
s
/billing/project/{projectId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
ResourceAllocation
>>
getBillingsForProject
(
@PathVariable
(
"projectId"
)
String
projectId
,
public
ResponseEntity
<
List
<
ResourceAllocation
>>
getBillingsForProject
(
@PathVariable
(
"projectId"
)
String
projectId
,
@RequestParam
(
"employeeId"
)
String
employeeId
)
throws
MyTeamException
{
@RequestParam
(
"employeeId"
)
String
employeeId
)
throws
MyTeamException
{
List
<
ResourceAllocation
>
resourceAllocList
=
resourceAllocService
.
getBillingsForProject
(
employeeId
,
projectId
);
List
<
ResourceAllocation
>
resourceAllocList
=
resourceAllocService
.
getBillingsForProject
(
employeeId
,
projectId
);
...
...
src/main/java/com/nisum/myteam/controller/ResourceController.java
View file @
01fb8bfb
This diff is collapsed.
Click to expand it.
src/main/java/com/nisum/myteam/repository/ResourceRepo.java
View file @
01fb8bfb
...
@@ -24,6 +24,6 @@ public interface ResourceRepo
...
@@ -24,6 +24,6 @@ public interface ResourceRepo
List
<
Resource
>
findByEmployeeIdAndProjectIdAndActive
(
String
employeeId
,
String
projectId
,
boolean
status
);
List
<
Resource
>
findByEmployeeIdAndProjectIdAndActive
(
String
employeeId
,
String
projectId
,
boolean
status
);
List
<
Resource
>
findByAccountAndActiveAndBillableStatus
(
String
account
,
boolean
status
,
String
billableStatus
);
List
<
Resource
>
findByAccountAndActiveAndBillableStatus
(
String
account
,
boolean
status
,
String
billableStatus
);
Optional
<
List
<
Resource
>>
findByActiveAndShiftLikeOrderByEmployeeIdDesc
(
boolean
active
,
String
shift
);
Optional
<
List
<
Resource
>>
findByActiveAndShiftLikeOrderByEmployeeIdDesc
(
boolean
active
,
String
shift
);
}
}
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
01fb8bfb
...
@@ -76,7 +76,7 @@ public class ResourceService implements IResourceService {
...
@@ -76,7 +76,7 @@ public class ResourceService implements IResourceService {
resourceReq
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
CREATE
);
resourceReq
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
CREATE
);
Resource
resourcePersisted
=
resourceRepo
.
save
(
resourceReq
);
Resource
resourcePersisted
=
resourceRepo
.
save
(
resourceReq
);
// Get Active billings for Nisum Bench Project.
// Get Active billings for Nisum Bench Project.
List
<
Billing
>
listBD
=
billingService
.
getActiveBillings
(
resourcePersisted
.
getEmployeeId
(),
"Nisum0000"
);
List
<
Billing
>
listBD
=
billingService
.
getActiveBillings
(
resourcePersisted
.
getEmployeeId
(),
"Nisum0000"
);
...
@@ -586,23 +586,23 @@ public class ResourceService implements IResourceService {
...
@@ -586,23 +586,23 @@ public class ResourceService implements IResourceService {
return
resourcesList
;
return
resourcesList
;
}
}
@Override
@Override
public
List
<
Resource
>
getResourcesUnderDeliveryLead
(
String
deliveryLeadId
)
{
public
List
<
Resource
>
getResourcesUnderDeliveryLead
(
String
deliveryLeadId
)
{
List
<
String
>
projectIdsList
=
new
ArrayList
<>();
List
<
String
>
projectIdsList
=
new
ArrayList
<>();
List
<
Resource
>
resourcesList
=
new
ArrayList
<>();
List
<
Resource
>
resourcesList
=
new
ArrayList
<>();
List
<
Project
>
projectsList
=
projectRepo
.
findByDeliveryLeadIds
(
deliveryLeadId
);
List
<
Project
>
projectsList
=
projectRepo
.
findByDeliveryLeadIds
(
deliveryLeadId
);
for
(
Project
project
:
projectsList
)
for
(
Project
project
:
projectsList
)
projectIdsList
.
add
(
project
.
getProjectId
());
projectIdsList
.
add
(
project
.
getProjectId
());
Query
query
=
new
Query
(
Criteria
.
where
(
"projectId"
).
in
(
projectIdsList
));
Query
query
=
new
Query
(
Criteria
.
where
(
"projectId"
).
in
(
projectIdsList
));
List
<
Resource
>
resourcesListPersisted
=
mongoTemplate
.
find
(
query
,
Resource
.
class
);
List
<
Resource
>
resourcesListPersisted
=
mongoTemplate
.
find
(
query
,
Resource
.
class
);
for
(
Resource
resource
:
resourcesListPersisted
)
{
for
(
Resource
resource
:
resourcesListPersisted
)
{
if
(!
resource
.
getEmployeeId
().
equals
(
deliveryLeadId
))
if
(!
resource
.
getEmployeeId
().
equals
(
deliveryLeadId
))
resourcesList
.
add
(
resource
);
resourcesList
.
add
(
resource
);
...
...
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