Showing
7 changed files
with
35 additions
and
4 deletions
@@ -12,4 +12,6 @@ public interface BrandMapper { | @@ -12,4 +12,6 @@ public interface BrandMapper { | ||
12 | List<Brand> selectAll(); | 12 | List<Brand> selectAll(); |
13 | 13 | ||
14 | int updateByPrimaryKey(Brand record); | 14 | int updateByPrimaryKey(Brand record); |
15 | + | ||
16 | + List<Integer> selectExcludeAppraise(); | ||
15 | } | 17 | } |
@@ -48,4 +48,8 @@ | @@ -48,4 +48,8 @@ | ||
48 | edit_time, edit_pid, order_by | 48 | edit_time, edit_pid, order_by |
49 | from brand | 49 | from brand |
50 | </select> | 50 | </select> |
51 | + <select id="selectExcludeAppraise" resultMap="BaseResultMap"> | ||
52 | + select id | ||
53 | + from brand where ex_raise = 1 | ||
54 | + </select> | ||
51 | </mapper> | 55 | </mapper> |
@@ -339,7 +339,7 @@ public class ProductSearchController { | @@ -339,7 +339,7 @@ public class ProductSearchController { | ||
339 | @RequestParam(value = "page", required = false)Integer page, | 339 | @RequestParam(value = "page", required = false)Integer page, |
340 | @RequestParam(value = "app_version", required = false)String appVersion | 340 | @RequestParam(value = "app_version", required = false)String appVersion |
341 | ) { | 341 | ) { |
342 | - ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page).setExcludeLimit("true"); | 342 | + ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page).setExcludeLimit("Y"); |
343 | searchHelpService.setQuery(query, req); | 343 | searchHelpService.setQuery(query, req); |
344 | //设置是否包含有货商品 | 344 | //设置是否包含有货商品 |
345 | LOG.info("in method=ufo.product.search.appraise.list req={}", req.toString()); | 345 | LOG.info("in method=ufo.product.search.appraise.list req={}", req.toString()); |
@@ -85,6 +85,8 @@ public final class SearchConstants { | @@ -85,6 +85,8 @@ public final class SearchConstants { | ||
85 | 85 | ||
86 | String NOT_ID = "not_id"; | 86 | String NOT_ID = "not_id"; |
87 | 87 | ||
88 | + String NOT_BRAND = "not_brand"; | ||
89 | + | ||
88 | String FILTER_YEAR_MONTH = "filter_year_month"; | 90 | String FILTER_YEAR_MONTH = "filter_year_month"; |
89 | 91 | ||
90 | String START_TIME = "startTime"; | 92 | String START_TIME = "startTime"; |
@@ -95,7 +97,7 @@ public final class SearchConstants { | @@ -95,7 +97,7 @@ public final class SearchConstants { | ||
95 | String RANK_TYPE = "rankType"; | 97 | String RANK_TYPE = "rankType"; |
96 | String TYPE = "product_type"; | 98 | String TYPE = "product_type"; |
97 | 99 | ||
98 | - String EXCLUDE_LIMIT = "exclude_limit"; | 100 | + String EXCLUDE_LIMIT = "isFilterLimitSale"; |
99 | 101 | ||
100 | } | 102 | } |
101 | 103 |
@@ -57,7 +57,8 @@ public class SearchParam { | @@ -57,7 +57,8 @@ public class SearchParam { | ||
57 | .setContainYoho(req.getContainYoho()) | 57 | .setContainYoho(req.getContainYoho()) |
58 | .setRankType(req.getRankType()) | 58 | .setRankType(req.getRankType()) |
59 | .setNotId(req.getNot_id()) | 59 | .setNotId(req.getNot_id()) |
60 | - .setExcludeLimit(req.getExcludeLimit()); | 60 | + .setExcludeLimit(req.getExcludeLimit()) |
61 | + .setNotBrand(req.getNot_brand()); | ||
61 | return this; | 62 | return this; |
62 | } | 63 | } |
63 | 64 | ||
@@ -70,7 +71,7 @@ public class SearchParam { | @@ -70,7 +71,7 @@ public class SearchParam { | ||
70 | .setStartTime(req.getStartTime()) | 71 | .setStartTime(req.getStartTime()) |
71 | .setEndTime(req.getEndTime()) | 72 | .setEndTime(req.getEndTime()) |
72 | .setContainYoho(req.getContainYoho()) | 73 | .setContainYoho(req.getContainYoho()) |
73 | - .setRankType(req.getRankType()).setId(req.getId()).setNotId(req.getNot_id()).setExcludeLimit(req.getExcludeLimit());; | 74 | + .setRankType(req.getRankType()).setId(req.getId()).setNotId(req.getNot_id()).setExcludeLimit(req.getExcludeLimit()).setNotBrand(req.getNot_brand()); |
74 | return this; | 75 | return this; |
75 | } | 76 | } |
76 | 77 | ||
@@ -237,6 +238,13 @@ public class SearchParam { | @@ -237,6 +238,13 @@ public class SearchParam { | ||
237 | return this; | 238 | return this; |
238 | } | 239 | } |
239 | 240 | ||
241 | + public SearchParam setNotBrand(String notBrand) { | ||
242 | + if (StringUtils.isNotBlank(notBrand)) { | ||
243 | + param.put(SearchConstants.IndexNameConstant.NOT_BRAND, notBrand); | ||
244 | + } | ||
245 | + return this; | ||
246 | + } | ||
247 | + | ||
240 | /** | 248 | /** |
241 | * 每次查询的条数 | 249 | * 每次查询的条数 |
242 | * | 250 | * |
@@ -27,6 +27,7 @@ public class ProductSearchReq { | @@ -27,6 +27,7 @@ public class ProductSearchReq { | ||
27 | private String rankType; | 27 | private String rankType; |
28 | private String couponToken; | 28 | private String couponToken; |
29 | private String excludeLimit; | 29 | private String excludeLimit; |
30 | + private String not_brand; | ||
30 | 31 | ||
31 | @Override | 32 | @Override |
32 | public String toString() { | 33 | public String toString() { |
@@ -256,6 +257,15 @@ public class ProductSearchReq { | @@ -256,6 +257,15 @@ public class ProductSearchReq { | ||
256 | return this; | 257 | return this; |
257 | } | 258 | } |
258 | 259 | ||
260 | + public ProductSearchReq setNotBrand(String notBrand) { | ||
261 | + this.not_brand = notBrand; | ||
262 | + return this; | ||
263 | + } | ||
264 | + | ||
265 | + public String getNot_brand() { | ||
266 | + return not_brand; | ||
267 | + } | ||
268 | + | ||
259 | public String getExcludeLimit() { | 269 | public String getExcludeLimit() { |
260 | return excludeLimit; | 270 | return excludeLimit; |
261 | } | 271 | } |
@@ -13,6 +13,7 @@ import java.util.stream.Collectors; | @@ -13,6 +13,7 @@ import java.util.stream.Collectors; | ||
13 | 13 | ||
14 | import com.yohobuy.ufo.model.promotion.response.CouponInfo; | 14 | import com.yohobuy.ufo.model.promotion.response.CouponInfo; |
15 | import com.yohoufo.common.ApiResponse; | 15 | import com.yohoufo.common.ApiResponse; |
16 | +import com.yohoufo.dal.product.BrandMapper; | ||
16 | import org.apache.commons.collections.MapUtils; | 17 | import org.apache.commons.collections.MapUtils; |
17 | import org.apache.commons.lang3.StringUtils; | 18 | import org.apache.commons.lang3.StringUtils; |
18 | import org.slf4j.Logger; | 19 | import org.slf4j.Logger; |
@@ -72,6 +73,9 @@ public class ProductSearchServiceImpl implements ProductSearchService { | @@ -72,6 +73,9 @@ public class ProductSearchServiceImpl implements ProductSearchService { | ||
72 | private ProductSortMapper productSortMapper; | 73 | private ProductSortMapper productSortMapper; |
73 | 74 | ||
74 | @Autowired | 75 | @Autowired |
76 | + private BrandMapper brandMapper; | ||
77 | + | ||
78 | + @Autowired | ||
75 | ProductSalesService productSalesService; | 79 | ProductSalesService productSalesService; |
76 | 80 | ||
77 | @Autowired | 81 | @Autowired |
@@ -183,6 +187,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { | @@ -183,6 +187,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { | ||
183 | 187 | ||
184 | @Override | 188 | @Override |
185 | public JSONObject searchAppraiseProductList(ProductSearchReq req) { | 189 | public JSONObject searchAppraiseProductList(ProductSearchReq req) { |
190 | + req.setNotBrand(StringUtils.join(brandMapper.selectExcludeAppraise(), ",")) | ||
186 | SearchParam searchParam = new SearchParam().buildPageSearchParam(req); | 191 | SearchParam searchParam = new SearchParam().buildPageSearchParam(req); |
187 | String url = PRODUCT_SEARCH_QUERY_URL; | 192 | String url = PRODUCT_SEARCH_QUERY_URL; |
188 | JSONObject data = search(searchParam.getParam(), url); | 193 | JSONObject data = search(searchParam.getParam(), url); |
-
Please register or login to post a comment