Authored by wangnan

productindex加入coupon_limit_status字段

... ... @@ -14,18 +14,12 @@ public interface ProductMapper {
int updateByPrimaryKeySelective(Product record);
int updateByPrimaryKey(Product record);
List<Product> selectPageLists(@Param(value = "offset") Integer offset, @Param(value = "pageSize") Integer pageSize);
Integer selectProductIdBySkn(Integer productSkn);
Integer selectSknByProductId(Integer productId);
List<Product> selectSknsByProductIds(List<Integer> productIds);
List<Product> selectAll();
int selectCount();
Product selectBySkn(Integer skn);
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.ProductMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.Product">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="shop_id" property="shopId" jdbcType="INTEGER"/>
... ... @@ -56,7 +57,9 @@
<result column="is_seckill" property="isSeckill" jdbcType="CHAR"/>
<result column="market_phrase" property="marketPhrase" jdbcType="VARCHAR"/>
<result column="bundle_type" property="bundleType" jdbcType="INTEGER"/>
<result column="coupon_limit_status" property="couponLimitStatus" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id, erp_product_id,shop_id, product_name, cn_alphabet,
phrase, sales_phrase, brand_id, max_sort_id, middle_sort_id,
... ... @@ -67,8 +70,9 @@
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,bundle_type
elements, age_level,app_type,is_instalment,is_seckill,is_limitbuy,is_deposit_advance,market_phrase,bundle_type,coupon_limit_status
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer" timeout="20000">
select
... ... @@ -76,6 +80,7 @@
from product
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectBySkn" resultMap="BaseResultMap"
parameterType="java.lang.Integer" timeout="20000">
select
... ... @@ -84,11 +89,13 @@
where erp_product_id = #{skn,jdbcType=INTEGER}
limit 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"
timeout="20000">
delete from product
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.Product"
timeout="20000">
insert ignore into product (id, erp_product_id,shop_id,
... ... @@ -112,7 +119,7 @@
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,bundle_type)
sell_channels, elements,age_level,app_type,is_instalment,is_seckill,is_deposit_advance,is_limitbuy,market_phrase,bundle_type,coupon_limit_status)
values
(#{id,jdbcType=INTEGER},
#{erpProductId,jdbcType=INTEGER},
... ... @@ -154,9 +161,11 @@
#{isDepositAdvance,jdbcType=CHAR},
#{isLimitbuy,jdbcType=CHAR},
#{marketPhrase,jdbcType=VARCHAR},
#{bundleType,jdbcType=INTEGER}
#{bundleType,jdbcType=INTEGER},
#{couponLimitStatus,jdbcType=INTEGER}
)
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.Product"
timeout="20000">
update product
... ... @@ -321,34 +330,37 @@
<if test="bundleType != null">
bundle_type = #{bundleType,jdbcType=INTEGER},
</if>
<if test="couponLimitStatus != null">
coupon_limit_status = #{couponLimitStatus,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
SELECT count(*) FROM product
</select>
<select id="selectProductIdBySkn" resultType="java.lang.Integer"
parameterType="java.lang.Integer" timeout="20000">
SELECT id FROM product where
erp_product_id =
#{productSkn,jdbcType=INTEGER}
</select>
<select id="selectSknByProductId" resultType="java.lang.Integer"
parameterType="java.lang.Integer" timeout="20000">
SELECT erp_product_id FROM product where
id =
#{id,jdbcType=INTEGER}
</select>
<select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from product limit #{offset},#{pageSize}
</select>
<select id="selectAll" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from product
</select>
<select id="selectBySkns" resultMap="BaseResultMap">
Select
<include refid="Base_Column_List"/>
... ... @@ -358,6 +370,7 @@
#{item}
</foreach>
</select>
<select id="selectListByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
... ... @@ -367,4 +380,5 @@
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
... ...
package com.yoho.search.consumer.index.increment;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel;
... ... @@ -24,6 +11,18 @@ import com.yoho.search.consumer.service.base.ActivityProductService;
import com.yoho.search.consumer.service.base.ProductService;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.dal.model.ActivityProduct;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* Created by YOHO on 15-9-2.
... ...
... ... @@ -1055,6 +1055,9 @@
},
"productProfitValue": {
"type":"long"
},
"couponLimitStatus": {
"type":"long"
}
}
}
... ...
... ... @@ -210,6 +210,7 @@ public class ProductIndexService {
map.put(ProductIndexEsField.giveValue, productIndexBO.getGiveValue());
map.put(ProductIndexEsField.profitValue, productIndexBO.getProfitValue());
map.put(ProductIndexEsField.promotionTitle, productIndexBO.getPromotionTitles());
map.put(ProductIndexEsField.couponLimitStatus, productIndexBO.getCouponLimitStatus());
return map;
}
... ...
... ... @@ -62,6 +62,8 @@ public class ProductIBO implements Serializable {
private String isInstalment;
private String isSeckill;
private String marketPhrase;
private Integer couponLimitStatus;
// inner join brand
private String brandNameCn;
... ... @@ -689,4 +691,11 @@ public class ProductIBO implements Serializable {
this.isPhraseExist = isPhraseExist;
}
public Integer getCouponLimitStatus() {
return couponLimitStatus;
}
public void setCouponLimitStatus(Integer couponLimitStatus) {
this.couponLimitStatus = couponLimitStatus;
}
}
\ No newline at end of file
... ...
... ... @@ -164,6 +164,7 @@ public class ProductILogicService {
productIBO.setSellChannels(p.getSellChannels());
productIBO.setAgeLevel(p.getAgeLevel());
productIBO.setAppType(p.getAppType());
productIBO.setCouponLimitStatus(p.getCouponLimitStatus());
//品牌
this.buildBrand(brandMap,p,productIBO);
//品类
... ...