Authored by Gino Zhang

productindex索引搜索支持bundleType

... ... @@ -55,6 +55,7 @@
<result column="is_instalment" property="isInstalment" jdbcType="VARCHAR"/>
<result column="is_seckill" property="isSeckill" jdbcType="CHAR"/>
<result column="market_phrase" property="marketPhrase" jdbcType="VARCHAR"/>
<result column="bundle_type" property="bundleType" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id, erp_product_id,shop_id, product_name, cn_alphabet,
... ... @@ -66,7 +67,7 @@
first_shelve_time,shelve_time,expect_arrival_time, create_time, arrival_time,
edit_time, auditing_time, is_down, status, is_edit,
vip_discount_type, storage,is_outlets,folder_id,sell_channels,
elements, age_level,app_type,is_instalment,is_seckill,is_limitbuy,is_deposit_advance,market_phrase
elements, age_level,app_type,is_instalment,is_seckill,is_limitbuy,is_deposit_advance,market_phrase,bundle_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer" timeout="20000">
... ... @@ -111,11 +112,12 @@
status, is_edit, vip_discount_type,
storage,
is_outlets, folder_id,
sell_channels, elements,age_level,app_type,is_instalment,is_seckill,is_deposit_advance,is_limitbuy,market_phrase)
sell_channels, elements,age_level,app_type,is_instalment,is_seckill,is_deposit_advance,is_limitbuy,market_phrase,bundle_type)
values
(#{id,jdbcType=INTEGER},
#{erpProductId,jdbcType=INTEGER},#{shopId,jdbcType=INTEGER}
,#{productName,jdbcType=VARCHAR},
#{erpProductId,jdbcType=INTEGER},
#{shopId,jdbcType=INTEGER},
#{productName,jdbcType=VARCHAR},
#{cnAlphabet,jdbcType=VARCHAR},
#{phrase,jdbcType=VARCHAR}, #{salesPhrase,jdbcType=VARCHAR},
#{brandId,jdbcType=INTEGER}, #{maxSortId,jdbcType=INTEGER},
... ... @@ -151,7 +153,8 @@
#{isSeckill,jdbcType=CHAR},
#{isDepositAdvance,jdbcType=CHAR},
#{isLimitbuy,jdbcType=CHAR},
#{marketPhrase,jdbcType=VARCHAR}
#{marketPhrase,jdbcType=VARCHAR},
#{bundleType,jdbcType=INTEGER}
)
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.Product"
... ... @@ -318,6 +321,9 @@
<if test="marketPhrase != null">
market_phrase = #{marketPhrase,jdbcType=CHAR},
</if>
<if test="bundleType != null">
bundle_type = #{bundleType,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
... ...
... ... @@ -87,6 +87,8 @@ public class ProductIBO implements Serializable {
// from sales_category
private String physicalChannels;
private Integer bundleType; //折扣类型 0:正常商品 1:套餐 2:量贩 3:搭配
public Integer getId() {
return id;
}
... ... @@ -622,4 +624,12 @@ public class ProductIBO implements Serializable {
public void setPhysicalChannels(String physicalChannels) {
this.physicalChannels = physicalChannels;
}
public Integer getBundleType() {
return bundleType;
}
public void setBundleType(Integer bundleType) {
this.bundleType = bundleType;
}
}
\ No newline at end of file
... ...
... ... @@ -8,7 +8,6 @@ import com.yoho.search.dal.model.ProductSort;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import retrofit.http.HEAD;
import java.util.ArrayList;
import java.util.List;
... ... @@ -79,6 +78,7 @@ public class ProductILogicService {
productIBO.setSmallSortId(p.getSmallSortId());
productIBO.setSeriesId(p.getSeriesId());
productIBO.setIsSeckill("N");
productIBO.setBundleType(p.getBundleType());
if("Y".equals(p.getIsSeckill()) || "1".equals(p.getIsSeckill()))
{
productIBO.setIsSeckill("Y");
... ... @@ -280,7 +280,7 @@ public class ProductILogicService {
}
pdis.add(productIBO);
} catch (Exception e) {
logger.error(e.getMessage(), e);
logger.error("[" + p.getId() + "]" + e.getMessage(), e);
}
}
return pdis;
... ...
... ... @@ -54,6 +54,24 @@ public class SpecialDealLogicService {
if ("Y".equalsIgnoreCase(productIBO.getIsGlobal())) {
specialSearchField.append("全球购,quanqiugou,");
}
if (productIBO.getBundleType() != null){
// 处理折扣类型 0:正常商品 1:套餐 2:量贩 3:搭配
switch (productIBO.getBundleType()){
case 1:
specialSearchField.append("套餐,taocan,");
break;
case 2:
specialSearchField.append("量贩,liangfan,");
break;
case 3:
specialSearchField.append("搭配,dapei,");
break;
default:
break;
}
}
return specialSearchField.toString();
}
... ...