| Line 552... |
Line 552... |
| 552 |
public String getNotificationsWithType(HttpServletRequest request,
|
552 |
public String getNotificationsWithType(HttpServletRequest request,
|
| 553 |
@RequestParam(required = false) MessageType messageType,
|
553 |
@RequestParam(required = false) MessageType messageType,
|
| 554 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
554 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 555 |
@RequestParam(name = "limit", defaultValue = "20") int limit, Model model) throws Exception {
|
555 |
@RequestParam(name = "limit", defaultValue = "20") int limit, Model model) throws Exception {
|
| 556 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
556 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
557 |
int userId = 0;
|
| - |
|
558 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| - |
|
559 |
if (isAdmin) {
|
| - |
|
560 |
userId = loginDetails.getFofoId();
|
| - |
|
561 |
} else {
|
| 557 |
int userId = userAccountRepository.selectUserIdByRetailerId(loginDetails.getFofoId());
|
562 |
userId = userAccountRepository.selectUserIdByRetailerId(loginDetails.getFofoId());
|
| - |
|
563 |
}
|
| 558 |
List<UserCampaign> userCampaigns = userCampaignRepository.selectByUserId(userId);
|
564 |
List<UserCampaign> userCampaigns = userCampaignRepository.selectByUserId(userId);
|
| 559 |
|
565 |
|
| 560 |
List<Notification> notifications = null;
|
566 |
List<Notification> notifications = null;
|
| 561 |
if (!userCampaigns.isEmpty()) {
|
567 |
if (!userCampaigns.isEmpty()) {
|
| 562 |
List<Integer> campaignIds = new ArrayList<>();
|
568 |
List<Integer> campaignIds = new ArrayList<>();
|