Authored by Gino Zhang

productindex索引搜索支持bundleType

@@ -55,6 +55,7 @@ @@ -55,6 +55,7 @@
55 <result column="is_instalment" property="isInstalment" jdbcType="VARCHAR"/> 55 <result column="is_instalment" property="isInstalment" jdbcType="VARCHAR"/>
56 <result column="is_seckill" property="isSeckill" jdbcType="CHAR"/> 56 <result column="is_seckill" property="isSeckill" jdbcType="CHAR"/>
57 <result column="market_phrase" property="marketPhrase" jdbcType="VARCHAR"/> 57 <result column="market_phrase" property="marketPhrase" jdbcType="VARCHAR"/>
  58 + <result column="bundle_type" property="bundleType" jdbcType="INTEGER"/>
58 </resultMap> 59 </resultMap>
59 <sql id="Base_Column_List"> 60 <sql id="Base_Column_List">
60 id, erp_product_id,shop_id, product_name, cn_alphabet, 61 id, erp_product_id,shop_id, product_name, cn_alphabet,
@@ -66,7 +67,7 @@ @@ -66,7 +67,7 @@
66 first_shelve_time,shelve_time,expect_arrival_time, create_time, arrival_time, 67 first_shelve_time,shelve_time,expect_arrival_time, create_time, arrival_time,
67 edit_time, auditing_time, is_down, status, is_edit, 68 edit_time, auditing_time, is_down, status, is_edit,
68 vip_discount_type, storage,is_outlets,folder_id,sell_channels, 69 vip_discount_type, storage,is_outlets,folder_id,sell_channels,
69 - elements, age_level,app_type,is_instalment,is_seckill,is_limitbuy,is_deposit_advance,market_phrase 70 + elements, age_level,app_type,is_instalment,is_seckill,is_limitbuy,is_deposit_advance,market_phrase,bundle_type
70 </sql> 71 </sql>
71 <select id="selectByPrimaryKey" resultMap="BaseResultMap" 72 <select id="selectByPrimaryKey" resultMap="BaseResultMap"
72 parameterType="java.lang.Integer" timeout="20000"> 73 parameterType="java.lang.Integer" timeout="20000">
@@ -111,11 +112,12 @@ @@ -111,11 +112,12 @@
111 status, is_edit, vip_discount_type, 112 status, is_edit, vip_discount_type,
112 storage, 113 storage,
113 is_outlets, folder_id, 114 is_outlets, folder_id,
114 - sell_channels, elements,age_level,app_type,is_instalment,is_seckill,is_deposit_advance,is_limitbuy,market_phrase) 115 + sell_channels, elements,age_level,app_type,is_instalment,is_seckill,is_deposit_advance,is_limitbuy,market_phrase,bundle_type)
115 values 116 values
116 (#{id,jdbcType=INTEGER}, 117 (#{id,jdbcType=INTEGER},
117 - #{erpProductId,jdbcType=INTEGER},#{shopId,jdbcType=INTEGER}  
118 - ,#{productName,jdbcType=VARCHAR}, 118 + #{erpProductId,jdbcType=INTEGER},
  119 + #{shopId,jdbcType=INTEGER},
  120 + #{productName,jdbcType=VARCHAR},
119 #{cnAlphabet,jdbcType=VARCHAR}, 121 #{cnAlphabet,jdbcType=VARCHAR},
120 #{phrase,jdbcType=VARCHAR}, #{salesPhrase,jdbcType=VARCHAR}, 122 #{phrase,jdbcType=VARCHAR}, #{salesPhrase,jdbcType=VARCHAR},
121 #{brandId,jdbcType=INTEGER}, #{maxSortId,jdbcType=INTEGER}, 123 #{brandId,jdbcType=INTEGER}, #{maxSortId,jdbcType=INTEGER},
@@ -151,7 +153,8 @@ @@ -151,7 +153,8 @@
151 #{isSeckill,jdbcType=CHAR}, 153 #{isSeckill,jdbcType=CHAR},
152 #{isDepositAdvance,jdbcType=CHAR}, 154 #{isDepositAdvance,jdbcType=CHAR},
153 #{isLimitbuy,jdbcType=CHAR}, 155 #{isLimitbuy,jdbcType=CHAR},
154 - #{marketPhrase,jdbcType=VARCHAR} 156 + #{marketPhrase,jdbcType=VARCHAR},
  157 + #{bundleType,jdbcType=INTEGER}
155 ) 158 )
156 </insert> 159 </insert>
157 <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.Product" 160 <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.Product"
@@ -318,6 +321,9 @@ @@ -318,6 +321,9 @@
318 <if test="marketPhrase != null"> 321 <if test="marketPhrase != null">
319 market_phrase = #{marketPhrase,jdbcType=CHAR}, 322 market_phrase = #{marketPhrase,jdbcType=CHAR},
320 </if> 323 </if>
  324 + <if test="bundleType != null">
  325 + bundle_type = #{bundleType,jdbcType=INTEGER},
  326 + </if>
