Subversion Repositories SmartDukaan

Rev

Rev 26071 | Rev 26090 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26071 Rev 26086
Line 572... Line 572...
572
		if (isAdmin) {
572
		if (isAdmin) {
573
			userId = loginDetails.getFofoId();
573
			userId = loginDetails.getFofoId();
574
		} else {
574
		} else {
575
			userId = userAccountRepository.selectUserIdByRetailerId(loginDetails.getFofoId());
575
			userId = userAccountRepository.selectUserIdByRetailerId(loginDetails.getFofoId());
576
		}
576
		}
577
		List<UserCampaign> userCampaigns = userCampaignRepository.selectByUserId(userId);
-
 
578
 
-
 
579
		List<Notification> notifications = null;
577
		List<Notification> notifications = null;
580
		if (!userCampaigns.isEmpty()) {
-
 
581
			List<Integer> campaignIds = new ArrayList<>();
-
 
582
			for (UserCampaign userCampaign : userCampaigns) {
-
 
583
				campaignIds.add(userCampaign.getCampaignId());
-
 
584
			}
-
 
585
			if (messageType == null) {
-
 
586
				messageType = MessageType.notification;
-
 
587
			}
-
 
588
			List<NotificationCampaign> notificationCampaigns = notificationCampaignRepository
-
 
589
					.selectbyCidsAndType(campaignIds, messageType, offset, limit);
-
 
590
			LOGGER.info("messageType" + messageType);
-
 
591
			notifications = getNotifications(notificationCampaigns, messageType);
-
 
592
 
578
 
-
 
579
		if (messageType == null) {
-
 
580
			messageType = MessageType.notification;
593
		}
581
		}
594
 
582
 
-
 
583
		List<NotificationCampaign> notificationCampaigns = notificationCampaignRepository.getNotifications(messageType,
-
 
584
				userId, offset, limit);
-
 
585
		LOGGER.info("messageType" + messageType);
-
 
586
		notifications = getNotifications(notificationCampaigns, messageType);
-
 
587
 
595
		model.addAttribute("notifications", notifications);
588
		model.addAttribute("notifications", notifications);
596
 
589
 
597
		LOGGER.info("notifications" + notifications);
590
		LOGGER.info("notifications" + notifications);
598
		return "notification-template";
591
		return "notification-template";
599
	}
592
	}