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
68970794
Commit
68970794
authored
Sep 11, 2018
by
b v s satyanarayana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MT-70 :SNS :: AuditFiledsAddedToTeams_ProjectTeamMates_BillingDetails_ShifTDetails
parent
3cd9ee2f
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
212 additions
and
192 deletions
+212
-192
ProjectController.java
...n/java/com/nisum/mytime/controller/ProjectController.java
+12
-10
ProjectTeamController.java
...va/com/nisum/mytime/controller/ProjectTeamController.java
+30
-44
AuditFields.java
src/main/java/com/nisum/mytime/model/AuditFields.java
+27
-0
BillingDetails.java
src/main/java/com/nisum/mytime/model/BillingDetails.java
+3
-3
EmpShiftDetails.java
src/main/java/com/nisum/mytime/model/EmpShiftDetails.java
+3
-5
Project.java
src/main/java/com/nisum/mytime/model/Project.java
+2
-8
ProjectTeamMate.java
src/main/java/com/nisum/mytime/model/ProjectTeamMate.java
+3
-5
ProjectService.java
src/main/java/com/nisum/mytime/service/ProjectService.java
+10
-10
ProjectServiceImpl.java
...ain/java/com/nisum/mytime/service/ProjectServiceImpl.java
+85
-82
UserServiceImpl.java
src/main/java/com/nisum/mytime/service/UserServiceImpl.java
+11
-9
MyTimeUtils.java
src/main/java/com/nisum/mytime/utils/MyTimeUtils.java
+3
-0
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+9
-8
ProjectMyTeamController.js
...ain/webapp/WEB-INF/controllers/ProjectMyTeamController.js
+2
-1
ProjectTeamController.js
src/main/webapp/WEB-INF/controllers/ProjectTeamController.js
+9
-5
ViewProjectController.js
src/main/webapp/WEB-INF/controllers/ViewProjectController.js
+3
-2
No files found.
src/main/java/com/nisum/mytime/controller/ProjectController.java
View file @
68970794
...
...
@@ -37,6 +37,7 @@ public class ProjectController {
private
AccountRepo
accountRepo
;
@Autowired
private
ProjectRepo
projectRepo
;
@RequestMapping
(
value
=
"/employee"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
EmployeeRoles
>
getEmployeeRole
(
@RequestParam
(
"emailId"
)
String
emailId
)
throws
MyTimeException
{
...
...
@@ -45,22 +46,21 @@ public class ProjectController {
}
@RequestMapping
(
value
=
"/addProject"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
addProject
(
@RequestBody
Project
projectAdded
)
throws
MyTimeException
{
public
ResponseEntity
<?>
addProject
(
@RequestBody
Project
projectAdded
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTimeException
{
// checking project duplicateName
int
projectNameCount
=
0
;
if
(
projectAdded
.
getAccountId
()
!=
null
)
{
List
<
Project
>
projects
=
projectRepo
.
findByDomainId
(
projectAdded
.
getDomainId
());
for
(
Project
existproject
:
projects
)
{
if
(
projectAdded
.
getProjectName
().
equalsIgnoreCase
(
existproject
.
getProjectName
()))
projectNameCount
++;
}
projectNameCount
++;
}
}
if
(
projectNameCount
>
0
)
{
if
(
projectNameCount
>
MyTimeUtils
.
INT_ZERO
){
MyTimeException
myTimeException
=
new
MyTimeException
(
"Project name already exist !!! try with new"
);
return
new
ResponseEntity
<>(
myTimeException
,
HttpStatus
.
OK
);
}
else
{
}
else
{
String
accountName
=
""
;
String
accountId
=
projectAdded
.
getAccountId
();
// String accountName=projectAdded.getAccount();
...
...
@@ -69,16 +69,18 @@ public class ProjectController {
accountName
=
account
.
getAccountName
();
int
sequenceNumber
=
account
.
getAccountProjectSequence
();
account
.
setAccountProjectSequence
(
sequenceNumber
+
1
);
//account.setAuditFields(loginEmpId, MyTimeUtils.UPDATE);
accountRepo
.
save
(
account
);
String
projectId
=
accountName
+
String
.
format
(
"%04d"
,
sequenceNumber
+
1
);
projectAdded
.
setProjectId
(
projectId
);
Project
project
=
projectService
.
addProject
(
projectAdded
);
Project
project
=
projectService
.
addProject
(
projectAdded
,
loginEmpId
);
return
new
ResponseEntity
<>(
project
,
HttpStatus
.
OK
);
}
}
@RequestMapping
(
value
=
"/updateProject"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
updateEmployeeRole
(
@RequestBody
Project
project
)
throws
MyTimeException
{
public
ResponseEntity
<?>
updateProject
(
@RequestBody
Project
project
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTimeException
{
// checking project duplicateName
int
projectNameCount
=
0
;
if
(
project
.
getAccountId
()
!=
null
)
{
...
...
@@ -95,7 +97,7 @@ public class ProjectController {
MyTimeException
myTimeException
=
new
MyTimeException
(
"Project name already exist !!! try with new"
);
return
new
ResponseEntity
<>(
myTimeException
,
HttpStatus
.
OK
);
}
Project
updatedProject
=
projectService
.
updateProject
(
project
);
Project
updatedProject
=
projectService
.
updateProject
(
project
,
loginEmpId
);
return
new
ResponseEntity
<>(
updatedProject
,
HttpStatus
.
OK
);
}
...
...
src/main/java/com/nisum/mytime/controller/ProjectTeamController.java
View file @
68970794
...
...
@@ -40,9 +40,6 @@ public class ProjectTeamController {
@Autowired
private
EmployeeVisaRepo
employeeVisaRepo
;
@Autowired
private
ProjectController
projectController
;
@RequestMapping
(
value
=
"/employee"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
EmployeeRoles
>
getEmployeeRole
(
...
...
@@ -55,17 +52,17 @@ public class ProjectTeamController {
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
Project
>
addProject
(
@RequestBody
Project
employeeRoles
)
throws
MyTimeException
{
Project
project
=
projectService
.
addProject
(
employeeRoles
);
@RequestBody
Project
projectObj
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTimeException
{
Project
project
=
projectService
.
addProject
(
projectObj
,
loginEmpId
);
return
new
ResponseEntity
<>(
project
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/updateEmployeeRole"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
EmployeeRoles
>
updateEmployeeRole
(
@RequestBody
EmployeeRoles
emp
loyeeRoles
,
public
ResponseEntity
<
EmployeeRoles
>
updateEmployeeRole
(
@RequestBody
EmployeeRoles
emp
,
@RequestParam
(
value
=
"empId"
)
String
loginEmpId
)
throws
MyTimeException
{
EmployeeRoles
employeeRole
=
userService
.
updateEmployeeRole
(
emp
loyeeRoles
,
loginEmpId
);
EmployeeRoles
employeeRole
=
userService
.
updateEmployeeRole
(
emp
,
loginEmpId
);
return
new
ResponseEntity
<>(
employeeRole
,
HttpStatus
.
OK
);
}
...
...
@@ -124,29 +121,20 @@ public class ProjectTeamController {
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
ProjectTeamMate
>
addEmployeeToTeam
(
@RequestBody
ProjectTeamMate
teamMate
)
throws
MyTimeException
{
@RequestBody
ProjectTeamMate
teamMate
,
@RequestParam
(
value
=
"loginEmpId"
,
required
=
false
)
String
loginEmpId
)
throws
MyTimeException
{
teamMate
.
setActive
(
true
);
// teamMate.setStartDate(new Date());
/*if (teamMate.getRole()!= null && teamMate.getRole().equals("Lead")) {
Project project = new Project();
project.setProjectName(teamMate.getProjectName());
project.setManagerIds(Arrays.asList(teamMate.getEmployeeId()));
project.setAccountId(teamMate.getAccountId());
project.setDomainId(teamMate.getDomainId());
project.setStatus("Active");
projectController.addProject(project);
}*/
ProjectTeamMate
teamMateDB
=
projectService
.
addProjectTeamMate
(
teamMate
);
teamMate
.
setAuditFields
(
loginEmpId
,
MyTimeUtils
.
CREATE
);
ProjectTeamMate
teamMateDB
=
projectService
.
addProjectTeamMate
(
teamMate
,
loginEmpId
);
return
new
ResponseEntity
<>(
teamMateDB
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/updateTeammate"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
TEXT_PLAIN_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
String
>
updateTeammate
(
@RequestBody
ProjectTeamMate
projectTeamMate
)
public
ResponseEntity
<
String
>
updateTeammate
(
@RequestBody
ProjectTeamMate
projectTeamMate
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTimeException
{
String
response
=
projectService
.
updateTeammate
(
projectTeamMate
);
projectTeamMate
.
setAuditFields
(
loginEmpId
,
MyTimeUtils
.
UPDATE
);
String
response
=
projectService
.
updateTeammate
(
projectTeamMate
,
loginEmpId
);
return
new
ResponseEntity
<>(
response
,
HttpStatus
.
OK
);
}
...
...
@@ -154,10 +142,10 @@ public class ProjectTeamController {
produces
=
MediaType
.
TEXT_PLAIN_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
String
>
deleteTeammate
(
@RequestBody
ProjectTeamMate
projectTeamMate
)
@RequestBody
ProjectTeamMate
projectTeamMate
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTimeException
{
projectService
.
deleteTeammate
(
projectTeamMate
.
getEmployeeId
(),
projectTeamMate
.
getProjectId
(),
projectTeamMate
.
getId
());
projectTeamMate
.
getProjectId
(),
projectTeamMate
.
getId
()
,
loginEmpId
);
return
new
ResponseEntity
<>(
"Success"
,
HttpStatus
.
OK
);
}
...
...
@@ -259,9 +247,9 @@ public class ProjectTeamController {
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
BillingDetails
>
addEmployeeBilling
(
@RequestBody
BillingDetails
teamMate
)
throws
MyTimeException
{
@RequestBody
BillingDetails
billingDetails
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTimeException
{
BillingDetails
billings
=
projectService
.
addEmployeeBillingDetails
(
teamMate
);
.
addEmployeeBillingDetails
(
billingDetails
,
loginEmpId
);
return
new
ResponseEntity
<>(
billings
,
HttpStatus
.
OK
);
}
...
...
@@ -271,9 +259,9 @@ public class ProjectTeamController {
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
BillingDetails
>
updateEmployeeBilling
(
@RequestBody
BillingDetails
teamMate
)
throws
MyTimeException
{
@RequestBody
BillingDetails
billingDetails
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTimeException
{
BillingDetails
billings
=
projectService
.
updateEmployeeBilling
(
teamMate
);
.
updateEmployeeBilling
(
billingDetails
,
loginEmpId
);
return
new
ResponseEntity
<>(
billings
,
HttpStatus
.
OK
);
}
...
...
@@ -301,12 +289,12 @@ public class ProjectTeamController {
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
List
<
EmployeeRoles
>>
getEmployeesHavingVisa
(
@RequestParam
(
"visa"
)
String
visa
)
throws
MyTimeException
{
if
(
visa
!=
null
&&
!
"passport"
.
equalsIgnoreCase
(
visa
))
{
@RequestParam
(
"visa"
)
String
passport
)
throws
MyTimeException
{
List
<
EmployeeRoles
>
employees
=
new
ArrayList
<>();
if
(
passport
!=
null
&&
!
"passport"
.
equalsIgnoreCase
(
passport
))
{
List
<
EmployeeVisa
>
employeeVisas
=
employeeVisaRepo
.
findByVisaName
(
visa
);
.
findByVisaName
(
passport
);
List
<
String
>
employeeIds
=
null
;
List
<
EmployeeRoles
>
employeesRoles
=
new
ArrayList
<>();
if
(
employeeVisas
!=
null
)
{
employeeIds
=
employeeVisas
.
stream
()
.
map
(
EmployeeVisa:
:
getEmployeeId
)
...
...
@@ -314,22 +302,22 @@ public class ProjectTeamController {
}
if
(
employeeIds
!=
null
&&
!
employeeIds
.
isEmpty
())
{
List
<
EmployeeRoles
>
emps
=
userService
.
getEmployeeRoles
();
for
(
EmployeeRoles
e
:
emps
)
{
if
(
employeeIds
.
contains
(
e
.
getEmployeeId
()))
{
employees
Roles
.
add
(
e
);
for
(
EmployeeRoles
e
mp
:
emps
)
{
if
(
employeeIds
.
contains
(
e
mp
.
getEmployeeId
()))
{
employees
.
add
(
emp
);
}
}
}
return
new
ResponseEntity
<>(
employees
Roles
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
employees
,
HttpStatus
.
OK
);
}
else
{
List
<
EmployeeRoles
>
employeesRol
es
=
new
ArrayList
<>();
//List<EmployeeRoles> employe
es = new ArrayList<>();
if
(
userService
.
getEmployeeRoles
()
!=
null
)
{
employees
Roles
=
userService
.
getEmployeeRoles
().
stream
()
employees
=
userService
.
getEmployeeRoles
().
stream
()
.
sorted
((
o1
,
o2
)
->
o1
.
getEmployeeName
()
.
compareTo
(
o2
.
getEmployeeName
()))
.
collect
(
Collectors
.
toList
());
}
return
new
ResponseEntity
<>(
employees
Roles
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
employees
,
HttpStatus
.
OK
);
}
}
...
...
@@ -338,10 +326,8 @@ public class ProjectTeamController {
produces
=
MediaType
.
TEXT_PLAIN_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
String
>
addEmployeeToTeamWithCheck
(
@RequestBody
ProjectTeamMate
teamMate
)
throws
MyTimeException
{
String
response
=
projectService
.
addProjectTeamMateWithCheck
(
teamMate
);
return
new
ResponseEntity
<>(
response
,
HttpStatus
.
OK
);
@RequestBody
ProjectTeamMate
teamMate
,
@RequestParam
(
value
=
"loginEmpId"
)
String
loginEmpId
)
throws
MyTimeException
{
String
response
=
projectService
.
addProjectTeamMateWithCheck
(
teamMate
,
loginEmpId
);
return
new
ResponseEntity
<>(
response
,
HttpStatus
.
OK
);
}
}
\ No newline at end of file
src/main/java/com/nisum/mytime/model/AuditFields.java
0 → 100644
View file @
68970794
package
com
.
nisum
.
mytime
.
model
;
import
java.util.Date
;
import
com.nisum.mytime.utils.MyTimeUtils
;
import
lombok.Getter
;
import
lombok.Setter
;
@Setter
@Getter
public
class
AuditFields
{
String
createdBy
;
String
modifiedBy
;
Date
createdOn
;
Date
lastModifiedOn
;
public
void
setAuditFields
(
String
loginEmpId
,
String
action
)
{
Date
currentDate
=
new
Date
();
if
(
MyTimeUtils
.
CREATE
.
equals
(
action
))
{
this
.
createdBy
=
loginEmpId
;
this
.
createdOn
=
currentDate
;
}
this
.
modifiedBy
=
loginEmpId
;
this
.
lastModifiedOn
=
currentDate
;
}
}
src/main/java/com/nisum/mytime/model/BillingDetails.java
View file @
68970794
...
...
@@ -21,7 +21,7 @@ import lombok.ToString;
@NoArgsConstructor
@ToString
@Document
(
collection
=
"BillingDetails"
)
public
class
BillingDetails
implements
Serializable
{
public
class
BillingDetails
extends
AuditFields
implements
Serializable
{
public
Date
getBillingEndDate
()
{
return
billingEndDate
;
...
...
@@ -43,7 +43,7 @@ public class BillingDetails implements Serializable {
private
Date
billingEndDate
;
private
String
comments
;
private
boolean
active
;
@DateTimeFormat
(
pattern
=
"dd-MM-yyyy"
)
private
Date
createDate
;
//
@DateTimeFormat(pattern = "dd-MM-yyyy")
//
private Date createDate;
}
src/main/java/com/nisum/mytime/model/EmpShiftDetails.java
View file @
68970794
package
com
.
nisum
.
mytime
.
model
;
import
java.util.Date
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
...
...
@@ -17,15 +15,15 @@ import lombok.ToString;
@NoArgsConstructor
@ToString
@Document
(
collection
=
"EmpShiftDetails"
)
public
class
EmpShiftDetails
{
public
class
EmpShiftDetails
extends
AuditFields
{
@Id
private
String
id
;
private
String
employeeId
;
private
String
employeeName
;
private
String
shift
;
private
Date
createDate
;
private
Date
updatedDate
;
//
private Date createDate;
//
private Date updatedDate;
private
boolean
active
;
}
src/main/java/com/nisum/mytime/model/Project.java
View file @
68970794
...
...
@@ -22,7 +22,7 @@ import lombok.ToString;
@NoArgsConstructor
@ToString
@Document
(
collection
=
"Teams"
)
public
class
Project
implements
Serializable
{
public
class
Project
extends
AuditFields
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -30,12 +30,7 @@ public class Project implements Serializable {
private
ObjectId
id
;
private
String
projectId
;
private
String
projectName
;
/*
* After Ui Integration this below commented code will be removed
*/
//private String managerId;
// private String managerName;
// private String account;
private
String
domain
;
private
String
status
;
private
List
<
String
>
employeeIds
;
...
...
@@ -47,5 +42,4 @@ public class Project implements Serializable {
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
private
Date
projectEndDate
;
private
List
<
String
>
deliveryLeadIds
;
}
src/main/java/com/nisum/mytime/model/ProjectTeamMate.java
View file @
68970794
...
...
@@ -21,7 +21,7 @@ import lombok.ToString;
@NoArgsConstructor
@ToString
@Document
(
collection
=
"TeamDetails"
)
public
class
ProjectTeamMate
implements
Serializable
{
public
class
ProjectTeamMate
extends
AuditFields
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -35,8 +35,7 @@ public class ProjectTeamMate implements Serializable {
private
String
projectId
;
private
String
projectName
;
private
String
account
;
//private String managerId;
//private String managerName;
private
String
experience
;
private
String
designation
;
private
String
billableStatus
;
...
...
@@ -48,8 +47,7 @@ public class ProjectTeamMate implements Serializable {
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
private
Date
newBillingStartDate
;
private
boolean
active
;
//private List<String> managerIds;
private
String
accountId
;
private
String
domainId
;
}
src/main/java/com/nisum/mytime/service/ProjectService.java
View file @
68970794
...
...
@@ -21,7 +21,7 @@ public interface ProjectService {
List
<
HashMap
<
Object
,
Object
>>
getProjects
()
throws
MyTimeException
;
Project
addProject
(
Project
project
)
throws
MyTimeException
;
Project
addProject
(
Project
project
,
String
loginEmpId
)
throws
MyTimeException
;
String
generatePdfReport
(
long
id
,
String
fromDate
,
String
toDate
)
throws
MyTimeException
;
...
...
@@ -30,7 +30,7 @@ public interface ProjectService {
void
deleteProject
(
String
projectId
);
Project
updateProject
(
Project
project
)
throws
MyTimeException
;
Project
updateProject
(
Project
project
,
String
loginEmpId
)
throws
MyTimeException
;
EmployeeRoles
getEmployeesRoleData
(
String
empId
);
...
...
@@ -39,12 +39,12 @@ public interface ProjectService {
//MT-72
List
<
ProjectTeamMate
>
getProjectInfo
(
String
empId
);
public
ProjectTeamMate
addProjectTeamMate
(
ProjectTeamMate
projectTeamMate
)
public
ProjectTeamMate
addProjectTeamMate
(
ProjectTeamMate
projectTeamMate
,
String
loginEmpId
)
throws
MyTimeException
;
String
updateTeammate
(
ProjectTeamMate
projectTeamMate
)
throws
MyTimeException
;
String
updateTeammate
(
ProjectTeamMate
projectTeamMate
,
String
loginEmpId
)
throws
MyTimeException
;
void
deleteTeammate
(
String
empId
,
String
projectId
,
ObjectId
id
);
void
deleteTeammate
(
String
empId
,
String
projectId
,
ObjectId
id
,
String
loginEmpId
);
List
<
Project
>
getProjects
(
String
managerId
)
throws
MyTimeException
;
...
...
@@ -63,9 +63,9 @@ public interface ProjectService {
List
<
BillingDetails
>
getEmployeeBillingDetails
(
String
empId
,
String
projectId
);
BillingDetails
addEmployeeBillingDetails
(
BillingDetails
teamMate
);
BillingDetails
addEmployeeBillingDetails
(
BillingDetails
billingDetails
,
String
loginEmpId
);
BillingDetails
updateEmployeeBilling
(
BillingDetails
teamMate
);
BillingDetails
updateEmployeeBilling
(
BillingDetails
billingDetails
,
String
loginEmpId
);
void
deleteEmployeeBilling
(
BillingDetails
teamMate
);
...
...
@@ -78,14 +78,14 @@ public interface ProjectService {
List
<
BillingDetails
>
getEmployeeBillingDetailsAll
(
String
empId
);
public
void
updateShiftDetails
(
ProjectTeamMate
existingTeammate
);
public
void
updateShiftDetails
(
ProjectTeamMate
existingTeammate
,
String
loginEmpId
);
public
void
addShiftDetails
(
ProjectTeamMate
projectTeamMate
);
public
void
addShiftDetails
(
ProjectTeamMate
projectTeamMate
,
String
loginEmpId
);
List
<
ProjectTeamMate
>
findByAccountAndActiveAndBillableStatus
(
String
account
,
boolean
status
,
String
billableStatus
);
public
String
addProjectTeamMateWithCheck
(
ProjectTeamMate
projectTeamMate
)
public
String
addProjectTeamMateWithCheck
(
ProjectTeamMate
projectTeamMate
,
String
loginEmpId
)
throws
MyTimeException
;
public
List
<
HashMap
<
Object
,
Object
>>
projectsInfoByEmpId
(
String
empId
);
...
...
src/main/java/com/nisum/mytime/service/ProjectServiceImpl.java
View file @
68970794
This diff is collapsed.
Click to expand it.
src/main/java/com/nisum/mytime/service/UserServiceImpl.java
View file @
68970794
...
...
@@ -146,11 +146,11 @@ public class UserServiceImpl implements UserService {
}
@Override
public
EmployeeRoles
assigingEmployeeRole
(
EmployeeRoles
employeeRoles
,
String
e
mpId
)
public
EmployeeRoles
assigingEmployeeRole
(
EmployeeRoles
employeeRoles
,
String
loginE
mpId
)
throws
MyTimeException
{
employeeRoles
.
setCreatedOn
(
new
Date
());
employeeRoles
.
setCreatedBy
(
e
mpId
);
employeeRoles
.
setModifiedBy
(
e
mpId
);
employeeRoles
.
setCreatedBy
(
loginE
mpId
);
employeeRoles
.
setModifiedBy
(
loginE
mpId
);
ProjectTeamMate
newBenchAllocation
=
new
ProjectTeamMate
();
newBenchAllocation
.
setAccount
(
MyTimeUtils
.
BENCH_ACCOUNT
);
...
...
@@ -180,7 +180,7 @@ public class UserServiceImpl implements UserService {
}
try
{
projectService
.
addProjectTeamMate
(
newBenchAllocation
);
projectService
.
addProjectTeamMate
(
newBenchAllocation
,
loginEmpId
);
}
catch
(
MyTimeException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -201,7 +201,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public
EmployeeRoles
updateEmployeeRole
(
EmployeeRoles
employeeRoles
,
String
e
mpId
)
{
public
EmployeeRoles
updateEmployeeRole
(
EmployeeRoles
employeeRoles
,
String
loginE
mpId
)
{
// update all emp details to inactive if employee is inactive
Query
query
=
new
Query
(
Criteria
.
where
(
"employeeId"
).
is
(
employeeRoles
.
getEmployeeId
()));
Update
update
=
new
Update
();
...
...
@@ -223,7 +223,7 @@ public class UserServiceImpl implements UserService {
update
.
set
(
"passportExpiryDate"
,
employeeRoles
.
getPassportExpiryDate
());
update
.
set
(
"b1ExpiryDate"
,
employeeRoles
.
getB1ExpiryDate
());
update
.
set
(
"modifiedBy"
,
e
mpId
);
update
.
set
(
"modifiedBy"
,
loginE
mpId
);
if
(
employeeRoles
.
getEmpStatus
().
equalsIgnoreCase
(
MyTimeUtils
.
IN_ACTIVE_SPACE
))
{
update
.
set
(
"endDate"
,
employeeRoles
.
getEndDate
());
...
...
@@ -278,8 +278,9 @@ public class UserServiceImpl implements UserService {
billingDetailsExisting
.
setActive
(
false
);
teamMatesBillingRepo
.
save
(
billingDetailsExisting
);
}
teamMate
.
setAuditFields
(
loginEmpId
,
MyTimeUtils
.
UPDATE
);
projectTeamMatesRepo
.
save
(
teamMate
);
updateShiftDetails
(
teamMate
);
updateShiftDetails
(
teamMate
,
loginEmpId
);
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -522,7 +523,7 @@ public class UserServiceImpl implements UserService {
return
billingsSorted
;
}
public
void
updateShiftDetails
(
ProjectTeamMate
existingTeammate
)
{
public
void
updateShiftDetails
(
ProjectTeamMate
existingTeammate
,
String
loginEmpId
)
{
Query
getQuery
=
new
Query
();
getQuery
.
addCriteria
(
new
Criteria
().
andOperator
(
Criteria
.
where
(
"active"
).
is
(
true
),
Criteria
.
where
(
"employeeId"
).
is
(
existingTeammate
.
getEmployeeId
())));
...
...
@@ -531,7 +532,8 @@ public class UserServiceImpl implements UserService {
EmpShiftDetails
existingShift
=
mongoTemplate
.
findOne
(
getQuery
,
EmpShiftDetails
.
class
);
if
(
existingShift
!=
null
)
{
existingShift
.
setActive
(
false
);
existingShift
.
setUpdatedDate
(
new
Date
());
//existingShift.setUpdatedDate(new Date());// Commented as added common audit fields
existingShift
.
setAuditFields
(
loginEmpId
,
MyTimeUtils
.
UPDATE
);
mongoTemplate
.
save
(
existingShift
);
}
}
...
...
src/main/java/com/nisum/mytime/utils/MyTimeUtils.java
View file @
68970794
...
...
@@ -148,4 +148,7 @@ public class MyTimeUtils {
public
final
static
String
FULL_TIME
=
"Full Time"
;
public
final
static
String
CAMA
=
","
;
public
final
static
String
CREATE
=
"CREATE"
;
public
final
static
String
UPDATE
=
"UPDATE"
;
}
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
68970794
...
...
@@ -288,8 +288,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function
deleteTeam
(
record
){
var
urlRequest
=
""
;
urlRequest
=
appConfig
.
appUri
+
"/projectTeam/deleteTeammate
"
;
var
loginEmpId
=
myFactory
.
getEmpId
();
urlRequest
=
appConfig
.
appUri
+
"/projectTeam/deleteTeammate
?loginEmpId="
+
loginEmpId
;
var
req
=
{
method
:
'POST'
,
url
:
urlRequest
,
...
...
@@ -1436,8 +1436,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function
addRecord
(
record
,
action
){
var
urlRequest
=
""
;
urlRequest
=
appConfig
.
appUri
+
"projectTeam/addEmployeeToTeamWithCheck
"
;
var
loginEmpId
=
myFactory
.
getEmpId
();
urlRequest
=
appConfig
.
appUri
+
"projectTeam/addEmployeeToTeamWithCheck
?loginEmpId="
+
loginEmpId
;
var
req
=
{
method
:
'POST'
,
url
:
urlRequest
,
...
...
@@ -1494,8 +1494,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}
function
updateTeamRecord
(
record
,
action
){
var
urlRequest
=
""
;
urlRequest
=
appConfig
.
appUri
+
"/projectTeam/updateTeammate
"
;
var
loginEmpId
=
myFactory
.
getEmpId
();
urlRequest
=
appConfig
.
appUri
+
"/projectTeam/updateTeammate
?loginEmpId="
+
loginEmpId
;
var
req
=
{
method
:
'POST'
,
url
:
urlRequest
,
...
...
@@ -1529,10 +1529,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
function
addOrUpdateProject
(
record
,
action
)
{
var
urlRequest
=
""
;
var
loginEmpId
=
myFactory
.
getEmpId
();
if
(
action
==
"Assign"
)
{
urlRequest
=
appConfig
.
appUri
+
"project/addProject
"
;
urlRequest
=
appConfig
.
appUri
+
"project/addProject
?loginEmpId="
+
loginEmpId
;
}
else
if
(
action
==
"Update"
)
{
urlRequest
=
appConfig
.
appUri
+
"project/updateProject
"
;
urlRequest
=
appConfig
.
appUri
+
"project/updateProject
?loginEmpId="
+
loginEmpId
;
}
var
req
=
{
method
:
'POST'
,
...
...
src/main/webapp/WEB-INF/controllers/ProjectMyTeamController.js
View file @
68970794
...
...
@@ -386,8 +386,9 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog
function
addOrUpdateRole
(
record
,
action
){
var
urlRequest
=
""
;
var
loginEmpId
=
myFactory
.
getEmpId
();
if
(
action
==
"Assign"
){
urlRequest
=
appConfig
.
appUri
+
"projectTeam/addEmployeeToTeam
"
;
urlRequest
=
appConfig
.
appUri
+
"projectTeam/addEmployeeToTeam
?loginEmpId="
+
loginEmpId
;
}
else
if
(
action
==
"Update"
){
urlRequest
=
appConfig
.
appUri
+
"user/updateEmployeeRole"
;
}
...
...
src/main/webapp/WEB-INF/controllers/ProjectTeamController.js
View file @
68970794
...
...
@@ -24,6 +24,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
};
$scope
.
employees
=
[];
$scope
.
projects
=
[];
var
getCellTemplate
=
'<p class="col-lg-12"><i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,
\'
Update
\'
)"></i>'
+
' <i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,
\'
Delete
\'
)"></i></p>'
;
var
getCellTemplate1
=
'<div ng-show="COL_FIELD!=
\'
Employee
\'
&& COL_FIELD!=
\'
HR
\'
"><p class="col-lg-12">{{COL_FIELD}} <i class="fa fa-sitemap fa-2x" aria-hidden="true" style="font-size:1.5em;color:blue;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,
\'
ViewTeamDetail
\'
)"></i></p></div><div ng-show="COL_FIELD==
\'
Employee
\'
|| COL_FIELD==
\'
HR
\'
"><p class="col-lg-12">{{COL_FIELD}}</p></div>'
...
...
@@ -256,7 +257,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
var
record
=
{
"id"
:
id
,
"employeeId"
:
empId
,
"projectId"
:
projectId
};
var
req
=
{
method
:
'POST'
,
url
:
appConfig
.
appUri
+
"projectTeam/deleteTeammate"
,
var
loginEmpId
=
myFactory
.
getEmpId
();
url
:
appConfig
.
appUri
+
"projectTeam/deleteTeammate?loginEmpId="
+
loginEmpId
,
headers
:
{
"Content-type"
:
"application/json"
},
...
...
@@ -445,10 +447,11 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
};
function
addOrUpdateBilling
(
record
,
action
){
var
urlRequest
=
""
;
var
loginEmpId
=
myFactory
.
getEmpId
();
if
(
action
==
"Add"
){
urlRequest
=
appConfig
.
appUri
+
"projectTeam/addEmployeeBilling
"
;
urlRequest
=
appConfig
.
appUri
+
"projectTeam/addEmployeeBilling
?loginEmpId="
+
loginEmpId
;
}
else
if
(
action
==
"Update"
){
urlRequest
=
appConfig
.
appUri
+
"projectTeam/updateEmployeeBilling
"
;
urlRequest
=
appConfig
.
appUri
+
"projectTeam/updateEmployeeBilling
?loginEmpId="
+
loginEmpId
;
}
else
if
(
action
==
"Delete"
){
...
...
@@ -829,10 +832,11 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
function
addOrUpdateRole
(
record
,
action
){
var
urlRequest
=
""
;
var
loginEmpId
=
myFactory
.
getEmpId
();
if
(
action
==
"Add"
){
urlRequest
=
appConfig
.
appUri
+
"projectTeam/addEmployeeToTeam
"
;
urlRequest
=
appConfig
.
appUri
+
"projectTeam/addEmployeeToTeam
?loginEmpId="
+
loginEmpId
;
}
else
if
(
action
==
"Update"
){
urlRequest
=
appConfig
.
appUri
+
"projectTeam/updateTeammate
"
;
urlRequest
=
appConfig
.
appUri
+
"projectTeam/updateTeammate
?loginEmpId="
+
loginEmpId
;
}
var
req
=
{
method
:
'POST'
,
...
...
src/main/webapp/WEB-INF/controllers/ViewProjectController.js
View file @
68970794
...
...
@@ -533,10 +533,11 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
function
addOrUpdateProject
(
record
,
action
){
var
urlRequest
=
""
;
var
loginEmpId
=
myFactory
.
getEmpId
();
if
(
action
==
"Assign"
){
urlRequest
=
appConfig
.
appUri
+
"project/addProject
"
;
urlRequest
=
appConfig
.
appUri
+
"project/addProject
?loginEmpId="
+
loginEmpId
;
}
else
if
(
action
==
"Update"
){
urlRequest
=
appConfig
.
appUri
+
"project/updateProject
"
;
urlRequest
=
appConfig
.
appUri
+
"project/updateProject
?loginEmpId="
+
loginEmpId
;
}
var
req
=
{
method
:
'POST'
,
...
...
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