Subversion Repositories SmartDukaan

Rev

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

Rev 24579 Rev 24872
Line 184... Line 184...
184
	public ResponseEntity<?> getFofo(HttpServletRequest request,
184
	public ResponseEntity<?> getFofo(HttpServletRequest request,
185
			@RequestParam(value = "categoryId", required = false, defaultValue = "(3 OR 6)") String categoryId,
185
			@RequestParam(value = "categoryId", required = false, defaultValue = "(3 OR 6)") String categoryId,
186
			@RequestParam(value = "offset") String offset, @RequestParam(value = "limit") String limit,
186
			@RequestParam(value = "offset") String offset, @RequestParam(value = "limit") String limit,
187
			@RequestParam(value = "sort", required = false) String sort,
187
			@RequestParam(value = "sort", required = false) String sort,
188
			@RequestParam(value = "brand", required = false) String brand,
188
			@RequestParam(value = "brand", required = false) String brand,
-
 
189
			@RequestParam(value = "subCategoryId", required = false) String subCategoryId,
189
			@RequestParam(value = "hotDeal", required = false) boolean hotDeal) throws Throwable {
190
			@RequestParam(value = "hotDeal", required = false) boolean hotDeal) throws Throwable {
190
		List<FofoCatalogResponse> dealResponse = new ArrayList<>();
191
		List<FofoCatalogResponse> dealResponse = new ArrayList<>();
191
		UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
192
		UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
192
		if (roleManagerService.isPartner(userInfo.getRoleIds())) {
193
		if (roleManagerService.isPartner(userInfo.getRoleIds())) {
193
			UserCart uc = userAccountRepository.getUserCart(userInfo.getUserId());
194
			UserCart uc = userAccountRepository.getUserCart(userInfo.getUserId());
Line 198... Line 199...
198
			if (brand != null) {
199
			if (brand != null) {
199
 
200
 
200
				mandatoryQ.add(
201
				mandatoryQ.add(
201
						String.format("+(categoryId_i:%s) +(brand_ss:%s) +{!parent which=\"brand_ss:%s\"} tagId_i:(%s)",
202
						String.format("+(categoryId_i:%s) +(brand_ss:%s) +{!parent which=\"brand_ss:%s\"} tagId_i:(%s)",
202
								categoryId, brand, brand, StringUtils.join(tagIds, " ")));
203
								categoryId, brand, brand, StringUtils.join(tagIds, " ")));
-
 
204
			} else if (subCategoryId != null) {
-
 
205
				mandatoryQ.add(
-
 
206
						String.format("+(subCategoryId_i:%s) +{!parent which=\"subCategoryId_i:%s\"} tagId_i:(%s)",
-
 
207
								categoryId, brand, brand, StringUtils.join(tagIds, " ")));
203
			} else if (hotDeal) {
208
			} else if (hotDeal) {
204
				mandatoryQ.add(String.format("+{!parent which=\"hot_deals_b=true\"} tagId_i:(%s)",
209
				mandatoryQ.add(String.format("+{!parent which=\"hot_deals_b=true\"} tagId_i:(%s)",
205
						StringUtils.join(tagIds, " ")));
210
						StringUtils.join(tagIds, " ")));
206
			} else {
211
			} else {
207
				mandatoryQ.add(
212
				mandatoryQ.add(