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
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
303 additions
and
303 deletions
+303
-303
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
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
package
com
.
nisum
.
myteam
.
controller
;
//package com.nisum.myteam.controller;
//
import
com.nisum.myteam.exception.handler.MyTeamException
;
//import com.nisum.myteam.exception.handler.MyTeamException;
import
com.nisum.myteam.exception.handler.ResponseDetails
;
//import com.nisum.myteam.exception.handler.ResponseDetails;
import
com.nisum.myteam.model.dao.Employee
;
//import com.nisum.myteam.model.dao.Employee;
import
com.nisum.myteam.model.dao.EmployeeVisa
;
//import com.nisum.myteam.model.dao.EmployeeVisa;
import
com.nisum.myteam.model.dao.Resource
;
//import com.nisum.myteam.model.dao.Resource;
import
com.nisum.myteam.model.vo.EmployeeDashboardVO
;
//import com.nisum.myteam.model.vo.EmployeeDashboardVO;
import
com.nisum.myteam.repository.EmployeeVisaRepo
;
//import com.nisum.myteam.repository.EmployeeVisaRepo;
import
com.nisum.myteam.service.IEmployeeService
;
//import com.nisum.myteam.service.IEmployeeService;
import
com.nisum.myteam.service.IProjectService
;
//import com.nisum.myteam.service.IProjectService;
import
com.nisum.myteam.service.IResourceService
;
//import com.nisum.myteam.service.IResourceService;
import
com.nisum.myteam.utils.MyTeamUtils
;
//import com.nisum.myteam.utils.MyTeamUtils;
import
org.apache.commons.lang3.StringUtils
;
//import org.apache.commons.lang3.StringUtils;
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.*
;
//import org.springframework.web.bind.annotation.*;
//
import
javax.servlet.http.HttpServletRequest
;
//import javax.servlet.http.HttpServletRequest;
import
java.util.ArrayList
;
//import java.util.ArrayList;
import
java.util.Date
;
//import java.util.Date;
import
java.util.HashMap
;
//import java.util.HashMap;
import
java.util.List
;
//import java.util.List;
import
java.util.stream.Collectors
;
//import java.util.stream.Collectors;
//
@RestController
//@RestController
@RequestMapping
//@RequestMapping
public
class
ResourceController
{
//public class ResourceController {
//
@Autowired
// @Autowired
private
IEmployeeService
employeeService
;
// private IEmployeeService employeeService;
//
@Autowired
// @Autowired
private
IProjectService
projectService
;
// private IProjectService projectService;
//
@Autowired
// @Autowired
private
EmployeeVisaRepo
employeeVisaRepo
;
// private EmployeeVisaRepo employeeVisaRepo;
//
@Autowired
// @Autowired
private
IResourceService
resourceService
;
// private IResourceService resourceService;
//
//
//
@RequestMapping
(
value
=
"/resources"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
// @RequestMapping(value = "/resources", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public
ResponseEntity
<?>
createResource
(
@RequestBody
Resource
resourceReq
,
// public ResponseEntity<?> createResource(@RequestBody Resource 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)) {
resourceReq
.
setActive
(
true
);
// resourceReq.setActive(true);
resourceReq
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
CREATE
);
// resourceReq.setAuditFields(loginEmpId, MyTeamUtils.CREATE);
Resource
resourcePersisted
=
resourceService
.
addResource
(
resourceReq
,
loginEmpId
);
// Resource resourcePersisted = resourceService.addResource(resourceReq, loginEmpId);
//
ResponseDetails
createResponseDetails
=
new
ResponseDetails
(
new
Date
(),
601
,
"Resource has been created"
,
// ResponseDetails createResponseDetails = new ResponseDetails(new Date(), 601, "Resource has been created",
"Resource description"
,
null
,
request
.
getContextPath
(),
"details"
,
resourcePersisted
);
// "Resource description", null, request.getContextPath(), "details", resourcePersisted);
return
new
ResponseEntity
<
ResponseDetails
>(
createResponseDetails
,
HttpStatus
.
OK
);
// return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK);
}
// }
//
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Please provide the valid Employee Id"
,
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Employee Id",
"Employee Id is not valid"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
resourceReq
);
// "Employee Id is not valid", null, request.getRequestURI(), "Resource details", resourceReq);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
//
}
// }
//
@RequestMapping
(
value
=
"/resources"
,
method
=
RequestMethod
.
PUT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
// @RequestMapping(value = "/resources", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public
ResponseEntity
<?>
updateResource
(
@RequestBody
Resource
resourceReq
,
// public ResponseEntity<?> updateResource(@RequestBody Resource resourceReq,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
// @RequestParam(value = "loginEmpId") String loginEmpId, HttpServletRequest request) throws MyTeamException {
//
if
(
StringUtils
.
isNotBlank
(
loginEmpId
))
{
// if (StringUtils.isNotBlank(loginEmpId)) {
resourceReq
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
UPDATE
);
// resourceReq.setAuditFields(loginEmpId, MyTeamUtils.UPDATE);
String
responseMessage
=
resourceService
.
updateResource
(
resourceReq
,
loginEmpId
);
// String responseMessage = resourceService.updateResource(resourceReq, loginEmpId);
ResponseDetails
createResponseDetails
=
new
ResponseDetails
(
new
Date
(),
601
,
responseMessage
,
// ResponseDetails createResponseDetails = new ResponseDetails(new Date(), 601, responseMessage,
"Resource description"
,
null
,
request
.
getContextPath
(),
"Resource details"
,
resourceReq
);
// "Resource description", null, request.getContextPath(), "Resource details", resourceReq);
return
new
ResponseEntity
<
ResponseDetails
>(
createResponseDetails
,
HttpStatus
.
OK
);
// return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK);
}
// }
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Please provide the valid Employee Id"
,
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Employee Id",
"Employee Id is not valid"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
resourceReq
);
// "Employee Id is not valid", null, request.getRequestURI(), "Resource details", resourceReq);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
}
// }
//
@RequestMapping
(
value
=
"/resources"
,
method
=
RequestMethod
.
DELETE
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
// @RequestMapping(value = "/resources", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public
ResponseEntity
<?>
deleteResource
(
@RequestBody
Resource
resourceReq
,
// public ResponseEntity<?> deleteResource(@RequestBody Resource 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)) {
Resource
resourceDeleted
=
resourceService
.
deleteResource
(
resourceReq
.
getEmployeeId
(),
resourceReq
.
getProjectId
(),
resourceReq
.
getId
(),
loginEmpId
);
// Resource resourceDeleted = resourceService.deleteResource(resourceReq.getEmployeeId(), resourceReq.getProjectId(), resourceReq.getId(), loginEmpId);
//
ResponseDetails
createResponseDetails
=
new
ResponseDetails
(
new
Date
(),
601
,
"Resource has been deleted"
,
// ResponseDetails createResponseDetails = new ResponseDetails(new Date(), 601, "Resource has been deleted",
"Resource description"
,
null
,
request
.
getContextPath
(),
"Resource details"
,
resourceDeleted
);
// "Resource description", null, request.getContextPath(), "Resource details", resourceDeleted);
return
new
ResponseEntity
<
ResponseDetails
>(
createResponseDetails
,
HttpStatus
.
OK
);
// return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK);
}
// }
//
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Please provide the valid Employee Id"
,
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Employee Id",
"Employee Id is not valid"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
resourceReq
);
// "Employee Id is not valid", null, request.getRequestURI(), "Resource details", resourceReq);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
}
// }
//
@RequestMapping
(
value
=
"/resources/employeeId/{employeeId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
// @RequestMapping(value = "/resources/employeeId/{employeeId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public
ResponseEntity
<?>
getResourcesSortByStartDate
(
@PathVariable
(
value
=
"employeeId"
,
required
=
true
)
String
employeeId
,
HttpServletRequest
request
)
// public ResponseEntity<?> getResourcesSortByStartDate(@PathVariable(value = "employeeId", required = true) String employeeId, HttpServletRequest request)
throws
MyTeamException
{
// throws MyTeamException {
//
if
(
StringUtils
.
isNotBlank
(
employeeId
))
{
// if (StringUtils.isNotBlank(employeeId)) {
List
<
Resource
>
resourcesList
=
resourceService
.
getResourcesSortByStartDate
(
employeeId
);
// List<Resource> resourcesList = resourceService.getResourcesSortByStartDate(employeeId);
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Resources have been retrieved successfully"
,
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
"List of Resources for an employee"
,
resourcesList
,
request
.
getRequestURI
(),
"Resource List details"
,
null
);
// "List of Resources for an employee", resourcesList, request.getRequestURI(), "Resource List details", null);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
}
// }
//
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Please provide the valid Employee Id"
,
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Employee Id",
"Employee Id is not valid"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
// "Employee Id is not valid", null, request.getRequestURI(), "Resource details", null);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
//
}
// }
//
@RequestMapping
(
value
=
"/resources/active"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
// @RequestMapping(value = "/resources/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)) {
List
<
Resource
>
employeesRoles
=
resourceService
.
getActiveResources
(
employeeId
);
// List<Resource> employeesRoles = resourceService.getActiveResources(employeeId);
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Resources have been retrieved successfully"
,
"List of Resources who are active in the projects"
,
employeesRoles
,
request
.
getRequestURI
(),
"Resource List details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Please provide the valid Employee Id"
,
"Employee Id is not valid"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/resources/shifts/{shift}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getResourcesForShift
(
@PathVariable
(
value
=
"shift"
,
required
=
true
)
String
shift
,
HttpServletRequest
request
)
throws
MyTeamException
{
if
(
StringUtils
.
isNotBlank
(
shift
))
{
List
<
Resource
>
resourcesList
=
resourceService
.
getResourcesForShift
(
shift
);
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Resources have been retrieved successfully"
,
"List of Resources for the provided shift"
,
resourcesList
,
request
.
getRequestURI
(),
"Resource List for shift"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Please provide the valid Shift value"
,
"List of Resources for the provided shift"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/resources/projects"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getResourcesAllocatedForAllProjects
(
HttpServletRequest
request
)
throws
MyTeamException
{
List
<
Resource
>
resourcesList
=
resourceService
.
getResourcesForActiveProjects
();
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Resources have been retrieved successfully"
,
"List of Resources for the projects"
,
resourcesList
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/resources/project/{projectId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getResourcesForProject
(
@PathVariable
(
value
=
"projectId"
,
required
=
true
)
String
projectId
,
@RequestParam
(
value
=
"status"
,
required
=
false
,
defaultValue
=
MyTeamUtils
.
ACTIVE
)
String
status
,
HttpServletRequest
request
)
throws
MyTeamException
{
if
(
StringUtils
.
isNotBlank
(
projectId
))
{
List
<
Resource
>
resourcesList
=
resourceService
.
getResourcesForProject
(
projectId
,
status
);
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Resources have been retrieved successfully"
,
"List of Resources for a project"
,
resourcesList
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Please provide ProjectId"
,
"List of Resources for a project"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/resources/deliverylead/{deliveryLeadId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getTeamDetails
(
@PathVariable
(
value
=
"deliveryLeadId"
,
required
=
true
)
String
deliveryLeadId
,
HttpServletRequest
request
)
throws
MyTeamException
{
if
(
StringUtils
.
isNotBlank
(
deliveryLeadId
))
{
List
<
Resource
>
resourcesList
=
resourceService
.
getResourcesUnderDeliveryLead
(
deliveryLeadId
);
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Resources have been retrieved successfully"
,
"List of Resources for a project"
,
resourcesList
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
}
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Please provide Valid Delivery Lead Id"
,
"List of Resources for DeliveryLead"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
// @RequestMapping(value = "resources/unAssignedEmployees", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> getUnAssignedEmployees(HttpServletRequest request) throws MyTeamException {
// List<Employee> employeesList = projectService.getUnAssignedEmployees();
//
//
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
// "List of Resources who are not assigned to project", employeesList, request.getRequestURI(), "Resource details", null);
// "List of Resources who are active in the projects", employeesRoles, request.getRequestURI(), "Resource List details", null);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
//
// }
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Employee Id",
// "Employee Id is not valid", null, request.getRequestURI(), "Resource details", null);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
// }
// }
//
//
//
//
// @RequestMapping(value = "/resources/
getEmployeesDashBoard
", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// @RequestMapping(value = "/resources/
shifts/{shift}
", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> get
EmployeesDashBoard(HttpServletRequest request) throws MyTeamException {
// public ResponseEntity<?> get
ResourcesForShift(@PathVariable(value = "shift", required = true) String shift, HttpServletRequest request)
//
List<EmployeeDashboardVO> employeeDashBoardList = projectService.getEmployeesDashBoard();
//
throws MyTeamException {
//
//
// if (StringUtils.isNotBlank(shift)) {
// List<Resource> resourcesList = resourceService.getResourcesForShift(shift);
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
//
"List of Resources for dashboard", employeeDashBoardList, request.getRequestURI(), "Resource details
", null);
//
"List of Resources for the provided shift", resourcesList, request.getRequestURI(), "Resource List for shift
", null);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
// }
// }
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide the valid Shift value",
// "List of Resources for the provided shift", null, request.getRequestURI(), "Resource details", null);
@RequestMapping
(
value
=
"resources/addEmployeeToTeamWithCheck"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
public
ResponseEntity
<?>
addEmployeeToTeamWithCheck
(
@RequestBody
Resource
resourceReq
,
//
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
// }
//
if
(
StringUtils
.
isNotBlank
(
loginEmpId
))
{
// @RequestMapping(value = "/resources/projects", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
HashMap
<
String
,
Object
>
responseMap
=
resourceService
.
verifyResourceAssignedToAnyProject
(
resourceReq
,
loginEmpId
);
// public ResponseEntity<?> getResourcesAllocatedForAllProjects(HttpServletRequest request) throws MyTeamException {
//
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
responseMap
.
get
(
"message"
).
toString
(),
// List<Resource> resourcesList = resourceService.getResourcesForActiveProjects();
"List of Resources for dashboard"
,
responseMap
.
get
(
"resourceObj"
),
request
.
getRequestURI
(),
"Resource details"
,
null
);
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
// "List of Resources for the projects", resourcesList, request.getRequestURI(), "Resource details", null);
}
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Please provide Valid Employee Id"
,
//
"Verification of resource in Bench Project"
,
null
,
request
.
getRequestURI
(),
"Resource details"
,
resourceReq
);
// }
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
//
// @RequestMapping(value = "/resources/project/{projectId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
}
// public ResponseEntity<?> getResourcesForProject(@PathVariable(value = "projectId", required = true) String projectId,
// @RequestParam(value = "status", required = false, defaultValue = MyTeamUtils.ACTIVE) String status,
}
// HttpServletRequest request)
// throws MyTeamException {
//
// if (StringUtils.isNotBlank(projectId)) {
// List<Resource> resourcesList = resourceService.getResourcesForProject(projectId, status);
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
// "List of Resources for a project", resourcesList, request.getRequestURI(), "Resource details", null);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
//
// }
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide ProjectId",
// "List of Resources for a project", null, request.getRequestURI(), "Resource details", null);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
// }
//
//
// @RequestMapping(value = "/resources/deliverylead/{deliveryLeadId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> getTeamDetails(@PathVariable(value = "deliveryLeadId", required = true) String deliveryLeadId, HttpServletRequest request)
// throws MyTeamException {
//
// if (StringUtils.isNotBlank(deliveryLeadId)) {
// List<Resource> resourcesList = resourceService.getResourcesUnderDeliveryLead(deliveryLeadId);
//
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
// "List of Resources for a project", resourcesList, request.getRequestURI(), "Resource details", null);
// }
//
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide Valid Delivery Lead Id",
// "List of Resources for DeliveryLead", null, request.getRequestURI(), "Resource details", null);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
//
// }
//
//
//// @RequestMapping(value = "resources/unAssignedEmployees", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
//// public ResponseEntity<?> getUnAssignedEmployees(HttpServletRequest request) throws MyTeamException {
//// List<Employee> employeesList = projectService.getUnAssignedEmployees();
////
//// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
//// "List of Resources who are not assigned to project", employeesList, request.getRequestURI(), "Resource details", null);
//// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
//// }
////
////
//// @RequestMapping(value = "/resources/getEmployeesDashBoard", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
//// public ResponseEntity<?> getEmployeesDashBoard(HttpServletRequest request) throws MyTeamException {
//// List<EmployeeDashboardVO> employeeDashBoardList = projectService.getEmployeesDashBoard();
////
//// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Resources have been retrieved successfully",
//// "List of Resources for dashboard", employeeDashBoardList, request.getRequestURI(), "Resource details", null);
//// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
//// }
//
//
// @RequestMapping(value = "resources/addEmployeeToTeamWithCheck", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> addEmployeeToTeamWithCheck(@RequestBody Resource resourceReq,
// @RequestParam(value = "loginEmpId") String loginEmpId, HttpServletRequest request) throws MyTeamException {
//
// if (StringUtils.isNotBlank(loginEmpId)) {
// HashMap<String, Object> responseMap = resourceService.verifyResourceAssignedToAnyProject(resourceReq, loginEmpId);
//
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, responseMap.get("message").toString(),
// "List of Resources for dashboard", responseMap.get("resourceObj"), request.getRequestURI(), "Resource details", null);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
// }
// ResponseDetails responseDetails = new ResponseDetails(new Date(), 602, "Please provide Valid Employee Id",
// "Verification of resource in Bench Project", null, request.getRequestURI(), "Resource details", resourceReq);
// return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
//
// }
//
//}
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