Subversion Repositories SmartDukaan

Rev

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

Rev 35435 Rev 35458
Line 185... Line 185...
185
    private CurrentInventorySnapshotRepository currentInventorySnapshotRepository;
185
    private CurrentInventorySnapshotRepository currentInventorySnapshotRepository;
186
 
186
 
187
    List<String> filterableParams = Arrays.asList("brand");
187
    List<String> filterableParams = Arrays.asList("brand");
188
 
188
 
189
    @RequestMapping(value = "/fofo/buckets", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
189
    @RequestMapping(value = "/fofo/buckets", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
190
    @Transactional(readOnly = true)
-
 
191
    public ResponseEntity<?> getBuckets(HttpServletRequest request) throws ProfitMandiBusinessException {
190
    public ResponseEntity<?> getBuckets(HttpServletRequest request) throws ProfitMandiBusinessException {
192
        logger.info("Request " + request.getParameterMap());
191
        logger.info("Request " + request.getParameterMap());
193
        return responseSender.ok(itemBucketService.getBuckets(Optional.of(true)));
192
        return responseSender.ok(itemBucketService.getBuckets(Optional.of(true)));
194
    }
193
    }
195
 
194
 
196
    @RequestMapping(value = "/fofo/bucket", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
195
    @RequestMapping(value = "/fofo/bucket", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
197
    @Transactional(readOnly = true)
-
 
198
    public ResponseEntity<?> getBucketDetails(HttpServletRequest request, @RequestParam int id) throws ProfitMandiBusinessException {
196
    public ResponseEntity<?> getBucketDetails(HttpServletRequest request, @RequestParam int id) throws ProfitMandiBusinessException {
199
        List<ItemQuantityPojo> iqPojo = itemBucketService.getBucketDetails(id);
197
        List<ItemQuantityPojo> iqPojo = itemBucketService.getBucketDetails(id);
200
        Map<Integer, Integer> itemIdsQtyMap = iqPojo.stream().collect(Collectors.toMap(x -> x.getItemId(), x -> x.getQuantity()));
198
        Map<Integer, Integer> itemIdsQtyMap = iqPojo.stream().collect(Collectors.toMap(x -> x.getItemId(), x -> x.getQuantity()));
201
        Set<Integer> catalogIds = itemRepository.selectByIds(itemIdsQtyMap.keySet()).stream().map(x -> x.getCatalogItemId()).collect(Collectors.toSet());
199
        Set<Integer> catalogIds = itemRepository.selectByIds(itemIdsQtyMap.keySet()).stream().map(x -> x.getCatalogItemId()).collect(Collectors.toSet());
202
        Map<String, String> params = new HashMap<>();
200
        Map<String, String> params = new HashMap<>();
Line 223... Line 221...
223
        bucket.setFofoCatalogResponses(dealResponse);
221
        bucket.setFofoCatalogResponses(dealResponse);
224
        return responseSender.ok(bucket);
222
        return responseSender.ok(bucket);
225
    }
223
    }
226
 
224
 
227
    @RequestMapping(value = "/fofo/suggestedPo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
225
    @RequestMapping(value = "/fofo/suggestedPo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
228
    @Transactional(readOnly = true)
-
 
229
    public ResponseEntity<?> getSuggestedPo(HttpServletRequest request, @RequestParam int id) throws ProfitMandiBusinessException {
226
    public ResponseEntity<?> getSuggestedPo(HttpServletRequest request, @RequestParam int id) throws ProfitMandiBusinessException {
230
        int userId = (int) request.getAttribute("userId");
227
        int userId = (int) request.getAttribute("userId");
231
        UserCart uc = userAccountRepository.getUserCart(userId);
228
        UserCart uc = userAccountRepository.getUserCart(userId);
232
        int fofoId = uc.getUserId();
229
        int fofoId = uc.getUserId();
233
        SuggestedPo  suggestedPo = suggestedPoRepository.selectAllOpenPoByFofoId(fofoId).get(0);
230
        SuggestedPo  suggestedPo = suggestedPoRepository.selectAllOpenPoByFofoId(fofoId).get(0);
Line 271... Line 268...
271
 
268
 
272
        return responseSender.ok(true);
269
        return responseSender.ok(true);
273
    }
270
    }
274
 
271
 
275
    @RequestMapping(value = "/fofo/fovourites", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
272
    @RequestMapping(value = "/fofo/fovourites", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
276
    @Transactional(readOnly = true)
-
 
277
    public ResponseEntity<?> getFavourites(HttpServletRequest request) throws Exception {
273
    public ResponseEntity<?> getFavourites(HttpServletRequest request) throws Exception {
278
 
274
 
279
        int userId = (int) request.getAttribute("userId");
275
        int userId = (int) request.getAttribute("userId");
280
        UserCart uc = userAccountRepository.getUserCart(userId);
276
        UserCart uc = userAccountRepository.getUserCart(userId);
281
        int fofoId = uc.getUserId();
277
        int fofoId = uc.getUserId();
Line 320... Line 316...
320
        }
316
        }
321
        return String.join(",", strTagIds);
317
        return String.join(",", strTagIds);
322
    }
318
    }
323
 
319
 
324
    @RequestMapping(value = "/fofo/similar-models/{modelId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
320
    @RequestMapping(value = "/fofo/similar-models/{modelId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
325
    @Transactional(readOnly = true)
-
 
326
    public ResponseEntity<?> similarModels(HttpServletRequest httpServletRequest, @PathVariable int modelId) throws Throwable {
321
    public ResponseEntity<?> similarModels(HttpServletRequest httpServletRequest, @PathVariable int modelId) throws Throwable {
327
        UserInfo userInfo = (UserInfo) httpServletRequest.getAttribute("userInfo");
322
        UserInfo userInfo = (UserInfo) httpServletRequest.getAttribute("userInfo");
328
        //FofoStore fs = fofoStoreRepository.selectByRetailerId(userInfo.getRetailerId());
323
        //FofoStore fs = fofoStoreRepository.selectByRetailerId(userInfo.getRetailerId());
329
 
324
 
330
        JSONObject jsonObject = solrService.getContentByCatalogIds(Arrays.asList(modelId)).get(modelId);
325
        JSONObject jsonObject = solrService.getContentByCatalogIds(Arrays.asList(modelId)).get(modelId);
Line 355... Line 350...
355
        }
350
        }
356
    }
351
    }
357
 
352
 
358
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
353
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
359
    @RequestMapping(value = "/fofo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
354
    @RequestMapping(value = "/fofo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
360
    @Transactional(readOnly = true)
-
 
361
    public ResponseEntity<?> getFofo(HttpServletRequest request, @RequestParam(value = "categoryId", required = false, defaultValue = "3") String categoryId, @RequestParam(value = "offset") int offset,
355
    public ResponseEntity<?> getFofo(HttpServletRequest request, @RequestParam(value = "categoryId", required = false, defaultValue = "3") String categoryId, @RequestParam(value = "offset") int offset,
362
                                     @RequestParam(value = "limit") int limit, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "brand", required = false) String brand, @RequestParam(value = "subCategoryId", required = false) int subCategoryId, @RequestParam(value = "q", required = false) String queryTerm, @RequestParam(value = "hotDeal", required = false) boolean hotDeal, @RequestParam(value = "endPoint", required = false) String endPoint,@RequestParam(value = "group", required = false) boolean group) throws Throwable {
356
                                     @RequestParam(value = "limit") int limit, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "brand", required = false) String brand, @RequestParam(value = "subCategoryId", required = false) int subCategoryId, @RequestParam(value = "q", required = false) String queryTerm, @RequestParam(value = "hotDeal", required = false) boolean hotDeal, @RequestParam(value = "endPoint", required = false) String endPoint,@RequestParam(value = "group", required = false) boolean group) throws Throwable {
363
        List<FofoCatalogResponse> dealResponse;
357
        List<FofoCatalogResponse> dealResponse;
364
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
358
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
365
        FofoStore fs = fofoStoreRepository.selectByRetailerId(userInfo.getRetailerId());
359
        FofoStore fs = fofoStoreRepository.selectByRetailerId(userInfo.getRetailerId());
Line 496... Line 490...
496
    }
490
    }
497
 
491
 
498
    @RequestMapping(value = "/online-deals", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
492
    @RequestMapping(value = "/online-deals", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
499
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
493
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
500
    @ApiOperation(value = "Get online deals")
494
    @ApiOperation(value = "Get online deals")
501
    @Transactional(readOnly = true)
-
 
502
    public ResponseEntity<?> getOnlineDeals(HttpServletRequest request, @RequestParam(value = "categoryId") String
495
    public ResponseEntity<?> getOnlineDeals(HttpServletRequest request, @RequestParam(value = "categoryId") String
503
            categoryId, @RequestParam(value = "offset") String offset, @RequestParam(value = "limit") String
496
            categoryId, @RequestParam(value = "offset") String offset, @RequestParam(value = "limit") String
504
                                                    limit, @RequestParam(value = "sort", required = false) String
497
                                                    limit, @RequestParam(value = "sort", required = false) String
505
                                                    sort, @RequestParam(value = "direction", required = false) String
498
                                                    sort, @RequestParam(value = "direction", required = false) String
506
                                                    direction, @RequestParam(value = "filterData", required = false) String filterData) throws Throwable {
499
                                                    direction, @RequestParam(value = "filterData", required = false) String filterData) throws Throwable {
Line 550... Line 543...
550
    }
543
    }
551
 
544
 
552
    @RequestMapping(value = ProfitMandiConstants.URL_BRANDS, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
545
    @RequestMapping(value = ProfitMandiConstants.URL_BRANDS, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
553
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
546
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
554
    @ApiOperation(value = "Get brand list and count for category")
547
    @ApiOperation(value = "Get brand list and count for category")
555
    @Transactional(readOnly = true)
-
 
556
    public ResponseEntity<?> getBrands(HttpServletRequest request, @RequestParam(value = "category_id") String
548
    public ResponseEntity<?> getBrands(HttpServletRequest request, @RequestParam(value = "category_id") String
557
            category_id) throws ProfitMandiBusinessException {
549
            category_id) throws ProfitMandiBusinessException {
558
        logger.info("Request " + request.getParameterMap());
550
        logger.info("Request " + request.getParameterMap());
559
        String response = null;
551
        String response = null;
560
        // TODO: move to properties
552
        // TODO: move to properties
Line 575... Line 567...
575
    }
567
    }
576
 
568
 
577
    @RequestMapping(value = ProfitMandiConstants.URL_UNIT_DEAL, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
569
    @RequestMapping(value = ProfitMandiConstants.URL_UNIT_DEAL, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
578
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
570
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
579
    @ApiOperation(value = "Get unit deal object")
571
    @ApiOperation(value = "Get unit deal object")
580
    @Transactional(readOnly = true)
-
 
581
    public ResponseEntity<?> getUnitDeal(HttpServletRequest request, @PathVariable(value = "id") long id) throws
572
    public ResponseEntity<?> getUnitDeal(HttpServletRequest request, @PathVariable(value = "id") long id) throws
582
            ProfitMandiBusinessException {
573
            ProfitMandiBusinessException {
583
        String response = null;
574
        String response = null;
584
        // TODO: move to properties
575
        // TODO: move to properties
585
        String uri = "getDealById/" + id;
576
        String uri = "getDealById/" + id;
Line 606... Line 597...
606
    }
597
    }
607
 
598
 
608
    @RequestMapping(value = "/partnerdeals/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
599
    @RequestMapping(value = "/partnerdeals/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
609
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
600
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
610
    @ApiOperation(value = "Get unit deal object")
601
    @ApiOperation(value = "Get unit deal object")
611
    @Transactional(readOnly = true)
-
 
612
    public ResponseEntity<?> getUnitFocoDeal(HttpServletRequest request, @PathVariable(value = "id") long id) throws
602
    public ResponseEntity<?> getUnitFocoDeal(HttpServletRequest request, @PathVariable(value = "id") long id) throws
613
            Exception {
603
            Exception {
614
        List<FofoCatalogResponse> dealResponse = new ArrayList<>();
604
        List<FofoCatalogResponse> dealResponse = new ArrayList<>();
615
        List<Integer> tagIds = Arrays.asList(4);
605
        List<Integer> tagIds = Arrays.asList(4);
616
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
606
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
Line 656... Line 646...
656
        }
646
        }
657
        return responseSender.ok(dealResponse);
647
        return responseSender.ok(dealResponse);
658
    }
648
    }
659
 
649
 
660
    @RequestMapping(value = "/fofo/brands", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
650
    @RequestMapping(value = "/fofo/brands", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
661
    @Transactional(readOnly = true)
-
 
662
    public ResponseEntity<?> getBrandsToDisplay(HttpServletRequest request,
651
    public ResponseEntity<?> getBrandsToDisplay(HttpServletRequest request,
663
                                                @RequestParam(required = false, defaultValue = "0") int categoryId) throws Exception {
652
                                                @RequestParam(required = false, defaultValue = "0") int categoryId) throws Exception {
664
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
653
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
665
        logger.info("userInfo [{}]", userInfo);
654
        logger.info("userInfo [{}]", userInfo);
666
        List<BrandCatalog> brandsDisplay = brandsService.getBrandsToDisplay(categoryId);
655
        List<BrandCatalog> brandsDisplay = brandsService.getBrandsToDisplay(categoryId);
667
        //List<DBObject> brandsDisplay = mongoClient.getMongoBrands(userInfo.getRetailerId(), userInfo.getEmail(), categoryId);
656
        //List<DBObject> brandsDisplay = mongoClient.getMongoBrands(userInfo.getRetailerId(), userInfo.getEmail(), categoryId);
668
        return new ResponseEntity<>(brandsDisplay, HttpStatus.OK);
657
        return new ResponseEntity<>(brandsDisplay, HttpStatus.OK);
669
    }
658
    }
670
 
659
 
671
    @RequestMapping(value = "/fofo/brandCatalog", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
660
    @RequestMapping(value = "/fofo/brandCatalog", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
672
    @Transactional(readOnly = true)
-
 
673
    public ResponseEntity<?> getBrands(HttpServletRequest request,
661
    public ResponseEntity<?> getBrands(HttpServletRequest request,
674
                                       @RequestParam(required = false, defaultValue = "0") int categoryId) throws Exception {
662
                                       @RequestParam(required = false, defaultValue = "0") int categoryId) throws Exception {
675
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
663
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
676
        logger.info("userInfo [{}]", userInfo);
664
        logger.info("userInfo [{}]", userInfo);
677
 
665
 
678
        List<BrandCatalog> brandsDisplay = brandsService.getBrands(userInfo.getRetailerId(), userInfo.getEmail(), categoryId);
666
        List<BrandCatalog> brandsDisplay = brandsService.getBrands(userInfo.getRetailerId(), userInfo.getEmail(), categoryId);
679
        return new ResponseEntity<>(brandsDisplay, HttpStatus.OK);
667
        return new ResponseEntity<>(brandsDisplay, HttpStatus.OK);
680
    }
668
    }
681
 
669
 
682
    @RequestMapping(value = "/fofo/accessory/all-categories", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
670
    @RequestMapping(value = "/fofo/accessory/all-categories", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
683
    @Transactional(readOnly = true)
-
 
684
    public ResponseEntity<?> getSubCategoriesToDisplay(HttpServletRequest request) throws Exception {
671
    public ResponseEntity<?> getSubCategoriesToDisplay(HttpServletRequest request) throws Exception {
685
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
672
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
686
        logger.info("userInfo [{}]", userInfo);
673
        logger.info("userInfo [{}]", userInfo);
687
        List<DBObject> subCategoriesDisplay = this.getSubCategoriesToDisplay();
674
        List<DBObject> subCategoriesDisplay = this.getSubCategoriesToDisplay();
688
        return new ResponseEntity<>(subCategoriesDisplay, HttpStatus.OK);
675
        return new ResponseEntity<>(subCategoriesDisplay, HttpStatus.OK);
Line 728... Line 715...
728
        return subCategories;
715
        return subCategories;
729
 
716
 
730
    }
717
    }
731
 
718
 
732
    @RequestMapping(value = "/banners/{bannerType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
719
    @RequestMapping(value = "/banners/{bannerType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
733
    @Transactional(readOnly = true)
-
 
734
    public ResponseEntity<?> getBanners(@PathVariable String bannerType) {
720
    public ResponseEntity<?> getBanners(@PathVariable String bannerType) {
735
        return new ResponseEntity<>(mongoClient.getBannersByType(bannerType), HttpStatus.OK);
721
        return new ResponseEntity<>(mongoClient.getBannersByType(bannerType), HttpStatus.OK);
736
    }
722
    }
737
 
723
 
738
    @RequestMapping(value = "/deals/subCategories", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
724
    @RequestMapping(value = "/deals/subCategories", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
739
    @Transactional(readOnly = true)
-
 
740
    public ResponseEntity<?> getSubcategoriesToDisplay() {
725
    public ResponseEntity<?> getSubcategoriesToDisplay() {
741
        return new ResponseEntity<>(mongoClient.getSubcategoriesToDisplay(), HttpStatus.OK);
726
        return new ResponseEntity<>(mongoClient.getSubcategoriesToDisplay(), HttpStatus.OK);
742
    }
727
    }
743
 
728
 
744
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
729
    @ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
745
    @RequestMapping(value = "/deals/skus/{skus}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
730
    @RequestMapping(value = "/deals/skus/{skus}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
746
    @Transactional(readOnly = true)
-
 
747
    public ResponseEntity<?> getDealsBySkus(@PathVariable String skus) throws ProfitMandiBusinessException {
731
    public ResponseEntity<?> getDealsBySkus(@PathVariable String skus) throws ProfitMandiBusinessException {
748
        StringBuffer sb = new StringBuffer("/getDealsForNotification/");
732
        StringBuffer sb = new StringBuffer("/getDealsForNotification/");
749
        String uri = sb.append(skus).toString();
733
        String uri = sb.append(skus).toString();
750
                String response;
734
                String response;
751
        try {
735
        try {
Line 767... Line 751...
767
        }
751
        }
768
        return responseSender.ok(responseObject);
752
        return responseSender.ok(responseObject);
769
    }
753
    }
770
 
754
 
771
    @RequestMapping(value = "/partner/listing", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
755
    @RequestMapping(value = "/partner/listing", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
772
    @Transactional(readOnly = true)
-
 
773
    public ResponseEntity<?> getPartnersListing(HttpServletRequest request) throws Exception {
756
    public ResponseEntity<?> getPartnersListing(HttpServletRequest request) throws Exception {
774
        List<WebListing> webListings = webListingRepository.selectAllWebListingByType(Optional.of(true), WebListingSource.partner);
757
        List<WebListing> webListings = webListingRepository.selectAllWebListingByType(Optional.of(true), WebListingSource.partner);
775
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
758
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
776
 
759
 
777
        // Pre-fetch FofoStore once (instead of N times inside getDealResponses)
760
        // Pre-fetch FofoStore once (instead of N times inside getDealResponses)
Line 1191... Line 1174...
1191
        return dealResponse;
1174
        return dealResponse;
1192
 
1175
 
1193
    }
1176
    }
1194
 
1177
 
1195
    @RequestMapping(value = "/combo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
1178
    @RequestMapping(value = "/combo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
1196
    @Transactional(readOnly = true)
-
 
1197
    public ResponseEntity<?> getBanners(@RequestParam int catalogId, @RequestParam int warehouseId) {
1179
    public ResponseEntity<?> getBanners(@RequestParam int catalogId, @RequestParam int warehouseId) {
1198
        List<ComboModel> comboModels = comboModelRepository.selectByCatalogIdAndWarehouseId(catalogId, warehouseId);
1180
        List<ComboModel> comboModels = comboModelRepository.selectByCatalogIdAndWarehouseId(catalogId, warehouseId);
1199
        return responseSender.ok(comboModels);
1181
        return responseSender.ok(comboModels);
1200
    }
1182
    }
1201
 
1183
 
1202
    @RequestMapping(value = "/checkCombo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
1184
    @RequestMapping(value = "/checkCombo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
1203
    @Transactional(readOnly = true)
-
 
1204
    public ResponseEntity<?> checkCombo(HttpServletRequest request, @RequestParam int catalogId,
1185
    public ResponseEntity<?> checkCombo(HttpServletRequest request, @RequestParam int catalogId,
1205
                                        @RequestParam int warehouseId, @RequestParam int qty) throws Exception {
1186
                                        @RequestParam int warehouseId, @RequestParam int qty) throws Exception {
1206
        boolean isCombo = false;
1187
        boolean isCombo = false;
1207
        ComboModel comboModel = comboModelRepository.selectByCatalogIdWarehouseIdAndQty(catalogId, warehouseId, qty);
1188
        ComboModel comboModel = comboModelRepository.selectByCatalogIdWarehouseIdAndQty(catalogId, warehouseId, qty);
1208
        if (comboModel != null) {
1189
        if (comboModel != null) {
Line 1211... Line 1192...
1211
 
1192
 
1212
        return responseSender.ok(isCombo);
1193
        return responseSender.ok(isCombo);
1213
    }
1194
    }
1214
 
1195
 
1215
    @GetMapping(value = "/partner/wodCompleteBrands", produces = MediaType.APPLICATION_JSON_VALUE)
1196
    @GetMapping(value = "/partner/wodCompleteBrands", produces = MediaType.APPLICATION_JSON_VALUE)
1216
    @Transactional(readOnly = true)
-
 
1217
    public ResponseEntity<?> getWodcompletBrands(HttpServletRequest request) throws Exception {
1197
    public ResponseEntity<?> getWodcompletBrands(HttpServletRequest request) throws Exception {
1218
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
1198
        UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
1219
        BrandAndAddToCartEligibleModel brandAndAddToCartEligibleModel = brandsService.wodcompletBrands(userInfo.getRetailerId());
1199
        BrandAndAddToCartEligibleModel brandAndAddToCartEligibleModel = brandsService.wodcompletBrands(userInfo.getRetailerId());
1220
        return responseSender.ok(brandAndAddToCartEligibleModel);
1200
        return responseSender.ok(brandAndAddToCartEligibleModel);
1221
 
1201