Commit 54f73aa4 authored by Vijay Akula's avatar Vijay Akula

Added delivery leads list instead of map

parent 924fb285
...@@ -43,6 +43,7 @@ public class ProjectController { ...@@ -43,6 +43,7 @@ public class ProjectController {
if (account != null) { if (account != null) {
accountName = account.getAccountName(); accountName = account.getAccountName();
int sequenceNumber = account.getAccountProjectSequence(); int sequenceNumber = account.getAccountProjectSequence();
account.setAccountProjectSequence(sequenceNumber + 1); account.setAccountProjectSequence(sequenceNumber + 1);
projectService.updateProjSeqinAccount(account); projectService.updateProjSeqinAccount(account);
......
...@@ -199,3 +199,6 @@ public class ResourceController { ...@@ -199,3 +199,6 @@ public class ResourceController {
// @RequestMapping(value = "/getEmployeesToTeam" // @RequestMapping(value = "/getEmployeesToTeam"
// public ResponseEntity<List<Employee>> getActiveEmployeesSortByName() throws // public ResponseEntity<List<Employee>> getActiveEmployeesSortByName() throws
// MyTimeException { // MyTimeException {
...@@ -27,10 +27,9 @@ public class Domain implements Serializable { ...@@ -27,10 +27,9 @@ public class Domain implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//private ObjectId id;
@Id @Id
private ObjectId id;
private String domainId; private String domainId;
@NotNull @NotNull
@Size(min = 2, max = 80, message = "Domain Name should have atlast 2 and less than 80 characters") @Size(min = 2, max = 80, message = "Domain Name should have atlast 2 and less than 80 characters")
......
...@@ -42,6 +42,11 @@ public class AccountService implements IAccountService { ...@@ -42,6 +42,11 @@ public class AccountService implements IAccountService {
accountReq.setAccountId(generateAccountId()); accountReq.setAccountId(generateAccountId());
accountReq.setStatus(MyTeamUtils.STRING_Y); accountReq.setStatus(MyTeamUtils.STRING_Y);
if (accountReq.getAccountProjectSequence() == null) {
accountReq.setAccountProjectSequence(0);
}
Account accountPersisted = accountRepo.save(accountReq); Account accountPersisted = accountRepo.save(accountReq);
if (log.isInfoEnabled()) { if (log.isInfoEnabled()) {
log.info("Account has been persisted in database with account details::" + accountPersisted); log.info("Account has been persisted in database with account details::" + accountPersisted);
......
...@@ -402,6 +402,8 @@ public class ProjectService implements IProjectService { ...@@ -402,6 +402,8 @@ public class ProjectService implements IProjectService {
List<Project> projectList = new ArrayList<>(); List<Project> projectList = new ArrayList<>();
List<Project> projectListPersisted = projectRepo.findByDeliveryLeadIds(deliveryLeadId); List<Project> projectListPersisted = projectRepo.findByDeliveryLeadIds(deliveryLeadId);
for (Project project : projectListPersisted) { for (Project project : projectListPersisted) {
//accountService.getAccountById(project.getAccountId()).getAccountName();
if (!project.getStatus().equals("Completed")) { if (!project.getStatus().equals("Completed")) {
projectList.add(project); projectList.add(project);
} }
...@@ -690,6 +692,7 @@ public class ProjectService implements IProjectService { ...@@ -690,6 +692,7 @@ public class ProjectService implements IProjectService {
List<HashMap<Object, Object>> projectsList = new ArrayList<HashMap<Object, Object>>(); List<HashMap<Object, Object>> projectsList = new ArrayList<HashMap<Object, Object>>();
Set<String> accountIdSet = domainService.accountsAssignedToDeliveryLead(empId); Set<String> accountIdSet = domainService.accountsAssignedToDeliveryLead(empId);
List<Project> projectList = projectRepo.findByAccountIdIn(accountIdSet); List<Project> projectList = projectRepo.findByAccountIdIn(accountIdSet);
for (Project proj : projectList) { for (Project proj : projectList) {
addToProjectList(projectsList, proj); addToProjectList(projectsList, proj);
} }
...@@ -730,15 +733,17 @@ public class ProjectService implements IProjectService { ...@@ -730,15 +733,17 @@ public class ProjectService implements IProjectService {
projectMap.put("account", account.getAccountName()); projectMap.put("account", account.getAccountName());
projectMap.put("accountId", proj.getAccountId()); projectMap.put("accountId", proj.getAccountId());
projectMap.put("domainId", proj.getDomainId()); projectMap.put("domainId", proj.getDomainId());
projectMap.put("domain",proj.getDomain());
projectMap.put("employeeIds", proj.getEmployeeIds()); projectMap.put("employeeIds", proj.getEmployeeIds());
if (proj.getDeliveryLeadIds() != null) { if (proj.getDeliveryLeadIds() != null) {
projectMap.put("deliveryLeadIds", employeeService.getDeliveryManagerMap(proj.getDeliveryLeadIds())); //employeeService.getDeliveryManagerMap(proj.getDeliveryLeadIds()).stream().map(mapObj->mapObj.get("employeeId")).collect(Collectors.toList());
projectMap.put("deliveryLeadIds",proj.getDeliveryLeadIds());
} }
if (proj.getManagerIds() != null) { if (proj.getManagerIds() != null) {
projectMap.put("managerIds", employeeService.getDeliveryManagerMap(proj.getManagerIds())); //projectMap.put("managerIds", employeeService.getDeliveryManagerMap(proj.getManagerIds()));
projectMap.put("managerIds", proj.getManagerIds());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment