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
b6f5ec3d
Commit
b6f5ec3d
authored
May 02, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Url Refactored in Accounts and Assign Role Controller
parent
62eb6ba1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
20 deletions
+21
-20
EmployeeController.java
.../java/com/nisum/myteam/controller/EmployeeController.java
+2
-2
Employee.java
src/main/java/com/nisum/myteam/model/Employee.java
+2
-2
AccountsController.js
src/main/webapp/WEB-INF/controllers/AccountsController.js
+4
-4
AssignRolesController.js
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
+8
-8
LoginController.js
src/main/webapp/WEB-INF/controllers/LoginController.js
+5
-4
No files found.
src/main/java/com/nisum/myteam/controller/EmployeeController.java
View file @
b6f5ec3d
...
@@ -40,10 +40,10 @@ public class EmployeeController {
...
@@ -40,10 +40,10 @@ public class EmployeeController {
private
IEmployeeRoleService
employeeRoleService
;
private
IEmployeeRoleService
employeeRoleService
;
@RequestMapping
(
value
=
"/employees/{empId}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@RequestMapping
(
value
=
"/employees/{empId}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<?>
createEmployee
(
@Valid
@RequestBody
Employee
employeeReq
,
public
ResponseEntity
<?>
createEmployee
(
@RequestBody
Employee
employeeReq
,
@PathVariable
(
value
=
"empId"
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
@PathVariable
(
value
=
"empId"
)
String
loginEmpId
,
HttpServletRequest
request
)
throws
MyTeamException
{
if
(
!
empService
.
isEmployeeExistsById
(
loginEmpId
))
{
if
(
empService
.
isEmployeeExistsById
(
loginEmpId
))
{
Employee
employeePersisted
=
empService
.
createEmployee
(
employeeReq
,
loginEmpId
);
Employee
employeePersisted
=
empService
.
createEmployee
(
employeeReq
,
loginEmpId
);
ResponseDetails
createRespDetails
=
new
ResponseDetails
(
new
Date
(),
901
,
"Employee has been created"
,
ResponseDetails
createRespDetails
=
new
ResponseDetails
(
new
Date
(),
901
,
"Employee has been created"
,
...
...
src/main/java/com/nisum/myteam/model/Employee.java
View file @
b6f5ec3d
...
@@ -72,12 +72,12 @@ public class Employee implements Serializable {
...
@@ -72,12 +72,12 @@ public class Employee implements Serializable {
@ExcelCellName
(
"Skills"
)
@ExcelCellName
(
"Skills"
)
private
String
technologyKnown
;
private
String
technologyKnown
;
@NotBlank
@Pattern
(
regexp
=
"(^$|[0-9]{10})"
,
message
=
"Invalid mobile number"
)
@Pattern
(
regexp
=
"(^$|[0-9]{10})"
,
message
=
"Invalid mobile number"
)
@ExcelCellName
(
"Primary Mobile"
)
@ExcelCellName
(
"Primary Mobile"
)
private
String
mobileNumber
;
private
String
mobileNumber
;
@NotBlank
@Pattern
(
regexp
=
"(^$|[0-9]{10})"
,
message
=
"Invalid alternate mobile number"
)
@Pattern
(
regexp
=
"(^$|[0-9]{10})"
,
message
=
"Invalid alternate mobile number"
)
@ExcelCellName
(
"Alternate Mobile"
)
@ExcelCellName
(
"Alternate Mobile"
)
private
String
alternateMobileNumber
;
private
String
alternateMobileNumber
;
...
...
src/main/webapp/WEB-INF/controllers/AccountsController.js
View file @
b6f5ec3d
...
@@ -56,7 +56,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
...
@@ -56,7 +56,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
else
{
else
{
$scope
.
gridOptions
.
enablePaginationControls
=
false
;
$scope
.
gridOptions
.
enablePaginationControls
=
false
;
}
}
$scope
.
gridOptions
.
data
=
response
.
data
;
$scope
.
gridOptions
.
data
=
response
.
data
.
records
;
myFactory
.
setAccounts
(
response
.
data
);
myFactory
.
setAccounts
(
response
.
data
);
for
(
i
=
0
;
i
<
response
.
data
.
length
;
i
++
){
for
(
i
=
0
;
i
<
response
.
data
.
length
;
i
++
){
if
(
response
.
data
[
i
].
status
==
'Y'
){
if
(
response
.
data
[
i
].
status
==
'Y'
){
...
@@ -112,7 +112,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
...
@@ -112,7 +112,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
function
deleteAccountRole
(
accountId
){
function
deleteAccountRole
(
accountId
){
var
req
=
{
var
req
=
{
method
:
'DELETE'
,
method
:
'DELETE'
,
url
:
appConfig
.
appUri
+
"accounts
?accountId=
"
+
accountId
url
:
appConfig
.
appUri
+
"accounts
/
"
+
accountId
}
}
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
$scope
.
result
=
"Success"
;
$scope
.
result
=
"Success"
;
...
@@ -171,7 +171,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
...
@@ -171,7 +171,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
$scope
.
getDeliveryManagers
=
function
(){
$scope
.
getDeliveryManagers
=
function
(){
$http
({
$http
({
method
:
"GET"
,
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"/
projectTeam/getEmployeesToTeam
"
url
:
appConfig
.
appUri
+
"/
employees/active/sortByName
"
}).
then
(
function
mySuccess
(
response
)
{
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
managerDetails
=
response
.
data
;
$scope
.
managerDetails
=
response
.
data
;
},
function
myError
(
response
)
{
},
function
myError
(
response
)
{
...
@@ -359,7 +359,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
...
@@ -359,7 +359,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
addOrUpdateAccount
=
function
(
record
,
action
,
flag
){
addOrUpdateAccount
=
function
(
record
,
action
,
flag
){
var
urlRequest
=
""
;
var
urlRequest
=
""
;
if
(
action
==
"Add"
||
action
==
"Update"
){
if
(
action
==
"Add"
||
action
==
"Update"
){
urlRequest
=
appConfig
.
appUri
+
"account
/account
s?action="
+
flag
;
urlRequest
=
appConfig
.
appUri
+
"accounts?action="
+
flag
;
}
}
var
req
=
{
var
req
=
{
method
:
'POST'
,
method
:
'POST'
,
...
...
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
View file @
b6f5ec3d
...
@@ -102,7 +102,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -102,7 +102,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
getUserRoles
=
function
(){
$scope
.
getUserRoles
=
function
(){
$http
({
$http
({
method
:
"GET"
,
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"
user/getEmployeeByStatus
?status="
+
$scope
.
status
url
:
appConfig
.
appUri
+
"
employees/
?status="
+
$scope
.
status
}).
then
(
function
mySuccess
(
response
)
{
}).
then
(
function
mySuccess
(
response
)
{
if
(
response
.
data
.
length
>
10
){
if
(
response
.
data
.
length
>
10
){
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
...
@@ -116,7 +116,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -116,7 +116,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
else
{
else
{
$scope
.
gridOptions
.
columnDefs
[
6
].
visible
=
true
;
$scope
.
gridOptions
.
columnDefs
[
6
].
visible
=
true
;
}
}
$scope
.
gridOptions
.
data
=
response
.
data
;
$scope
.
gridOptions
.
data
=
response
.
data
.
records
;
},
function
myError
(
response
)
{
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
showAlert
(
"Something went wrong while fetching data!!!"
);
$scope
.
gridOptions
.
data
=
[];
$scope
.
gridOptions
.
data
=
[];
...
@@ -126,9 +126,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -126,9 +126,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
getOrgEmps
=
function
(){
$scope
.
getOrgEmps
=
function
(){
$http
({
$http
({
method
:
"GET"
,
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"
user/getUserRoles
"
url
:
appConfig
.
appUri
+
"
employees/active
"
}).
then
(
function
mySuccess
(
response
)
{
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
gridOptionsOrgView
.
data
=
response
.
data
;
$scope
.
gridOptionsOrgView
.
data
=
response
.
data
.
records
;
if
(
response
.
data
.
length
>
10
){
if
(
response
.
data
.
length
>
10
){
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
}
}
...
@@ -189,7 +189,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -189,7 +189,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
function
deleteUserRole
(
empId
){
function
deleteUserRole
(
empId
){
var
req
=
{
var
req
=
{
method
:
'DELETE'
,
method
:
'DELETE'
,
url
:
appConfig
.
appUri
+
"
user/deleteEmployee?empId=
"
+
empId
url
:
appConfig
.
appUri
+
"
employees/
"
+
empId
}
}
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
$scope
.
result
=
response
.
data
;
$scope
.
result
=
response
.
data
;
...
@@ -626,10 +626,10 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -626,10 +626,10 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
function
addOrUpdateRole
(
record
,
action
){
function
addOrUpdateRole
(
record
,
action
){
var
empId
=
myFactory
.
getEmpId
();
var
empId
=
myFactory
.
getEmpId
();
var
urlRequest
=
""
;
var
urlRequest
=
""
;
if
(
action
==
"
Add
"
){
if
(
action
==
"
"
){
urlRequest
=
appConfig
.
appUri
+
"
user/assignEmployeeRole?empId=
"
+
empId
;
urlRequest
=
appConfig
.
appUri
+
"
employees/
"
+
empId
;
}
else
if
(
action
==
"Update"
){
}
else
if
(
action
==
"Update"
){
urlRequest
=
appConfig
.
appUri
+
"
user/updateEmployeeRole?empId=
"
+
empId
;
urlRequest
=
appConfig
.
appUri
+
"
employees/
"
+
empId
;
}
}
var
req
=
{
var
req
=
{
method
:
'POST'
,
method
:
'POST'
,
...
...
src/main/webapp/WEB-INF/controllers/LoginController.js
View file @
b6f5ec3d
...
@@ -31,9 +31,9 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
...
@@ -31,9 +31,9 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
function
getUserRole
(
profile
){
function
getUserRole
(
profile
){
$http
({
$http
({
method
:
"GET"
,
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"employees
?emailId=
"
+
profile
.
getEmail
()
url
:
appConfig
.
appUri
+
"employees
/emailId/
"
+
profile
.
getEmail
()
}).
then
(
function
mySuccess
(
response
)
{
}).
then
(
function
mySuccess
(
response
)
{
var
result
=
response
.
data
;
var
result
=
response
.
data
.
records
;
if
(
result
==
""
||
result
.
length
==
0
){
if
(
result
==
""
||
result
.
length
==
0
){
showRegisterEmployeeScreen
(
profile
);
showRegisterEmployeeScreen
(
profile
);
}
else
{
}
else
{
...
@@ -78,9 +78,9 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
...
@@ -78,9 +78,9 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
function
getAllLocations
(){
function
getAllLocations
(){
$http
({
$http
({
method
:
"GET"
,
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"employees
/locations/"
url
:
appConfig
.
appUri
+
"/organization
/locations/"
}).
then
(
function
mySuccess
(
response
)
{
}).
then
(
function
mySuccess
(
response
)
{
myFactory
.
setLocations
(
response
.
data
);
myFactory
.
setLocations
(
response
.
data
.
records
);
},
function
myError
(
response
)
{
},
function
myError
(
response
)
{
});
});
...
@@ -93,6 +93,7 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
...
@@ -93,6 +93,7 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
myFactory
.
setAccounts
(
response
.
data
);
myFactory
.
setAccounts
(
response
.
data
);
},
function
myError
(
response
)
{
},
function
myError
(
response
)
{
});
});
};
};
function
showRegisterEmployeeScreen
(
profile
){
function
showRegisterEmployeeScreen
(
profile
){
...
...
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