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
22239759
Commit
22239759
authored
May 13, 2019
by
Vijay Akula
Browse files
Options
Browse Files
Download
Plain Diff
Resolved merge conflicts
parents
5592d335
6d94ee50
Changes
36
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
2165 additions
and
1209 deletions
+2165
-1209
MyTeamApplication.java
src/main/java/com/nisum/myteam/MyTeamApplication.java
+3
-3
BillingController.java
...n/java/com/nisum/myteam/controller/BillingController.java
+68
-69
DashboardController.java
...java/com/nisum/myteam/controller/DashboardController.java
+38
-0
DomainController.java
...in/java/com/nisum/myteam/controller/DomainController.java
+63
-75
EmployeeController.java
.../java/com/nisum/myteam/controller/EmployeeController.java
+45
-2
ProjectController.java
...n/java/com/nisum/myteam/controller/ProjectController.java
+27
-99
ResourceAllocationController.java
...nisum/myteam/controller/ResourceAllocationController.java
+292
-0
ResourceController.java
.../java/com/nisum/myteam/controller/ResourceController.java
+231
-266
Employee.java
src/main/java/com/nisum/myteam/model/dao/Employee.java
+2
-1
Project.java
src/main/java/com/nisum/myteam/model/dao/Project.java
+0
-1
ResourceAllocation.java
...n/java/com/nisum/myteam/model/dao/ResourceAllocation.java
+43
-0
MyProjectAllocationVO.java
...java/com/nisum/myteam/model/vo/MyProjectAllocationVO.java
+34
-0
ResourceVO.java
src/main/java/com/nisum/myteam/model/vo/ResourceVO.java
+38
-0
ResourceAllocationRepo.java
...a/com/nisum/myteam/repository/ResourceAllocationRepo.java
+28
-0
ResourceRepo.java
src/main/java/com/nisum/myteam/repository/ResourceRepo.java
+1
-1
IDashboardService.java
...main/java/com/nisum/myteam/service/IDashboardService.java
+9
-0
IEmployeeService.java
src/main/java/com/nisum/myteam/service/IEmployeeService.java
+26
-26
IEmployeeVisaService.java
...n/java/com/nisum/myteam/service/IEmployeeVisaService.java
+6
-0
IProjectService.java
src/main/java/com/nisum/myteam/service/IProjectService.java
+34
-29
IResourceAllocationService.java
.../com/nisum/myteam/service/IResourceAllocationService.java
+66
-0
IResourceService.java
src/main/java/com/nisum/myteam/service/IResourceService.java
+25
-22
DashboardService.java
.../java/com/nisum/myteam/service/impl/DashboardService.java
+98
-0
DomainService.java
...ain/java/com/nisum/myteam/service/impl/DomainService.java
+17
-15
EmployeeService.java
...n/java/com/nisum/myteam/service/impl/EmployeeService.java
+14
-6
EmployeeVisaService.java
...va/com/nisum/myteam/service/impl/EmployeeVisaService.java
+14
-0
ProjectService.java
...in/java/com/nisum/myteam/service/impl/ProjectService.java
+356
-545
ResourceAllocationService.java
.../nisum/myteam/service/impl/ResourceAllocationService.java
+385
-0
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+86
-27
DomainStatus.java
src/main/java/com/nisum/myteam/statuscodes/DomainStatus.java
+5
-2
ProjectStatus.java
...main/java/com/nisum/myteam/statuscodes/ProjectStatus.java
+28
-1
ResourceCodes.java
...main/java/com/nisum/myteam/statuscodes/ResourceCodes.java
+25
-0
ResourceStatus.java
...ain/java/com/nisum/myteam/statuscodes/ResourceStatus.java
+13
-1
MyTeamDateUtils.java
src/main/java/com/nisum/myteam/utils/MyTeamDateUtils.java
+13
-0
MyTeamUtils.java
src/main/java/com/nisum/myteam/utils/MyTeamUtils.java
+7
-0
ApplicationRole.java
...ava/com/nisum/myteam/utils/constants/ApplicationRole.java
+25
-0
RoleEnum.java
src/main/java/com/nisum/myteam/utils/constants/RoleEnum.java
+0
-18
No files found.
src/main/java/com/nisum/myteam/MyT
ime
Application.java
→
src/main/java/com/nisum/myteam/MyT
eam
Application.java
View file @
22239759
...
...
@@ -16,15 +16,15 @@ import org.springframework.web.filter.CorsFilter;
@SpringBootApplication
@EnableAutoConfiguration
@EnableMongoRepositories
(
basePackages
=
{
"com.nisum.myteam.repository"
})
public
class
MyT
ime
Application
extends
SpringBootServletInitializer
{
public
class
MyT
eam
Application
extends
SpringBootServletInitializer
{
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
application
)
{
return
application
.
sources
(
MyT
ime
Application
.
class
);
return
application
.
sources
(
MyT
eam
Application
.
class
);
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
MyT
ime
Application
.
class
,
args
);
SpringApplication
.
run
(
MyT
eam
Application
.
class
,
args
);
}
@Bean
...
...
src/main/java/com/nisum/myteam/controller/BillingController.java
View file @
22239759
package
com
.
nisum
.
myteam
.
controller
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
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
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.dao.Billing
;
import
com.nisum.myteam.service.IBillingService
;
import
lombok.extern.slf4j.Slf4j
;
@RestController
@Slf4j
public
class
BillingController
{
@Autowired
private
IBillingService
billingService
;
// @RequestMapping(value = "/addEmployeeBilling"
@RequestMapping
(
value
=
"/billing"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
Billing
>
addEmployeeBilling
(
@RequestBody
Billing
billing
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTeamException
{
Billing
billingList
=
billingService
.
addBilling
(
billing
,
loginEmpId
);
return
new
ResponseEntity
<>(
billingList
,
HttpStatus
.
OK
);
}
// @RequestMapping(value = "/updateEmployeeBilling",
@RequestMapping
(
value
=
"/billing"
,
method
=
RequestMethod
.
PUT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
Billing
>
updateEmployeeBilling
(
@RequestBody
Billing
billing
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTeamException
{
Billing
billingList
=
billingService
.
updateBilling
(
billing
,
loginEmpId
);
return
new
ResponseEntity
<>(
billingList
,
HttpStatus
.
OK
);
}
// @RequestMapping(value = "/deleteEmployeeBilling"
@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
{
billingService
.
deleteBilling
(
billing
);
return
new
ResponseEntity
<>(
null
,
HttpStatus
.
OK
);
}
// @RequestMapping(value = "/getEmployeeBillingDetailsAll"
@RequestMapping
(
value
=
"/billing"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
Billing
>>
getAllBillingsForEmployee
(
@RequestParam
(
"employeeId"
)
String
employeeId
)
throws
MyTeamException
{
List
<
Billing
>
billingList
=
billingService
.
getBillingsForEmployee
(
employeeId
);
return
new
ResponseEntity
<>(
billingList
,
HttpStatus
.
OK
);
}
// @RequestMapping(value = "/getEmployeeBillingDetails"
@RequestMapping
(
value
=
"/billing/project/{projectId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
Billing
>>
getBillingsForProject
(
@PathVariable
(
"projectId"
)
String
projectId
,
@RequestParam
(
"employeeId"
)
String
employeeId
)
throws
MyTeamException
{
List
<
Billing
>
billingList
=
billingService
.
getBillingsForProject
(
employeeId
,
projectId
);
return
new
ResponseEntity
<>(
billingList
,
HttpStatus
.
OK
);
}
}
//package com.nisum.myteam.controller;
//
//import java.util.List;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.MediaType;
//import org.springframework.http.ResponseEntity;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestBody;
//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 com.nisum.myteam.exception.handler.MyTeamException;
//import com.nisum.myteam.model.dao.Billing;
//import com.nisum.myteam.service.IBillingService;
//import lombok.extern.slf4j.Slf4j;
//
//@RestController
//@Slf4j
//public class BillingController {
//
// @Autowired
// private IBillingService billingService;
//
// // @RequestMapping(value = "/addEmployeeBilling"
// @RequestMapping(value = "/billing", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<Billing> addEmployeeBilling(@RequestBody Billing billing,
// @RequestParam(value = "loginEmpId") String loginEmpId) throws MyTeamException {
// Billing billingList = billingService.addBilling(billing, loginEmpId);
//
// return new ResponseEntity<>(billingList, HttpStatus.OK);
// }
//
// // @RequestMapping(value = "/updateEmployeeBilling",
// @RequestMapping(value = "/billing", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<Billing> updateEmployeeBilling(@RequestBody Billing billing,
// @RequestParam(value = "loginEmpId") String loginEmpId) throws MyTeamException {
// Billing billingList = billingService.updateBilling(billing, loginEmpId);
// return new ResponseEntity<>(billingList, HttpStatus.OK);
// }
//
// // @RequestMapping(value = "/deleteEmployeeBilling"
// @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 {
// billingService.deleteBilling(billing);
// return new ResponseEntity<>(null, HttpStatus.OK);
// }
//
//
//
// // @RequestMapping(value = "/getEmployeeBillingDetailsAll"
// @RequestMapping(value = "/billing", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<List<Billing>> getAllBillingsForEmployee(@RequestParam("employeeId") String employeeId)
// throws MyTeamException {
// List<Billing> billingList = billingService.getBillingsForEmployee(employeeId);
// return new ResponseEntity<>(billingList, HttpStatus.OK);
// }
//
// // @RequestMapping(value = "/getEmployeeBillingDetails"
// @RequestMapping(value = "/billing/project/{projectId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<List<Billing>> getBillingsForProject(@PathVariable("projectId") String projectId,
// @RequestParam("employeeId") String employeeId) throws MyTeamException {
// List<Billing> billingList = billingService.getBillingsForProject(employeeId, projectId);
// return new ResponseEntity<>(billingList, HttpStatus.OK);
// }
//
//}
src/main/java/com/nisum/myteam/controller/DashboardController.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
controller
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.exception.handler.ResponseDetails
;
import
com.nisum.myteam.model.vo.EmployeeDashboardVO
;
import
com.nisum.myteam.service.IDashboardService
;
import
com.nisum.myteam.service.impl.DashboardService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.List
;
@RestController
@RequestMapping
public
class
DashboardController
{
@Autowired
private
IDashboardService
dashboardService
;
@RequestMapping
(
value
=
"/resources/getEmployeesDashBoard"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getEmployeesDashBoard
(
HttpServletRequest
request
)
throws
MyTeamException
{
List
<
EmployeeDashboardVO
>
employeeDashBoardList
=
dashboardService
.
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
);
}
}
src/main/java/com/nisum/myteam/controller/DomainController.java
View file @
22239759
package
com
.
nisum
.
myteam
.
controller
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.exception.handler.ResponseDetails
;
import
com.nisum.myteam.model.dao.Domain
;
import
com.nisum.myteam.service.IDomainService
;
import
com.nisum.myteam.statuscodes.DomainStatus
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author Vijay
*
*/
@RestController
@Slf4j
public
class
DomainController
{
@Autowired
private
IDomainService
domainService
;
@RequestMapping
(
value
=
"/domains"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
createDomain
(
@RequestBody
Domain
domain
,
HttpServletRequest
request
)
throws
MyTeamException
{
log
.
info
(
"Domain Creation"
);
if
(!
domainService
.
isDomainExists
(
domain
))
{
Domain
domainPeristed
=
domainService
.
create
(
domain
);
@Autowired
private
IDomainService
domainService
;
ResponseDetails
createRespDetails
=
new
ResponseDetails
(
new
Date
(),
801
,
"Domain has been created"
,
"Domain Creation"
,
null
,
""
,
"details"
,
domainPeristed
);
return
new
ResponseEntity
<
ResponseDetails
>(
createRespDetails
,
HttpStatus
.
OK
);
}
log
.
info
(
"A domain is already existed with the requested name"
+
domain
.
getDomainName
());
@RequestMapping
(
value
=
"/domains"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
createDomain
(
@RequestBody
Domain
domain
,
HttpServletRequest
request
)
throws
MyTeamException
{
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
802
,
"Domain is already existed"
,
"Choose the different domain name"
,
null
,
request
.
getRequestURI
(),
"Domain details"
,
domain
);
log
.
info
(
"Domain Creation"
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
if
(!
domainService
.
isDomainExists
(
domain
))
{
Domain
domainPeristed
=
domainService
.
create
(
domain
);
}
ResponseDetails
createRespDetails
=
new
ResponseDetails
(
new
Date
(),
DomainStatus
.
CREATE
.
getCode
(),
DomainStatus
.
CREATE
.
getMessage
(),
"Domain Creation"
,
null
,
""
,
"details"
,
domainPeristed
);
return
new
ResponseEntity
<
ResponseDetails
>(
createRespDetails
,
HttpStatus
.
OK
);
}
log
.
info
(
"A domain is already existed with the requested name"
+
domain
.
getDomainName
());
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
DomainStatus
.
ALREADY_EXISTED
.
getCode
(),
DomainStatus
.
ALREADY_EXISTED
.
getMessage
(),
"Choose the different domain name"
,
null
,
request
.
getRequestURI
(),
"Domain details"
,
domain
);
@RequestMapping
(
value
=
"/domains"
,
method
=
RequestMethod
.
PUT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
updateDomain
(
@RequestBody
Domain
domain
,
HttpServletRequest
request
)
throws
MyTeamException
{
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
boolean
isDomainExists
=
domainService
.
isDomainExists
(
domain
);
if
(
isDomainExists
==
true
)
{
Domain
domainPersisted
=
domainService
.
update
(
domain
);
ResponseDetails
updateRespDetails
=
new
ResponseDetails
(
new
Date
(),
802
,
"Domain has been updated"
,
"Domain Updation"
,
null
,
request
.
getRequestURI
(),
"Updation Domain details"
,
domainPersisted
);
}
return
new
ResponseEntity
<
ResponseDetails
>(
updateRespDetails
,
HttpStatus
.
OK
);
}
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
803
,
"Domain is Not found"
,
"Choose the correct updating domain name"
,
null
,
request
.
getRequestURI
(),
"details"
,
domain
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/domains"
,
method
=
RequestMethod
.
PUT
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
updateDomain
(
@RequestBody
Domain
domain
,
HttpServletRequest
request
)
throws
MyTeamException
{
@RequestMapping
(
value
=
"/domains/{domainId}"
,
method
=
RequestMethod
.
DELETE
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
deleteDomain
(
@PathVariable
String
domainId
,
HttpServletRequest
request
)
throws
MyTeamException
{
domainService
.
delete
(
domainId
);
boolean
isDomainExists
=
domainService
.
isDomainExists
(
domain
);
if
(
isDomainExists
==
true
)
{
Domain
domainPersisted
=
domainService
.
update
(
domain
);
ResponseDetails
updateRespDetails
=
new
ResponseDetails
(
new
Date
(),
DomainStatus
.
UPDATE
.
getCode
(),
DomainStatus
.
UPDATE
.
getMessage
(),
"Domain Updation"
,
null
,
request
.
getRequestURI
(),
"Updation Domain details"
,
domainPersisted
);
ResponseDetails
deleteRespDetails
=
new
ResponseDetails
(
new
Date
(),
804
,
"Domain has been deleted"
,
"Domain Deletion"
,
null
,
request
.
getRequestURI
(),
"Deletion Domain details"
,
domainId
);
return
new
ResponseEntity
<
ResponseDetails
>(
updateRespDetails
,
HttpStatus
.
OK
);
}
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
803
,
"Domain is Not found"
,
"Choose the correct updating domain name"
,
null
,
request
.
getRequestURI
(),
"details"
,
domain
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<
ResponseDetails
>(
deleteRespDetails
,
HttpStatus
.
OK
);
}
}
@RequestMapping
(
value
=
"/domains/{domainId}"
,
method
=
RequestMethod
.
DELETE
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
deleteDomain
(
@PathVariable
String
domainId
,
HttpServletRequest
request
)
throws
MyTeamException
{
domainService
.
delete
(
domainId
);
ResponseDetails
deleteRespDetails
=
new
ResponseDetails
(
new
Date
(),
804
,
"Domain has been deleted"
,
"Domain Deletion"
,
null
,
request
.
getRequestURI
(),
"Deletion Domain details"
,
domainId
);
return
new
ResponseEntity
<
ResponseDetails
>(
deleteRespDetails
,
HttpStatus
.
OK
);
@RequestMapping
(
value
=
"/domains"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getDomains
(
HttpServletRequest
request
)
throws
MyTeamException
{
}
ResponseDetails
getRespDetails
=
new
ResponseDetails
(
new
Date
(),
804
,
"Retrieved the domains successfully"
,
"Domains list"
,
domainService
.
getDomainsList
(),
request
.
getRequestURI
(),
"details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
getRespDetails
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/domains"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getDomains
(
HttpServletRequest
request
)
throws
MyTeamException
{
//getting domains list under accountId which is an active.
@RequestMapping
(
value
=
"/domains/{accountId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
Domain
>>
getDomains
(
@PathVariable
(
"accountId"
)
String
accountId
)
throws
MyTeamException
{
List
<
Domain
>
domains
=
domainService
.
getDomainsUnderAccount
(
accountId
).
stream
()
.
filter
(
e
->
"Active"
.
equalsIgnoreCase
(
e
.
getStatus
())).
collect
(
Collectors
.
toList
());
return
new
ResponseEntity
<>(
domains
,
HttpStatus
.
OK
);
}
ResponseDetails
getRespDetails
=
new
ResponseDetails
(
new
Date
(),
DomainStatus
.
GET_DOMIAINS
.
getCode
(),
DomainStatus
.
GET_DOMIAINS
.
getMessage
(),
"Domains list"
,
domainService
.
getDomainsList
(),
request
.
getRequestURI
(),
"details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
getRespDetails
,
HttpStatus
.
OK
);
}
//getting domains list under accountId which is an active.
@RequestMapping
(
value
=
"/domains/{accountId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
Domain
>>
getDomains
(
@PathVariable
(
"accountId"
)
String
accountId
)
throws
MyTeamException
{
List
<
Domain
>
domains
=
domainService
.
getDomainsUnderAccount
(
accountId
).
stream
()
.
filter
(
e
->
"Active"
.
equalsIgnoreCase
(
e
.
getStatus
())).
collect
(
Collectors
.
toList
());
return
new
ResponseEntity
<>(
domains
,
HttpStatus
.
OK
);
}
}
\ No newline at end of file
src/main/java/com/nisum/myteam/controller/EmployeeController.java
View file @
22239759
...
...
@@ -8,6 +8,8 @@ import java.util.stream.Collectors;
import
javax.servlet.http.HttpServletRequest
;
import
com.nisum.myteam.model.dao.EmployeeVisa
;
import
com.nisum.myteam.repository.EmployeeVisaRepo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
...
...
@@ -38,11 +40,15 @@ public class EmployeeController {
@Autowired
private
IEmployeeRoleService
employeeRoleService
;
@Autowired
private
EmployeeVisaRepo
employeeVisaRepo
;
@RequestMapping
(
value
=
"/employees/{empId}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
createEmployee
(
@RequestBody
Employee
employeeReq
,
@PathVariable
(
value
=
"empId"
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
if
(
empService
.
isEmployeeExistsById
(
loginEmpId
))
{
if
(
!
empService
.
isEmployeeExistsById
(
loginEmpId
))
{
Employee
employeePersisted
=
empService
.
createEmployee
(
employeeReq
,
loginEmpId
);
ResponseDetails
createRespDetails
=
new
ResponseDetails
(
new
Date
(),
901
,
"Employee has been created"
,
...
...
@@ -227,6 +233,43 @@ public class EmployeeController {
return
new
ResponseEntity
<>(
employeesList
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/getEmployeesHavingVisa"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
getEmployeesHavingVisa
(
@RequestParam
(
"visa"
)
String
passport
,
HttpServletRequest
request
)
throws
MyTeamException
{
List
<
Employee
>
employees
=
new
ArrayList
<>();
if
(
passport
!=
null
&&
!
"passport"
.
equalsIgnoreCase
(
passport
))
{
List
<
EmployeeVisa
>
employeeVisas
=
employeeVisaRepo
.
findByVisaName
(
passport
);
List
<
String
>
employeeIds
=
null
;
if
(
employeeVisas
!=
null
)
{
employeeIds
=
employeeVisas
.
stream
().
map
(
EmployeeVisa:
:
getEmployeeId
).
collect
(
Collectors
.
toList
());
}
if
(
employeeIds
!=
null
&&
!
employeeIds
.
isEmpty
())
{
List
<
Employee
>
emps
=
empService
.
getActiveEmployees
();
for
(
Employee
emp
:
emps
)
{
if
(
employeeIds
.
contains
(
emp
.
getEmployeeId
()))
{
employees
.
add
(
emp
);
}
}
}
}
else
{
if
(
empService
.
getActiveEmployees
()
!=
null
)
{
employees
=
empService
.
getActiveEmployees
().
stream
()
.
sorted
((
o1
,
o2
)
->
o1
.
getEmployeeName
().
compareTo
(
o2
.
getEmployeeName
()))
.
collect
(
Collectors
.
toList
());
}
}
ResponseDetails
responseDetails
=
new
ResponseDetails
(
new
Date
(),
602
,
"Resources have been retrieved successfully"
,
"List of Resources who has visa"
,
employees
,
request
.
getRequestURI
(),
"Resource details"
,
null
);
return
new
ResponseEntity
<
ResponseDetails
>(
responseDetails
,
HttpStatus
.
OK
);
}
}
\ No newline at end of file
src/main/java/com/nisum/myteam/controller/ProjectController.java
View file @
22239759
This diff is collapsed.
Click to expand it.
src/main/java/com/nisum/myteam/controller/ResourceAllocationController.java
0 → 100644
View file @
22239759
This diff is collapsed.
Click to expand it.
src/main/java/com/nisum/myteam/controller/ResourceController.java
View file @
22239759
This diff is collapsed.
Click to expand it.
src/main/java/com/nisum/myteam/model/dao/Employee.java
View file @
22239759
...
...
@@ -7,6 +7,7 @@ import javax.validation.constraints.NotNull;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
import
org.bson.types.ObjectId
;
import
org.hibernate.validator.constraints.Email
;
import
org.hibernate.validator.constraints.NotBlank
;
import
org.springframework.data.annotation.Id
;
...
...
@@ -31,7 +32,7 @@ public class Employee implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
String
id
;
private
ObjectId
id
;
@NotBlank
(
message
=
"Employee Id cannot be blank"
)
...
...
src/main/java/com/nisum/myteam/model/dao/Project.java
View file @
22239759
...
...
@@ -32,7 +32,6 @@ public class Project extends AuditFields implements Serializable {
private
String
projectId
;
private
String
projectName
;
private
String
domainId
;
private
String
domain
;
private
String
accountId
;
private
String
status
;
private
List
<
String
>
employeeIds
;
...
...
src/main/java/com/nisum/myteam/model/dao/ResourceAllocation.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
model
.
dao
;
import
com.nisum.myteam.model.AuditFields
;
import
lombok.*
;
import
org.bson.types.ObjectId
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.format.annotation.DateTimeFormat.ISO
;
import
java.io.Serializable
;
import
java.util.Date
;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document
(
collection
=
"resourceAllocation"
)
public
class
ResourceAllocation
extends
AuditFields
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
ObjectId
id
;
private
String
employeeId
;
private
String
projectId
;
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
private
String
billableStatus
;
@DateTimeFormat
(
iso
=
ISO
.
DATE
,
pattern
=
"yyyy-MM-dd'T'HH:mm:ss.SSSX"
)
private
Date
billingStartDate
;
@DateTimeFormat
(
iso
=
ISO
.
DATE
,
pattern
=
"yyyy-MM-dd'T'HH:mm:ss.SSSX"
)
private
Date
billingEndDate
;
private
String
resourceRole
;
}
src/main/java/com/nisum/myteam/model/vo/MyProjectAllocationVO.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
model
.
vo
;
import
lombok.*
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public
class
MyProjectAllocationVO
{
private
String
projectId
;
private
String
projectName
;
private
String
accountName
;
private
String
billableStatus
;
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE
)
private
Date
billingStartDate
;
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE
)
private
Date
billingEndDate
;
private
String
shift
;
private
String
resourceStatus
;
private
List
<
HashMap
<
String
,
String
>>
deliveryLeadIds
;
}
src/main/java/com/nisum/myteam/model/vo/ResourceVO.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
model
.
vo
;
import
lombok.*
;
import
org.bson.types.ObjectId
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public
class
ResourceVO
{
@Id
private
ObjectId
id
;
private
String
employeeId
;
private
String
employeeName
;
private
String
designation
;
private
String
emailId
;
private
String
projectId
;
private
String
projectName
;
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE
)
private
String
billableStatus
;
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE
,
pattern
=
"yyyy-MM-dd'T'HH:mm:ss.SSSX"
)
private
Date
billingStartDate
;
@DateTimeFormat
(
iso
=
DateTimeFormat
.
ISO
.
DATE
,
pattern
=
"yyyy-MM-dd'T'HH:mm:ss.SSSX"
)
private
Date
billingEndDate
;
private
String
resourceStatus
;
private
String
resourceRole
;
}
src/main/java/com/nisum/myteam/repository/ResourceAllocationRepo.java
0 → 100644
View file @
22239759
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
ResourceAllocationRepo
extends
MongoRepository
<
ResourceAllocation
,
String
>
{
List
<
ResourceAllocation
>
findByProjectId
(
String
projectId
);
List
<
ResourceAllocation
>
findByEmployeeId
(
String
employeeId
);
ResourceAllocation
findById
(
ObjectId
id
);
List
<
ResourceAllocation
>
findByEmployeeIdAndProjectId
(
String
employeeId
,
String
projectId
);
// List<Resource> findByEmployeeIdAndActive(String employeeId, boolean status);
// List<Resource> findByEmployeeIdAndProjectIdAndActive(String employeeId, String projectId, boolean status);
// List<Resource> findByAccountAndActiveAndBillableStatus(String account, boolean status, String billableStatus);
}
src/main/java/com/nisum/myteam/repository/ResourceRepo.java
View file @
22239759
...
...
@@ -24,6 +24,6 @@ public interface ResourceRepo
List
<
Resource
>
findByEmployeeIdAndProjectIdAndActive
(
String
employeeId
,
String
projectId
,
boolean
status
);
List
<
Resource
>
findByAccountAndActiveAndBillableStatus
(
String
account
,
boolean
status
,
String
billableStatus
);
Optional
<
List
<
Resource
>>
findByActiveAndShiftLikeOrderByEmployeeIdDesc
(
boolean
active
,
String
shift
);
}
src/main/java/com/nisum/myteam/service/IDashboardService.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
service
;
import
com.nisum.myteam.model.vo.EmployeeDashboardVO
;
import
java.util.List
;
public
interface
IDashboardService
{
public
List
<
EmployeeDashboardVO
>
getEmployeesDashBoard
();
}
src/main/java/com/nisum/myteam/service/IEmployeeService.java
View file @
22239759
package
com
.
nisum
.
myteam
.
service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Set
;
import
org.springframework.stereotype.Service
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.dao.Account
;
import
com.nisum.myteam.model.dao.Employee
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Set
;
@Service
public
interface
IEmployeeService
{
boolean
isEmployeeExistsById
(
String
employeeId
);
boolean
isEmployeeExistsById
(
String
employeeId
);
Employee
createEmployee
(
Employee
employeeRoles
,
String
empId
)
throws
MyTeamException
;
Employee
updateEmployee
(
Employee
employeeRoles
,
String
empId
);
Employee
createEmployee
(
Employee
employeeRoles
,
String
empId
)
throws
MyTeamException
;
Employee
deleteEmployee
(
String
empId
)
;
Employee
updateEmployee
(
Employee
employeeRoles
,
String
empId
)
;
Employee
updateProfile
(
Employee
employeeRoles
)
throws
MyTeamException
;
Employee
deleteEmployee
(
String
empId
);
Employee
getEmployeeById
(
String
empId
);
Employee
updateProfile
(
Employee
employeeRoles
)
throws
MyTeamException
;
Employee
getEmployeeByEmaillId
(
String
emailId
)
;
Employee
getEmployeeById
(
String
empId
)
;
List
<
Employee
>
getManagers
()
throws
MyTeamException
;
Employee
getEmployeeByEmaillId
(
String
emailId
)
;
List
<
Employee
>
getActiveEmployees
()
throws
MyTeamException
;
List
<
Employee
>
getManagers
()
throws
MyTeamException
;
List
<
Employee
>
getEmployeesByStatus
(
String
status
)
;
List
<
Employee
>
getActiveEmployee
s
()
throws
MyTeamException
;
List
<
Account
>
getAccount
s
()
throws
MyTeamException
;
List
<
Employee
>
getEmployeesByStatus
(
String
status
);
Employee
getEmployeeRoleDataForSearchCriteria
(
String
searchId
,
String
searchAttribute
);
List
<
Account
>
getAccounts
()
throws
MyTeamException
;
List
<
String
>
getEmployeeDetailsForAutocomplete
()
;
Employee
getEmployeeRoleDataForSearchCriteria
(
String
searchId
,
String
searchAttribute
);
List
<
HashMap
<
String
,
String
>>
getDeliveryLeads
(
String
domainId
);
List
<
String
>
getEmployeeDetailsForAutocomplete
(
);
List
<
Employee
>
getEmployeesByFunctionalGrp
(
String
functionalGrp
);
List
<
HashMap
<
String
,
String
>>
getDeliveryLeads
(
String
domainId
);
boolean
verifyEmployeeRole
(
String
empId
,
String
roleName
);
List
<
Employee
>
getEmployeesByFunctionalGrp
(
String
functionalGrp
);
List
<
Employee
>
getEmployeesFromList
(
Set
<
String
>
empIdsSet
);
boolean
verifyEmployeeRole
(
String
empId
,
String
roleName
);
List
<
HashMap
<
String
,
String
>>
getDeliveryManagerMap
(
List
deliveryManagerIdsList
);
List
<
Employee
>
getEmployeesFromList
(
Set
<
String
>
empIdsSet
);
List
<
HashMap
<
String
,
String
>>
getDeliveryManagerMap
(
List
deliveryManagerIdsList
);
public
List
<
Employee
>
getAllEmployees
();
public
List
<
Employee
>
getAllEmployees
();
}
src/main/java/com/nisum/myteam/service/IEmployeeVisaService.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
service
;
public
interface
IEmployeeVisaService
{
}
src/main/java/com/nisum/myteam/service/IProjectService.java
View file @
22239759
package
com
.
nisum
.
myteam
.
service
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.dao.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Set
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.dao.*
;
import
com.nisum.myteam.model.vo.EmployeeDashboardVO
;
public
interface
IProjectService
{
Project
createProject
(
Project
project
,
String
loginEmpId
)
throws
MyTeamException
;
Project
createProject
(
Project
project
,
String
loginEmpId
)
throws
MyTeamException
;
Project
updateProject
(
Project
project
,
String
loginEmpId
)
throws
MyTeamException
;
void
deleteProject
(
String
projectId
);
public
boolean
isProjectExistsByName
(
String
projectName
);
public
boolean
isProjectExistsById
(
String
projectId
);
public
Project
getProjectByProjectId
(
String
projectId
);
public
long
getProjectsCount
();
Project
updateProject
(
Project
project
,
String
loginEmpId
)
throws
MyTeamException
;
public
List
<
Project
>
getAllProjects
()
;
void
deleteProject
(
String
projectId
)
;
List
<
HashMap
<
Object
,
Object
>>
getProjects
()
throws
MyTeamException
;
List
<
Project
>
getProjectsUnderDomain
(
String
domainId
);
public
List
<
Project
>
getOnlyActiveProjects
(
);
List
<
HashMap
<
Object
,
Object
>>
getProjects
()
throws
MyTeamException
;
List
<
Project
>
getProjectsUnderDomain
(
String
domainId
)
;
List
<
Project
>
getProjectsUnderDeliveryLead
(
String
managerId
)
throws
MyTeamException
;
List
<
Project
>
getProjectsUnderDeliveryLead
(
String
managerId
)
throws
MyTeamException
;
public
Resource
addNewBeanchAllocation
(
Employee
employee
,
String
loginEmpId
);
public
Resource
addNewBeanchAllocation
(
Employee
employee
,
String
loginEmpId
);
List
<
EmpLoginData
>
employeeLoginsBasedOnDate
(
long
id
,
String
fromDate
,
String
toDate
)
throws
MyTeamException
;
List
<
EmpLoginData
>
employeeLoginsBasedOnDate
(
long
id
,
String
fromDate
,
String
toDate
)
throws
MyTeamException
;
String
generatePdfReport
(
long
id
,
String
fromDate
,
String
toDate
)
throws
MyTeamException
;
String
generatePdfReport
(
long
id
,
String
fromDate
,
String
toDate
)
throws
MyTeamException
;
List
<
Resource
>
getResourcesUnderProject
(
String
empId
);
List
<
Employee
>
getUnAssignedEmployees
(
);
//public List<HashMap<Object, Object>> getProjectsForEmployee(String empId
);
public
List
<
EmployeeDashboardVO
>
getEmployeesDashBoard
(
);
public
Set
<
String
>
accountsAssignedToDl
(
String
empId
);
public
HashMap
<
String
,
Object
>
addProjectTeamMateWithCheck
(
Resource
projectTeamMate
,
String
loginE
mpId
)
throws
MyTeamException
;
public
List
<
HashMap
<
Object
,
Object
>>
deliveryLeadProjects
(
String
e
mpId
)
throws
MyTeamException
;
public
List
<
HashMap
<
Object
,
Object
>>
getProjectsForEmployee
(
String
empId
);
public
Set
<
String
>
accountsAssignedToDl
(
String
emp
Id
);
public
Account
getProjectAccount
(
String
account
Id
);
public
List
<
HashMap
<
Object
,
Object
>>
deliveryLeadProjects
(
String
empId
)
throws
MyTeamException
;
public
Account
updateProjSeqinAccount
(
Account
account
)
throws
MyTeamException
;
public
List
<
Project
>
getAllProjects
()
;
public
List
<
HashMap
<
Object
,
Object
>>
getRoleBasedProjects
(
String
empId
)
throws
MyTeamException
;
public
boolean
isProjectExists
(
String
projectName
)
;
public
List
<
HashMap
<
Object
,
Object
>>
getProjectsInsteadOfRole
()
throws
MyTeamException
;
public
boolean
isProjectExistsById
(
String
projectId
)
;
public
List
<
Project
>
getActiveProjects
()
throws
MyTeamException
;
public
long
getProjectsCount
();
public
Account
getProjectAccount
(
String
account
Id
);
public
List
<
Project
>
getProjectsForDeliveryLead
(
String
deliveryLead
Id
);
public
Account
updateProjSeqinAccount
(
Account
account
)
throws
MyTeamException
;
List
<
Resource
>
getResourcesUnderProject
(
String
empId
)
;
public
List
<
HashMap
<
Object
,
Object
>>
getRoleBasedProjects
(
String
empId
)
throws
MyTeamException
;
public
List
<
HashMap
<
Object
,
Object
>>
getProjectsInsteadOfRole
()
throws
MyTeamException
;
public
List
<
Project
>
getActiveProjects
()
throws
MyTeamException
;
}
src/main/java/com/nisum/myteam/service/IResourceAllocationService.java
0 → 100644
View file @
22239759
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
;
import
com.nisum.myteam.model.dao.ResourceAllocation
;
import
com.nisum.myteam.model.vo.MyProjectAllocationVO
;
import
com.nisum.myteam.model.vo.ResourceVO
;
import
org.bson.types.ObjectId
;
import
java.util.HashMap
;
import
java.util.List
;
public
interface
IResourceAllocationService
{
ResourceAllocation
addResourceAllocation
(
ResourceAllocation
resourceAllocation
,
String
loginEmpId
)
throws
MyTeamException
;
void
updateResource
(
ResourceAllocation
resourceAllocation
,
String
loginEmpId
)
throws
MyTeamException
;
void
deleteResource
(
ResourceAllocation
resource
,
String
loginEmpId
);
List
<
ResourceAllocation
>
getAllResourcesForAllActiveProjects
();
// Resource save(Resource resource);
// void addResources(Employee employee, String loginEmpId);
// void inactivateResource(Employee employeeReq, Employee employeeUpdated, String loginEmpId);
List
<
ResourceAllocation
>
getResourcesSortByBillingStartDate
(
String
employeeId
);
// List<Resource> getAllResourcesForProject(String projectId, String status);
// List<Resource> getResourcesForEmployee(String empId);
// List<Resource> getAllResourcesForProject(String projectId);
List
<
ResourceAllocation
>
getActiveResources
(
String
empId
);
// List<Resource> getResourcesForShift(String shift);
public
List
<
ResourceVO
>
getResourcesForProject
(
String
projectId
,
String
statusFlag
);
public
List
<
ResourceAllocation
>
getResourcesUnderDeliveryLead
(
String
empId
);
public
List
<
ResourceAllocation
>
getBillingsForEmployee
(
String
empId
);
public
List
<
ResourceAllocation
>
getBillingsForProject
(
String
empId
,
String
projectId
);
public
List
<
MyProjectAllocationVO
>
getWorkedProjectsForResource
(
String
empId
);
public
List
<
Employee
>
getUnAssignedEmployees
();
public
List
<
ResourceAllocation
>
getAllResources
();
}
src/main/java/com/nisum/myteam/service/IResourceService.java
View file @
22239759
package
com
.
nisum
.
myteam
.
service
;
import
java.util.List
;
import
org.bson.types.ObjectId
;
import
org.springframework.stereotype.Service
;
import
com.nisum.myteam.exception.handler.MyTeamException
;
import
com.nisum.myteam.model.dao.Employee
;
import
com.nisum.myteam.model.dao.Resource
;
import
org.bson.types.ObjectId
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
@Service
public
interface
IResourceService
{
Resource
addResource
(
Resource
projectTeamMate
,
String
loginEmpId
)
throws
MyTeamException
;
Resource
addResource
(
Resource
projectTeamMate
,
String
loginEmpId
)
throws
MyTeamException
;
String
updateResource
(
Resource
projectTeamMate
,
String
loginEmpId
)
throws
MyTeamException
;
Resource
deleteResource
(
String
empId
,
String
projectId
,
ObjectId
id
,
String
loginEmpId
);
Resource
save
(
Resource
resource
);
void
addResources
(
Employee
employee
,
String
loginEmpId
);
String
updateResource
(
Resource
projectTeamMate
,
String
loginEmpId
)
throws
MyTeamException
;
void
inactivateResource
(
Employee
employeeReq
,
Employee
employeeUpdated
,
String
loginEmpId
)
;
Resource
deleteResource
(
String
empId
,
String
projectId
,
ObjectId
id
,
String
loginEmpId
);
List
<
Resource
>
findByAccountAndActiveAndBillableStatus
(
String
account
,
boolean
status
,
String
billableStatus
);
Resource
save
(
Resource
resource
);
List
<
Resource
>
getResourcesSortByStartDate
(
String
employeeId
);
void
addResources
(
Employee
employee
,
String
loginEmpId
);
List
<
Resource
>
getResourcesForProject
(
String
projectId
,
String
status
);
void
inactivateResource
(
Employee
employeeReq
,
Employee
employeeUpdated
,
String
loginE
mpId
);
List
<
Resource
>
getResourcesForEmployee
(
String
e
mpId
);
List
<
Resource
>
findByAccountAndActiveAndBillableStatus
(
String
account
,
boolean
status
,
String
billableStatus
);
List
<
Resource
>
getResourcesForProject
(
String
projectId
);
List
<
Resource
>
getResourcesSortByStartDate
(
String
employee
Id
);
List
<
Resource
>
getActiveResources
(
String
emp
Id
);
List
<
Resource
>
getResourcesForProject
(
String
projectId
,
String
status
);
List
<
Resource
>
getResourcesForActiveProjects
(
);
List
<
Resource
>
getResourcesForEmployee
(
String
empId
);
List
<
Resource
>
getResourcesForShift
(
String
shift
);
List
<
Resource
>
getResourcesForProject
(
String
project
Id
);
public
List
<
Resource
>
getResourcesUnderDeliveryLead
(
String
emp
Id
);
List
<
Resource
>
getActiveResources
(
String
empId
)
;
public
HashMap
<
String
,
Object
>
verifyResourceAssignedToAnyProject
(
Resource
projectTeamMate
,
String
loginEmpId
)
throws
MyTeamException
;
List
<
Resource
>
getResourcesForActiveProjects
();
List
<
Resource
>
getResourcesForShift
(
String
shift
);
public
List
<
Resource
>
getResourcesUnderDeliveryLead
(
String
empId
);
}
src/main/java/com/nisum/myteam/service/impl/DashboardService.java
0 → 100644
View file @
22239759
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.service.IDashboardService
;
import
com.nisum.myteam.service.IEmployeeService
;
import
com.nisum.myteam.service.IProjectService
;
import
com.nisum.myteam.service.IResourceAllocationService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
@Service
@Slf4j
public
class
DashboardService
implements
IDashboardService
{
@Autowired
private
IEmployeeService
employeeService
;
@Autowired
private
IResourceAllocationService
resourceService
;
@Autowired
private
IProjectService
projectService
;
@Override
public
List
<
EmployeeDashboardVO
>
getEmployeesDashBoard
()
{
//List<Employee> allEmployees = employeeRepo.findAll();
List
<
Employee
>
allEmployees
=
employeeService
.
getAllEmployees
();
List
<
EmployeeDashboardVO
>
employeeDashboard
=
new
ArrayList
<>();
Map
<
String
,
Object
>
teamMatesMap
=
new
HashMap
();
Map
<
String
,
Object
>
teamMatesStatusMap
=
new
HashMap
();
// Find all active employees
List
<
ResourceAllocation
>
resources
=
resourceService
.
getAllResources
();
for
(
ResourceAllocation
resource
:
resources
)
{
//if (resource.isActive()) {
if
(
resource
.
getBillingEndDate
().
compareTo
(
new
Date
())>
0
)
{
Project
project
=
projectService
.
getProjectByProjectId
(
resource
.
getProjectId
());
if
(
project
!=
null
&&
project
.
getStatus
()
!=
null
&&
!
"Completed"
.
equalsIgnoreCase
(
project
.
getStatus
()))
{
Object
projectTeamMate
=
teamMatesMap
.
get
(
resource
.
getEmployeeId
());
if
(
projectTeamMate
==
null
)
{
List
listOfObjects
=
new
ArrayList
<>();
listOfObjects
.
add
(
resource
);
// A person can have multiple active projects with billability
teamMatesMap
.
put
(
resource
.
getEmployeeId
(),
listOfObjects
);
}
else
{
List
existingRecordsInMap
=
(
List
)
teamMatesMap
.
get
(
resource
.
getEmployeeId
());
existingRecordsInMap
.
add
(
resource
);
teamMatesMap
.
put
(
resource
.
getEmployeeId
(),
existingRecordsInMap
);
}
}
}
}
for
(
Employee
emp
:
allEmployees
)
{
if
(
teamMatesMap
.
containsKey
(
emp
.
getEmployeeId
()))
{
Object
value
=
teamMatesMap
.
get
(
emp
.
getEmployeeId
());
if
(
value
instanceof
List
)
{
List
listOfTeamMates
=
(
List
)
value
;
String
billableStatus
=
"NA"
;
for
(
Object
obj
:
listOfTeamMates
)
{
ResourceAllocation
projectTeamMate
=
(
ResourceAllocation
)
obj
;
String
status
=
projectTeamMate
.
getBillableStatus
();
if
(
status
==
null
)
{
status
=
"NA"
;
}
EmployeeDashboardVO
empVo
=
new
EmployeeDashboardVO
();
BeanUtils
.
copyProperties
(
emp
,
empVo
);
BeanUtils
.
copyProperties
(
projectTeamMate
,
empVo
,
"employeeId"
,
"employeeName"
,
"emailId"
,
"role"
,
"designation"
,
"mobileNumber"
);
employeeDashboard
.
add
(
empVo
);
}
}
}
else
{
EmployeeDashboardVO
empVo
=
new
EmployeeDashboardVO
();
BeanUtils
.
copyProperties
(
emp
,
empVo
);
empVo
.
setBillableStatus
(
"UA"
);
empVo
.
setProjectAssigned
(
false
);
employeeDashboard
.
add
(
empVo
);
}
}
return
employeeDashboard
;
}
}
src/main/java/com/nisum/myteam/service/impl/DomainService.java
View file @
22239759
...
...
@@ -158,6 +158,23 @@ public class DomainService implements IDomainService {
return
domainVOS
;
}
public
Domain
getDomainById
(
String
domainId
)
{
Domain
domain
=
null
;
if
(
domainId
!=
null
&&
domainId
.
length
()
>
0
)
{
domain
=
domainRepo
.
findByDomainId
(
domainId
);
}
return
domain
;
}
@Override
public
List
<
Domain
>
getDomainsUnderAccount
(
String
accountId
)
throws
MyTeamException
{
List
<
Domain
>
domains
=
domainRepo
.
findByAccountId
(
accountId
);
return
domains
;
}
@Override
public
WriteResult
delete
(
String
domainId
)
throws
MyTeamException
{
List
<
String
>
domEmpIds
=
new
ArrayList
<
String
>();
...
...
@@ -243,22 +260,7 @@ public class DomainService implements IDomainService {
return
accIdsSet
;
}
public
Domain
getDomainById
(
String
domainId
)
{
Domain
domain
=
null
;
if
(
domainId
!=
null
&&
domainId
.
length
()
>
0
)
{
domain
=
domainRepo
.
findByDomainId
(
domainId
);
}
return
domain
;
}
@Override
public
List
<
Domain
>
getDomainsUnderAccount
(
String
accountId
)
throws
MyTeamException
{
List
<
Domain
>
domains
=
domainRepo
.
findByAccountId
(
accountId
);
return
domains
;
}
}
\ No newline at end of file
src/main/java/com/nisum/myteam/service/impl/EmployeeService.java
View file @
22239759
...
...
@@ -8,7 +8,9 @@ import com.nisum.myteam.model.dao.Resource;
import
com.nisum.myteam.repository.EmployeeRepo
;
import
com.nisum.myteam.service.*
;
import
com.nisum.myteam.utils.MyTeamUtils
;
import
com.nisum.myteam.utils.constants.ApplicationRole
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.FindAndModifyOptions
;
...
...
@@ -297,7 +299,7 @@ public class EmployeeService implements IEmployeeService {
}
@Override
public
boolean
verifyEmployeeRole
(
String
empId
,
String
role
Name
)
{
public
boolean
verifyEmployeeRole
(
String
empId
,
String
role
IdReq
)
{
boolean
flag
=
false
;
log
.
info
(
"The employeeId::"
+
empId
);
...
...
@@ -305,23 +307,29 @@ public class EmployeeService implements IEmployeeService {
Employee
employee
=
getEmployeeById
(
empId
);
log
.
info
(
"Employee::::in EmployeeService::"
+
employee
);
String
role
=
employee
.
getRole
();
log
.
info
(
"The employee role::"
+
role
);
if
(
null
!=
role
&&
""
!=
role
&&
!
"Admin"
.
equalsIgnoreCase
(
rol
e
))
{
String
role
Name
=
employee
.
getRole
();
log
.
info
(
"The employee role::"
+
role
Name
);
if
(
StringUtils
.
isNotBlank
(
roleName
)
&&
!
ApplicationRole
.
ADMIN
.
getRoleName
().
equalsIgnoreCase
(
roleNam
e
))
{
if
(
"FM"
.
equalsIgnoreCase
(
role
)
||
"Delivery Lead"
.
equalsIgnoreCase
(
role
))
{
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
(
role
Name
))
{
if
(
roleSet
.
contains
(
role
IdReq
))
{
flag
=
true
;
}
}
}
}
log
.
info
(
"before return flag::"
+
flag
);
return
flag
;
}
...
...
src/main/java/com/nisum/myteam/service/impl/EmployeeVisaService.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
service
.
impl
;
import
com.nisum.myteam.service.IEmployeeVisaService
;
import
org.springframework.stereotype.Service
;
@Service
public
class
EmployeeVisaService
implements
IEmployeeVisaService
{
//
// public getEmployeeVisaByName(String passport)
//
// employeeVisaRepo.findByVisaName(passport);
}
src/main/java/com/nisum/myteam/service/impl/ProjectService.java
View file @
22239759
This diff is collapsed.
Click to expand it.
src/main/java/com/nisum/myteam/service/impl/ResourceAllocationService.java
0 → 100644
View file @
22239759
This diff is collapsed.
Click to expand it.
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
22239759
package
com
.
nisum
.
myteam
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
...
...
@@ -66,7 +61,7 @@ public class ResourceService implements IResourceService {
private
ProjectService
projectService
;
@Autowired
private
EmployeeRepo
employeeR
oleR
epo
;
private
EmployeeRepo
employeeRepo
;
public
Resource
save
(
Resource
resource
)
{
return
resourceRepo
.
save
(
resource
);
...
...
@@ -81,7 +76,7 @@ public class ResourceService implements IResourceService {
resourceReq
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
CREATE
);
Resource
resourcePersisted
=
resourceRepo
.
save
(
resourceReq
);
// Get Active billings for Nisum Bench Project.
List
<
Billing
>
listBD
=
billingService
.
getActiveBillings
(
resourcePersisted
.
getEmployeeId
(),
"Nisum0000"
);
...
...
@@ -311,11 +306,11 @@ public class ResourceService implements IResourceService {
empShiftService
.
updateEmployeeShift
(
existingResource
,
loginEmpId
);
existingResource
.
setShift
(
resourceReq
.
getShift
());
Employee
employeeDB
=
employeeR
oleR
epo
.
findByEmployeeId
(
resourceReq
.
getEmployeeId
());
Employee
employeeDB
=
employeeRepo
.
findByEmployeeId
(
resourceReq
.
getEmployeeId
());
employeeDB
.
setShift
(
resourceReq
.
getShift
());
employeeDB
.
setModifiedBy
(
loginEmpId
);
employeeDB
.
setLastModifiedOn
(
new
Date
());
employeeR
oleR
epo
.
save
(
employeeDB
);
employeeRepo
.
save
(
employeeDB
);
}
existingResource
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
UPDATE
);
// Setting
// audit
...
...
@@ -340,15 +335,6 @@ public class ResourceService implements IResourceService {
return
response
;
}
private
String
validateAgainstDOJ
(
Resource
resource
)
{
String
response
=
null
;
Date
empDoj
=
employeeRoleRepo
.
findByEmployeeId
(
resource
.
getEmployeeId
()).
getDateOfJoining
();
if
(
resource
.
getNewBillingStartDate
().
compareTo
(
empDoj
)
<
0
)
{
response
=
"Resource Start Date ("
+
resource
.
getNewBillingStartDate
()
+
" ) in "
+
resource
.
getProjectName
()
+
" project should not be before Date of Joining ( "
+
empDoj
+
")."
;
}
return
response
;
}
@Override
public
Resource
deleteResource
(
String
empId
,
String
projectId
,
ObjectId
id
,
String
loginEmpId
)
{
...
...
@@ -600,23 +586,23 @@ public class ResourceService implements IResourceService {
return
resourcesList
;
}
@Override
public
List
<
Resource
>
getResourcesUnderDeliveryLead
(
String
deliveryLeadId
)
{
List
<
String
>
projectIdsList
=
new
ArrayList
<>();
List
<
Resource
>
resourcesList
=
new
ArrayList
<>();
List
<
Project
>
projectsList
=
projectRepo
.
findByDeliveryLeadIds
(
deliveryLeadId
);
for
(
Project
project
:
projectsList
)
projectIdsList
.
add
(
project
.
getProjectId
());
Query
query
=
new
Query
(
Criteria
.
where
(
"projectId"
).
in
(
projectIdsList
));
List
<
Resource
>
resourcesListPersisted
=
mongoTemplate
.
find
(
query
,
Resource
.
class
);
for
(
Resource
resource
:
resourcesListPersisted
)
{
if
(!
resource
.
getEmployeeId
().
equals
(
deliveryLeadId
))
resourcesList
.
add
(
resource
);
...
...
@@ -624,4 +610,77 @@ public class ResourceService implements IResourceService {
return
resourcesList
;
}
@Override
public
HashMap
<
String
,
Object
>
verifyResourceAssignedToAnyProject
(
Resource
resourceReq
,
String
loginEmpId
)
throws
MyTeamException
{
boolean
flag
=
false
;
String
projectName
=
null
;
String
fromDate
=
null
;
String
toDate
=
null
;
String
result
=
null
;
HashMap
<
String
,
Object
>
responseMap
=
new
HashMap
<>();
Resource
resourcePersisted
=
null
;
List
<
Resource
>
resourceList
=
resourceRepo
.
findByEmployeeId
(
resourceReq
.
getEmployeeId
()).
stream
()
.
filter
(
e
->
!(
"Nisum0000"
.
equalsIgnoreCase
(
e
.
getProjectId
())))
.
sorted
(
Comparator
.
comparing
(
Resource:
:
getEndDate
).
reversed
())
.
collect
(
Collectors
.
toList
());
// Checking, if resource has existing project assignment.
for
(
Resource
resource
:
resourceList
)
{
log
.
info
(
"Resource::"
+
resource
);
if
(
resource
.
getEndDate
()
!=
null
&&
(
resource
.
getEndDate
().
compareTo
(
new
Date
())
>
0
))
{
flag
=
true
;
projectName
=
resource
.
getProjectName
();
fromDate
=
resource
.
getStartDate
().
toString
();
toDate
=
resource
.
getEndDate
().
toString
();
break
;
}
}
if
(
flag
)
{
// If yes, error thrown to user.
result
=
"Resource "
+
resourceReq
.
getEmployeeId
()
+
" already Assigned to the "
+
projectName
+
" Project"
+
" from "
+
fromDate
+
"to "
+
toDate
;
}
else
{
// If no, validating new project assignment start date against previous project end date.
result
=
validateNewProjectAssignmentStartDate
(
resourceList
,
resourceReq
);
if
(
result
==
null
)
{
resourcePersisted
=
this
.
addResource
(
resourceReq
,
loginEmpId
);
result
=
"TeamMate added successfuly"
;
}
}
responseMap
.
put
(
"message"
,
result
);
responseMap
.
put
(
"resourceObj"
,
resourcePersisted
);
return
responseMap
;
}
private
String
validateNewProjectAssignmentStartDate
(
List
<
Resource
>
resourceList
,
Resource
resourceReq
)
{
String
response
=
null
;
if
(
resourceList
!=
null
&&
resourceList
.
size
()
>
0
)
{
Resource
resource
=
resourceList
.
get
(
0
);
if
(
resourceReq
.
getNewBillingStartDate
().
compareTo
(
resource
.
getEndDate
())
<=
0
)
{
response
=
"Resource Start Date ("
+
resourceReq
.
getNewBillingStartDate
()
+
" ) in "
+
resourceReq
.
getProjectName
()
+
" project should be after "
+
resource
.
getProjectName
()
+
" project End Date ( "
+
resource
.
getEndDate
()
+
")."
;
}
}
else
{
response
=
validateAgainstDOJ
(
resourceReq
);
}
return
response
;
}
private
String
validateAgainstDOJ
(
Resource
resource
)
{
String
response
=
null
;
Date
empDoj
=
employeeRepo
.
findByEmployeeId
(
resource
.
getEmployeeId
()).
getDateOfJoining
();
if
(
resource
.
getNewBillingStartDate
().
compareTo
(
empDoj
)
<
0
)
{
response
=
"Resource Start Date ("
+
resource
.
getNewBillingStartDate
()
+
" ) in "
+
resource
.
getProjectName
()
+
" project should not be before Date of Joining ( "
+
empDoj
+
")."
;
}
return
response
;
}
}
src/main/java/com/nisum/myteam/statuscodes/DomainStatus.java
View file @
22239759
...
...
@@ -2,8 +2,11 @@ package com.nisum.myteam.statuscodes;
public
enum
DomainStatus
{
CREATE
(
600
,
"Account has been created"
),
UPDATE
(
601
,
"Account has been updated"
);
CREATE
(
610
,
"Domain has been created"
),
UPDATE
(
611
,
"Domain has been updated"
),
ALREADY_EXISTED
(
612
,
"Domain is already existed"
),
IS_NOT_FOUND
(
613
,
"Domain is Not found"
),
GET_DOMIAINS
(
614
,
"Retrieved the domains successfully"
);
private
int
code
;
private
String
message
;
...
...
src/main/java/com/nisum/myteam/statuscodes/ProjectStatus.java
View file @
22239759
package
com
.
nisum
.
myteam
.
statuscodes
;
public
class
ProjectStatus
{
public
enum
ProjectStatus
{
CREATE
(
700
,
"Project has been created"
),
UPDATE
(
701
,
"Project has been updated"
),
DELETE
(
702
,
"Project has been deleted successfully"
),
ALREADY_EXISTED
(
703
,
"Project is already existed"
),
PROJECTID_IS_NOT_EXISTS
(
704
,
"Project Id is not existed"
),
PROJECT_NAME_IS_NOT_EXISTS
(
705
,
"Project is not existed"
),
IS_NOT_FOUND
(
706
,
"Project is Not found"
),
GET_PROJECTS
(
707
,
"Retrieved the projects successfully"
),
EMPLOYEE_NOT_EXISTS
(
708
,
"Please Provide valid employee id"
),
DELIVERYLEAD_NOT_EXISTS
(
709
,
"Please Provide valid Delivery lead id"
);
private
int
code
;
private
String
message
;
private
ProjectStatus
(
int
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
public
int
getCode
()
{
return
this
.
code
;
}
public
String
getMessage
()
{
return
this
.
message
;
}
}
src/main/java/com/nisum/myteam/statuscodes/ResourceCodes.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
statuscodes
;
public
enum
ResourceCodes
{
CREATE
(
800
,
""
);
private
int
code
;
private
String
message
;
private
ResourceCodes
(
int
code
,
String
message
){
this
.
code
=
code
;
this
.
message
=
message
;
}
public
int
getCode
()
{
return
this
.
code
;
}
public
String
getMessage
()
{
return
this
.
message
;
}
}
src/main/java/com/nisum/myteam/statuscodes/ResourceStatus.java
View file @
22239759
package
com
.
nisum
.
myteam
.
statuscodes
;
public
class
ResourceStatus
{
public
enum
ResourceStatus
{
ACTIVE
(
"Active"
),
IN_ACTIVE
(
"InActive"
);
private
String
status
;
private
ResourceStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getStatus
()
{
return
this
.
status
;
}
}
src/main/java/com/nisum/myteam/utils/MyTeamDateUtils.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
utils
;
import
java.util.Calendar
;
import
java.util.Date
;
public
class
MyTeamDateUtils
{
public
static
Date
getYesterdayDate
()
{
final
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
add
(
Calendar
.
DATE
,
-
1
);
return
cal
.
getTime
();
}
}
src/main/java/com/nisum/myteam/utils/MyTeamUtils.java
View file @
22239759
...
...
@@ -156,11 +156,18 @@ public class MyTeamUtils {
public
final
static
String
UPDATE
=
"UPDATE"
;
public
static
final
String
SHIFT1
=
"Shift 1(9:00 AM - 6:00 PM)"
;
public
static
final
String
SHIFT2
=
"Shift-2(2:00 PM - 11:00 PM)"
;
public
static
final
String
SHIFT3
=
"Shift 3(10:00 PM - 6:00 AM)"
;
public
static
final
String
SHIFT4
=
"Shift 4(7:30 AM - 3:30 PM)"
;
public
static
final
String
SHIFT5
=
"Shift 5(11:30 AM - 7:30 PM)"
;
public
final
static
String
PROJECT_START_DATE
=
"ProjectStartDate"
;
public
final
static
String
PROJECT_END_DATE
=
"ProjectEndDate"
;
public
final
static
String
BILLING_START_DATE
=
"billingStartDate"
;
public
final
static
String
BILLING_END_DATE
=
"billingEndDate"
;
}
src/main/java/com/nisum/myteam/utils/constants/ApplicationRole.java
0 → 100644
View file @
22239759
package
com
.
nisum
.
myteam
.
utils
.
constants
;
public
enum
ApplicationRole
{
FUNCTIONAL_MANAGER
(
""
,
"FM"
),
ADMIN
(
""
,
"Admin"
),
DIRECTOR
(
""
,
"Director"
),
DELIVERY_MANAGER
(
"DM"
,
"Delivery Manager"
),
DELIVERY_LEAD
(
"DL"
,
"Delivery Lead"
),
LEAD
(
"L"
,
"Lead"
),
EMPLOYEE
(
""
,
"Employee"
),
HR
(
""
,
"Hr"
);
private
String
roleId
;
private
String
roleName
;
private
ApplicationRole
(
String
roleId
,
String
roleName
)
{
this
.
roleId
=
roleId
;
this
.
roleName
=
roleName
;
}
public
String
getRoleId
()
{
return
this
.
roleId
;
}
public
String
getRoleName
()
{
return
this
.
roleName
;
}
}
src/main/java/com/nisum/myteam/utils/constants/RoleEnum.java
deleted
100644 → 0
View file @
5592d335
package
com
.
nisum
.
myteam
.
utils
.
constants
;
public
enum
RoleEnum
{
ADMIN
(
"admin"
),
DIRECTOR
(
"Director"
),
DELIVERY_MANAGER
(
"Delivery Manager"
),
DELIVERY_LEAD
(
"Delivery Lead"
),
LEAD
(
"Lead"
),
EMPLOYEE
(
"Employee"
),
HR
(
"hr"
);
private
String
role
;
private
RoleEnum
(
String
role
)
{
this
.
role
=
role
;
}
public
String
getRole
()
{
return
this
.
role
;
}
}
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