Subversion Repositories SmartDukaan

Rev

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

Rev 34973 Rev 35064
Line 321... Line 321...
321
 
321
 
322
        model.addAttribute("monthSales", monthSaleMap);
322
        model.addAttribute("monthSales", monthSaleMap);
323
        return "monthSales";
323
        return "monthSales";
324
    }
324
    }
325
 
325
 
-
 
326
    @RequestMapping(value = "/getBrandwisePartnerSale", method = RequestMethod.GET)
-
 
327
    @ResponseBody
-
 
328
    public List<Map<String, Object>> getBrandwisePartnerSale(HttpServletRequest request, @RequestParam(name = "month", required = true, defaultValue = "0") int month, Model model) throws Exception {
-
 
329
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
-
 
330
        if (month < 1 || month > 12) {
-
 
331
            throw new IllegalArgumentException("Month must be between 1 and 12");
-
 
332
        }
-
 
333
        int fofoId = loginDetails.getFofoId();
-
 
334
        List<BrandWisePartnerSaleModel> brandWisePartnerSaleModels = fofoStoreRepository.selectBrandWiseMonthlyPartnerSale(Collections.singletonList(fofoId), month);
-
 
335
        List<Map<String, Object>> response = new ArrayList<>();
-
 
336
        for (BrandWisePartnerSaleModel m : brandWisePartnerSaleModels) {
-
 
337
            Map<String, Object> row = new HashMap<>();
-
 
338
            row.put("brand", m.getBrand());
-
 
339
            row.put("lms", fofoUser.format(m.getLms()));
-
 
340
            row.put("lmsQty", m.getLmsQty());
-
 
341
            row.put("mtd", fofoUser.format(m.getMtd()));
-
 
342
            row.put("mtdQty", m.getMtdQty());
-
 
343
            row.put("lmtd", fofoUser.format(m.getLmtd()));
-
 
344
            row.put("lmtdQty", m.getLmtdQty());
-
 
345
            row.put("amtd", fofoUser.format(m.getAmtd()));
-
 
346
            response.add(row);
-
 
347
        }
-
 
348
 
-
 
349
 
-
 
350
        LOGGER.info("brandItemWisePartnerSaleModels {}", response);
-
 
351
        return response;
-
 
352
    }
-
 
353
 
-
 
354
    @RequestMapping(value = "/getBrandItemwisePartnerSale", method = RequestMethod.GET)
-
 
355
    @ResponseBody
-
 
356
    public List<BrandItemWisePartnerSaleModel> getBrandItemwisePartnerSale(HttpServletRequest request, @RequestParam(name = "month", required = true, defaultValue = "0") int month, @RequestParam(name = "brand") String brand, @RequestParam(name = "fofoId") Integer fofoId, Model model) throws Exception {
-
 
357
        if (month < 1 || month > 12) {
-
 
358
            throw new IllegalArgumentException("Month must be between 1 and 12");
-
 
359
        }
-
 
360
        List<BrandItemWisePartnerSaleModel> brandItemWisePartnerSaleModels = fofoStoreRepository.selectPartnerBrandItemMonthlySale(Collections.singletonList(fofoId), month, brand);
-
 
361
        LOGGER.info("brandItemWisePartnerSaleModels {}", brandItemWisePartnerSaleModels);
-
 
362
        return brandItemWisePartnerSaleModels;
-
 
363
    }
-
 
364
 
-
 
365
 
326
    @Autowired
366
    @Autowired
327
    SchemeService schemeService;
367
    SchemeService schemeService;
328
 
368
 
329
    @Value("${google.api.key}")
369
    @Value("${google.api.key}")
330
    private String googleApiKey;
370
    private String googleApiKey;