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
260287c4
Unverified
Commit
260287c4
authored
Aug 28, 2018
by
mshaik-nisum-com
Committed by
GitHub
Aug 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #165 from nisum-inc/MT-173
Updated remaning columns in db , added validations as per story
parents
abbff955
8b874918
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
19 deletions
+41
-19
ProjectServiceImpl.java
...ain/java/com/nisum/mytime/service/ProjectServiceImpl.java
+19
-11
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+14
-4
default-styles.css
src/main/webapp/WEB-INF/css/default-styles.css
+3
-0
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 @
260287c4
...
...
@@ -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 @
260287c4
...
...
@@ -33,8 +33,8 @@ 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>'
;
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;"
ng-class="{
\'
my-css-class
\'
: grid.appScope.rowFormatter( row ) }"
data-placement="center" title="View" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.getRowData(row,
\'
View
\'
)" ></i>'
+
' <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>'
...
...
@@ -56,7 +56,11 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
]
};
$scope
.
gridOptions
.
data
=
$scope
.
records
;
$scope
.
rowFormatter
=
function
(
row
)
{
return
(
row
.
entity
.
status
==
'Active'
&&
row
.
entity
.
projectName
!=
"Bench"
);
};
$scope
.
getRowData
=
function
(
row
,
action
)
{
console
.
log
(
row
.
entity
);
$scope
.
parentData
.
projectId
=
row
.
entity
.
projectId
;
...
...
@@ -1135,7 +1139,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 +1474,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/css/default-styles.css
View file @
260287c4
...
...
@@ -232,4 +232,7 @@ md-select {
.manageGroup
{
padding-left
:
15px
;
list-style
:
none
;
}
.my-css-class
{
margin-left
:
20px
;
}
\ No newline at end of file
src/main/webapp/WEB-INF/js/app.js
View file @
260287c4
...
...
@@ -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