Skip to content

Commit

Permalink
Merge pull request #955 from hth/notify-delay
Browse files Browse the repository at this point in the history
Moved show stats of new visit and re-visit to Queue Supervisor
  • Loading branch information
hth committed Jan 27, 2018
2 parents fbf078d + 3ad1d0e commit 67c5cfa
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public class QueueDetail {
private long assignedToQueue;
private long pendingApprovalToQueue;

//TODO(hth) Move this to Queue Manager Screen.
/* Used in Queue Supervisor and Queue Manager Screen. */
private long previouslyVisitedClientCount;

//TODO(hth) Move this to Queue Manager Screen.
/* Used in Queue Supervisor and Queue Manager Screen. */
private long newVisitClientCount;

public String getId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.noqapp.domain.UserProfileEntity;
import com.noqapp.domain.types.UserLevelEnum;
import com.noqapp.service.AccountService;
import com.noqapp.service.QueueService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -77,7 +76,6 @@ public class AdminBusinessLandingController {
private BizService bizService;
private BusinessUserStoreService businessUserStoreService;
private AccountService accountService;
private QueueService queueService;

@Autowired
public AdminBusinessLandingController(
Expand Down Expand Up @@ -109,8 +107,7 @@ public AdminBusinessLandingController(
BizDimensionService bizDimensionService,
BizService bizService,
BusinessUserStoreService businessUserStoreService,
AccountService accountService,
QueueService queueService
AccountService accountService
) {
this.queueLimit = queueLimit;
this.nextPage = nextPage;
Expand All @@ -126,7 +123,6 @@ public AdminBusinessLandingController(
this.bizService = bizService;
this.businessUserStoreService = businessUserStoreService;
this.accountService = accountService;
this.queueService = queueService;
}

/**
Expand Down Expand Up @@ -192,9 +188,7 @@ private void populateLandingForm(BusinessLandingForm businessLandingForm, Busine
QueueDetail queueDetail = new QueueDetail()
.setId(bizStore.getId())
.setAssignedToQueue(businessUserStoreService.findNumberOfPeopleAssignedToQueue(bizStore.getId()))
.setPendingApprovalToQueue(businessUserStoreService.findNumberOfPeoplePendingApprovalToQueue(bizStore.getId()))
.setPreviouslyVisitedClientCount(queueService.getPreviouslyVisitedClientCount(bizStore.getCodeQR()))
.setNewVisitClientCount(queueService.getNewVisitClientCount(bizStore.getCodeQR()));
.setPendingApprovalToQueue(businessUserStoreService.findNumberOfPeoplePendingApprovalToQueue(bizStore.getId()));

businessLandingForm.addQueueDetail(queueDetail);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.noqapp.view.controller.business.store.queue;

import com.noqapp.domain.BizStoreEntity;
import com.noqapp.domain.helper.QueueDetail;
import com.noqapp.service.BizService;
import com.noqapp.service.QueueService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -43,23 +47,29 @@ public class QueueSupervisorLandingController {

private BusinessUserService businessUserService;
private BusinessUserStoreService businessUserStoreService;
private QueueService queueService;
private BizService bizService;

@Autowired
public QueueSupervisorLandingController(
@Value ("${nextPage:/business/queueLanding}")
@Value("${nextPage:/business/queueLanding}")
String nextPage,

@Value ("${migrateBusinessProfileFlow:redirect:/migrate/business/profile.htm}")
@Value("${migrateBusinessProfileFlow:redirect:/migrate/business/profile.htm}")
String migrateBusinessProfileFlow,

BusinessUserService businessUserService,
BusinessUserStoreService businessUserStoreService
BusinessUserStoreService businessUserStoreService,
QueueService queueService,
BizService bizService
) {
this.nextPage = nextPage;
this.migrateBusinessProfileFlow = migrateBusinessProfileFlow;

this.businessUserService = businessUserService;
this.businessUserStoreService = businessUserStoreService;
this.queueService = queueService;
this.bizService = bizService;
}

/**
Expand Down Expand Up @@ -110,5 +120,15 @@ private void populateLandingForm(BusinessLandingForm businessLandingForm, Busine
LOG.info("Loading dashboard for bizName={} bizId={}", bizName.getBusinessName(), bizName.getId());
List<JsonTopic> jsonTopics = businessUserStoreService.getQueues(businessUser.getQueueUserId());
businessLandingForm.setJsonTopics(jsonTopics);

List<BizStoreEntity> bizStores = bizService.getAllBizStores(businessUser.getBizName().getId());
for (BizStoreEntity bizStore : bizStores) {
QueueDetail queueDetail = new QueueDetail()
.setId(bizStore.getCodeQR())
.setPreviouslyVisitedClientCount(queueService.getPreviouslyVisitedClientCount(bizStore.getCodeQR()))
.setNewVisitClientCount(queueService.getNewVisitClientCount(bizStore.getCodeQR()));

businessLandingForm.addQueueDetail(queueDetail);
}
}
}
8 changes: 0 additions & 8 deletions view/web/WEB-INF/jsp/business/landing.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@
<img src="${pageContext.request.contextPath}/static2/internal/img/sortAZ.png"
alt="Sort" height="16px;"/>
</th>
<th>New</th>
<th>Re-Visit</th>
<th>Pending</th>
<th>Assigned</th>
<th>&nbsp;</th>
Expand All @@ -88,12 +86,6 @@
<a href="/${store.codeQR}/q.htm" target="_blank">${store.displayName}</a>
<span style="display:block; font-size:13px;">${businessLandingForm.categories.get(store.bizCategoryId)}</span>
</td>
<td>
${businessLandingForm.queueDetails.get(store.id).previouslyVisitedClientCount}
</td>
<td>
${businessLandingForm.queueDetails.get(store.id).newVisitClientCount}
</td>
<td>
<a href="/business/${store.id}/listQueueSupervisor.htm">${businessLandingForm.queueDetails.get(store.id).pendingApprovalToQueue}</a>
</td>
Expand Down
4 changes: 4 additions & 0 deletions view/web/WEB-INF/jsp/business/queueLanding.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
<th>&nbsp;</th>
<th nowrap>Queue Name</th>
<th nowrap>Queue Status</th>
<th>New</th>
<th>Re-Visit</th>
<th nowrap>In Queue</th>
<th>Serving</th>
</tr>
Expand All @@ -74,6 +76,8 @@
<td>${status.count}&nbsp;</td>
<td nowrap><a href="/${jsonTopic.codeQR}/q.htm" target="_blank">${jsonTopic.displayName}</a></td>
<td nowrap>${jsonTopic.queueStatus.description}</td>
<td>${businessLandingForm.queueDetails.get(jsonTopic.codeQR).previouslyVisitedClientCount}</td>
<td>${businessLandingForm.queueDetails.get(jsonTopic.codeQR).newVisitClientCount}</td>
<td nowrap>${jsonTopic.token - jsonTopic.servingNumber}</td>
<td nowrap>${jsonTopic.servingNumber}</td>
</tr>
Expand Down

0 comments on commit 67c5cfa

Please sign in to comment.