Authored by 胡古飞

全量建索引的时候考虑学生价

@@ -57,7 +57,6 @@ public class SpecialDealLogicService { @@ -57,7 +57,6 @@ public class SpecialDealLogicService {
57 if ("Y".equalsIgnoreCase(productIBO.getIsGlobal())) { 57 if ("Y".equalsIgnoreCase(productIBO.getIsGlobal())) {
58 specialSearchField.append("全球购,quanqiugou,"); 58 specialSearchField.append("全球购,quanqiugou,");
59 } 59 }
60 -  
61 if (productIBO.getBundleType() != null) { 60 if (productIBO.getBundleType() != null) {
62 // 处理折扣类型 0:正常商品 1:套餐 2:量贩 3:搭配 61 // 处理折扣类型 0:正常商品 1:套餐 2:量贩 3:搭配
63 switch (productIBO.getBundleType()) { 62 switch (productIBO.getBundleType()) {
@@ -74,14 +73,15 @@ public class SpecialDealLogicService { @@ -74,14 +73,15 @@ public class SpecialDealLogicService {
74 break; 73 break;
75 } 74 }
76 } 75 }
77 -  
78 - if(productIBO instanceof ProductIndexBO){  
79 - ProductIndexBO indexBO = (ProductIndexBO)productIBO;  
80 - if("Y".equalsIgnoreCase(indexBO.getIsDiscount())){ 76 + if (productIBO instanceof ProductIndexBO) {
  77 + ProductIndexBO indexBO = (ProductIndexBO) productIBO;
  78 + if ("Y".equalsIgnoreCase(indexBO.getIsDiscount())) {
81 specialSearchField.append("折扣,zhekou,优惠,youhui,打折,dazhe"); 79 specialSearchField.append("折扣,zhekou,优惠,youhui,打折,dazhe");
82 } 80 }
  81 + if ("Y".equalsIgnoreCase(indexBO.getIsStudentPrice())) {
  82 + specialSearchField.append("学生,xuesheng,学生价,xueshengjia");
  83 + }
83 } 84 }
84 -  
85 return specialSearchField.toString(); 85 return specialSearchField.toString();
86 } 86 }
87 87
@@ -100,26 +100,26 @@ public class SpecialDealLogicService { @@ -100,26 +100,26 @@ public class SpecialDealLogicService {
100 // 1、处理ageLevel 100 // 1、处理ageLevel
101 String ageLevel = specialDealAgeLevel(productIBO.getAgeLevel()); 101 String ageLevel = specialDealAgeLevel(productIBO.getAgeLevel());
102 productIBO.setAgeLevel(ageLevel); 102 productIBO.setAgeLevel(ageLevel);
103 - 103 +
104 // 2、处理specialSearchField 104 // 2、处理specialSearchField
105 String specialSearchField = getSpecialSearchFieldFromProduct(productIBO); 105 String specialSearchField = getSpecialSearchFieldFromProduct(productIBO);
106 productIBO.setSpecialSearchField(specialSearchField); 106 productIBO.setSpecialSearchField(specialSearchField);
107 - 107 +
108 // 3、处理isForiddenSortBrand 108 // 3、处理isForiddenSortBrand
109 int isForbiddenSortBrand = this.getIsForbiddenSortBrand(productIBO); 109 int isForbiddenSortBrand = this.getIsForbiddenSortBrand(productIBO);
110 productIBO.setIsForbiddenSortBrand(isForbiddenSortBrand); 110 productIBO.setIsForbiddenSortBrand(isForbiddenSortBrand);
111 - 111 +
112 // 4、处理forbiddenPageIds 112 // 4、处理forbiddenPageIds
113 String forbiddenPageIds = forbiddenPageIdsLogicService.getSknForbiddenPageIds(productIBO); 113 String forbiddenPageIds = forbiddenPageIdsLogicService.getSknForbiddenPageIds(productIBO);
114 productIBO.setForbiddenPageIds(forbiddenPageIds); 114 productIBO.setForbiddenPageIds(forbiddenPageIds);
115 - 115 +
116 // 5、处理物理分类对应的销售分类 116 // 5、处理物理分类对应的销售分类
117 List<Integer> physicalChannels = salesCategoryLogicService.getPhysicalChannelsBySmallSortId(productIBO.getSmallSortId()); 117 List<Integer> physicalChannels = salesCategoryLogicService.getPhysicalChannelsBySmallSortId(productIBO.getSmallSortId());
118 productIBO.setPhysicalChannels(StringUtils.join(physicalChannels, ",")); 118 productIBO.setPhysicalChannels(StringUtils.join(physicalChannels, ","));
119 if ("Y".equals(productIBO.getIsGlobal())) { 119 if ("Y".equals(productIBO.getIsGlobal())) {
120 productIBO.setPhysicalChannels("1,2,3,4"); 120 productIBO.setPhysicalChannels("1,2,3,4");
121 } 121 }
122 - 122 +
123 // 6、处理限购,防止数据库未设置 123 // 6、处理限购,防止数据库未设置
124 if (StringUtils.isBlank(productIBO.getIsLimitbuy())) { 124 if (StringUtils.isBlank(productIBO.getIsLimitbuy())) {
125 productIBO.setIsLimitbuy("N"); 125 productIBO.setIsLimitbuy("N");