Subversion Repositories SmartDukaan

Rev

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

Rev 35458 Rev 35628
Line 1850... Line 1850...
1850
        model.addAttribute("suo", suo);
1850
        model.addAttribute("suo", suo);
1851
        return "samsung-upgrade-offer-index";
1851
        return "samsung-upgrade-offer-index";
1852
 
1852
 
1853
    }
1853
    }
1854
 
1854
 
-
 
1855
    @RequestMapping(value = "/schemes/rejectActivatedSchemeIds", method = RequestMethod.GET)
-
 
1856
    public String rejectActivatedSchemeIds(HttpServletRequest request, @RequestParam String schemeIds, Model model)
-
 
1857
            throws Exception {
-
 
1858
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
-
 
1859
        String emailId = loginDetails.getEmailId();
-
 
1860
 
-
 
1861
        List<String> techEmails = new ArrayList<>();
-
 
1862
        for (EscalationType et : Arrays.asList(EscalationType.L2, EscalationType.L3, EscalationType.L4, EscalationType.L5)) {
-
 
1863
            techEmails.addAll(csService.getAuthUserByCategoryId(ProfitMandiConstants.TICKET_CATEGORY_TECHNOLOGY, et)
-
 
1864
                    .stream().map(x -> x.getEmailId()).collect(Collectors.toList()));
-
 
1865
        }
-
 
1866
        if (!techEmails.contains(emailId)) {
-
 
1867
            throw new ProfitMandiBusinessException("User", emailId, "Unauthorised access");
-
 
1868
        }
-
 
1869
 
-
 
1870
        List<Integer> schemeIdList = Arrays.stream(schemeIds.split(","))
-
 
1871
                .map(String::trim).filter(s -> !s.isEmpty())
-
 
1872
                .map(Integer::parseInt).collect(Collectors.toList());
-
 
1873
 
-
 
1874
        schemeService.rejectActivatedSchemeIds(schemeIdList);
-
 
1875
        model.addAttribute("response1", mvcResponseSender.createResponseString(true));
-
 
1876
        return "response";
-
 
1877
    }
-
 
1878
 
1855
}
1879
}
1856
1880