Authored by wangnan

fix mapper

@@ -2,14 +2,15 @@ package com.yoho.search.consumer.index.common.impl; @@ -2,14 +2,15 @@ package com.yoho.search.consumer.index.common.impl;
2 2
3 import com.yoho.search.base.utils.ISearchConstants; 3 import com.yoho.search.base.utils.ISearchConstants;
4 import com.yoho.search.consumer.index.common.IYohoIndexRebuildListener; 4 import com.yoho.search.consumer.index.common.IYohoIndexRebuildListener;
  5 +import com.yoho.search.consumer.index.fullbuild.BigdataSimilarSknIndexBuilder;
5 import com.yoho.search.consumer.index.fullbuild.ProductIndexIndexBuilder; 6 import com.yoho.search.consumer.index.fullbuild.ProductIndexIndexBuilder;
6 import com.yoho.search.consumer.index.fullbuild.TblProductNewIndexBuilder; 7 import com.yoho.search.consumer.index.fullbuild.TblProductNewIndexBuilder;
7 import com.yoho.search.consumer.service.daoService.Product15DaySalesNumService; 8 import com.yoho.search.consumer.service.daoService.Product15DaySalesNumService;
  9 +import com.yoho.search.consumer.service.logicService.ProductHeatValueLogicService;
8 import com.yoho.search.consumer.service.logicService.PromotionConditionLogicService; 10 import com.yoho.search.consumer.service.logicService.PromotionConditionLogicService;
9 import com.yoho.search.consumer.service.logicService.personal.PersonalVectorVersionManager; 11 import com.yoho.search.consumer.service.logicService.personal.PersonalVectorVersionManager;
10 import com.yoho.search.consumer.service.logicService.productIndex.IndexFieldBuilder; 12 import com.yoho.search.consumer.service.logicService.productIndex.IndexFieldBuilder;
11 import com.yoho.search.consumer.service.logicService.productIndex.ProductSalesInfoBuilder; 13 import com.yoho.search.consumer.service.logicService.productIndex.ProductSalesInfoBuilder;
12 -import com.yoho.search.consumer.service.logicService.ProductHeatValueLogicService;  
13 import org.slf4j.Logger; 14 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory; 15 import org.slf4j.LoggerFactory;
15 import org.springframework.beans.BeansException; 16 import org.springframework.beans.BeansException;
@@ -47,6 +48,9 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I @@ -47,6 +48,9 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I
47 private ProductSalesInfoBuilder productSalesInfoBuilder; 48 private ProductSalesInfoBuilder productSalesInfoBuilder;
48 @Autowired 49 @Autowired
49 private PersonalVectorVersionManager personalVectorVersionManager; 50 private PersonalVectorVersionManager personalVectorVersionManager;
  51 + @Autowired
  52 + private BigdataSimilarSknIndexBuilder bigdataSimilarSknIndexBuilder;
  53 +
50 54
51 @Override 55 @Override
52 public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 56 public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
@@ -72,6 +76,7 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I @@ -72,6 +76,7 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I
72 tblProductNewIndexBuilder.init(); 76 tblProductNewIndexBuilder.init();
73 personalVectorVersionManager.calCurrentVersion(); 77 personalVectorVersionManager.calCurrentVersion();
74 promotionConditionLogicService.init(); 78 promotionConditionLogicService.init();
  79 + bigdataSimilarSknIndexBuilder.init();
75 } 80 }
76 81
77 @Override 82 @Override
@@ -89,5 +94,6 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I @@ -89,5 +94,6 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I
89 productHeatValueLogicService.finish(); 94 productHeatValueLogicService.finish();
90 product15DaySalesNumService.finish(); 95 product15DaySalesNumService.finish();
91 productSalesInfoBuilder.finish(); 96 productSalesInfoBuilder.finish();
  97 + bigdataSimilarSknIndexBuilder.finish();
92 } 98 }
93 } 99 }
@@ -28,7 +28,7 @@ public class BigdataSimilarSknIndexBuilder extends IIndexBuilder { @@ -28,7 +28,7 @@ public class BigdataSimilarSknIndexBuilder extends IIndexBuilder {
28 28
29 @Override 29 @Override
30 public void init(){ 30 public void init(){
31 - cache.invalidateAll(); 31 + cache.put("maxDataId",getMaxDateId());
32 } 32 }
33 33
34 @Override 34 @Override
@@ -37,7 +37,7 @@ public class BigdataSimilarSknIndexBuilder extends IIndexBuilder { @@ -37,7 +37,7 @@ public class BigdataSimilarSknIndexBuilder extends IIndexBuilder {
37 if(maxDataId==null){ 37 if(maxDataId==null){
38 return 0; 38 return 0;
39 } 39 }
40 - return similarSknMapper.selectCount(cache.get("maxDataId")); 40 + return similarSknMapper.selectCount(maxDataId);
41 } 41 }
42 42
43 @Override 43 @Override