321 </set> 327 </set>
322 where id = #{id,jdbcType=INTEGER} 328 where id = #{id,jdbcType=INTEGER}
323 </update> 329 </update>
@@ -87,6 +87,8 @@ public class ProductIBO implements Serializable { @@ -87,6 +87,8 @@ public class ProductIBO implements Serializable {
87 // from sales_category 87 // from sales_category
88 private String physicalChannels; 88 private String physicalChannels;
89 89
  90 + private Integer bundleType; //折扣类型 0:正常商品 1:套餐 2:量贩 3:搭配
  91 +
90 public Integer getId() { 92 public Integer getId() {
91 return id; 93 return id;
92 } 94 }
@@ -622,4 +624,12 @@ public class ProductIBO implements Serializable { @@ -622,4 +624,12 @@ public class ProductIBO implements Serializable {
622 public void setPhysicalChannels(String physicalChannels) { 624 public void setPhysicalChannels(String physicalChannels) {
623 this.physicalChannels = physicalChannels; 625 this.physicalChannels = physicalChannels;
624 } 626 }
  627 +
  628 + public Integer getBundleType() {
  629 + return bundleType;
  630 + }
  631 +
  632 + public void setBundleType(Integer bundleType) {
  633 + this.bundleType = bundleType;
  634 + }
625 } 635 }
@@ -8,7 +8,6 @@ import com.yoho.search.dal.model.ProductSort; @@ -8,7 +8,6 @@ import com.yoho.search.dal.model.ProductSort;
8 import org.slf4j.Logger; 8 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory; 9 import org.slf4j.LoggerFactory;
10 import org.springframework.stereotype.Component; 10 import org.springframework.stereotype.Component;
11 -import retrofit.http.HEAD;  
12 11
13 import java.util.ArrayList; 12 import java.util.ArrayList;
14 import java.util.List; 13 import java.util.List;
@@ -79,6 +78,7 @@ public class ProductILogicService { @@ -79,6 +78,7 @@ public class ProductILogicService {
79 productIBO.setSmallSortId(p.getSmallSortId()); 78 productIBO.setSmallSortId(p.getSmallSortId());
80 productIBO.setSeriesId(p.getSeriesId()); 79 productIBO.setSeriesId(p.getSeriesId());
81 productIBO.setIsSeckill("N"); 80 productIBO.setIsSeckill("N");
  81 + productIBO.setBundleType(p.getBundleType());
82 if("Y".equals(p.getIsSeckill()) || "1".equals(p.getIsSeckill())) 82 if("Y".equals(p.getIsSeckill()) || "1".equals(p.getIsSeckill()))
83 { 83 {
84 productIBO.setIsSeckill("Y"); 84 productIBO.setIsSeckill("Y");
@@ -280,7 +280,7 @@ public class ProductILogicService { @@ -280,7 +280,7 @@ public class ProductILogicService {
280 } 280 }
281 pdis.add(productIBO); 281 pdis.add(productIBO);
282 } catch (Exception e) { 282 } catch (Exception e) {
283 - logger.error(e.getMessage(), e); 283 + logger.error("[" + p.getId() + "]" + e.getMessage(), e);
284 } 284 }
285 } 285 }
286 return pdis; 286 return pdis;
@@ -54,6 +54,24 @@ public class SpecialDealLogicService { @@ -54,6 +54,24 @@ public class SpecialDealLogicService {
54 if ("Y".equalsIgnoreCase(productIBO.getIsGlobal())) { 54 if ("Y".equalsIgnoreCase(productIBO.getIsGlobal())) {
55 specialSearchField.append("全球购,quanqiugou,"); 55 specialSearchField.append("全球购,quanqiugou,");
56 } 56 }
  57 +
  58 + if (productIBO.getBundleType() != null){
  59 + // 处理折扣类型 0:正常商品 1:套餐 2:量贩 3:搭配
  60 + switch (productIBO.getBundleType()){
  61 + case 1:
  62 + specialSearchField.append("套餐,taocan,");
  63 + break;
  64 + case 2:
  65 + specialSearchField.append("量贩,liangfan,");
  66 + break;
  67 + case 3:
  68 + specialSearchField.append("搭配,dapei,");
  69 + break;
  70 + default:
  71 + break;
  72 + }
  73 + }
  74 +
57 return specialSearchField.toString(); 75 return specialSearchField.toString();
58 } 76 }
59 77