Subversion Repositories SmartDukaan

Rev

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

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