Subversion Repositories SmartDukaan

Rev

Rev 37277 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37277 Rev 37991
Line 386... Line 386...
386
		}
386
		}
387
 
387
 
388
		Map<String, Object> result = new HashMap<>();
388
		Map<String, Object> result = new HashMap<>();
389
		result.put("dtrUserId", dtrUserId);
389
		result.put("dtrUserId", dtrUserId);
390
		result.put("authUserId", authUserId);
390
		result.put("authUserId", authUserId);
391
		result.put("userName", au.getFirstName() + " " + au.getLastName());
391
		result.put("userName", au.getFullName());
392
		result.put("parties", parties);
392
		result.put("parties", parties);
393
		result.put("agendaOptions", com.spice.profitmandi.dao.enumuration.dtr.VisitAgenda.labels());
393
		result.put("agendaOptions", com.spice.profitmandi.dao.enumuration.dtr.VisitAgenda.labels());
394
		// Managers can't assign a visit while a scheduled beat's agenda is unfilled; the
394
		// Managers can't assign a visit while a scheduled beat's agenda is unfilled; the
395
		// modal uses this flag to show the warning and disable the assign action. (A
395
		// modal uses this flag to show the warning and disable the assign action. (A
396
		// user with no beat that day is allowed — nothing to fill.)
396
		// user with no beat that day is allowed — nothing to fill.)
Line 587... Line 587...
587
			msg.append(createdCount).append(" new visit").append(createdCount == 1 ? "" : "s").append(" assigned");
587
			msg.append(createdCount).append(" new visit").append(createdCount == 1 ? "" : "s").append(" assigned");
588
		if (updatedCount > 0) {
588
		if (updatedCount > 0) {
589
			if (msg.length() > 0) msg.append(", ");
589
			if (msg.length() > 0) msg.append(", ");
590
			msg.append(updatedCount).append(" existing agenda").append(updatedCount == 1 ? "" : "s").append(" refilled");
590
			msg.append(updatedCount).append(" existing agenda").append(updatedCount == 1 ? "" : "s").append(" refilled");
591
		}
591
		}
592
		msg.append(" for ").append(au.getFirstName()).append(" ").append(au.getLastName());
592
		msg.append(" for ").append(au.getFullName());
593
		result.put("message", msg.toString());
593
		result.put("message", msg.toString());
594
		return responseSender.ok(result);
594
		return responseSender.ok(result);
595
	}
595
	}
596
 
596
 
597
	// Close a MANUAL agenda instance. AUTO instances are refused inside
597
	// Close a MANUAL agenda instance. AUTO instances are refused inside
Line 716... Line 716...
716
			boolean isLead = "lead".equalsIgnoreCase(r.getTaskType());
716
			boolean isLead = "lead".equalsIgnoreCase(r.getTaskType());
717
			boolean isOffice = "office-visit".equalsIgnoreCase(r.getTaskType());
717
			boolean isOffice = "office-visit".equalsIgnoreCase(r.getTaskType());
718
			Map<String, Object> row = new HashMap<>();
718
			Map<String, Object> row = new HashMap<>();
719
			row.put("id", r.getId());
719
			row.put("id", r.getId());
720
			row.put("authUserId", r.getAuthUserId());
720
			row.put("authUserId", r.getAuthUserId());
721
			row.put("userName", u != null ? (u.getFirstName() + " " + u.getLastName()) : ("User #" + r.getAuthUserId()));
721
			row.put("userName", u != null ? u.getFullName() : ("User #" + r.getAuthUserId()));
722
			row.put("fofoStoreId", r.getFofoId());
722
			row.put("fofoStoreId", r.getFofoId());
723
			row.put("name", r.getDisplayName() != null ? r.getDisplayName() : ("#" + r.getFofoId()));
723
			row.put("name", r.getDisplayName() != null ? r.getDisplayName() : ("#" + r.getFofoId()));
724
			row.put("type", isLead ? "Lead" : (isOffice ? "Office" : "Visit"));
724
			row.put("type", isLead ? "Lead" : (isOffice ? "Office" : "Visit"));
725
			row.put("deferredDate", r.getDeferredDate() != null ? r.getDeferredDate().toString() : null);
725
			row.put("deferredDate", r.getDeferredDate() != null ? r.getDeferredDate().toString() : null);
726
			row.put("reason", r.getReason());
726
			row.put("reason", r.getReason());
Line 1869... Line 1869...
1869
		List<Map<String, Object>> rows = new ArrayList<>();
1869
		List<Map<String, Object>> rows = new ArrayList<>();
1870
		for (com.spice.profitmandi.dao.model.BeatDayDetails b : beats) {
1870
		for (com.spice.profitmandi.dao.model.BeatDayDetails b : beats) {
1871
			AuthUser u = userMap.get(b.getAuthUserId());
1871
			AuthUser u = userMap.get(b.getAuthUserId());
1872
			Map<String, Object> row = new HashMap<>();
1872
			Map<String, Object> row = new HashMap<>();
1873
			row.put("authUserId", b.getAuthUserId());
1873
			row.put("authUserId", b.getAuthUserId());
1874
			row.put("userName", u != null ? (u.getFirstName() + " " + u.getLastName()) : "User #" + b.getAuthUserId());
1874
			row.put("userName", u != null ? u.getFullName() : "User #" + b.getAuthUserId());
1875
			row.put("scheduleDate", b.getScheduleDate().toString());
1875
			row.put("scheduleDate", b.getScheduleDate().toString());
1876
			row.put("dayNumber", b.getDayNumber());
1876
			row.put("dayNumber", b.getDayNumber());
1877
			row.put("beatId", b.getBeatId());
1877
			row.put("beatId", b.getBeatId());
1878
			row.put("beatName", b.getBeatName());
1878
			row.put("beatName", b.getBeatName());
1879
			row.put("beatColor", b.getBeatColor());
1879
			row.put("beatColor", b.getBeatColor());
Line 2224... Line 2224...
2224
				.filter(au -> au.getActive())
2224
				.filter(au -> au.getActive())
2225
				.filter(au -> visible == null || visible.contains(au.getId()))
2225
				.filter(au -> visible == null || visible.contains(au.getId()))
2226
				.map(au -> {
2226
				.map(au -> {
2227
					Map<String, Object> map = new HashMap<>();
2227
					Map<String, Object> map = new HashMap<>();
2228
					map.put("id", au.getId());
2228
					map.put("id", au.getId());
2229
					map.put("name", au.getFirstName() + " " + au.getLastName());
2229
					map.put("name", au.getFullName());
2230
					return map;
2230
					return map;
2231
				})
2231
				})
2232
				.collect(Collectors.toList());
2232
				.collect(Collectors.toList());
2233
		return responseSender.ok(result);
2233
		return responseSender.ok(result);
2234
	}
2234
	}