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
f5555a8c
Commit
f5555a8c
authored
Aug 28, 2018
by
Manikanta SKPB Duppanapudi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated remaning columns in db , added validations as per story
parent
abbff955
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
17 deletions
+32
-17
ProjectServiceImpl.java
...ain/java/com/nisum/mytime/service/ProjectServiceImpl.java
+19
-11
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+8
-2
app.js
src/main/webapp/WEB-INF/js/app.js
+5
-4
No files found.
src/main/java/com/nisum/mytime/service/ProjectServiceImpl.java
View file @
f5555a8c
...
...
@@ -208,8 +208,9 @@ public class ProjectServiceImpl implements ProjectService {
for
(
ProjectTeamMate
existingTeammate
:
existingTeammates
)
{
existingTeammate
.
setActive
(
false
);
existingTeammate
.
setEndDate
(
project
.
getProjectEndDate
());
projectTeamMatesRepo
.
save
(
existingTeammate
);
BillingDetails
billingDetails
=
new
BillingDetails
();
ProjectTeamMate
newBenchAllocation
=
new
ProjectTeamMate
();
billingDetails
.
setBillableStatus
(
MyTimeUtils
.
BENCH_BILLABILITY_STATUS
);
List
<
BillingDetails
>
listBD
=
getEmployeeActiveBillingDetails
(
existingTeammate
.
getEmployeeId
(),
existingTeammate
.
getProjectId
());
...
...
@@ -219,6 +220,7 @@ public class ProjectServiceImpl implements ProjectService {
billingDetailsExisting
.
setActive
(
false
);
updateEmployeeBilling
(
billingDetailsExisting
);
}
Project
benchProject
=
projectRepo
.
findByProjectId
(
MyTimeUtils
.
BENCH_PROJECT_ID
);
Date
sd
=
project
.
getProjectEndDate
();
billingDetails
.
setBillingStartDate
(
sd
);
billingDetails
.
setAccount
(
MyTimeUtils
.
BENCH_ACCOUNT
);
...
...
@@ -228,13 +230,18 @@ public class ProjectServiceImpl implements ProjectService {
billingDetails
.
setCreateDate
(
new
Date
());
billingDetails
.
setProjectId
(
MyTimeUtils
.
BENCH_PROJECT_ID
);
billingDetails
.
setProjectName
(
MyTimeUtils
.
FREE_POLL
);
if
(
benchProject
!=
null
)
{
billingDetails
.
setBillingEndDate
(
benchProject
.
getProjectEndDate
());
newBenchAllocation
.
setAccountId
(
benchProject
.
getAccountId
());
newBenchAllocation
.
setProjectName
(
benchProject
.
getProjectName
());
newBenchAllocation
.
setDomainId
(
benchProject
.
getDomainId
());
newBenchAllocation
.
setEndDate
(
benchProject
.
getProjectEndDate
());
}
addEmployeeBillingDetails
(
billingDetails
);
projectTeamMatesRepo
.
save
(
existingTeammate
);
ProjectTeamMate
newBenchAllocation
=
new
ProjectTeamMate
();
Project
benchProject
=
projectRepo
.
findByProjectId
(
MyTimeUtils
.
BENCH_PROJECT_ID
);
if
(
benchProject
!=
null
)
newBenchAllocation
.
setAccountId
(
benchProject
.
getAccountId
());
newBenchAllocation
.
setRole
(
existingTeammate
.
getRole
());
newBenchAllocation
.
setAccount
(
MyTimeUtils
.
BENCH_ACCOUNT
);
newBenchAllocation
.
setShift
(
existingTeammate
.
getShift
());
newBenchAllocation
.
setBillableStatus
(
MyTimeUtils
.
BENCH_BILLABILITY_STATUS
);
newBenchAllocation
.
setDesignation
(
existingTeammate
.
getDesignation
());
newBenchAllocation
.
setEmailId
(
existingTeammate
.
getEmailId
());
...
...
@@ -243,7 +250,6 @@ public class ProjectServiceImpl implements ProjectService {
newBenchAllocation
.
setEmployeeName
(
existingTeammate
.
getEmployeeName
());
newBenchAllocation
.
setProjectId
(
MyTimeUtils
.
BENCH_PROJECT_ID
);
newBenchAllocation
.
setStartDate
(
sd
);
newBenchAllocation
.
setProjectName
(
benchProject
.
getProjectName
());
projectTeamMatesRepo
.
save
(
newBenchAllocation
);
updateShiftDetails
(
existingTeammate
);
}
...
...
@@ -852,10 +858,12 @@ public class ProjectServiceImpl implements ProjectService {
cal
.
setTime
(
d
);
cal
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
Date
oneDayLess
=
cal
.
getTime
();
if
(
teamMate
.
getNewBillingStartDate
().
getDate
()
==
projectTeamMate
.
getNewBillingStartDate
().
getDate
())
{
teamMate
.
setEndDate
(
DateUtils
.
truncate
(
projectTeamMate
.
getEndDate
(),
Calendar
.
DATE
));
}
else
{
if
(
null
!=
teamMate
.
getNewBillingStartDate
()){
if
(
teamMate
.
getNewBillingStartDate
().
getDate
()
==
projectTeamMate
.
getNewBillingStartDate
().
getDate
())
{
teamMate
.
setEndDate
(
DateUtils
.
truncate
(
projectTeamMate
.
getEndDate
(),
Calendar
.
DATE
));
}
}
else
{
teamMate
.
setEndDate
(
DateUtils
.
truncate
(
oneDayLess
,
Calendar
.
DATE
));
}
teamMate
.
setActive
(
false
);
...
...
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
f5555a8c
...
...
@@ -34,7 +34,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
var
getCellTemplate
=
'<p class="col-lg-12"><i class="fa fa-users fa-2x" aria-hidden="true" style="font-size:1.4em;margin-top:3px;cursor:pointer;" data-placement="center" title="View" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.getRowData(row,
\'
View
\'
)" ></i>'
+
' <i ng-show="row.entity.projectName
==
\'
Bench
\'
"> </i><i ng-show="row.entity.projectName !=
\'
Bench
\'
" class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Edit" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.getRowData(row,
\'
Update
\'
)"></i></p>'
;
' <i ng-show="row.entity.projectName
!=
\'
Bench
\'
&& row.entity.status ==
\'
Active
\'
" class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Edit" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.getRowData(row,
\'
Update
\'
)"></i></p>'
;
// ' <i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>'
...
...
@@ -1135,7 +1135,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}
else
if
(
!
((
$scope
.
newBillingStartDate
>=
$scope
.
startDate
)
&&
(
$scope
.
newBillingStartDate
<=
$scope
.
endDate
))
&&
action
==
"Update"
){
$scope
.
alertMsg
=
$scope
.
empBillableStatus
+
" start date should be in between start date and end date"
;
}
else
if
(
$scope
.
endDate
>
dataToPass
.
projectEndDate
){
}
else
if
(
$scope
.
endDate
>
new
Date
(
dataToPass
.
projectEndDate
)
){
$scope
.
alertMsg
=
"End date should not exceed project end date"
;
}
else
{
...
...
@@ -1470,6 +1470,12 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
url
:
appConfig
.
appUri
+
"/projectTeam/getProjectDetails?projectId="
+
projectId
+
"&status="
+
status
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
gridOptions
.
data
=
response
.
data
;
if
(
status
==
"InActive"
||
status
==
"Both"
||
dataToPass
.
status
==
"InActive"
){
$scope
.
gridOptions
.
columnDefs
[
5
].
visible
=
false
;
}
else
{
$scope
.
gridOptions
.
columnDefs
[
5
].
visible
=
true
;
}
for
(
i
=
0
;
i
<
$scope
.
gridOptions
.
data
.
length
;
i
++
){
if
(
$scope
.
gridOptions
.
data
[
i
].
role
==
'Lead'
){
$scope
.
gridOptions
.
data
[
i
].
role
=
"Lead"
;
...
...
src/main/webapp/WEB-INF/js/app.js
View file @
f5555a8c
...
...
@@ -182,11 +182,12 @@ myApp.factory('myFactory', function() {
function
sortObjectBasedOnKeys
(
unordered
){
var
ordered
=
{};
Object
.
keys
(
unordered
).
sort
().
forEach
(
function
(
key
)
{
ordered
[
key
]
=
unordered
[
key
];
if
(
Array
.
isArray
(
unordered
[
key
])){
ordered
[
key
]
=
unordered
[
key
].
sort
();
}
ordered
[
key
]
=
unordered
[
key
];
});
console
.
log
(
ordered
);
return
ordered
;
return
ordered
;
}
function
addFormDataCheck
(
form
){
...
...
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