Authored by hugufei

去除pi索引中的无效字段

@@ -56,17 +56,9 @@ public class GeneralBuilder { @@ -56,17 +56,9 @@ public class GeneralBuilder {
56 productIndexBO.setGenderS(tblProduct.getGender().replace('1', '男').replace('2', '女').replace("3", "男/女")); 56 productIndexBO.setGenderS(tblProduct.getGender().replace('1', '男').replace('2', '女').replace("3", "男/女"));
57 } 57 }
58 productIndexBO.setIsSpecial("N"); 58 productIndexBO.setIsSpecial("N");
59 - productIndexBO.setIsHot("N");  
60 - productIndexBO.setIshot(2);  
61 productIndexBO.setIspromotion(0); 59 productIndexBO.setIspromotion(0);
62 productIndexBO.setIsAdvance("N"); 60 productIndexBO.setIsAdvance("N");
63 - productIndexBO.setIsadvance(2);  
64 - productIndexBO.setIsAuditing("N");  
65 - productIndexBO.setIsauditing(2);  
66 productIndexBO.setAttribute(1); 61 productIndexBO.setAttribute(1);
67 - productIndexBO.setIsDown("N");  
68 - productIndexBO.setIsdown(2);  
69 - productIndexBO.setIsrecommend(2);  
70 productIndexBO.setIsOutlets(2); 62 productIndexBO.setIsOutlets(2);
71 if (null != tblProduct.getShelfTime()) { 63 if (null != tblProduct.getShelfTime()) {
72 productIndexBO.setShelveTime(tblProduct.getShelfTime()); 64 productIndexBO.setShelveTime(tblProduct.getShelfTime());
@@ -34,14 +34,11 @@ public class ShowStatusBuilder { @@ -34,14 +34,11 @@ public class ShowStatusBuilder {
34 } 34 }
35 productIndexBO.setStatus(isShow ? 1 : 0); 35 productIndexBO.setStatus(isShow ? 1 : 0);
36 productIndexBO.setIsSales(productIndexBO.getStatus() == 1 ? "Y" : "N"); 36 productIndexBO.setIsSales(productIndexBO.getStatus() == 1 ? "Y" : "N");
37 - productIndexBO.setIssales(productIndexBO.getIsSales().equals("Y") ? 1 : 2);  
38 // 判断库存状态 37 // 判断库存状态
39 if (tblProduct.getStockStatus() != null) { 38 if (tblProduct.getStockStatus() != null) {
40 boolean hasStock = tblProduct.getStockStatus().equals("1") ? true : false; 39 boolean hasStock = tblProduct.getStockStatus().equals("1") ? true : false;
41 productIndexBO.setStorageNum(isShow && hasStock ? new BigDecimal(100) : BigDecimal.ZERO); 40 productIndexBO.setStorageNum(isShow && hasStock ? new BigDecimal(100) : BigDecimal.ZERO);
42 productIndexBO.setIsSoonSoldOut("N"); 41 productIndexBO.setIsSoonSoldOut("N");
43 - productIndexBO.setIsSoldOut("N");  
44 - productIndexBO.setSoldOut(1);  
45 } 42 }
46 return productIndexBO; 43 return productIndexBO;
47 } 44 }
@@ -30,8 +30,6 @@ public abstract class AbstractStorageRelatedMqListener extends AbstractIndexMqLi @@ -30,8 +30,6 @@ public abstract class AbstractStorageRelatedMqListener extends AbstractIndexMqLi
30 if (productSizesBOList == null || productSizesBOList.isEmpty()) { 30 if (productSizesBOList == null || productSizesBOList.isEmpty()) {
31 indexData.put("storageNum", 0); 31 indexData.put("storageNum", 0);
32 indexData.put("isSoonSoldOut", "Y"); 32 indexData.put("isSoonSoldOut", "Y");
33 - indexData.put("isSoldOut", "Y");  
34 - indexData.put("soldOut", 0);  
35 indexData.put("sizeIds", ""); 33 indexData.put("sizeIds", "");
36 indexData.put("sizeNames", ""); 34 indexData.put("sizeNames", "");
37 indexData.put("breakSizePercent", 100); 35 indexData.put("breakSizePercent", 100);
@@ -42,8 +40,6 @@ public abstract class AbstractStorageRelatedMqListener extends AbstractIndexMqLi @@ -42,8 +40,6 @@ public abstract class AbstractStorageRelatedMqListener extends AbstractIndexMqLi
42 ProductSizesBO productSizesBO = productSizesBOList.get(0); 40 ProductSizesBO productSizesBO = productSizesBOList.get(0);
43 indexData.put("storageNum", productSizesBO.getStorageNum()); 41 indexData.put("storageNum", productSizesBO.getStorageNum());
44 indexData.put("isSoonSoldOut", productSizesBO.getIsSoonSoldOut()); 42 indexData.put("isSoonSoldOut", productSizesBO.getIsSoonSoldOut());
45 - indexData.put("isSoldOut", productSizesBO.getIsSoldOut());  
46 - indexData.put("soldOut", productSizesBO.getSoldOut());  
47 indexData.put("sizeIds", productSizesBO.getSizeIds()); 43 indexData.put("sizeIds", productSizesBO.getSizeIds());
48 indexData.put("sizeNames", productSizesBO.getSizeNames()); 44 indexData.put("sizeNames", productSizesBO.getSizeNames());
49 indexData.put("breakSizePercent", productSizesBO.getBreakSizePercent()); 45 indexData.put("breakSizePercent", productSizesBO.getBreakSizePercent());
@@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONObject; @@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONObject;
4 import com.yoho.search.base.utils.ConvertUtils; 4 import com.yoho.search.base.utils.ConvertUtils;
5 import com.yoho.search.base.utils.EventReportEnum; 5 import com.yoho.search.base.utils.EventReportEnum;
6 import com.yoho.search.base.utils.ISearchConstants; 6 import com.yoho.search.base.utils.ISearchConstants;
  7 +import com.yoho.search.base.utils.ProductIndexEsField;
7 import com.yoho.search.consumer.index.increment.AbstractIndexMqListener; 8 import com.yoho.search.consumer.index.increment.AbstractIndexMqListener;
8 import com.yoho.search.consumer.service.daoService.ProductSearchService; 9 import com.yoho.search.consumer.service.daoService.ProductSearchService;
9 import com.yoho.search.consumer.service.daoService.ProductService; 10 import com.yoho.search.consumer.service.daoService.ProductService;
10 import com.yoho.search.dal.model.ProductSearch; 11 import com.yoho.search.dal.model.ProductSearch;
  12 +
11 import org.slf4j.Logger; 13 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 14 import org.slf4j.LoggerFactory;
13 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
@@ -87,20 +89,17 @@ public class ProductSearchMqListener extends AbstractIndexMqListener { @@ -87,20 +89,17 @@ public class ProductSearchMqListener extends AbstractIndexMqListener {
87 // 2、生成商品索引数据 89 // 2、生成商品索引数据
88 Map<String, Object> indexData = new HashMap<String, Object>(); 90 Map<String, Object> indexData = new HashMap<String, Object>();
89 if (productSearch.getProjectId() == 1 && productSearch.getModelId() == 1) { 91 if (productSearch.getProjectId() == 1 && productSearch.getModelId() == 1) {
90 - indexData.put("productId", productId);  
91 - indexData.put("brandWeight", productSearch.getIntValue());  
92 - // indexData.put("sortWeight", 0); 92 + indexData.put(ProductIndexEsField.productId, productId);
  93 + indexData.put(ProductIndexEsField.brandWeight, productSearch.getIntValue());
93 // indexData.put("shopWeight", 0); 94 // indexData.put("shopWeight", 0);
94 } else if (productSearch.getProjectId() == 4 && productSearch.getModelId() == 1) { 95 } else if (productSearch.getProjectId() == 4 && productSearch.getModelId() == 1) {
95 - indexData.put("productId", productId);  
96 - indexData.put("sortWeight", productSearch.getIntValue()); 96 + indexData.put(ProductIndexEsField.productId, productId);
97 // indexData.put("brandWeight", 0); 97 // indexData.put("brandWeight", 0);
98 // indexData.put("shopWeight", 0); 98 // indexData.put("shopWeight", 0);
99 } else if (productSearch.getProjectId() == 5 && productSearch.getModelId() == 1) { 99 } else if (productSearch.getProjectId() == 5 && productSearch.getModelId() == 1) {
100 - indexData.put("productId", productId); 100 + indexData.put(ProductIndexEsField.productId, productId);
101 // indexData.put("brandWeight", 0); 101 // indexData.put("brandWeight", 0);
102 - // indexData.put("sortWeight", 0);  
103 - indexData.put("shopWeight", productSearch.getIntValue()); 102 + indexData.put(ProductIndexEsField.shopWeight, productSearch.getIntValue());
104 103
105 } 104 }
106 // 3、更新商品索引数据 105 // 3、更新商品索引数据
@@ -92,27 +92,12 @@ @@ -92,27 +92,12 @@
92 "islimited": { 92 "islimited": {
93 "type": "keyword" 93 "type": "keyword"
94 }, 94 },
95 - "ishot": {  
96 - "type": "long"  
97 - },  
98 - "isHot": {  
99 - "type": "keyword"  
100 - },  
101 - "isspecial": {  
102 - "type": "long"  
103 - },  
104 "isSpecial": { 95 "isSpecial": {
105 "type": "keyword" 96 "type": "keyword"
106 }, 97 },
107 - "issales": {  
108 - "type": "long"  
109 - },  
110 "isSales": { 98 "isSales": {
111 "type": "keyword" 99 "type": "keyword"
112 }, 100 },
113 - "isadvance": {  
114 - "type": "long"  
115 - },  
116 "isAdvance": { 101 "isAdvance": {
117 "type": "keyword" 102 "type": "keyword"
118 }, 103 },
@@ -122,24 +107,12 @@ @@ -122,24 +107,12 @@
122 "isLimitbuy": { 107 "isLimitbuy": {
123 "type": "keyword" 108 "type": "keyword"
124 }, 109 },
125 - "isAuditing": {  
126 - "type": "keyword"  
127 - },  
128 - "isauditing": {  
129 - "type": "long"  
130 - },  
131 - "isrecommend": {  
132 - "type": "long"  
133 - },  
134 "ispromotion": { 110 "ispromotion": {
135 "type": "long" 111 "type": "long"
136 }, 112 },
137 "attribute": { 113 "attribute": {
138 "type": "long" 114 "type": "long"
139 }, 115 },
140 - "seasonsS": {  
141 - "type": "long"  
142 - },  
143 "seasons": { 116 "seasons": {
144 "type": "text", 117 "type": "text",
145 "analyzer": "comma_spliter", 118 "analyzer": "comma_spliter",
@@ -160,12 +133,6 @@ @@ -160,12 +133,6 @@
160 "editTime": { 133 "editTime": {
161 "type": "integer" 134 "type": "integer"
162 }, 135 },
163 - "isdown": {  
164 - "type": "long"  
165 - },  
166 - "isDown": {  
167 - "type": "keyword"  
168 - },  
169 "status": { 136 "status": {
170 "type": "long" 137 "type": "long"
171 }, 138 },
@@ -324,11 +291,6 @@ @@ -324,11 +291,6 @@
324 "search_analyzer": "ik_complex_search", 291 "search_analyzer": "ik_complex_search",
325 "fielddata": "true" 292 "fielddata": "true"
326 }, 293 },
327 - "hotKeyword": {  
328 - "type": "text",  
329 - "analyzer": "ik_complex",  
330 - "search_analyzer": "ik_complex_search"  
331 - },  
332 "countryId": { 294 "countryId": {
333 "type": "long" 295 "type": "long"
334 }, 296 },
@@ -353,9 +315,6 @@ @@ -353,9 +315,6 @@
353 } 315 }
354 } 316 }
355 }, 317 },
356 - "specialPrice": {  
357 - "type": "double"  
358 - },  
359 "marketPrice": { 318 "marketPrice": {
360 "type": "double" 319 "type": "double"
361 }, 320 },
@@ -420,12 +379,6 @@ @@ -420,12 +379,6 @@
420 "isSoonSoldOut": { 379 "isSoonSoldOut": {
421 "type": "keyword" 380 "type": "keyword"
422 }, 381 },
423 - "isSoldOut": {  
424 - "type": "keyword"  
425 - },  
426 - "soldOut": {  
427 - "type": "long"  
428 - },  
429 "colorIds": { 382 "colorIds": {
430 "type": "text", 383 "type": "text",
431 "analyzer": "comma_spliter", 384 "analyzer": "comma_spliter",
@@ -478,9 +431,6 @@ @@ -478,9 +431,6 @@
478 "searchField_ansj" 431 "searchField_ansj"
479 ] 432 ]
480 }, 433 },
481 - "sortWeight": {  
482 - "type": "long"  
483 - },  
484 "brandWeight": { 434 "brandWeight": {
485 "type": "long" 435 "type": "long"
486 }, 436 },
@@ -559,9 +509,6 @@ @@ -559,9 +509,6 @@
559 "discountScore": { 509 "discountScore": {
560 "type": "double" 510 "type": "double"
561 }, 511 },
562 - "isForbiddenSortBrand": {  
563 - "type": "long"  
564 - },  
565 "forbiddenPageIds": { 512 "forbiddenPageIds": {
566 "type": "text", 513 "type": "text",
567 "analyzer": "comma_spliter" 514 "analyzer": "comma_spliter"
@@ -29,29 +29,18 @@ public class ProductIBO implements Serializable { @@ -29,29 +29,18 @@ public class ProductIBO implements Serializable {
29 private String style; 29 private String style;
30 private String pattern; 30 private String pattern;
31 private String islimited; 31 private String islimited;
32 - private Integer ishot;  
33 - private String isHot;  
34 private String isSpecial; 32 private String isSpecial;
35 - private Integer isspecial;  
36 private String isSales; 33 private String isSales;
37 - private Integer issales;  
38 private String isAdvance; 34 private String isAdvance;
39 - private Integer isadvance;  
40 private String isDepositAdvance; 35 private String isDepositAdvance;
41 private String isLimitbuy; 36 private String isLimitbuy;
42 - private String isAuditing;  
43 - private Integer isauditing;  
44 - private Integer isrecommend;  
45 private Integer ispromotion; 37 private Integer ispromotion;
46 private Integer attribute; 38 private Integer attribute;
47 private String seasons; 39 private String seasons;
48 - private Integer seasonsS;  
49 private Integer firstShelveTime; 40 private Integer firstShelveTime;
50 private Integer shelveTime; 41 private Integer shelveTime;
51 private String shelveDay; 42 private String shelveDay;
52 private Integer editTime; 43 private Integer editTime;
53 - private String isDown;  
54 - private Integer isdown;  
55 private Integer status; 44 private Integer status;
56 private Integer isOutlets; 45 private Integer isOutlets;
57 private Integer folderId; 46 private Integer folderId;
@@ -70,7 +59,6 @@ public class ProductIBO implements Serializable { @@ -70,7 +59,6 @@ public class ProductIBO implements Serializable {
70 private String brandNameCn; 59 private String brandNameCn;
71 private String brandNameEn; 60 private String brandNameEn;
72 private String brandKeyword; 61 private String brandKeyword;
73 - private String hotKeyword;  
74 private String brandName; 62 private String brandName;
75 private String brandDomain; 63 private String brandDomain;
76 private String brandAlif; 64 private String brandAlif;
@@ -89,7 +77,6 @@ public class ProductIBO implements Serializable { @@ -89,7 +77,6 @@ public class ProductIBO implements Serializable {
89 private String shopDomain; 77 private String shopDomain;
90 private Integer shopCreateTime; 78 private Integer shopCreateTime;
91 79
92 - private Integer isForbiddenSortBrand;// 是否是品类+品牌的屏蔽字段  
93 private String forbiddenPageIds;// 需要屏蔽的页面id 80 private String forbiddenPageIds;// 需要屏蔽的页面id
94 81
95 // from quanqiugou 82 // from quanqiugou
@@ -302,30 +289,6 @@ public class ProductIBO implements Serializable { @@ -302,30 +289,6 @@ public class ProductIBO implements Serializable {
302 this.status = status; 289 this.status = status;
303 } 290 }
304 291
305 - public Integer getSeasonsS() {  
306 - return seasonsS;  
307 - }  
308 -  
309 - public void setSeasonsS(Integer seasonsS) {  
310 - this.seasonsS = seasonsS;  
311 - }  
312 -  
313 - public Integer getIsspecial() {  
314 - return isspecial;  
315 - }  
316 -  
317 - public void setIsspecial(Integer isspecial) {  
318 - this.isspecial = isspecial;  
319 - }  
320 -  
321 - public String getIsHot() {  
322 - return isHot;  
323 - }  
324 -  
325 - public void setIsHot(String isHot) {  
326 - this.isHot = isHot == null ? null : isHot.trim();  
327 - }  
328 -  
329 public Integer getFolderId() { 292 public Integer getFolderId() {
330 return folderId; 293 return folderId;
331 } 294 }
@@ -334,14 +297,6 @@ public class ProductIBO implements Serializable { @@ -334,14 +297,6 @@ public class ProductIBO implements Serializable {
334 this.folderId = folderId; 297 this.folderId = folderId;
335 } 298 }
336 299
337 - public Integer getIshot() {  
338 - return ishot;  
339 - }  
340 -  
341 - public void setIshot(Integer ishot) {  
342 - this.ishot = ishot;  
343 - }  
344 -  
345 public Integer getIspromotion() { 300 public Integer getIspromotion() {
346 return ispromotion; 301 return ispromotion;
347 } 302 }
@@ -366,14 +321,6 @@ public class ProductIBO implements Serializable { @@ -366,14 +321,6 @@ public class ProductIBO implements Serializable {
366 this.isSales = isSales == null ? null : isSales.trim(); 321 this.isSales = isSales == null ? null : isSales.trim();
367 } 322 }
368 323
369 - public Integer getIssales() {  
370 - return issales;  
371 - }  
372 -  
373 - public void setIssales(Integer issales) {  
374 - this.issales = issales;  
375 - }  
376 -  
377 public String getIsAdvance() { 324 public String getIsAdvance() {
378 return isAdvance; 325 return isAdvance;
379 } 326 }
@@ -382,30 +329,6 @@ public class ProductIBO implements Serializable { @@ -382,30 +329,6 @@ public class ProductIBO implements Serializable {
382 this.isAdvance = isAdvance == null ? null : isAdvance.trim(); 329 this.isAdvance = isAdvance == null ? null : isAdvance.trim();
383 } 330 }
384 331
385 - public Integer getIsadvance() {  
386 - return isadvance;  
387 - }  
388 -  
389 - public void setIsadvance(Integer isadvance) {  
390 - this.isadvance = isadvance;  
391 - }  
392 -  
393 - public String getIsAuditing() {  
394 - return isAuditing;  
395 - }  
396 -  
397 - public void setIsAuditing(String isAuditing) {  
398 - this.isAuditing = isAuditing == null ? null : isAuditing.trim();  
399 - }  
400 -  
401 - public Integer getIsauditing() {  
402 - return isauditing;  
403 - }  
404 -  
405 - public void setIsauditing(Integer isauditing) {  
406 - this.isauditing = isauditing;  
407 - }  
408 -  
409 public Integer getAttribute() { 332 public Integer getAttribute() {
410 return attribute; 333 return attribute;
411 } 334 }
@@ -422,30 +345,6 @@ public class ProductIBO implements Serializable { @@ -422,30 +345,6 @@ public class ProductIBO implements Serializable {
422 this.seasons = seasons == null ? null : seasons.trim(); 345 this.seasons = seasons == null ? null : seasons.trim();
423 } 346 }
424 347
425 - public String getIsDown() {  
426 - return isDown;  
427 - }  
428 -  
429 - public void setIsDown(String isDown) {  
430 - this.isDown = isDown == null ? null : isDown.trim();  
431 - }  
432 -  
433 - public Integer getIsdown() {  
434 - return isdown;  
435 - }  
436 -  
437 - public void setIsdown(Integer isdown) {  
438 - this.isdown = isdown;  
439 - }  
440 -  
441 - public Integer getIsrecommend() {  
442 - return isrecommend;  
443 - }  
444 -  
445 - public void setIsrecommend(Integer isrecommend) {  
446 - this.isrecommend = isrecommend;  
447 - }  
448 -  
449 public Integer getIsOutlets() { 348 public Integer getIsOutlets() {
450 return isOutlets; 349 return isOutlets;
451 } 350 }
@@ -502,14 +401,6 @@ public class ProductIBO implements Serializable { @@ -502,14 +401,6 @@ public class ProductIBO implements Serializable {
502 this.brandKeyword = brandKeyword == null ? null : brandKeyword.trim(); 401 this.brandKeyword = brandKeyword == null ? null : brandKeyword.trim();
503 } 402 }
504 403
505 - public String getHotKeyword() {  
506 - return hotKeyword;  
507 - }  
508 -  
509 - public void setHotKeyword(String hotKeyword) {  
510 - this.hotKeyword = hotKeyword == null ? null : hotKeyword.trim();  
511 - }  
512 -  
513 public String getBrandName() { 404 public String getBrandName() {
514 return brandName; 405 return brandName;
515 } 406 }
@@ -630,14 +521,6 @@ public class ProductIBO implements Serializable { @@ -630,14 +521,6 @@ public class ProductIBO implements Serializable {
630 this.isLimitbuy = isLimitbuy; 521 this.isLimitbuy = isLimitbuy;
631 } 522 }
632 523
633 - public Integer getIsForbiddenSortBrand() {  
634 - return isForbiddenSortBrand;  
635 - }  
636 -  
637 - public void setIsForbiddenSortBrand(Integer isForbiddenSortBrand) {  
638 - this.isForbiddenSortBrand = isForbiddenSortBrand;  
639 - }  
640 -  
641 public String getForbiddenPageIds() { 524 public String getForbiddenPageIds() {
642 return forbiddenPageIds; 525 return forbiddenPageIds;
643 } 526 }
@@ -33,11 +33,8 @@ public class ProductIndexBO extends ProductIBO implements Serializable { @@ -33,11 +33,8 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
33 private String standardOnlyNames; 33 private String standardOnlyNames;
34 34
35 // from product_sizes 35 // from product_sizes
36 - // private BigDecimal salesNum;  
37 private BigDecimal storageNum; 36 private BigDecimal storageNum;
38 private String isSoonSoldOut; 37 private String isSoonSoldOut;
39 - private String isSoldOut;  
40 - private Integer soldOut;  
41 private String sizeIds; 38 private String sizeIds;
42 private String sizeNames; 39 private String sizeNames;
43 private double breakSizePercent; 40 private double breakSizePercent;
@@ -59,7 +56,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable { @@ -59,7 +56,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
59 private String activities; 56 private String activities;
60 57
61 // from product_search 58 // from product_search
62 - private Long sortWeight;  
63 private Long brandWeight; 59 private Long brandWeight;
64 private Long shopWeight; 60 private Long shopWeight;
65 61
@@ -260,14 +256,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable { @@ -260,14 +256,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
260 return isSoonSoldOut; 256 return isSoonSoldOut;
261 } 257 }
262 258
263 - public String getIsSoldOut() {  
264 - return isSoldOut;  
265 - }  
266 -  
267 - public Integer getSoldOut() {  
268 - return soldOut;  
269 - }  
270 -  
271 public String getSizeIds() { 259 public String getSizeIds() {
272 return sizeIds; 260 return sizeIds;
273 } 261 }
@@ -288,10 +276,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable { @@ -288,10 +276,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
288 return activities; 276 return activities;
289 } 277 }
290 278
291 - public Long getSortWeight() {  
292 - return sortWeight;  
293 - }  
294 -  
295 public Long getBrandWeight() { 279 public Long getBrandWeight() {
296 return brandWeight; 280 return brandWeight;
297 } 281 }
@@ -352,14 +336,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable { @@ -352,14 +336,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
352 this.isSoonSoldOut = isSoonSoldOut; 336 this.isSoonSoldOut = isSoonSoldOut;
353 } 337 }
354 338
355 - public void setIsSoldOut(String isSoldOut) {  
356 - this.isSoldOut = isSoldOut;  
357 - }  
358 -  
359 - public void setSoldOut(Integer soldOut) {  
360 - this.soldOut = soldOut;  
361 - }  
362 -  
363 public void setSizeIds(String sizeIds) { 339 public void setSizeIds(String sizeIds) {
364 this.sizeIds = sizeIds == null ? null : sizeIds.trim(); 340 this.sizeIds = sizeIds == null ? null : sizeIds.trim();
365 } 341 }
@@ -380,10 +356,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable { @@ -380,10 +356,6 @@ public class ProductIndexBO extends ProductIBO implements Serializable {
380 this.activities = activities; 356 this.activities = activities;
381 } 357 }
382 358
383 - public void setSortWeight(Long sortWeight) {  
384 - this.sortWeight = sortWeight;  
385 - }  
386 -  
387 public void setBrandWeight(Long brandWeight) { 359 public void setBrandWeight(Long brandWeight) {
388 this.brandWeight = brandWeight; 360 this.brandWeight = brandWeight;
389 } 361 }
@@ -68,14 +68,6 @@ public class ProductSizesBO { @@ -68,14 +68,6 @@ public class ProductSizesBO {
68 this.heatValue = heatValue; 68 this.heatValue = heatValue;
69 } 69 }
70 70
71 - public Integer getSoldOut() {  
72 - return storageNum == null || storageNum == 0 ? 0 : 1;  
73 - }  
74 -  
75 - public String getIsSoldOut() {  
76 - return storageNum == null || storageNum == 0 ? "Y" : "N";  
77 - }  
78 -  
79 public String getIsSoonSoldOut() { 71 public String getIsSoonSoldOut() {
80 return storageNum == null || storageNum <= 2 ? "Y" : "N"; 72 return storageNum == null || storageNum <= 2 ? "Y" : "N";
81 } 73 }
@@ -79,45 +79,17 @@ public class ProductILogicService { @@ -79,45 +79,17 @@ public class ProductILogicService {
79 if ("Y".equals(p.getIsLimited())) { 79 if ("Y".equals(p.getIsLimited())) {
80 productIBO.setIslimited("Y"); 80 productIBO.setIslimited("Y");
81 } 81 }
82 - productIBO.setIsHot("N");  
83 - productIBO.setIshot(2);  
84 - if ("Y".equals(p.getIsHot())) {  
85 - productIBO.setIsHot("Y");  
86 - productIBO.setIshot(1);  
87 - }  
88 productIBO.setIsSpecial("N"); 82 productIBO.setIsSpecial("N");
89 - productIBO.setIsspecial(2);  
90 if ("Y".equals(p.getIsSpecial())) { 83 if ("Y".equals(p.getIsSpecial())) {
91 productIBO.setIsSpecial("Y"); 84 productIBO.setIsSpecial("Y");
92 - productIBO.setIsspecial(1);  
93 } 85 }
94 productIBO.setIsSales("Y"); 86 productIBO.setIsSales("Y");
95 - productIBO.setIssales(1);  
96 if ("N".equals(p.getIsSales())) { 87 if ("N".equals(p.getIsSales())) {
97 productIBO.setIsSales("N"); 88 productIBO.setIsSales("N");
98 - productIBO.setIssales(2);  
99 } 89 }
100 productIBO.setIsAdvance("N"); 90 productIBO.setIsAdvance("N");
101 - productIBO.setIsadvance(2);  
102 if ("Y".equals(p.getIsAdvance())) { 91 if ("Y".equals(p.getIsAdvance())) {
103 productIBO.setIsAdvance("Y"); 92 productIBO.setIsAdvance("Y");
104 - productIBO.setIsadvance(1);  
105 - }  
106 - productIBO.setIsAuditing("Y");  
107 - productIBO.setIsauditing(1);  
108 - if ("N".equals(p.getIsAuditing())) {  
109 - productIBO.setIsAuditing("N");  
110 - productIBO.setIsauditing(2);  
111 - }  
112 - productIBO.setIsrecommend(2);  
113 - if ("Y".equals(p.getIsRecommend())) {  
114 - productIBO.setIsrecommend(1);  
115 - }  
116 - productIBO.setIsdown(2);  
117 - productIBO.setIsDown("N");  
118 - if ("Y".equals(p.getIsDown())) {  
119 - productIBO.setIsdown(1);  
120 - productIBO.setIsDown("Y");  
121 } 93 }
122 productIBO.setIsOutlets(2); 94 productIBO.setIsOutlets(2);
123 if ("Y".equals(p.getIsOutlets())) { 95 if ("Y".equals(p.getIsOutlets())) {
@@ -142,21 +114,6 @@ public class ProductILogicService { @@ -142,21 +114,6 @@ public class ProductILogicService {
142 productIBO.setIspromotion(p.getIsPromotion()); 114 productIBO.setIspromotion(p.getIsPromotion());
143 productIBO.setAttribute(p.getAttribute()); 115 productIBO.setAttribute(p.getAttribute());
144 productIBO.setSeasons(p.getSeasons()); 116 productIBO.setSeasons(p.getSeasons());
145 - if (p.getSeasons() != null) {  
146 - productIBO.setSeasonsS(4);  
147 - if (p.getSeasons().equals("spring") || p.getSeasons().equals("autumn") || p.getSeasons().equals("spring,autumn")) {  
148 - productIBO.setSeasonsS(1);  
149 - }  
150 - if (p.getSeasons().equals("summer")) {  
151 - productIBO.setSeasonsS(2);  
152 - }  
153 - if (p.getSeasons().equals("winter")) {  
154 - productIBO.setSeasonsS(3);  
155 - }  
156 - if (p.getSeasons().equals("spring,summer,autumn,winter") || p.getSeasons().equals("seasons")) {  
157 - productIBO.setSeasonsS(4);  
158 - }  
159 - }  
160 productIBO.setFirstShelveTime(p.getFirstShelveTime()); 117 productIBO.setFirstShelveTime(p.getFirstShelveTime());
161 productIBO.setShelveTime(p.getShelveTime()); 118 productIBO.setShelveTime(p.getShelveTime());
162 String shelveDay = DateUtil.TimeStamp2DateWithFormat(Long.valueOf(p.getShelveTime()), "yyyy-MM-dd"); 119 String shelveDay = DateUtil.TimeStamp2DateWithFormat(Long.valueOf(p.getShelveTime()), "yyyy-MM-dd");
@@ -198,7 +155,6 @@ public class ProductILogicService { @@ -198,7 +155,6 @@ public class ProductILogicService {
198 productIBO.setBrandNameCn(brand.getBrandNameCn()); 155 productIBO.setBrandNameCn(brand.getBrandNameCn());
199 productIBO.setBrandNameEn(brand.getBrandNameEn()); 156 productIBO.setBrandNameEn(brand.getBrandNameEn());
200 productIBO.setBrandKeyword(brand.getBrandKeyword()); 157 productIBO.setBrandKeyword(brand.getBrandKeyword());
201 - productIBO.setHotKeyword(brand.getHotKeyword());  
202 productIBO.setBrandName(brand.getBrandName()); 158 productIBO.setBrandName(brand.getBrandName());
203 productIBO.setBrandDomain(brand.getBrandDomain()); 159 productIBO.setBrandDomain(brand.getBrandDomain());
204 productIBO.setBrandAlif(brand.getBrandAlif()); 160 productIBO.setBrandAlif(brand.getBrandAlif());
@@ -242,26 +198,4 @@ public class ProductILogicService { @@ -242,26 +198,4 @@ public class ProductILogicService {
242 } 198 }
243 } 199 }
244 200
245 - /**  
246 - * 过滤product列表  
247 - *  
248 - * @deprecated  
249 - */  
250 - public List<Product> filterProductList(List<Product> products, Map<Integer, ProductSort> ProductSortMap, Map<Integer, Brand> brandMap) {  
251 - List<Product> productsNew = new ArrayList<>();  
252 - for (Product p : products) {  
253 - if (ProductSortMap.containsKey(p.getMaxSortId())) {  
254 - if (ProductSortMap.containsKey(p.getMiddleSortId())) {  
255 - if (ProductSortMap.containsKey(p.getSmallSortId())) {  
256 - if (brandMap.containsKey(p.getBrandId())) {  
257 - productsNew.add(p);  
258 - }  
259 - }  
260 - }  
261 -  
262 - }  
263 - }  
264 - return productsNew;  
265 - }  
266 -  
267 } 201 }
@@ -33,7 +33,6 @@ public class ProductIndexBOToMapService { @@ -33,7 +33,6 @@ public class ProductIndexBOToMapService {
33 map.put(ProductIndexEsField.brandNameCn, productIndexBO.getBrandNameCn()); 33 map.put(ProductIndexEsField.brandNameCn, productIndexBO.getBrandNameCn());
34 map.put(ProductIndexEsField.brandNameEn, productIndexBO.getBrandNameEn()); 34 map.put(ProductIndexEsField.brandNameEn, productIndexBO.getBrandNameEn());
35 map.put(ProductIndexEsField.brandKeyword, productIndexBO.getBrandKeyword()); 35 map.put(ProductIndexEsField.brandKeyword, productIndexBO.getBrandKeyword());
36 - map.put(ProductIndexEsField.hotKeyword, productIndexBO.getHotKeyword());  
37 map.put(ProductIndexEsField.brandName, productIndexBO.getBrandName()); 36 map.put(ProductIndexEsField.brandName, productIndexBO.getBrandName());
38 map.put(ProductIndexEsField.style, productIndexBO.getStyle()); 37 map.put(ProductIndexEsField.style, productIndexBO.getStyle());
39 map.put(ProductIndexEsField.salesPhrase, productIndexBO.getSalesPhrase()); 38 map.put(ProductIndexEsField.salesPhrase, productIndexBO.getSalesPhrase());
@@ -47,26 +46,15 @@ public class ProductIndexBOToMapService { @@ -47,26 +46,15 @@ public class ProductIndexBOToMapService {
47 map.put(ProductIndexEsField.brandId, productIndexBO.getBrandId()); 46 map.put(ProductIndexEsField.brandId, productIndexBO.getBrandId());
48 map.put(ProductIndexEsField.isSpecial, productIndexBO.getIsSpecial()); 47 map.put(ProductIndexEsField.isSpecial, productIndexBO.getIsSpecial());
49 map.put(ProductIndexEsField.status, productIndexBO.getStatus()); 48 map.put(ProductIndexEsField.status, productIndexBO.getStatus());
50 - map.put(ProductIndexEsField.seasonsS, productIndexBO.getSeasonsS());  
51 - map.put(ProductIndexEsField.isspecial, productIndexBO.getIsspecial());  
52 - map.put(ProductIndexEsField.isHot, productIndexBO.getIsHot());  
53 map.put(ProductIndexEsField.folderId, productIndexBO.getFolderId()); 49 map.put(ProductIndexEsField.folderId, productIndexBO.getFolderId());
54 - map.put(ProductIndexEsField.ishot, productIndexBO.getIshot());  
55 map.put(ProductIndexEsField.ispromotion, productIndexBO.getIspromotion()); 50 map.put(ProductIndexEsField.ispromotion, productIndexBO.getIspromotion());
56 map.put(ProductIndexEsField.seriesId, productIndexBO.getSeriesId()); 51 map.put(ProductIndexEsField.seriesId, productIndexBO.getSeriesId());
57 map.put(ProductIndexEsField.isSales, productIndexBO.getIsSales()); 52 map.put(ProductIndexEsField.isSales, productIndexBO.getIsSales());
58 - map.put(ProductIndexEsField.issales, productIndexBO.getIssales());  
59 map.put(ProductIndexEsField.isAdvance, productIndexBO.getIsAdvance()); 53 map.put(ProductIndexEsField.isAdvance, productIndexBO.getIsAdvance());
60 - map.put(ProductIndexEsField.isadvance, productIndexBO.getIsadvance());  
61 map.put(ProductIndexEsField.isDepositAdvance, productIndexBO.getIsDepositAdvance()); 54 map.put(ProductIndexEsField.isDepositAdvance, productIndexBO.getIsDepositAdvance());
62 map.put(ProductIndexEsField.isLimitbuy, productIndexBO.getIsLimitbuy()); 55 map.put(ProductIndexEsField.isLimitbuy, productIndexBO.getIsLimitbuy());
63 - map.put(ProductIndexEsField.isAuditing, productIndexBO.getIsAuditing());  
64 - map.put(ProductIndexEsField.isauditing, productIndexBO.getIsauditing());  
65 map.put(ProductIndexEsField.attribute, productIndexBO.getAttribute()); 56 map.put(ProductIndexEsField.attribute, productIndexBO.getAttribute());
66 map.put(ProductIndexEsField.seasons, productIndexBO.getSeasons()); 57 map.put(ProductIndexEsField.seasons, productIndexBO.getSeasons());
67 - map.put(ProductIndexEsField.isDown, productIndexBO.getIsDown());  
68 - map.put(ProductIndexEsField.isdown, productIndexBO.getIsdown());  
69 - map.put(ProductIndexEsField.isrecommend, productIndexBO.getIsrecommend());  
70 map.put(ProductIndexEsField.isOutlets, productIndexBO.getIsOutlets()); 58 map.put(ProductIndexEsField.isOutlets, productIndexBO.getIsOutlets());
71 map.put(ProductIndexEsField.firstShelveTime, productIndexBO.getFirstShelveTime()); 59 map.put(ProductIndexEsField.firstShelveTime, productIndexBO.getFirstShelveTime());
72 60
@@ -121,9 +109,6 @@ public class ProductIndexBOToMapService { @@ -121,9 +109,6 @@ public class ProductIndexBOToMapService {
121 map.put(ProductIndexEsField.brandAlif, productIndexBO.getBrandAlif()); 109 map.put(ProductIndexEsField.brandAlif, productIndexBO.getBrandAlif());
122 map.put(ProductIndexEsField.editTime, productIndexBO.getEditTime()); 110 map.put(ProductIndexEsField.editTime, productIndexBO.getEditTime());
123 map.put(ProductIndexEsField.isSoonSoldOut, productIndexBO.getIsSoonSoldOut()); 111 map.put(ProductIndexEsField.isSoonSoldOut, productIndexBO.getIsSoonSoldOut());
124 - map.put(ProductIndexEsField.isSoldOut, productIndexBO.getIsSoldOut());  
125 - map.put(ProductIndexEsField.soldOut, productIndexBO.getSoldOut());  
126 - map.put(ProductIndexEsField.sortWeight, productIndexBO.getSortWeight());  
127 map.put(ProductIndexEsField.brandWeight, productIndexBO.getBrandWeight()); 112 map.put(ProductIndexEsField.brandWeight, productIndexBO.getBrandWeight());
128 map.put(ProductIndexEsField.shopWeight, productIndexBO.getShopWeight()); 113 map.put(ProductIndexEsField.shopWeight, productIndexBO.getShopWeight());
129 map.put(ProductIndexEsField.yohoodId, productIndexBO.getYohoodId()); 114 map.put(ProductIndexEsField.yohoodId, productIndexBO.getYohoodId());
@@ -166,7 +151,6 @@ public class ProductIndexBOToMapService { @@ -166,7 +151,6 @@ public class ProductIndexBOToMapService {
166 logger.error("[id={}} [activitiesStr={}] [e={}]", productIndexBO.getId(), activitiesStr, e.getMessage()); 151 logger.error("[id={}} [activitiesStr={}] [e={}]", productIndexBO.getId(), activitiesStr, e.getMessage());
167 } 152 }
168 } 153 }
169 - map.put(ProductIndexEsField.isForbiddenSortBrand, productIndexBO.getIsForbiddenSortBrand());  
170 map.put(ProductIndexEsField.forbiddenPageIds, productIndexBO.getForbiddenPageIds()); 154 map.put(ProductIndexEsField.forbiddenPageIds, productIndexBO.getForbiddenPageIds());
171 map.put(ProductIndexEsField.productFeatureFactor, productIndexBO.getProductFeatureFactor()); 155 map.put(ProductIndexEsField.productFeatureFactor, productIndexBO.getProductFeatureFactor());
172 map.put(ProductIndexEsField.productFeatureFactorExist, productIndexBO.getProductFeatureFactorExist()); 156 map.put(ProductIndexEsField.productFeatureFactorExist, productIndexBO.getProductFeatureFactorExist());
1 package com.yoho.search.consumer.service.logicService.productIndex; 1 package com.yoho.search.consumer.service.logicService.productIndex;
2 2
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +import java.util.stream.Collectors;
  7 +
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Component;
  10 +
3 import com.yoho.search.consumer.service.bo.ProductIndexBO; 11 import com.yoho.search.consumer.service.bo.ProductIndexBO;
4 import com.yoho.search.consumer.service.bo.ProductSearchSortWeightBO; 12 import com.yoho.search.consumer.service.bo.ProductSearchSortWeightBO;
5 -import com.yoho.search.consumer.service.logicService.productIndex.IndexFieldBuilder;  
6 import com.yoho.search.dal.ProductSearchMapper; 13 import com.yoho.search.dal.ProductSearchMapper;
7 import com.yoho.search.dal.ProductSearchSortMapper; 14 import com.yoho.search.dal.ProductSearchSortMapper;
8 import com.yoho.search.dal.model.ProductSearch; 15 import com.yoho.search.dal.model.ProductSearch;
9 import com.yoho.search.dal.model.ProductSearchSort; 16 import com.yoho.search.dal.model.ProductSearchSort;
10 -import org.apache.commons.collections.CollectionUtils;  
11 -import org.springframework.beans.factory.annotation.Autowired;  
12 -import org.springframework.stereotype.Component;  
13 -  
14 -import java.util.ArrayList;  
15 -import java.util.List;  
16 -import java.util.Map;  
17 -import java.util.Optional;  
18 -import java.util.stream.Collectors;  
19 17
20 /** 18 /**
21 * Created by wangnan on 2017/1/9. 19 * Created by wangnan on 2017/1/9.
@@ -29,16 +27,17 @@ public class ProductSearchSortWeightBuilder implements IndexFieldBuilder { @@ -29,16 +27,17 @@ public class ProductSearchSortWeightBuilder implements IndexFieldBuilder {
29 27
30 @Override 28 @Override
31 public void build(List<ProductIndexBO> productIndexBOs, List<Integer> ids, List<Integer> sknList) { 29 public void build(List<ProductIndexBO> productIndexBOs, List<Integer> ids, List<Integer> sknList) {
32 - List<ProductSearchSortWeightBO> productSearchSortWeightBOs = this.getData(sknList);  
33 - if (CollectionUtils.isEmpty(productSearchSortWeightBOs)) {  
34 - return; 30 + // List<ProductSearchSortWeightBO> productSearchSortWeightBOs = this.getData(sknList);
  31 + // if (CollectionUtils.isEmpty(productSearchSortWeightBOs)) {
  32 + // return;
  33 + // }
  34 + // Map<Integer, ProductSearchSortWeightBO> productSearchSortWeightsMap =
  35 + // productSearchSortWeightBOs.stream().collect(Collectors.toMap(ProductSearchSortWeightBO::getProductSkn, (p) -> p));
  36 + // productIndexBOs.stream().forEach(productIndexBO ->
  37 + // productIndexBO.setSortWeight(Optional.ofNullable(productSearchSortWeightsMap.get(productIndexBO.getProductSkn()))
  38 + // .map(ProductSearchSortWeightBO::getSortWeight)
  39 + // .orElse(Long.valueOf(0))));
35 } 40 }
36 - Map<Integer, ProductSearchSortWeightBO> productSearchSortWeightsMap = productSearchSortWeightBOs.stream().collect(Collectors.toMap(ProductSearchSortWeightBO::getProductSkn, (p) -> p));  
37 - productIndexBOs.stream().forEach(productIndexBO -> productIndexBO.setSortWeight(Optional.ofNullable(productSearchSortWeightsMap.get(productIndexBO.getProductSkn()))  
38 - .map(ProductSearchSortWeightBO::getSortWeight)  
39 - .orElse(Long.valueOf(0))));  
40 - }  
41 -  
42 41
43 public List<ProductSearchSortWeightBO> getData(List<Integer> productSknList) { 42 public List<ProductSearchSortWeightBO> getData(List<Integer> productSknList) {
44 List<ProductSearchSort> productSearchSorts = productSearchSortMapper.selectProductSearchSort(productSknList); 43 List<ProductSearchSort> productSearchSorts = productSearchSortMapper.selectProductSearchSort(productSknList);
1 package com.yoho.search.consumer.service.logicService.productIndex; 1 package com.yoho.search.consumer.service.logicService.productIndex;
2 2
3 -import com.yoho.search.consumer.service.logicService.productIndex.IndexFieldBuilder;  
4 -import com.yoho.search.consumer.service.logicService.ProductSizesLogicService;  
5 -import com.yoho.search.consumer.service.bo.ProductIndexBO;  
6 -import com.yoho.search.consumer.service.bo.ProductSizesBO;  
7 -import org.springframework.beans.factory.annotation.Autowired;  
8 -import org.springframework.stereotype.Component;  
9 -  
10 import java.math.BigDecimal; 3 import java.math.BigDecimal;
11 import java.util.List; 4 import java.util.List;
12 import java.util.Map; 5 import java.util.Map;
13 import java.util.stream.Collectors; 6 import java.util.stream.Collectors;
14 7
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Component;
  10 +
  11 +import com.yoho.search.consumer.service.bo.ProductIndexBO;
  12 +import com.yoho.search.consumer.service.bo.ProductSizesBO;
  13 +import com.yoho.search.consumer.service.logicService.ProductSizesLogicService;
  14 +
15 /** 15 /**
16 * Created by wangnan on 2017/1/6. 16 * Created by wangnan on 2017/1/6.
17 */ 17 */
@@ -29,8 +29,6 @@ public class ProductSizesBuilder implements IndexFieldBuilder { @@ -29,8 +29,6 @@ public class ProductSizesBuilder implements IndexFieldBuilder {
29 // 设置默认值 29 // 设置默认值
30 productIndexBO.setStorageNum(BigDecimal.valueOf(0)); 30 productIndexBO.setStorageNum(BigDecimal.valueOf(0));
31 productIndexBO.setIsSoonSoldOut("Y"); 31 productIndexBO.setIsSoonSoldOut("Y");
32 - productIndexBO.setIsSoldOut("Y");  
33 - productIndexBO.setSoldOut(1);  
34 productIndexBO.setSizeIds(""); 32 productIndexBO.setSizeIds("");
35 productIndexBO.setSizeNames(""); 33 productIndexBO.setSizeNames("");
36 productIndexBO.setBreakSizePercent(100); 34 productIndexBO.setBreakSizePercent(100);
@@ -40,8 +38,6 @@ public class ProductSizesBuilder implements IndexFieldBuilder { @@ -40,8 +38,6 @@ public class ProductSizesBuilder implements IndexFieldBuilder {
40 if (productSizesBO != null) { 38 if (productSizesBO != null) {
41 productIndexBO.setStorageNum(BigDecimal.valueOf(productSizesBO.getStorageNum())); 39 productIndexBO.setStorageNum(BigDecimal.valueOf(productSizesBO.getStorageNum()));
42 productIndexBO.setIsSoonSoldOut(productSizesBO.getIsSoonSoldOut()); 40 productIndexBO.setIsSoonSoldOut(productSizesBO.getIsSoonSoldOut());
43 - productIndexBO.setIsSoldOut(productSizesBO.getIsSoldOut());  
44 - productIndexBO.setSoldOut(productSizesBO.getSoldOut());  
45 productIndexBO.setSizeIds(productSizesBO.getSizeIds()); 41 productIndexBO.setSizeIds(productSizesBO.getSizeIds());
46 productIndexBO.setSizeNames(productSizesBO.getSizeNames()); 42 productIndexBO.setSizeNames(productSizesBO.getSizeNames());
47 productIndexBO.setBreakSizePercent(productSizesBO.getBreakSizePercent()); 43 productIndexBO.setBreakSizePercent(productSizesBO.getBreakSizePercent());