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
6afbbb88
Unverified
Commit
6afbbb88
authored
Aug 03, 2018
by
mshaik-nisum-com
Committed by
GitHub
Aug 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #106 from nisum-inc/New_Defects_Project_Module
Defects in project module
parents
88f9effd
0679cc31
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
7 deletions
+73
-7
Project.java
src/main/java/com/nisum/mytime/model/Project.java
+7
-0
ProjectServiceImpl.java
...ain/java/com/nisum/mytime/service/ProjectServiceImpl.java
+19
-0
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+21
-4
newProject.html
src/main/webapp/WEB-INF/templates/newProject.html
+26
-3
No files found.
src/main/java/com/nisum/mytime/model/Project.java
View file @
6afbbb88
package
com
.
nisum
.
mytime
.
model
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
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
lombok.AllArgsConstructor
;
import
lombok.Getter
;
...
...
@@ -39,6 +42,10 @@ public class Project implements Serializable {
private
List
<
String
>
managerIds
;
private
String
accountId
;
private
String
domainId
;
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
private
Date
projectStartDate
;
@DateTimeFormat
(
iso
=
ISO
.
DATE
)
private
Date
projectEndDate
;
private
List
<
String
>
deliveryLeadIds
;
}
src/main/java/com/nisum/mytime/service/ProjectServiceImpl.java
View file @
6afbbb88
package
com
.
nisum
.
mytime
.
service
;
import
java.time.LocalDate
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Calendar
;
...
...
@@ -110,6 +111,7 @@ public class ProjectServiceImpl implements ProjectService {
List
<
HashMap
<
String
,
String
>>
managerList
=
null
;
List
<
Project
>
projects
=
projectRepo
.
findAll
();
for
(
Project
p
:
projects
)
{
System
.
out
.
println
(
"==========================="
+
p
);
HashMap
<
Object
,
Object
>
projectMap
=
new
HashMap
<>();
projectMap
.
put
(
"id"
,
p
.
getId
());
projectMap
.
put
(
"projectId"
,
p
.
getProjectId
());
...
...
@@ -124,6 +126,8 @@ public class ProjectServiceImpl implements ProjectService {
projectMap
.
put
(
"domainId"
,
p
.
getDomainId
());
projectMap
.
put
(
"status"
,
p
.
getStatus
());
projectMap
.
put
(
"employeeIds"
,
p
.
getEmployeeIds
());
projectMap
.
put
(
"projectStartDate"
,
p
.
getProjectStartDate
());
projectMap
.
put
(
"projectEndDate"
,
p
.
getProjectEndDate
());
// projectMap.put("deliveryLeadIds", p.getDeliveryLeadIds());
/*
...
...
@@ -201,6 +205,8 @@ public class ProjectServiceImpl implements ProjectService {
update
.
set
(
"domainId"
,
project
.
getDomainId
());
update
.
set
(
"accountId"
,
project
.
getAccountId
());
update
.
set
(
"status"
,
project
.
getStatus
());
update
.
set
(
"projectStartDate"
,
project
.
getProjectStartDate
());
update
.
set
(
"projectEndDate"
,
project
.
getProjectEndDate
());
FindAndModifyOptions
options
=
new
FindAndModifyOptions
();
options
.
returnNew
(
true
);
options
.
upsert
(
true
);
...
...
@@ -271,6 +277,7 @@ public class ProjectServiceImpl implements ProjectService {
Arrays
.
asList
(
projectTeamMate
.
getEmployeeId
()));
projectRepo
.
save
(
project
);
}
updateProjectEndDateInProjectTeamMate
(
projectTeamMate
);
ProjectTeamMate
pT
=
projectTeamMatesRepo
.
save
(
projectTeamMate
);
List
<
BillingDetails
>
listBD
=
getEmployeeActiveNisumBench
(
...
...
@@ -565,13 +572,25 @@ public class ProjectServiceImpl implements ProjectService {
// return projectTeamMatesRepo.findByProjectId(projectId);
// MT-79: adding the existing managerIds in List and sending them as
// response
List
<
ProjectTeamMate
>
teamMatesList
=
new
ArrayList
<>();
List
<
ProjectTeamMate
>
teamMates
=
projectTeamMatesRepo
.
findByProjectId
(
projectId
);
System
.
out
.
println
(
"=================from details id"
+
teamMates
);
/*
* for(ProjectTeamMate pt:teamMates) { if(pt.getManagerIds()== null &&
* pt.getManagerId()!= null)
* pt.setManagerIds(Arrays.asList(pt.getManagerId())); }
*/
/* for(ProjectTeamMate projectTeamMate:teamMates)
{
//Active
if(statusFlag.equals("1") && projectTeamMate.getEndDate().compareTo(new Date())>=0)
teamMatesList.add(projectTeamMate);
else if(statusFlag.equals("2")&& projectTeamMate.getEndDate().compareTo(new Date())<0)
teamMatesList.add(projectTeamMate);
else if(statusFlag.equals("3"))
teamMatesList.add(projectTeamMate);
}*/
return
teamMates
;
}
...
...
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
6afbbb88
...
...
@@ -66,6 +66,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope
.
parentData
.
accountId
=
row
.
entity
.
accountId
;
$scope
.
parentData
.
domainId
=
row
.
entity
.
domainId
;
$scope
.
parentData
.
deliveryLeadIds
=
row
.
entity
.
deliveryLeadIds
;
$scope
.
parentData
.
projectStartDate
=
row
.
entity
.
projectStartDate
;
$scope
.
parentData
.
projectEndDate
=
row
.
entity
.
projectEndDate
;
if
(
action
==
"Update"
)
$scope
.
addProject
(
action
,
$scope
.
parentData
);
else
if
(
action
==
"Delete"
)
...
...
@@ -458,6 +460,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}
else
if
(
dataToPass
.
action
==
"Update"
)
{
$scope
.
projectId
=
dataToPass
.
projectId
;
$scope
.
projectName
=
dataToPass
.
projectName
;
$scope
.
projectStartDate
=
(
dataToPass
.
projectStartDate
==
null
)
?
null
:
new
Date
(
dataToPass
.
projectStartDate
);
$scope
.
projectEndDate
=
(
dataToPass
.
projectEndDate
==
null
)
?
null
:
new
Date
(
dataToPass
.
projectEndDate
);
// $scope.managerId = dataToPass.managerId;
// $scope.managerName = dataToPass.managerName;
// var accounts1 = myFactory.getAccounts();
...
...
@@ -573,8 +577,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope
.
parentData
.
mobileNumber
=
row
.
entity
.
mobileNumber
;
$scope
.
parentData
.
employeeModel
=
{}
$scope
.
parentData
.
newBillingStartDate
=
row
.
entity
.
newBillingStartDate
;
$scope
.
parentData
.
startDate
=
row
.
entity
.
startDate
;
$scope
.
parentData
.
endDate
=
row
.
entity
.
endDate
;
;
$scope
.
parentData
.
startDate
=
new
Date
(
row
.
entity
.
startDate
)
;
$scope
.
parentData
.
endDate
=
new
Date
(
row
.
entity
.
endDate
)
;
if
(
action
==
"UpdateTeam"
){
$scope
.
updateTeamMate
(
action
,
$scope
.
parentData
);
}
...
...
@@ -985,6 +989,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
var
domain
=
$scope
.
domain
;
var
newBillingStartDate
=
$scope
.
newBillingStartDate
var
deliveryLeadsSelectedList
=
$scope
.
deliveryLeadsSelectedList
;
var
projectStartDate
=
$scope
.
projectStartDate
;
var
projectEndDate
=
$scope
.
projectEndDate
;
var
projectStatus
=
$scope
.
projectStatus
;
if
(
action
===
"Add"
||
action
==
"Update"
){
if
(
employeeModel
==
undefined
){
...
...
@@ -1023,7 +1029,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}
else
{
$scope
.
alertMsg
=
""
;
var
record
=
{
"employeeId"
:
employeeModel
.
employeeId
,
"employeeName"
:
employeeModel
.
employeeName
,
"emailId"
:
employeeModel
.
emailId
,
"designation"
:
employeeModel
.
designation
,
"projectId"
:
project
,
"projectName"
:
projectName
,
"managerId"
:
managerId
,
"managerName"
:
managerName
,
"mobileNumber"
:
employeeModel
.
mobileNumber
,
"active"
:
true
,
"billableStatus"
:
$scope
.
empBillableStatus
,
"startDate"
:
$scope
.
startDate
,
"endDate"
:
$scope
.
endDate
,
"account"
:
account
,
"role"
:
$scope
.
employeeRole
,
"newBillingStartDate"
:
newBillingStartDate
,
"accountId"
:
$scope
.
accountId
,
"domainId"
:
$scope
.
domainId
,
"shift"
:
$scope
.
employeeShift
};
var
record
=
{
"employeeId"
:
employeeModel
.
employeeId
,
"employeeName"
:
employeeModel
.
employeeName
,
"emailId"
:
employeeModel
.
emailId
,
"designation"
:
employeeModel
.
designation
,
"projectId"
:
project
,
"projectName"
:
projectName
,
"managerId"
:
managerId
,
"managerName"
:
managerName
,
"mobileNumber"
:
employeeModel
.
mobileNumber
,
"active"
:
true
,
"billableStatus"
:
$scope
.
empBillableStatus
,
"startDate"
:
$scope
.
startDate
,
"endDate"
:
$scope
.
endDate
,
"account"
:
account
,
"role"
:
$scope
.
employeeRole
,
"newBillingStartDate"
:
newBillingStartDate
,
"accountId"
:
$scope
.
accountId
,
"domainId"
:
$scope
.
domainId
,
"shift"
:
$scope
.
employeeShift
,
"projectStartDate"
:
$scope
.
startDate
,
"projectEndDate"
:
$scope
.
endDate
};
if
(
action
==
"Add"
){
addRecord
(
record
,
action
);
$timeout
(
function
(){
...
...
@@ -1076,10 +1082,21 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope
.
alertMsg
=
"Please select a Project Status"
;
document
.
getElementById
(
'projectStatus'
).
focus
();
}
else
if
(
projectStartDate
==
undefined
){
$scope
.
alertMsg
=
"Please select project start date"
;
document
.
getElementById
(
'projectStartDate'
).
focus
();
}
else
if
(
projectEndDate
==
undefined
){
$scope
.
alertMsg
=
"Please select project end date"
;
document
.
getElementById
(
'projectEndDate'
).
focus
();
}
else
if
(
projectStartDate
>=
projectEndDate
){
$scope
.
alertMsg
=
"Start date should be grater than end date"
;
}
else
{
$scope
.
alertMsg
=
""
;
console
.
log
(
$scope
.
projectStatus
,
$scope
.
domain
.
domainId
);
var
record
=
{
"projectId"
:
$scope
.
projectId
,
"projectName"
:
$scope
.
projectName
,
"account"
:
$scope
.
account
.
accountName
,
"domain"
:
$scope
.
domain
.
domainName
,
"accountId"
:
$scope
.
account
.
accountId
,
"domainId"
:
$scope
.
domain
.
domainId
,
"managerIds"
:
[],
"deliveryLeadIds"
:
getSelectedDeliveryLeadIds
(),
"status"
:
$scope
.
projectStatus
};
var
record
=
{
"projectId"
:
$scope
.
projectId
,
"projectName"
:
$scope
.
projectName
,
"account"
:
$scope
.
account
.
accountName
,
"domain"
:
$scope
.
domain
.
domainName
,
"accountId"
:
$scope
.
account
.
accountId
,
"domainId"
:
$scope
.
domain
.
domainId
,
"managerIds"
:
[],
"deliveryLeadIds"
:
getSelectedDeliveryLeadIds
(),
"status"
:
$scope
.
projectStatus
,
"projectStartDate"
:
$scope
.
projectStartDate
,
"projectEndDate"
:
$scope
.
projectEndDate
};
console
.
log
(
record
);
addOrUpdateProject
(
record
,
$scope
.
templateTitle
);
$timeout
(
function
()
{
updateGrid
(
$scope
.
templateTitle
,
record
)
},
500
);
...
...
src/main/webapp/WEB-INF/templates/newProject.html
View file @
6afbbb88
<md-dialog
aria-label=
"Role Template"
style=
"width:5
20px;height:4
50px;"
>
<md-dialog
aria-label=
"Role Template"
style=
"width:5
50px;height:5
50px;"
>
<form
ng-cloak
name=
"myForm"
>
<md-toolbar>
<div
class=
"md-toolbar-tools"
style=
"background: cadetblue;"
>
<h2>
{{templateTitle}}
Project
</h2>
<h2>
<span
ng-show=
"templateTitle == 'Assign' "
>
Add
</span>
<span
ng-show=
"templateTitle != 'Assign' "
>
{{templateTitle}}
</span>
Project
</h2>
<span
flex
></span>
<md-button
class=
"md-icon-button"
ng-click=
"cancel()"
>
<i
class=
"fa fa-times fa-2x"
style=
"margin-top: 5px; font-size: 1.5em; float: left"
></i>
...
...
@@ -81,6 +81,29 @@
</md-select>
</td>
</tr>
<tr>
<td
colspan=
"4"
>
<b>
Project Start Date
</b>
</td>
<td
colspan=
"8"
>
<md-datepicker
ng-model=
"projectStartDate"
md-placeholder =
"Please select the date"
id =
"projectStartDate"
md-min-date=
"minDate"
md-max-date=
"maxDate"
onkeydown=
"return false"
>
</md-datepicker>
</td>
</tr>
<tr>
<td
colspan=
"4"
>
<b>
Project End Date
</b>
</td>
<td
colspan=
"8"
>
<md-datepicker
ng-model=
"projectEndDate"
md-placeholder =
"Please select the date"
id =
"projectEndDate"
md-min-date=
"minDate"
md-max-date=
"maxDate"
onkeydown=
"return false"
>
</md-datepicker>
</td>
</tr>
</table>
<div
role=
"alert"
>
...
...
@@ -93,7 +116,7 @@
<md-dialog-actions
layout=
"row"
>
<md-button
class=
"md-raised"
data-ng-click=
"validateFields('{{templateTitle}}')"
style=
"width:120px;background: cadetblue;color:white;"
>
{{templateTitle}}
</md-button>
<span
ng-show=
"templateTitle == 'Assign' "
>
Add
</span>
<span
ng-show=
"templateTitle != 'Assign' "
>
{{templateTitle}}
</span>
</md-button>
<md-button
class=
"md-raised"
ng-click=
"cancel()"
style=
"width:120px;background: cadetblue;color:white;"
>
Cancel
</md-button>
...
...
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