Subversion Repositories SmartDukaan

Rev

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

Rev 35458 Rev 35534
Line 129... Line 129...
129
    private MVCResponseSender mvcResponseSender;
129
    private MVCResponseSender mvcResponseSender;
130
 
130
 
131
    @Autowired
131
    @Autowired
132
    private FofoOrderItemRepository fofoOrderItemRepository;
132
    private FofoOrderItemRepository fofoOrderItemRepository;
133
 
133
 
-
 
134
    @Autowired
-
 
135
    private com.spice.profitmandi.service.transaction.CreditBlockedExceptionPartnersRepository creditBlockedExceptionPartnersRepository;
-
 
136
 
134
    private static final Logger LOGGER = LogManager.getLogger(SDCreditController.class);
137
    private static final Logger LOGGER = LogManager.getLogger(SDCreditController.class);
135
 
138
 
136
    @RequestMapping(value = "/getSDCreditReq", method = RequestMethod.GET)
139
    @RequestMapping(value = "/getSDCreditReq", method = RequestMethod.GET)
137
    public String getSDCreditReq(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
140
    public String getSDCreditReq(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
138
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
141
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
Line 249... Line 252...
249
        }
252
        }
250
        model.addAttribute("response1", mvcResponseSender.createResponseString(true));
253
        model.addAttribute("response1", mvcResponseSender.createResponseString(true));
251
        return "response";
254
        return "response";
252
    }
255
    }
253
 
256
 
-
 
257
    @RequestMapping(value = "/addCreditBlockedException", method = RequestMethod.POST)
-
 
258
    public String addCreditBlockedException(HttpServletRequest request, @RequestParam int fofoId, Model model) throws Exception {
-
 
259
        LOGGER.info("Adding credit blocked exception for fofoId: {} for today", fofoId);
-
 
260
 
-
 
261
        CreditBlockedExceptionPartner existingException = creditBlockedExceptionPartnersRepository.select(fofoId);
-
 
262
        if (existingException != null && existingException.getOnDate().equals(LocalDate.now())) {
-
 
263
            LOGGER.info("Exception already exists for fofoId: {} for today", fofoId);
-
 
264
            model.addAttribute("response1", mvcResponseSender.createResponseString(true));
-
 
265
            return "response";
-
 
266
        }
-
 
267
 
-
 
268
        CreditBlockedExceptionPartner exception = new CreditBlockedExceptionPartner();
-
 
269
        exception.setFofoId(fofoId);
-
 
270
        exception.setOnDate(LocalDate.now());
-
 
271
        creditBlockedExceptionPartnersRepository.persist(exception);
-
 
272
 
-
 
273
        LOGGER.info("Credit blocked exception added successfully for fofoId: {}", fofoId);
-
 
274
        model.addAttribute("response1", mvcResponseSender.createResponseString(true));
-
 
275
        return "response";
-
 
276
    }
-
 
277
 
254
    @RequestMapping(value = "/getSanctionRequest", method = RequestMethod.GET)
278
    @RequestMapping(value = "/getSanctionRequest", method = RequestMethod.GET)
255
    public String getSanctionRequest(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
279
    public String getSanctionRequest(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
256
 
280
 
257
        List<SanctionRequest> sanctionRequests = sanctionRequestRepository.getL2ApprovedByDate(LocalDate.now(), SanctionStatus.APPROVED);
281
        List<SanctionRequest> sanctionRequests = sanctionRequestRepository.getL2ApprovedByDate(LocalDate.now(), SanctionStatus.APPROVED);
258
 
282