Authored by YOHO01\aaron.wang

ufo用真实表明和类名 test

Showing 86 changed files with 686 additions and 684 deletions
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoBrand;
import com.yoho.search.dal.model.ufo_product.Brand;
import org.apache.ibatis.annotations.Param;
import java.util.List;
... ... @@ -8,15 +8,15 @@ import java.util.List;
public interface UfoBrandMapper {
int deleteByPrimaryKey(Short id);
int insertSelective(UfoBrand record);
int insertSelective(Brand record);
UfoBrand selectByPrimaryKey(Short id);
Brand selectByPrimaryKey(Short id);
int updateByPrimaryKeySelective(UfoBrand record);
int updateByPrimaryKeySelective(Brand record);
List<UfoBrand> selectByIdList(List<Short> idList);
List<Brand> selectByIdList(List<Short> idList);
int selectCount();
List<UfoBrand> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
List<Brand> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoBrandSeries;
import com.yoho.search.dal.model.ufo_product.BrandSeries;
import org.apache.ibatis.annotations.Param;
import java.util.List;
... ... @@ -8,15 +8,15 @@ import java.util.List;
public interface UfoBrandSeriesMapper {
int deleteByPrimaryKey(Short id);
int insertSelective(UfoBrandSeries record);
int insertSelective(BrandSeries record);
UfoBrandSeries selectByPrimaryKey(Short id);
BrandSeries selectByPrimaryKey(Short id);
int updateByPrimaryKeySelective(UfoBrandSeries record);
int updateByPrimaryKeySelective(BrandSeries record);
List<UfoBrandSeries> selectByIdList(List<Short> brandIdList);
List<BrandSeries> selectByIdList(List<Short> brandIdList);
List<UfoBrandSeries> selectByBrandIdList(List<Integer> brandIdList);
List<BrandSeries> selectByBrandIdList(List<Integer> brandIdList);
List<UfoBrandSeries> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
List<BrandSeries> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoBuyerOrderGoods;
import com.yoho.search.dal.model.ufo_order.BuyerOrderGoods;
import java.util.List;
public interface UfoBuyerOrderGoodsMapper {
int deleteByPrimaryKey(Integer id);
int insert(UfoBuyerOrderGoods record);
int insert(BuyerOrderGoods record);
int insertSelective(UfoBuyerOrderGoods record);
int insertSelective(BuyerOrderGoods record);
UfoBuyerOrderGoods selectByPrimaryKey(Integer id);
BuyerOrderGoods selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoBuyerOrderGoods record);
int updateByPrimaryKeySelective(BuyerOrderGoods record);
int updateByPrimaryKey(UfoBuyerOrderGoods record);
int updateByPrimaryKey(BuyerOrderGoods record);
List<UfoBuyerOrderGoods> selectBySkupList(List<Integer> skupList);
List<BuyerOrderGoods> selectBySkupList(List<Integer> skupList);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoBuyerOrder;
import com.yoho.search.dal.model.ufo_order.BuyerOrder;
import java.util.List;
public interface UfoBuyerOrderMapper {
int deleteByPrimaryKey(Integer id);
int insert(UfoBuyerOrder record);
int insert(BuyerOrder record);
int insertSelective(UfoBuyerOrder record);
int insertSelective(BuyerOrder record);
UfoBuyerOrder selectByPrimaryKey(Integer id);
BuyerOrder selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoBuyerOrder record);
int updateByPrimaryKeySelective(BuyerOrder record);
int updateByPrimaryKey(UfoBuyerOrder record);
int updateByPrimaryKey(BuyerOrder record);
List<UfoBuyerOrder> selectByOrderCodeList(List<Long> orderCodeList);
List<BuyerOrder> selectByOrderCodeList(List<Long> orderCodeList);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoGoodsImages;
import com.yoho.search.dal.model.ufo_product.GoodsImages;
import java.util.List;
public interface UfoGoodsImagesMapper {
int deleteByPrimaryKey(Integer id);
int insertSelective(UfoGoodsImages record);
int insertSelective(GoodsImages record);
UfoGoodsImages selectByPrimaryKey(Integer id);
GoodsImages selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoGoodsImages record);
int updateByPrimaryKeySelective(GoodsImages record);
List<UfoGoodsImages> selectByProductIdList(List<Integer> idList);
List<GoodsImages> selectByProductIdList(List<Integer> idList);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoGoods;
import com.yoho.search.dal.model.ufo_product.Goods;
import java.util.List;
public interface UfoGoodsMapper {
int deleteByPrimaryKey(Integer id);
int insertSelective(UfoGoods record);
int insertSelective(Goods record);
UfoGoods selectByPrimaryKey(Integer id);
Goods selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoGoods record);
int updateByPrimaryKeySelective(Goods record);
List<UfoGoods> selectByProductIdList(List<Integer> idList);
List<Goods> selectByProductIdList(List<Integer> idList);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoProductColor;
import com.yoho.search.dal.model.ufo_product.ProductColor;
import org.apache.ibatis.annotations.Param;
import java.util.List;
... ... @@ -8,13 +8,13 @@ import java.util.List;
public interface UfoProductColorMapper {
int deleteByPrimaryKey(Short id);
int insertSelective(UfoProductColor record);
int insertSelective(ProductColor record);
UfoProductColor selectByPrimaryKey(Short id);
ProductColor selectByPrimaryKey(Short id);
int updateByPrimaryKeySelective(UfoProductColor record);
int updateByPrimaryKeySelective(ProductColor record);
int selectCount();
List<UfoProductColor> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
List<ProductColor> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.ufo_product.Product;
import org.apache.ibatis.annotations.Param;
import java.util.List;
... ... @@ -8,17 +8,17 @@ import java.util.List;
public interface UfoProductMapper {
int deleteByPrimaryKey(Integer id);
int insertSelective(UfoProduct record);
int insertSelective(Product record);
UfoProduct selectByPrimaryKey(Integer id);
Product selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoProduct record);
int updateByPrimaryKeySelective(Product record);
int selectCount();
List<UfoProduct> selectPageLists(@Param(value = "offset") Integer offset, @Param(value = "pageSize") Integer pageSize);
List<Product> selectPageLists(@Param(value = "offset") Integer offset, @Param(value = "pageSize") Integer pageSize);
List<UfoProduct> selectByIdList(List<Integer> idList);
List<Product> selectByIdList(List<Integer> idList);
List<UfoProduct> selectByBrandId(Short brandId);
List<Product> selectByBrandId(Short brandId);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoProductPoolDetail;
import com.yoho.search.dal.model.ufo_product.ProductPoolDetail;
import java.util.List;
public interface UfoProductPoolDetailMapper {
int deleteByPrimaryKey(Integer id);
int insertSelective(UfoProductPoolDetail record);
int insertSelective(ProductPoolDetail record);
UfoProductPoolDetail selectByPrimaryKey(Integer id);
ProductPoolDetail selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoProductPoolDetail record);
int updateByPrimaryKeySelective(ProductPoolDetail record);
List<UfoProductPoolDetail> selectByProductId(Integer id);
List<ProductPoolDetail> selectByProductId(Integer id);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoProductPool;
import com.yoho.search.dal.model.ufo_product.ProductPool;
public interface UfoProductPoolMapper {
int deleteByPrimaryKey(Integer id);
int insertSelective(UfoProductPool record);
int insertSelective(ProductPool record);
UfoProductPool selectByPrimaryKey(Integer id);
ProductPool selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoProductPool record);
int updateByPrimaryKeySelective(ProductPool record);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoProductSort;
import com.yoho.search.dal.model.ufo_product.ProductSort;
import org.apache.ibatis.annotations.Param;
import java.util.List;
... ... @@ -8,15 +8,15 @@ import java.util.List;
public interface UfoProductSortMapper {
int deleteByPrimaryKey(Short id);
int insertSelective(UfoProductSort record);
int insertSelective(ProductSort record);
UfoProductSort selectByPrimaryKey(Short id);
ProductSort selectByPrimaryKey(Short id);
int updateByPrimaryKeySelective(UfoProductSort record);
int updateByPrimaryKeySelective(ProductSort record);
List<UfoProductSort> selectByIdList(List<Short> idList);
List<ProductSort> selectByIdList(List<Short> idList);
int selectCount();
List<UfoProductSort> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
List<ProductSort> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoScoreProductRule;
import com.yoho.search.dal.model.ufo_product.ScoreProductRule;
import org.apache.ibatis.annotations.Param;
import java.util.List;
... ... @@ -8,15 +8,15 @@ import java.util.List;
public interface UfoScoreProductRuleMapper {
int deleteByPrimaryKey(Integer id);
int insert(UfoScoreProductRule record);
int insert(ScoreProductRule record);
int insertSelective(UfoScoreProductRule record);
int insertSelective(ScoreProductRule record);
UfoScoreProductRule selectByPrimaryKey(Integer id);
ScoreProductRule selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoScoreProductRule record);
int updateByPrimaryKeySelective(ScoreProductRule record);
int updateByPrimaryKey(UfoScoreProductRule record);
int updateByPrimaryKey(ScoreProductRule record);
List<Integer> selectByIdList(@Param(value = "idList") List<Integer> idList);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoSearchSortRelation;
import com.yoho.search.dal.model.ufo_product.SearchSortRelation;
import java.util.List;
public interface UfoSearchSortRelationMapper {
int deleteByPrimaryKey(Integer ufoSortId);
int insert(UfoSearchSortRelation record);
int insert(SearchSortRelation record);
int insertSelective(UfoSearchSortRelation record);
int insertSelective(SearchSortRelation record);
UfoSearchSortRelation selectByPrimaryKey(Integer ufoSortId);
SearchSortRelation selectByPrimaryKey(Integer ufoSortId);
int updateByPrimaryKeySelective(UfoSearchSortRelation record);
int updateByPrimaryKeySelective(SearchSortRelation record);
void insertBatch(List<UfoSearchSortRelation> list);
void insertBatch(List<SearchSortRelation> list);
void deleteAll();
List<UfoSearchSortRelation> selectAll();
List<SearchSortRelation> selectAll();
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoSize;
import com.yoho.search.dal.model.ufo_product.Size;
import org.apache.ibatis.annotations.Param;
import java.util.List;
... ... @@ -8,13 +8,13 @@ import java.util.List;
public interface UfoSizeMapper {
int deleteByPrimaryKey(Short id);
int insertSelective(UfoSize record);
int insertSelective(Size record);
UfoSize selectByPrimaryKey(Short id);
Size selectByPrimaryKey(Short id);
int updateByPrimaryKeySelective(UfoSize record);
int updateByPrimaryKeySelective(Size record);
int selectCount();
List<UfoSize> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
List<Size> selectPageList(@Param(value = "offset") int offset, @Param(value = "pageSize") int pageSize);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoStorage;
import com.yoho.search.dal.model.ufo_product.Storage;
import java.util.List;
public interface UfoStorageMapper {
int deleteByPrimaryKey(Integer id);
int insertSelective(UfoStorage record);
int insertSelective(Storage record);
UfoStorage selectByPrimaryKey(Integer id);
Storage selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoStorage record);
int updateByPrimaryKeySelective(Storage record);
List<UfoStorage> selectByProductIdList(List<Integer> idList);
List<Storage> selectByProductIdList(List<Integer> idList);
}
\ No newline at end of file
... ...
package com.yoho.search.dal;
import com.yoho.search.dal.model.UfoStoragePrice;
import com.yoho.search.dal.model.ufo_product.StoragePrice;
import java.util.List;
public interface UfoStoragePriceMapper {
int deleteByPrimaryKey(Integer id);
int insertSelective(UfoStoragePrice record);
int insertSelective(StoragePrice record);
UfoStoragePrice selectByPrimaryKey(Integer id);
StoragePrice selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(UfoStoragePrice record);
int updateByPrimaryKeySelective(StoragePrice record);
List<UfoStoragePrice> selectByProductIdList(List<Integer> idList);
List<StoragePrice> selectByProductIdList(List<Integer> idList);
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoBrandMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoBrand">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.Brand">
<id column="id" property="id" jdbcType="SMALLINT"/>
<result column="brand_name" property="brandName" jdbcType="VARCHAR"/>
<result column="brand_name_en" property="brandNameEn" jdbcType="VARCHAR"/>
... ... @@ -27,7 +27,7 @@
where id = #{id,jdbcType=SMALLINT}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoBrand" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.Brand" >
insert into ufo_brand
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -71,7 +71,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoBrand">
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.Brand">
update ufo_brand
<set>
<if test="brandName != null">
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoBrandSeriesMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoBrandSeries">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.BrandSeries">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="series_name" property="seriesName" jdbcType="VARCHAR"/>
<result column="series_search" property="seriesSearch" jdbcType="VARCHAR"/>
... ... @@ -28,7 +28,7 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoBrandSeries">
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.BrandSeries">
insert into ufo_brand_series
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
... ... @@ -78,7 +78,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoBrandSeries">
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.BrandSeries">
update ufo_brand_series
<set>
<if test="seriesName != null">
... ...
<?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.UfoBuyerOrderGoodsMapper" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoBuyerOrderGoods" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_order.BuyerOrderGoods" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="skup" property="skup" jdbcType="INTEGER" />
... ... @@ -23,7 +23,7 @@
delete from ufo_buyer_order_goods
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.UfoBuyerOrderGoods" >
<insert id="insert" parameterType="com.yoho.search.dal.model.ufo_order.BuyerOrderGoods" >
insert into ufo_buyer_order_goods (id, order_code, skup,
goods_price, goods_amount, uid,
coupon_cut_amount)
... ... @@ -31,7 +31,7 @@
#{goodsPrice,jdbcType=DECIMAL}, #{goodsAmount,jdbcType=DECIMAL}, #{uid,jdbcType=INTEGER},
#{couponCutAmount,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoBuyerOrderGoods" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_order.BuyerOrderGoods" >
insert into ufo_buyer_order_goods
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -80,7 +80,7 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoBuyerOrderGoods" >
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_order.BuyerOrderGoods" >
update ufo_buyer_order_goods
<set >
<if test="orderCode != null" >
... ... @@ -104,7 +104,7 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.UfoBuyerOrderGoods" >
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ufo_order.BuyerOrderGoods" >
update ufo_buyer_order_goods
set order_code = #{orderCode,jdbcType=BIGINT},
skup = #{skup,jdbcType=INTEGER},
... ...
<?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.UfoBuyerOrderMapper" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoBuyerOrder" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_order.BuyerOrder" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
... ... @@ -34,7 +34,7 @@
delete from ufo_buyer_order
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.UfoBuyerOrder" >
<insert id="insert" parameterType="com.yoho.search.dal.model.ufo_order.BuyerOrder" >
insert into ufo_buyer_order (id, uid, order_code,
seller_uid, client_type, payment,
payment_type, is_cancel, amount,
... ... @@ -48,7 +48,7 @@
#{updateTime,jdbcType=INTEGER}, #{sellerOrderStatus,jdbcType=TINYINT}, #{buyerOrderStatus,jdbcType=TINYINT},
#{channelNo,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoBuyerOrder" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_order.BuyerOrder" >
insert into ufo_buyer_order
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -151,7 +151,7 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoBuyerOrder" >
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_order.BuyerOrder" >
update ufo_buyer_order
<set >
<if test="uid != null" >
... ... @@ -202,7 +202,7 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.UfoBuyerOrder" >
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ufo_order.BuyerOrder" >
update ufo_buyer_order
set uid = #{uid,jdbcType=INTEGER},
order_code = #{orderCode,jdbcType=BIGINT},
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoGoodsImagesMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoGoodsImages">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.GoodsImages">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="goods_id" property="goodsId" jdbcType="INTEGER"/>
<result column="product_id" property="productId" jdbcType="INTEGER"/>
... ... @@ -27,7 +27,7 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoGoodsImages" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.GoodsImages" >
insert into ufo_goods_images
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -71,7 +71,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoGoodsImages">
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.GoodsImages">
update ufo_goods_images
<set>
<if test="goodsId != null">
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoGoodsMapper" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoGoods" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.Goods" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="product_id" property="productId" jdbcType="INTEGER" />
<result column="color_id" property="colorId" jdbcType="SMALLINT" />
... ... @@ -28,7 +28,7 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoGoods" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.Goods" >
insert into ufo_goods
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -78,7 +78,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoGoods" >
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.Goods" >
update ufo_goods
<set >
<if test="productId != null" >
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoProductColorMapper" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoProductColor" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.ProductColor" >
<id column="id" property="id" jdbcType="SMALLINT" />
<result column="color_name" property="colorName" jdbcType="VARCHAR" />
<result column="color_code" property="colorCode" jdbcType="VARCHAR" />
... ... @@ -25,7 +25,7 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoProductColor" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductColor" >
insert into ufo_product_color
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -57,7 +57,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoProductColor" >
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductColor" >
update ufo_product_color
<set >
<if test="colorName != null" >
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoProductMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoProduct">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.Product">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="product_name" property="productName" jdbcType="VARCHAR"/>
<result column="product_code" property="productCode" jdbcType="VARCHAR"/>
... ... @@ -41,7 +41,7 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoProduct" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.Product" >
insert into ufo_product
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -157,7 +157,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoProduct">
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.Product">
update ufo_product
<set>
<if test="productName != null">
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoProductPoolDetailMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoProductPoolDetail">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.ProductPoolDetail">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="pool_id" property="poolId" jdbcType="INTEGER"/>
<result column="product_id" property="productId" jdbcType="INTEGER"/>
... ... @@ -26,7 +26,7 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoProductPoolDetail" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductPoolDetail" >
insert into ufo_product_pool_detail
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -64,7 +64,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoProductPoolDetail">
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductPoolDetail">
update ufo_product_pool_detail
<set>
<if test="poolId != null">
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoProductPoolMapper" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoProductPool" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.ProductPool" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="pool_name" property="poolName" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
... ... @@ -24,7 +24,7 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoProductPool" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductPool" >
insert into ufo_product_pool
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -50,7 +50,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoProductPool" >
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductPool" >
update ufo_product_pool
<set >
<if test="poolName != null" >
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoProductSortMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoProductSort" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.ProductSort" >
<id column="id" property="id" jdbcType="SMALLINT" />
<result column="sort_name" property="sortName" jdbcType="VARCHAR" />
<result column="level" property="level" jdbcType="SMALLINT" />
... ... @@ -27,7 +27,7 @@
where id = #{id,jdbcType=SMALLINT}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoProductSort" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductSort" >
insert into ufo_product_sort
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -71,7 +71,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoProductSort" >
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.ProductSort" >
update ufo_product_sort
<set >
<if test="sortName != null" >
... ...
<?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.UfoScoreProductRuleMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoScoreProductRule">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="product_id" property="productId" jdbcType="INTEGER"/>
<result column="update_time" property="updateTime" jdbcType="INTEGER"/>
... ... @@ -20,13 +20,13 @@
delete from ufo_score_product_rule
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.UfoScoreProductRule">
<insert id="insert" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
insert into ufo_score_product_rule (id, product_id, update_time,
create_time)
values (#{id,jdbcType=INTEGER}, #{productId,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER},
#{createTime,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoScoreProductRule">
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
insert into ufo_score_product_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
... ... @@ -57,7 +57,7 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoScoreProductRule">
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
update ufo_score_product_rule
<set>
<if test="productId != null">
... ... @@ -72,7 +72,7 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.UfoScoreProductRule">
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ufo_product.ScoreProductRule">
update ufo_score_product_rule
set product_id = #{productId,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=INTEGER},
... ...
<?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.UfoSearchSortRelationMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoSearchSortRelation">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.SearchSortRelation">
<id column="ufo_sort_id" property="ufoSortId" jdbcType="INTEGER"/>
<result column="yoho_sort_id" property="yohoSortId" jdbcType="INTEGER"/>
<result column="yoho_small_sort_id" property="yohoSmallSortId" jdbcType="INTEGER"/>
... ... @@ -23,14 +23,14 @@
where ufo_sort_id = #{ufoSortId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.UfoSearchSortRelation">
<insert id="insert" parameterType="com.yoho.search.dal.model.ufo_product.SearchSortRelation">
insert into ufo_search_sort_relation (ufo_sort_id, yoho_sort_id, yoho_small_sort_id
)
values (#{ufoSortId,jdbcType=INTEGER}, #{yohoSortId,jdbcType=INTEGER}, #{yohoSmallSortId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoSearchSortRelation" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.SearchSortRelation" >
insert into ufo_search_sort_relation
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="ufoSortId != null" >
... ... @@ -56,7 +56,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoSearchSortRelation">
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.SearchSortRelation">
update ufo_search_sort_relation
<set>
<if test="yohoSortId != null">
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoSizeMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoSize">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.Size">
<id column="id" property="id" jdbcType="SMALLINT"/>
<result column="size_name" property="sizeName" jdbcType="VARCHAR"/>
<result column="sort_id" property="sortId" jdbcType="SMALLINT"/>
... ... @@ -25,7 +25,7 @@
where id = #{id,jdbcType=SMALLINT}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoSize" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.Size" >
insert into ufo_size
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -57,7 +57,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoSize">
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.Size">
update ufo_size
<set>
<if test="sizeName != null">
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoStorageMapper" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoStorage" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.Storage" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="product_id" property="productId" jdbcType="INTEGER" />
<result column="goods_id" property="goodsId" jdbcType="INTEGER" />
... ... @@ -29,7 +29,7 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoStorage" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.Storage" >
insert into ufo_storage
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -79,7 +79,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoStorage" >
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.Storage" >
update ufo_storage
<set >
<if test="productId != null" >
... ...
... ... @@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.search.dal.UfoStoragePriceMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.UfoStoragePrice">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.StoragePrice">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="product_id" property="productId" jdbcType="INTEGER"/>
<result column="skup" property="skup" jdbcType="INTEGER"/>
... ... @@ -33,7 +33,7 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.UfoStoragePrice" >
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.StoragePrice" >
insert into ufo_storage_price
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -107,7 +107,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.UfoStoragePrice">
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.StoragePrice">
update ufo_storage_price
<set>
<if test="skup != null">
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.index.fullbuild.ufo;
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
import com.yoho.search.dal.UfoBrandMapper;
import com.yoho.search.dal.model.UfoBrand;
import com.yoho.search.dal.model.ufo_product.Brand;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -27,15 +27,15 @@ public class UfoBrandIndexBuilder extends IIndexBuilder {
@Override
public List<?> getPageLists(int offset, int limit) throws Exception {
List<UfoBrand> ufoBrandList = ufoBrandMapper.selectPageList(offset, limit);
if (CollectionUtils.isEmpty(ufoBrandList)) {
List<Brand> brandList = ufoBrandMapper.selectPageList(offset, limit);
if (CollectionUtils.isEmpty(brandList)) {
return new ArrayList<>(0);
}
return ufoBrandList;
return brandList;
}
@Override
public String getId(Object object) {
return ((UfoBrand) object).getId().toString();
return ((Brand) object).getId().toString();
}
}
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.index.fullbuild.ufo;
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
import com.yoho.search.dal.UfoProductColorMapper;
import com.yoho.search.dal.model.UfoProductColor;
import com.yoho.search.dal.model.ufo_product.ProductColor;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -27,15 +27,15 @@ public class UfoColorIndexBuilder extends IIndexBuilder {
@Override
public List<?> getPageLists(int offset, int limit) throws Exception {
List<UfoProductColor> ufoProductColorList = ufoProductColorMapper.selectPageList(offset, limit);
if (CollectionUtils.isEmpty(ufoProductColorList)) {
List<ProductColor> productColorList = ufoProductColorMapper.selectPageList(offset, limit);
if (CollectionUtils.isEmpty(productColorList)) {
return new ArrayList<>(0);
}
return ufoProductColorList;
return productColorList;
}
@Override
public String getId(Object object) {
return ((UfoProductColor) object).getId().toString();
return ((ProductColor) object).getId().toString();
}
}
... ...
... ... @@ -4,7 +4,7 @@ import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
import com.yoho.search.consumer.service.bo.UfoProductIndexBO;
import com.yoho.search.consumer.service.logicService.ufo.UfoIndexFieldBuilder;
import com.yoho.search.dal.UfoProductMapper;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.ufo_product.Product;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
... ... @@ -51,20 +51,20 @@ public class UfoProductIndexBuilder extends IIndexBuilder implements Application
*/
@Override
public List<?> getPageLists(int offset, int limit) throws Exception {
List<UfoProduct> ufoProductList = ufoProductMapper.selectPageLists(offset, limit);
return buildUfoProductIndexBOList(ufoProductList);
List<Product> productList = ufoProductMapper.selectPageLists(offset, limit);
return buildUfoProductIndexBOList(productList);
}
/**
* 增量
*/
public UfoProductIndexBO buildUfoProductIndexBOIncrease(Integer id) {
UfoProduct ufoProduct = ufoProductMapper.selectByPrimaryKey(id);
if (ufoProduct == null) {
Product product = ufoProductMapper.selectByPrimaryKey(id);
if (product == null) {
return null;
}
List<UfoProduct> ufoProductList = Arrays.asList(ufoProduct);
List<UfoProductIndexBO> ufoProductIndexBOList = buildUfoProductIndexBOList(ufoProductList);
List<Product> productList = Arrays.asList(product);
List<UfoProductIndexBO> ufoProductIndexBOList = buildUfoProductIndexBOList(productList);
if (CollectionUtils.isEmpty(ufoProductIndexBOList)) {
return null;
}
... ... @@ -78,30 +78,30 @@ public class UfoProductIndexBuilder extends IIndexBuilder implements Application
/**
* 构建UfoProductIndexBO列表
*/
private List<UfoProductIndexBO> buildUfoProductIndexBOList(List<UfoProduct> ufoProductList) {
private List<UfoProductIndexBO> buildUfoProductIndexBOList(List<Product> productList) {
List<UfoProductIndexBO> ufoProductIndexBOList = new ArrayList<>();
for (UfoProduct ufoProduct : ufoProductList) {
for (Product product : productList) {
UfoProductIndexBO ufoProductIndexBO = new UfoProductIndexBO();
BeanUtils.copyProperties(ufoProduct, ufoProductIndexBO);
this.buildSimpleField(ufoProduct, ufoProductIndexBO);
BeanUtils.copyProperties(product, ufoProductIndexBO);
this.buildSimpleField(product, ufoProductIndexBO);
ufoProductIndexBOList.add(ufoProductIndexBO);
}
List<Integer> idList = ufoProductList.stream().map(UfoProduct::getId).collect(Collectors.toList());
List<Integer> idList = productList.stream().map(Product::getId).collect(Collectors.toList());
//调用每个builder构建UfoProductIndexBO的各种属性数据
indexFieldBuilderList.stream().forEach(builder -> builder.build(ufoProductIndexBOList, idList));
return ufoProductIndexBOList;
}
private void buildSimpleField(UfoProduct ufoProduct, UfoProductIndexBO ufoProductIndexBO) {
ufoProductIndexBO.setIdString(ufoProduct.getId().toString());
private void buildSimpleField(Product product, UfoProductIndexBO ufoProductIndexBO) {
ufoProductIndexBO.setIdString(product.getId().toString());
ufoProductIndexBO.setGenderS("男,女");
if (ufoProduct.getGender() == null) {
if (product.getGender() == null) {
return;
}
if ("1".equals(ufoProduct.getGender())) {
if ("1".equals(product.getGender())) {
ufoProductIndexBO.setGenderS("男");
}
if ("2".equals(ufoProduct.getGender())) {
if ("2".equals(product.getGender())) {
ufoProductIndexBO.setGenderS("女");
}
}
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.index.fullbuild.ufo;
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
import com.yoho.search.dal.UfoSizeMapper;
import com.yoho.search.dal.model.UfoSize;
import com.yoho.search.dal.model.ufo_product.Size;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -27,15 +27,15 @@ public class UfoSizeIndexBuilder extends IIndexBuilder {
@Override
public List<?> getPageLists(int offset, int limit) throws Exception {
List<UfoSize> ufoSizeList = ufoSizeMapper.selectPageList(offset, limit);
if (CollectionUtils.isEmpty(ufoSizeList)) {
List<Size> sizeList = ufoSizeMapper.selectPageList(offset, limit);
if (CollectionUtils.isEmpty(sizeList)) {
return new ArrayList<>(0);
}
return ufoSizeList;
return sizeList;
}
@Override
public String getId(Object object) {
return ((UfoSize) object).getId().toString();
return ((Size) object).getId().toString();
}
}
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.index.fullbuild.ufo;
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
import com.yoho.search.dal.UfoProductSortMapper;
import com.yoho.search.dal.model.UfoProductSort;
import com.yoho.search.dal.model.ufo_product.ProductSort;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -27,15 +27,15 @@ public class UfoSortIndexBuilder extends IIndexBuilder {
@Override
public List<?> getPageLists(int offset, int limit) throws Exception {
List<UfoProductSort> ufoProductSortList = ufoProductSortMapper.selectPageList(offset, limit);
if (CollectionUtils.isEmpty(ufoProductSortList)) {
List<ProductSort> productSortList = ufoProductSortMapper.selectPageList(offset, limit);
if (CollectionUtils.isEmpty(productSortList)) {
return new ArrayList<>(0);
}
return ufoProductSortList;
return productSortList;
}
@Override
public String getId(Object object) {
return ((UfoProductSort) object).getId().toString();
return ((ProductSort) object).getId().toString();
}
}
... ...
... ... @@ -7,7 +7,11 @@ import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService
import com.yoho.search.consumer.service.logicService.ufo.yoho.*;
import com.yoho.search.consumer.service.utils.IdCheckUtils;
import com.yoho.search.dal.*;
import com.yoho.search.dal.model.*;
import com.yoho.search.dal.model.Brand;
import com.yoho.search.dal.model.ufo_product.*;
import com.yoho.search.dal.model.ufo_product.Goods;
import com.yoho.search.dal.model.ufo_product.Product;
import com.yoho.search.dal.model.ufo_product.Size;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -81,30 +85,30 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder {
* 全量构建
*/
public List<ProductIndexBO> buildProductIndexBOList(int start, int limit) {
List<UfoProduct> ufoProductList = ufoProductMapper.selectPageLists(start, limit);
if (CollectionUtils.isEmpty(ufoProductList)) {
List<Product> productList = ufoProductMapper.selectPageLists(start, limit);
if (CollectionUtils.isEmpty(productList)) {
return new ArrayList<>();
}
return buildProductIndexBOList(ufoProductList);
return buildProductIndexBOList(productList);
}
/**
* 增量构建
*/
public ProductIndexBO buildProductIndexBOIncrease(Integer id) {
UfoProduct ufoProduct = ufoProductMapper.selectByPrimaryKey(id);
if (ufoProduct == null) {
Product product = ufoProductMapper.selectByPrimaryKey(id);
if (product == null) {
return null;
}
List<UfoProduct> ufoProductList = new ArrayList<>(Arrays.asList(ufoProduct));
List<ProductIndexBO> productIndexBOList = buildProductIndexBOList(ufoProductList);
List<Product> productList = new ArrayList<>(Arrays.asList(product));
List<ProductIndexBO> productIndexBOList = buildProductIndexBOList(productList);
if (CollectionUtils.isEmpty(productIndexBOList)) {
return null;
}
return productIndexBOList.get(0);
}
private List<ProductIndexBO> buildProductIndexBOList(List<UfoProduct> ufoProductList) {
private List<ProductIndexBO> buildProductIndexBOList(List<Product> productList) {
List<ProductIndexBO> productIndexBOList = new ArrayList<>();
try {
//缓存中获取所有基础数据
... ... @@ -112,30 +116,30 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder {
Map<Integer, ProductSort> yohoSortMap = basicDataCacheService.getProductSort();
Map<String, ProductColor> yohoColorNameMap = basicDataCacheService.getColorNameMap();
Map<String, List<Size>> yohoSizeNameMap = basicDataCacheService.getSizeNameMap();
Map<Short, UfoBrand> ufoBrandMap = basicDataCacheService.getUfoBrand();
Map<Short, UfoBrandSeries> ufoBrandSeriesMap = basicDataCacheService.getUfoBrandSeries();
Map<Short, UfoSize> ufoSizeMap = basicDataCacheService.getUfoSize();
Map<Short, com.yoho.search.dal.model.ufo_product.Brand> ufoBrandMap = basicDataCacheService.getUfoBrand();
Map<Short, BrandSeries> ufoBrandSeriesMap = basicDataCacheService.getUfoBrandSeries();
Map<Short, Size> ufoSizeMap = basicDataCacheService.getUfoSize();
Map<Integer, Integer> ufoBrandRelation = basicDataCacheService.getUfoBrandRelationMap();
Map<Integer, UfoSearchSortRelation> ufoSortRelationMap = basicDataCacheService.getUfoSortRelationMap();
Map<Integer, SearchSortRelation> ufoSortRelationMap = basicDataCacheService.getUfoSortRelationMap();
List<Integer> ufoProductIdList = ufoProductList.stream().map(UfoProduct::getId).collect(Collectors.toList());
List<Integer> ufoProductIdList = productList.stream().map(Product::getId).collect(Collectors.toList());
//去查这一批ufo商品的goods,转换为map
List<UfoGoods> ufoGoodsList = ufoGoodsMapper.selectByProductIdList(ufoProductIdList);
Map<Integer, List<UfoGoods>> ufoGoodsMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoGoodsList)) {
ufoGoodsMap = ufoGoodsList.stream().collect(Collectors.groupingBy(UfoGoods::getProductId));
List<com.yoho.search.dal.model.ufo_product.Goods> goodsList = ufoGoodsMapper.selectByProductIdList(ufoProductIdList);
Map<Integer, List<Goods>> ufoGoodsMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(goodsList)) {
ufoGoodsMap = goodsList.stream().collect(Collectors.groupingBy(Goods::getProductId));
}
//去查这一批ufo商品的storage,转换为map
List<UfoStorage> ufoStorageList = ufoStorageMapper.selectByProductIdList(ufoProductIdList);
Map<Integer, List<UfoStorage>> ufoStorageMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoStorageList)) {
ufoStorageMap = ufoStorageList.stream().collect(Collectors.groupingBy(UfoStorage::getProductId));
List<Storage> storageList = ufoStorageMapper.selectByProductIdList(ufoProductIdList);
Map<Integer, List<Storage>> ufoStorageMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(storageList)) {
ufoStorageMap = storageList.stream().collect(Collectors.groupingBy(Storage::getProductId));
}
//去查这一批ufo商品的storage_price,转换为map
List<UfoStoragePrice> ufoStoragePriceList = ufoStoragePriceMapper.selectByProductIdList(ufoProductIdList);
Map<Integer, List<UfoStoragePrice>> ufoStoragePriceMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoStoragePriceList)) {
ufoStoragePriceMap = ufoStoragePriceList.stream().collect(Collectors.groupingBy(UfoStoragePrice::getProductId));
List<StoragePrice> storagePriceList = ufoStoragePriceMapper.selectByProductIdList(ufoProductIdList);
Map<Integer, List<StoragePrice>> ufoStoragePriceMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(storagePriceList)) {
ufoStoragePriceMap = storagePriceList.stream().collect(Collectors.groupingBy(StoragePrice::getProductId));
}
//去查这一批ufo商品的ufo_score_product_rule Set
List<Integer> ufoScoreProductRuleList = ufoScoreProductRuleMapper.selectByIdList(ufoProductIdList);
... ... @@ -144,26 +148,26 @@ public class UfoToYohoIndexBuilder extends IIndexBuilder {
ufoScoreProductRuleSet = ufoScoreProductRuleList.stream().collect(Collectors.toSet());
}
for (UfoProduct ufoProduct : ufoProductList) {
for (Product product : productList) {
//不合法id直接丢掉
if (!IdCheckUtils.isUfoIdLegal(ufoProduct.getId())) {
if (!IdCheckUtils.isUfoIdLegal(product.getId())) {
continue;
}
ProductIndexBO productIndexBO = new ProductIndexBO();
//一般字段
ufoToYohoGeneralService.build(productIndexBO, ufoProduct, ufoBrandSeriesMap);
ufoToYohoGeneralService.build(productIndexBO, product, ufoBrandSeriesMap);
//品牌
ufoToYohoBrandService.build(productIndexBO, ufoProduct, yohoBrandMap, ufoBrandMap, ufoBrandRelation);
ufoToYohoBrandService.build(productIndexBO, product, yohoBrandMap, ufoBrandMap, ufoBrandRelation);
//品类
ufoToYohoSortService.build(productIndexBO, ufoProduct, yohoSortMap, ufoSortRelationMap);
ufoToYohoSortService.build(productIndexBO, product, yohoSortMap, ufoSortRelationMap);
//颜色
ufoToYohoColorService.build(productIndexBO, ufoProduct, yohoColorNameMap, ufoGoodsMap);
ufoToYohoColorService.build(productIndexBO, product, yohoColorNameMap, ufoGoodsMap);
//尺码
ufoToYohoSizeService.build(productIndexBO, ufoProduct, ufoSizeMap, yohoSizeNameMap, ufoStorageMap);
ufoToYohoSizeService.build(productIndexBO, product, ufoSizeMap, yohoSizeNameMap, ufoStorageMap);
//价格
ufoToYohoPriceService.build(productIndexBO, ufoProduct, ufoStoragePriceMap,ufoStorageMap);
ufoToYohoPriceService.build(productIndexBO, product, ufoStoragePriceMap,ufoStorageMap);
//直通车
productIndexBO.setToAddScore(ufoScoreProductRuleSet.contains(ufoProduct.getId()) ? "Y" : "N");
productIndexBO.setToAddScore(ufoScoreProductRuleSet.contains(product.getId()) ? "Y" : "N");
productIndexBOList.add(productIndexBO);
}
return productIndexBOList;
... ...
... ... @@ -9,7 +9,7 @@ import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoBrandService;
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoBrand;
import com.yoho.search.dal.model.ufo_product.Brand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -18,7 +18,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_brand")
@SearchMqConsumerListerner(tableName = "ufo_product.brand")
public class UfoBrandMqListener extends AbstractMqListener {
@Autowired
... ... @@ -46,12 +46,12 @@ public class UfoBrandMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoBrand ufoBrand = ConvertUtils.toJavaObject(UfoBrand.class, data);
if (ufoBrand == null || ufoBrand.getId() == null) {
Brand brand = ConvertUtils.toJavaObject(Brand.class, data);
if (brand == null || brand.getId() == null) {
return;
}
ufoBrandService.saveOrUpdate(ufoBrand);
indexService.updateIndexData(this.getIndexName(), ufoBrand.getId().toString(), ufoBrand);
ufoBrandService.saveOrUpdate(brand);
indexService.updateIndexData(this.getIndexName(), brand.getId().toString(), brand);
}
@Override
... ...
... ... @@ -7,7 +7,7 @@ import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoBrandSeriesService;
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoBrandSeries;
import com.yoho.search.dal.model.ufo_product.BrandSeries;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -16,7 +16,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_brand_series")
@SearchMqConsumerListerner(tableName = "ufo_product.brand_series")
public class UfoBrandSeriesMqListener extends AbstractMqListener {
@Autowired
... ... @@ -36,11 +36,11 @@ public class UfoBrandSeriesMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoBrandSeries ufoBrandSeries = ConvertUtils.toJavaObject(UfoBrandSeries.class, data);
if (ufoBrandSeries == null || ufoBrandSeries.getId() == null) {
BrandSeries brandSeries = ConvertUtils.toJavaObject(BrandSeries.class, data);
if (brandSeries == null || brandSeries.getId() == null) {
return;
}
ufoBrandSeriesService.saveOrUpdate(ufoBrandSeries);
ufoBrandSeriesService.saveOrUpdate(brandSeries);
}
@Override
... ...
... ... @@ -5,10 +5,8 @@ import com.yoho.search.base.utils.ConvertUtils;
import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoBuyerOrderGoodsService;
import com.yoho.search.consumer.service.daoService.ufo.UfoGoodsImagesService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoBuyerOrderGoods;
import com.yoho.search.dal.model.UfoGoodsImages;
import com.yoho.search.dal.model.ufo_order.BuyerOrderGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -16,7 +14,7 @@ import org.springframework.stereotype.Component;
* Created by aaron.wang on 2018/12/5.
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_buyer_order_goods")
@SearchMqConsumerListerner(tableName = "ufo_order.buyer_order_goods")
public class UfoBuyerOrderGoodsMqListener extends AbstractMqListener {
@Autowired
... ... @@ -34,10 +32,10 @@ public class UfoBuyerOrderGoodsMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoBuyerOrderGoods ufoBuyerOrderGoods = ConvertUtils.toJavaObject(UfoBuyerOrderGoods.class, data);
if (ufoBuyerOrderGoods == null || ufoBuyerOrderGoods.getId() == null) {
BuyerOrderGoods buyerOrderGoods = ConvertUtils.toJavaObject(BuyerOrderGoods.class, data);
if (buyerOrderGoods == null || buyerOrderGoods.getId() == null) {
return;
}
ufoBuyerOrderGoodsService.saveOrUpdate(ufoBuyerOrderGoods);
ufoBuyerOrderGoodsService.saveOrUpdate(buyerOrderGoods);
}
}
... ...
... ... @@ -5,10 +5,8 @@ import com.yoho.search.base.utils.ConvertUtils;
import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoBuyerOrderService;
import com.yoho.search.consumer.service.daoService.ufo.UfoGoodsImagesService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoBuyerOrder;
import com.yoho.search.dal.model.UfoGoodsImages;
import com.yoho.search.dal.model.ufo_order.BuyerOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -16,7 +14,7 @@ import org.springframework.stereotype.Component;
* Created by aaron.wang on 2018/12/5.
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_buyer_order")
@SearchMqConsumerListerner(tableName = "ufo_order.buyer_order")
public class UfoBuyerOrderMqListener extends AbstractMqListener {
@Autowired
private UfoBuyerOrderService ufoBuyerOrderService;
... ... @@ -33,10 +31,10 @@ public class UfoBuyerOrderMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoBuyerOrder ufoBuyerOrder = ConvertUtils.toJavaObject(UfoBuyerOrder.class, data);
if (ufoBuyerOrder == null || ufoBuyerOrder.getId() == null) {
BuyerOrder buyerOrder = ConvertUtils.toJavaObject(BuyerOrder.class, data);
if (buyerOrder == null || buyerOrder.getId() == null) {
return;
}
ufoBuyerOrderService.saveOrUpdate(ufoBuyerOrder);
ufoBuyerOrderService.saveOrUpdate(buyerOrder);
}
}
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoGoodsImagesService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoGoodsImages;
import com.yoho.search.dal.model.ufo_product.GoodsImages;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_goods_images")
@SearchMqConsumerListerner(tableName = "ufo_product.goods_images")
public class UfoGoodsImagesMqListener extends AbstractMqListener {
@Autowired
... ... @@ -33,10 +33,10 @@ public class UfoGoodsImagesMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoGoodsImages ufoGoodsImages = ConvertUtils.toJavaObject(UfoGoodsImages.class, data);
if (ufoGoodsImages == null || ufoGoodsImages.getId() == null) {
GoodsImages goodsImages = ConvertUtils.toJavaObject(GoodsImages.class, data);
if (goodsImages == null || goodsImages.getId() == null) {
return;
}
ufoGoodsImagesService.saveOrUpdate(ufoGoodsImages);
ufoGoodsImagesService.saveOrUpdate(goodsImages);
}
}
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoGoodsService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoGoods;
import com.yoho.search.dal.model.ufo_product.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_goods")
@SearchMqConsumerListerner(tableName = "ufo_product.goods")
public class UfoGoodsMqListener extends AbstractMqListener {
@Autowired
... ... @@ -31,22 +31,22 @@ public class UfoGoodsMqListener extends AbstractMqListener {
@Override
protected void deleteData(String id) throws Exception {
UfoGoods ufoGoods = ufoGoodsService.getById(Integer.valueOf(id));
Goods goods = ufoGoodsService.getById(Integer.valueOf(id));
ufoGoodsService.delete(Integer.valueOf(id));
if (ufoGoods != null) {
ufoIndexUpdateHelper.updateUfoIndex(ufoGoods.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(ufoGoods.getProductId());
if (goods != null) {
ufoIndexUpdateHelper.updateUfoIndex(goods.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(goods.getProductId());
}
}
@Override
protected void updateData(JSONObject data) throws Exception {
UfoGoods ufoGoods = ConvertUtils.toJavaObject(UfoGoods.class, data);
if (ufoGoods == null || ufoGoods.getId() == null) {
Goods goods = ConvertUtils.toJavaObject(Goods.class, data);
if (goods == null || goods.getId() == null) {
return;
}
ufoGoodsService.saveOrUpdate(ufoGoods);
ufoIndexUpdateHelper.updateUfoIndex(ufoGoods.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(ufoGoods.getProductId());
ufoGoodsService.saveOrUpdate(goods);
ufoIndexUpdateHelper.updateUfoIndex(goods.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(goods.getProductId());
}
}
... ...
... ... @@ -8,7 +8,7 @@ import com.yoho.search.consumer.common.IYohoIndexService;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoProductColorService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoProductColor;
import com.yoho.search.dal.model.ufo_product.ProductColor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_product_color")
@SearchMqConsumerListerner(tableName = "ufo_product.product_color")
public class UfoProductColorMqListener extends AbstractMqListener {
@Autowired
... ... @@ -44,7 +44,7 @@ public class UfoProductColorMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoProductColor ProductColor = ConvertUtils.toJavaObject(UfoProductColor.class, data);
ProductColor ProductColor = ConvertUtils.toJavaObject(com.yoho.search.dal.model.ufo_product.ProductColor.class, data);
if (ProductColor == null || ProductColor.getId() == null) {
return;
}
... ...
... ... @@ -8,7 +8,7 @@ import com.yoho.search.consumer.common.IYohoIndexService;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoProductService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.ufo_product.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_product")
@SearchMqConsumerListerner(tableName = "ufo_product.product")
public class UfoProductMqListener extends AbstractMqListener {
@Autowired
... ... @@ -47,13 +47,13 @@ public class UfoProductMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoProduct ufoProduct = ConvertUtils.toJavaObject(UfoProduct.class, data);
if (ufoProduct == null || ufoProduct.getId() == null) {
Product product = ConvertUtils.toJavaObject(Product.class, data);
if (product == null || product.getId() == null) {
return;
}
ufoProductService.saveOrUpdate(ufoProduct);
ufoIndexUpdateHelper.updateUfoIndex(ufoProduct.getId());
ufoIndexUpdateHelper.updateYohoIndex(ufoProduct.getId());
ufoProductService.saveOrUpdate(product);
ufoIndexUpdateHelper.updateUfoIndex(product.getId());
ufoIndexUpdateHelper.updateYohoIndex(product.getId());
}
}
... ...
... ... @@ -7,7 +7,7 @@ import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoProductPoolDetailService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoProductPoolDetail;
import com.yoho.search.dal.model.ufo_product.ProductPoolDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -16,7 +16,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_product_pool_detail")
@SearchMqConsumerListerner(tableName = "ufo_product.product_pool_detail")
public class UfoProductPoolDetailMqListener extends AbstractMqListener {
@Autowired
... ... @@ -37,20 +37,20 @@ public class UfoProductPoolDetailMqListener extends AbstractMqListener {
@Override
protected void deleteData(String id) throws Exception {
UfoProductPoolDetail ufoProductPoolDetail = ufoProductPoolDetailService.getById(Integer.valueOf(id));
ProductPoolDetail productPoolDetail = ufoProductPoolDetailService.getById(Integer.valueOf(id));
ufoProductPoolDetailService.delete(Integer.valueOf(id));
if (ufoProductPoolDetail != null) {
ufoIndexUpdateHelper.updateUfoIndex(ufoProductPoolDetail.getProductId());
if (productPoolDetail != null) {
ufoIndexUpdateHelper.updateUfoIndex(productPoolDetail.getProductId());
}
}
@Override
protected void updateData(JSONObject data) throws Exception {
UfoProductPoolDetail ufoProductPoolDetail = ConvertUtils.toJavaObject(UfoProductPoolDetail.class, data);
if (ufoProductPoolDetail == null || ufoProductPoolDetail.getId() == null) {
ProductPoolDetail productPoolDetail = ConvertUtils.toJavaObject(ProductPoolDetail.class, data);
if (productPoolDetail == null || productPoolDetail.getId() == null) {
return;
}
ufoProductPoolDetailService.saveOrUpdate(ufoProductPoolDetail);
ufoIndexUpdateHelper.updateUfoIndex(ufoProductPoolDetail.getProductId());
ufoProductPoolDetailService.saveOrUpdate(productPoolDetail);
ufoIndexUpdateHelper.updateUfoIndex(productPoolDetail.getProductId());
}
}
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoProductPoolService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoProductPool;
import com.yoho.search.dal.model.ufo_product.ProductPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_product_pool")
@SearchMqConsumerListerner(tableName = "ufo_product.product_pool")
public class UfoProductPoolMqListener extends AbstractMqListener {
@Autowired
... ... @@ -33,10 +33,10 @@ public class UfoProductPoolMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoProductPool ufoProductPool = ConvertUtils.toJavaObject(UfoProductPool.class, data);
if (ufoProductPool == null || ufoProductPool.getId() == null) {
ProductPool productPool = ConvertUtils.toJavaObject(ProductPool.class, data);
if (productPool == null || productPool.getId() == null) {
return;
}
ufoProductPoolService.saveOrUpdate(ufoProductPool);
ufoProductPoolService.saveOrUpdate(productPool);
}
}
... ...
... ... @@ -8,7 +8,7 @@ import com.yoho.search.consumer.common.IYohoIndexService;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoProductSortService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoProductSort;
import com.yoho.search.dal.model.ufo_product.ProductSort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_product_sort")
@SearchMqConsumerListerner(tableName = "ufo_product.product_sort")
public class UfoProductSortMqListener extends AbstractMqListener {
@Autowired
... ... @@ -43,11 +43,11 @@ public class UfoProductSortMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoProductSort ufoProductSort = ConvertUtils.toJavaObject(UfoProductSort.class, data);
if (ufoProductSort == null || ufoProductSort.getId() == null) {
ProductSort productSort = ConvertUtils.toJavaObject(ProductSort.class, data);
if (productSort == null || productSort.getId() == null) {
return;
}
ufoProductSortService.saveOrUpdate(ufoProductSort);
indexService.updateIndexData(this.getIndexName(), ufoProductSort.getId().toString(), ufoProductSort);
ufoProductSortService.saveOrUpdate(productSort);
indexService.updateIndexData(this.getIndexName(), productSort.getId().toString(), productSort);
}
}
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.UfoScoreProductRuleMapper;
import com.yoho.search.dal.model.UfoScoreProductRule;
import com.yoho.search.dal.model.ufo_product.ScoreProductRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -29,28 +29,28 @@ public class UfoScoreProductRuleMqListener extends AbstractMqListener {
@Override
protected void deleteData(String id) throws Exception {
UfoScoreProductRule ufoScoreProductRule = ufoScoreProductRuleMapper.selectByPrimaryKey(Integer.valueOf(id));
ScoreProductRule scoreProductRule = ufoScoreProductRuleMapper.selectByPrimaryKey(Integer.valueOf(id));
ufoScoreProductRuleMapper.deleteByPrimaryKey(Integer.valueOf(id));
if (ufoScoreProductRule != null) {
ufoIndexUpdateHelper.updateYohoIndex(ufoScoreProductRule.getProductId());
if (scoreProductRule != null) {
ufoIndexUpdateHelper.updateYohoIndex(scoreProductRule.getProductId());
}
}
@Override
protected void updateData(JSONObject data) throws Exception {
UfoScoreProductRule ufoScoreProductRule = ConvertUtils.toJavaObject(UfoScoreProductRule.class, data);
if (ufoScoreProductRule == null || ufoScoreProductRule.getId() == null) {
ScoreProductRule scoreProductRule = ConvertUtils.toJavaObject(ScoreProductRule.class, data);
if (scoreProductRule == null || scoreProductRule.getId() == null) {
return;
}
this.saveOrUpdate(ufoScoreProductRule);
ufoIndexUpdateHelper.updateYohoIndex(ufoScoreProductRule.getProductId());
this.saveOrUpdate(scoreProductRule);
ufoIndexUpdateHelper.updateYohoIndex(scoreProductRule.getProductId());
}
private int saveOrUpdate(UfoScoreProductRule ufoScoreProductRule) {
if (ufoScoreProductRule.getId() == null || ufoScoreProductRuleMapper.selectByPrimaryKey(ufoScoreProductRule.getId()) == null) {
return ufoScoreProductRuleMapper.insertSelective(ufoScoreProductRule);
private int saveOrUpdate(ScoreProductRule scoreProductRule) {
if (scoreProductRule.getId() == null || ufoScoreProductRuleMapper.selectByPrimaryKey(scoreProductRule.getId()) == null) {
return ufoScoreProductRuleMapper.insertSelective(scoreProductRule);
} else {
return ufoScoreProductRuleMapper.updateByPrimaryKeySelective(ufoScoreProductRule);
return ufoScoreProductRuleMapper.updateByPrimaryKeySelective(scoreProductRule);
}
}
}
... ...
... ... @@ -7,7 +7,7 @@ import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoSearchSortRelationService;
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoSearchSortRelation;
import com.yoho.search.dal.model.ufo_product.SearchSortRelation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -16,7 +16,7 @@ import org.springframework.stereotype.Component;
* @version 2018/11/8
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_search_sort_relation")
@SearchMqConsumerListerner(tableName = "ufo_product.search_sort_relation")
public class UfoSearchSortRelationMqListener extends AbstractMqListener {
@Autowired
... ... @@ -36,11 +36,11 @@ public class UfoSearchSortRelationMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoSearchSortRelation ufoSearchSortRelation = ConvertUtils.toJavaObject(UfoSearchSortRelation.class, data);
if (ufoSearchSortRelation == null || ufoSearchSortRelation.getUfoSortId() == null) {
SearchSortRelation searchSortRelation = ConvertUtils.toJavaObject(SearchSortRelation.class, data);
if (searchSortRelation == null || searchSortRelation.getUfoSortId() == null) {
return;
}
ufoSearchSortRelationService.saveOrUpdate(ufoSearchSortRelation);
ufoSearchSortRelationService.saveOrUpdate(searchSortRelation);
}
@Override
... ...
... ... @@ -9,7 +9,7 @@ import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoSizeService;
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoSize;
import com.yoho.search.dal.model.ufo_product.Size;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -18,7 +18,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_size")
@SearchMqConsumerListerner(tableName = "ufo_product.size")
public class UfoSizeMqListener extends AbstractMqListener {
@Autowired
... ... @@ -46,12 +46,12 @@ public class UfoSizeMqListener extends AbstractMqListener {
@Override
protected void updateData(JSONObject data) throws Exception {
UfoSize ufoSize = ConvertUtils.toJavaObject(UfoSize.class, data);
if (ufoSize == null || ufoSize.getId() == null) {
Size size = ConvertUtils.toJavaObject(Size.class, data);
if (size == null || size.getId() == null) {
return;
}
ufoSizeService.saveOrUpdate(ufoSize);
indexService.updateIndexData(this.getIndexName(), ufoSize.getId().toString(), ufoSize);
ufoSizeService.saveOrUpdate(size);
indexService.updateIndexData(this.getIndexName(), size.getId().toString(), size);
}
@Override
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoStorageService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoStorage;
import com.yoho.search.dal.model.ufo_product.Storage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_storage")
@SearchMqConsumerListerner(tableName = "ufo_product.storage")
public class UfoStorageMqListener extends AbstractMqListener {
@Autowired
... ... @@ -30,23 +30,23 @@ public class UfoStorageMqListener extends AbstractMqListener {
@Override
protected void deleteData(String id) throws Exception {
UfoStorage ufoStorage = ufoStorageService.getById(Integer.valueOf(id));
Storage storage = ufoStorageService.getById(Integer.valueOf(id));
ufoStorageService.delete(Integer.valueOf(id));
if (ufoStorage != null) {
ufoIndexUpdateHelper.updateUfoIndex(ufoStorage.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(ufoStorage.getProductId());
if (storage != null) {
ufoIndexUpdateHelper.updateUfoIndex(storage.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(storage.getProductId());
}
}
@Override
protected void updateData(JSONObject data) throws Exception {
UfoStorage ufoStorage = ConvertUtils.toJavaObject(UfoStorage.class, data);
if (ufoStorage == null || ufoStorage.getId() == null) {
Storage storage = ConvertUtils.toJavaObject(Storage.class, data);
if (storage == null || storage.getId() == null) {
return;
}
ufoStorageService.saveOrUpdate(ufoStorage);
ufoIndexUpdateHelper.updateUfoIndex(ufoStorage.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(ufoStorage.getProductId());
ufoStorageService.saveOrUpdate(storage);
ufoIndexUpdateHelper.updateUfoIndex(storage.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(storage.getProductId());
}
}
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoStoragePriceService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoStoragePrice;
import com.yoho.search.dal.model.ufo_product.StoragePrice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
* @version 2018/9/11
*/
@Component
@SearchMqConsumerListerner(tableName = "ufo_storage_price")
@SearchMqConsumerListerner(tableName = "ufo_product.storage_price")
public class UfoStoragePriceMqListener extends AbstractMqListener {
@Autowired
... ... @@ -30,23 +30,23 @@ public class UfoStoragePriceMqListener extends AbstractMqListener {
@Override
protected void deleteData(String id) throws Exception {
UfoStoragePrice ufoStoragePrice = ufoStoragePriceService.getById(Integer.valueOf(id));
StoragePrice storagePrice = ufoStoragePriceService.getById(Integer.valueOf(id));
ufoStoragePriceService.delete(Integer.valueOf(id));
if (ufoStoragePrice != null) {
ufoIndexUpdateHelper.updateUfoIndex(ufoStoragePrice.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(ufoStoragePrice.getProductId());
if (storagePrice != null) {
ufoIndexUpdateHelper.updateUfoIndex(storagePrice.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(storagePrice.getProductId());
}
}
@Override
protected void updateData(JSONObject data) throws Exception {
UfoStoragePrice ufoStoragePrice = ConvertUtils.toJavaObject(UfoStoragePrice.class, data);
if (ufoStoragePrice == null || ufoStoragePrice.getId() == null) {
StoragePrice storagePrice = ConvertUtils.toJavaObject(StoragePrice.class, data);
if (storagePrice == null || storagePrice.getId() == null) {
return;
}
ufoStoragePriceService.saveOrUpdate(ufoStoragePrice);
ufoIndexUpdateHelper.updateUfoIndex(ufoStoragePrice.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(ufoStoragePrice.getProductId());
ufoStoragePriceService.saveOrUpdate(storagePrice);
ufoIndexUpdateHelper.updateUfoIndex(storagePrice.getProductId());
ufoIndexUpdateHelper.updateYohoIndex(storagePrice.getProductId());
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoBrandSeriesMapper;
import com.yoho.search.dal.model.UfoBrandSeries;
import com.yoho.search.dal.model.ufo_product.BrandSeries;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoBrandSeriesService {
@Autowired
private UfoBrandSeriesMapper ufoBrandSeriesMapper;
public UfoBrandSeries getById(Short id) {
public BrandSeries getById(Short id) {
return ufoBrandSeriesMapper.selectByPrimaryKey(id);
}
public int insert(UfoBrandSeries ufoBrandSeries) {
return ufoBrandSeriesMapper.insertSelective(ufoBrandSeries);
public int insert(BrandSeries brandSeries) {
return ufoBrandSeriesMapper.insertSelective(brandSeries);
}
public int update(UfoBrandSeries ufoBrandSeries) {
return ufoBrandSeriesMapper.updateByPrimaryKeySelective(ufoBrandSeries);
public int update(BrandSeries brandSeries) {
return ufoBrandSeriesMapper.updateByPrimaryKeySelective(brandSeries);
}
public int saveOrUpdate(UfoBrandSeries ufoBrandSeries) {
if (ufoBrandSeries.getId() == null || ufoBrandSeriesMapper.selectByPrimaryKey(ufoBrandSeries.getId()) == null) {
return ufoBrandSeriesMapper.insertSelective(ufoBrandSeries);
public int saveOrUpdate(BrandSeries brandSeries) {
if (brandSeries.getId() == null || ufoBrandSeriesMapper.selectByPrimaryKey(brandSeries.getId()) == null) {
return ufoBrandSeriesMapper.insertSelective(brandSeries);
} else {
return ufoBrandSeriesMapper.updateByPrimaryKeySelective(ufoBrandSeries);
return ufoBrandSeriesMapper.updateByPrimaryKeySelective(brandSeries);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoBrandMapper;
import com.yoho.search.dal.model.UfoBrand;
import com.yoho.search.dal.model.ufo_product.Brand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoBrandService {
@Autowired
private UfoBrandMapper ufoBrandMapper;
public UfoBrand getById(Short id) {
public Brand getById(Short id) {
return ufoBrandMapper.selectByPrimaryKey(id);
}
public int insert(UfoBrand ufoBrand) {
return ufoBrandMapper.insertSelective(ufoBrand);
public int insert(Brand brand) {
return ufoBrandMapper.insertSelective(brand);
}
public int update(UfoBrand ufoBrand) {
return ufoBrandMapper.updateByPrimaryKeySelective(ufoBrand);
public int update(Brand brand) {
return ufoBrandMapper.updateByPrimaryKeySelective(brand);
}
public int saveOrUpdate(UfoBrand ufoBrand) {
if (ufoBrand.getId() == null || ufoBrandMapper.selectByPrimaryKey(ufoBrand.getId()) == null) {
return ufoBrandMapper.insertSelective(ufoBrand);
public int saveOrUpdate(Brand brand) {
if (brand.getId() == null || ufoBrandMapper.selectByPrimaryKey(brand.getId()) == null) {
return ufoBrandMapper.insertSelective(brand);
} else {
return ufoBrandMapper.updateByPrimaryKeySelective(ufoBrand);
return ufoBrandMapper.updateByPrimaryKeySelective(brand);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoBuyerOrderGoodsMapper;
import com.yoho.search.dal.UfoBuyerOrderMapper;
import com.yoho.search.dal.model.UfoBuyerOrder;
import com.yoho.search.dal.model.UfoBuyerOrderGoods;
import com.yoho.search.dal.model.ufo_order.BuyerOrderGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -15,23 +13,23 @@ public class UfoBuyerOrderGoodsService{
@Autowired
private UfoBuyerOrderGoodsMapper ufoBuyerOrderGoodsMapper;
public UfoBuyerOrderGoods getById(Integer id) {
public BuyerOrderGoods getById(Integer id) {
return ufoBuyerOrderGoodsMapper.selectByPrimaryKey(id);
}
public int insert(UfoBuyerOrderGoods ufoBuyerOrderGoods) {
return ufoBuyerOrderGoodsMapper.insertSelective(ufoBuyerOrderGoods);
public int insert(BuyerOrderGoods buyerOrderGoods) {
return ufoBuyerOrderGoodsMapper.insertSelective(buyerOrderGoods);
}
public int update(UfoBuyerOrderGoods ufoBuyerOrderGoods) {
return ufoBuyerOrderGoodsMapper.updateByPrimaryKeySelective(ufoBuyerOrderGoods);
public int update(BuyerOrderGoods buyerOrderGoods) {
return ufoBuyerOrderGoodsMapper.updateByPrimaryKeySelective(buyerOrderGoods);
}
public int saveOrUpdate(UfoBuyerOrderGoods ufoBuyerOrderGoods) {
if (ufoBuyerOrderGoods.getId() == null || ufoBuyerOrderGoodsMapper.selectByPrimaryKey(ufoBuyerOrderGoods.getId()) == null) {
return ufoBuyerOrderGoodsMapper.insertSelective(ufoBuyerOrderGoods);
public int saveOrUpdate(BuyerOrderGoods buyerOrderGoods) {
if (buyerOrderGoods.getId() == null || ufoBuyerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getId()) == null) {
return ufoBuyerOrderGoodsMapper.insertSelective(buyerOrderGoods);
} else {
return ufoBuyerOrderGoodsMapper.updateByPrimaryKeySelective(ufoBuyerOrderGoods);
return ufoBuyerOrderGoodsMapper.updateByPrimaryKeySelective(buyerOrderGoods);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoBrandMapper;
import com.yoho.search.dal.UfoBuyerOrderMapper;
import com.yoho.search.dal.model.UfoBrand;
import com.yoho.search.dal.model.UfoBuyerOrder;
import com.yoho.search.dal.model.ufo_order.BuyerOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -15,23 +13,23 @@ public class UfoBuyerOrderService {
@Autowired
private UfoBuyerOrderMapper ufoBuyerOrderMapper;
public UfoBuyerOrder getById(Integer id) {
public BuyerOrder getById(Integer id) {
return ufoBuyerOrderMapper.selectByPrimaryKey(id);
}
public int insert(UfoBuyerOrder ufoBuyerOrder) {
return ufoBuyerOrderMapper.insertSelective(ufoBuyerOrder);
public int insert(BuyerOrder buyerOrder) {
return ufoBuyerOrderMapper.insertSelective(buyerOrder);
}
public int update(UfoBuyerOrder ufoBuyerOrder) {
return ufoBuyerOrderMapper.updateByPrimaryKeySelective(ufoBuyerOrder);
public int update(BuyerOrder buyerOrder) {
return ufoBuyerOrderMapper.updateByPrimaryKeySelective(buyerOrder);
}
public int saveOrUpdate(UfoBuyerOrder ufoBuyerOrder) {
if (ufoBuyerOrder.getId() == null || ufoBuyerOrderMapper.selectByPrimaryKey(ufoBuyerOrder.getId()) == null) {
return ufoBuyerOrderMapper.insertSelective(ufoBuyerOrder);
public int saveOrUpdate(BuyerOrder buyerOrder) {
if (buyerOrder.getId() == null || ufoBuyerOrderMapper.selectByPrimaryKey(buyerOrder.getId()) == null) {
return ufoBuyerOrderMapper.insertSelective(buyerOrder);
} else {
return ufoBuyerOrderMapper.updateByPrimaryKeySelective(ufoBuyerOrder);
return ufoBuyerOrderMapper.updateByPrimaryKeySelective(buyerOrder);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoGoodsImagesMapper;
import com.yoho.search.dal.model.UfoGoodsImages;
import com.yoho.search.dal.model.ufo_product.GoodsImages;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoGoodsImagesService {
@Autowired
private UfoGoodsImagesMapper ufoGoodsImagesMapper;
public UfoGoodsImages getById(Integer id) {
public GoodsImages getById(Integer id) {
return ufoGoodsImagesMapper.selectByPrimaryKey(id);
}
public int insert(UfoGoodsImages ufoGoodsImages) {
return ufoGoodsImagesMapper.insertSelective(ufoGoodsImages);
public int insert(GoodsImages goodsImages) {
return ufoGoodsImagesMapper.insertSelective(goodsImages);
}
public int update(UfoGoodsImages ufoGoodsImages) {
return ufoGoodsImagesMapper.updateByPrimaryKeySelective(ufoGoodsImages);
public int update(GoodsImages goodsImages) {
return ufoGoodsImagesMapper.updateByPrimaryKeySelective(goodsImages);
}
public int saveOrUpdate(UfoGoodsImages ufoGoodsImages) {
if (ufoGoodsImages.getId() == null || ufoGoodsImagesMapper.selectByPrimaryKey(ufoGoodsImages.getId()) == null) {
return ufoGoodsImagesMapper.insertSelective(ufoGoodsImages);
public int saveOrUpdate(GoodsImages goodsImages) {
if (goodsImages.getId() == null || ufoGoodsImagesMapper.selectByPrimaryKey(goodsImages.getId()) == null) {
return ufoGoodsImagesMapper.insertSelective(goodsImages);
} else {
return ufoGoodsImagesMapper.updateByPrimaryKeySelective(ufoGoodsImages);
return ufoGoodsImagesMapper.updateByPrimaryKeySelective(goodsImages);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoGoodsMapper;
import com.yoho.search.dal.model.UfoGoods;
import com.yoho.search.dal.model.ufo_product.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoGoodsService {
@Autowired
private UfoGoodsMapper ufoGoodsMapper;
public UfoGoods getById(Integer id) {
public Goods getById(Integer id) {
return ufoGoodsMapper.selectByPrimaryKey(id);
}
public int insert(UfoGoods ufoGoods) {
return ufoGoodsMapper.insertSelective(ufoGoods);
public int insert(Goods goods) {
return ufoGoodsMapper.insertSelective(goods);
}
public int update(UfoGoods ufoGoods) {
return ufoGoodsMapper.updateByPrimaryKeySelective(ufoGoods);
public int update(Goods goods) {
return ufoGoodsMapper.updateByPrimaryKeySelective(goods);
}
public int saveOrUpdate(UfoGoods ufoGoods) {
if (ufoGoods.getId() == null || ufoGoodsMapper.selectByPrimaryKey(ufoGoods.getId()) == null) {
return ufoGoodsMapper.insertSelective(ufoGoods);
public int saveOrUpdate(Goods goods) {
if (goods.getId() == null || ufoGoodsMapper.selectByPrimaryKey(goods.getId()) == null) {
return ufoGoodsMapper.insertSelective(goods);
} else {
return ufoGoodsMapper.updateByPrimaryKeySelective(ufoGoods);
return ufoGoodsMapper.updateByPrimaryKeySelective(goods);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoProductColorMapper;
import com.yoho.search.dal.model.UfoProductColor;
import com.yoho.search.dal.model.ufo_product.ProductColor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoProductColorService {
@Autowired
private UfoProductColorMapper ufoProductColorMapper;
public UfoProductColor getById(Short id) {
public ProductColor getById(Short id) {
return ufoProductColorMapper.selectByPrimaryKey(id);
}
public int insert(UfoProductColor ufoProductColor) {
return ufoProductColorMapper.insertSelective(ufoProductColor);
public int insert(ProductColor productColor) {
return ufoProductColorMapper.insertSelective(productColor);
}
public int update(UfoProductColor ufoProductColor) {
return ufoProductColorMapper.updateByPrimaryKeySelective(ufoProductColor);
public int update(ProductColor productColor) {
return ufoProductColorMapper.updateByPrimaryKeySelective(productColor);
}
public int saveOrUpdate(UfoProductColor ufoProductColor) {
if (ufoProductColor.getId() == null || ufoProductColorMapper.selectByPrimaryKey(ufoProductColor.getId()) == null) {
return ufoProductColorMapper.insertSelective(ufoProductColor);
public int saveOrUpdate(ProductColor productColor) {
if (productColor.getId() == null || ufoProductColorMapper.selectByPrimaryKey(productColor.getId()) == null) {
return ufoProductColorMapper.insertSelective(productColor);
} else {
return ufoProductColorMapper.updateByPrimaryKeySelective(ufoProductColor);
return ufoProductColorMapper.updateByPrimaryKeySelective(productColor);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoProductPoolDetailMapper;
import com.yoho.search.dal.model.UfoProductPoolDetail;
import com.yoho.search.dal.model.ufo_product.ProductPoolDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoProductPoolDetailService {
@Autowired
private UfoProductPoolDetailMapper ufoProductPoolDetailMapper;
public UfoProductPoolDetail getById(Integer id) {
public ProductPoolDetail getById(Integer id) {
return ufoProductPoolDetailMapper.selectByPrimaryKey(id);
}
public int insert(UfoProductPoolDetail ufoProductPoolDetail) {
return ufoProductPoolDetailMapper.insertSelective(ufoProductPoolDetail);
public int insert(ProductPoolDetail productPoolDetail) {
return ufoProductPoolDetailMapper.insertSelective(productPoolDetail);
}
public int update(UfoProductPoolDetail ufoProductPoolDetail) {
return ufoProductPoolDetailMapper.updateByPrimaryKeySelective(ufoProductPoolDetail);
public int update(ProductPoolDetail productPoolDetail) {
return ufoProductPoolDetailMapper.updateByPrimaryKeySelective(productPoolDetail);
}
public int saveOrUpdate(UfoProductPoolDetail ufoProductPoolDetail) {
if (ufoProductPoolDetail.getId() == null || ufoProductPoolDetailMapper.selectByPrimaryKey(ufoProductPoolDetail.getId()) == null) {
return ufoProductPoolDetailMapper.insertSelective(ufoProductPoolDetail);
public int saveOrUpdate(ProductPoolDetail productPoolDetail) {
if (productPoolDetail.getId() == null || ufoProductPoolDetailMapper.selectByPrimaryKey(productPoolDetail.getId()) == null) {
return ufoProductPoolDetailMapper.insertSelective(productPoolDetail);
} else {
return ufoProductPoolDetailMapper.updateByPrimaryKeySelective(ufoProductPoolDetail);
return ufoProductPoolDetailMapper.updateByPrimaryKeySelective(productPoolDetail);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoProductPoolMapper;
import com.yoho.search.dal.model.UfoProductPool;
import com.yoho.search.dal.model.ufo_product.ProductPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoProductPoolService {
@Autowired
private UfoProductPoolMapper ufoProductPoolMapper;
public UfoProductPool getById(Integer id) {
public ProductPool getById(Integer id) {
return ufoProductPoolMapper.selectByPrimaryKey(id);
}
public int insert(UfoProductPool ufoProductPool) {
return ufoProductPoolMapper.insertSelective(ufoProductPool);
public int insert(ProductPool productPool) {
return ufoProductPoolMapper.insertSelective(productPool);
}
public int update(UfoProductPool ufoProductPool) {
return ufoProductPoolMapper.updateByPrimaryKeySelective(ufoProductPool);
public int update(ProductPool productPool) {
return ufoProductPoolMapper.updateByPrimaryKeySelective(productPool);
}
public int saveOrUpdate(UfoProductPool ufoProductPool) {
if (ufoProductPool.getId() == null || ufoProductPoolMapper.selectByPrimaryKey(ufoProductPool.getId()) == null) {
return ufoProductPoolMapper.insertSelective(ufoProductPool);
public int saveOrUpdate(ProductPool productPool) {
if (productPool.getId() == null || ufoProductPoolMapper.selectByPrimaryKey(productPool.getId()) == null) {
return ufoProductPoolMapper.insertSelective(productPool);
} else {
return ufoProductPoolMapper.updateByPrimaryKeySelective(ufoProductPool);
return ufoProductPoolMapper.updateByPrimaryKeySelective(productPool);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoProductMapper;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.ufo_product.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,19 +14,19 @@ public class UfoProductService {
@Autowired
private UfoProductMapper sizeMapper;
public UfoProduct getById(Integer id) {
public Product getById(Integer id) {
return sizeMapper.selectByPrimaryKey(id);
}
public int insert(UfoProduct size) {
public int insert(Product size) {
return sizeMapper.insertSelective(size);
}
public int update(UfoProduct size) {
public int update(Product size) {
return sizeMapper.updateByPrimaryKeySelective(size);
}
public int saveOrUpdate(UfoProduct size) {
public int saveOrUpdate(Product size) {
if (size.getId() == null || sizeMapper.selectByPrimaryKey(size.getId()) == null) {
return sizeMapper.insertSelective(size);
} else {
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoProductSortMapper;
import com.yoho.search.dal.model.UfoProductSort;
import com.yoho.search.dal.model.ufo_product.ProductSort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoProductSortService {
@Autowired
private UfoProductSortMapper ufoProductSortMapper;
public UfoProductSort getById(Short id) {
public ProductSort getById(Short id) {
return ufoProductSortMapper.selectByPrimaryKey(id);
}
public int insert(UfoProductSort ufoProductSort) {
return ufoProductSortMapper.insertSelective(ufoProductSort);
public int insert(ProductSort productSort) {
return ufoProductSortMapper.insertSelective(productSort);
}
public int update(UfoProductSort ufoProductSort) {
return ufoProductSortMapper.updateByPrimaryKeySelective(ufoProductSort);
public int update(ProductSort productSort) {
return ufoProductSortMapper.updateByPrimaryKeySelective(productSort);
}
public int saveOrUpdate(UfoProductSort ufoProductSort) {
if (ufoProductSort.getId() == null || ufoProductSortMapper.selectByPrimaryKey(ufoProductSort.getId()) == null) {
return ufoProductSortMapper.insertSelective(ufoProductSort);
public int saveOrUpdate(ProductSort productSort) {
if (productSort.getId() == null || ufoProductSortMapper.selectByPrimaryKey(productSort.getId()) == null) {
return ufoProductSortMapper.insertSelective(productSort);
} else {
return ufoProductSortMapper.updateByPrimaryKeySelective(ufoProductSort);
return ufoProductSortMapper.updateByPrimaryKeySelective(productSort);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoSearchSortRelationMapper;
import com.yoho.search.dal.model.UfoSearchSortRelation;
import com.yoho.search.dal.model.ufo_product.SearchSortRelation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoSearchSortRelationService {
@Autowired
private UfoSearchSortRelationMapper ufoSearchSortRelationMapper;
public UfoSearchSortRelation getById(Integer id) {
public SearchSortRelation getById(Integer id) {
return ufoSearchSortRelationMapper.selectByPrimaryKey(id);
}
public int insert(UfoSearchSortRelation ufoSearchSortRelation) {
return ufoSearchSortRelationMapper.insertSelective(ufoSearchSortRelation);
public int insert(SearchSortRelation searchSortRelation) {
return ufoSearchSortRelationMapper.insertSelective(searchSortRelation);
}
public int update(UfoSearchSortRelation ufoSearchSortRelation) {
return ufoSearchSortRelationMapper.updateByPrimaryKeySelective(ufoSearchSortRelation);
public int update(SearchSortRelation searchSortRelation) {
return ufoSearchSortRelationMapper.updateByPrimaryKeySelective(searchSortRelation);
}
public int saveOrUpdate(UfoSearchSortRelation ufoSearchSortRelation) {
if (ufoSearchSortRelation.getUfoSortId() == null || ufoSearchSortRelationMapper.selectByPrimaryKey(ufoSearchSortRelation.getUfoSortId()) == null) {
return ufoSearchSortRelationMapper.insertSelective(ufoSearchSortRelation);
public int saveOrUpdate(SearchSortRelation searchSortRelation) {
if (searchSortRelation.getUfoSortId() == null || ufoSearchSortRelationMapper.selectByPrimaryKey(searchSortRelation.getUfoSortId()) == null) {
return ufoSearchSortRelationMapper.insertSelective(searchSortRelation);
} else {
return ufoSearchSortRelationMapper.updateByPrimaryKeySelective(ufoSearchSortRelation);
return ufoSearchSortRelationMapper.updateByPrimaryKeySelective(searchSortRelation);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoSizeMapper;
import com.yoho.search.dal.model.UfoSize;
import com.yoho.search.dal.model.ufo_product.Size;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoSizeService {
@Autowired
private UfoSizeMapper ufoSizeMapper;
public UfoSize getById(Short id) {
public Size getById(Short id) {
return ufoSizeMapper.selectByPrimaryKey(id);
}
public int insert(UfoSize ufoSize) {
return ufoSizeMapper.insertSelective(ufoSize);
public int insert(Size size) {
return ufoSizeMapper.insertSelective(size);
}
public int update(UfoSize ufoSize) {
return ufoSizeMapper.updateByPrimaryKeySelective(ufoSize);
public int update(Size size) {
return ufoSizeMapper.updateByPrimaryKeySelective(size);
}
public int saveOrUpdate(UfoSize ufoSize) {
if (ufoSize.getId() == null || ufoSizeMapper.selectByPrimaryKey(ufoSize.getId()) == null) {
return ufoSizeMapper.insertSelective(ufoSize);
public int saveOrUpdate(Size size) {
if (size.getId() == null || ufoSizeMapper.selectByPrimaryKey(size.getId()) == null) {
return ufoSizeMapper.insertSelective(size);
} else {
return ufoSizeMapper.updateByPrimaryKeySelective(ufoSize);
return ufoSizeMapper.updateByPrimaryKeySelective(size);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoStoragePriceMapper;
import com.yoho.search.dal.model.UfoStoragePrice;
import com.yoho.search.dal.model.ufo_product.StoragePrice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoStoragePriceService {
@Autowired
private UfoStoragePriceMapper ufoStoragePriceMapper;
public UfoStoragePrice getById(Integer id) {
public StoragePrice getById(Integer id) {
return ufoStoragePriceMapper.selectByPrimaryKey(id);
}
public int insert(UfoStoragePrice ufoStoragePrice) {
return ufoStoragePriceMapper.insertSelective(ufoStoragePrice);
public int insert(StoragePrice storagePrice) {
return ufoStoragePriceMapper.insertSelective(storagePrice);
}
public int update(UfoStoragePrice ufoStoragePrice) {
return ufoStoragePriceMapper.updateByPrimaryKeySelective(ufoStoragePrice);
public int update(StoragePrice storagePrice) {
return ufoStoragePriceMapper.updateByPrimaryKeySelective(storagePrice);
}
public int saveOrUpdate(UfoStoragePrice ufoStoragePrice) {
if (ufoStoragePrice.getId() == null || ufoStoragePriceMapper.selectByPrimaryKey(ufoStoragePrice.getId()) == null) {
return ufoStoragePriceMapper.insertSelective(ufoStoragePrice);
public int saveOrUpdate(StoragePrice storagePrice) {
if (storagePrice.getId() == null || ufoStoragePriceMapper.selectByPrimaryKey(storagePrice.getId()) == null) {
return ufoStoragePriceMapper.insertSelective(storagePrice);
} else {
return ufoStoragePriceMapper.updateByPrimaryKeySelective(ufoStoragePrice);
return ufoStoragePriceMapper.updateByPrimaryKeySelective(storagePrice);
}
}
... ...
package com.yoho.search.consumer.service.daoService.ufo;
import com.yoho.search.dal.UfoStorageMapper;
import com.yoho.search.dal.model.UfoStorage;
import com.yoho.search.dal.model.ufo_product.Storage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -14,23 +14,23 @@ public class UfoStorageService {
@Autowired
private UfoStorageMapper ufoStorageMapper;
public UfoStorage getById(Integer id) {
public Storage getById(Integer id) {
return ufoStorageMapper.selectByPrimaryKey(id);
}
public int insert(UfoStorage ufoStorage) {
return ufoStorageMapper.insertSelective(ufoStorage);
public int insert(Storage storage) {
return ufoStorageMapper.insertSelective(storage);
}
public int update(UfoStorage ufoStorage) {
return ufoStorageMapper.updateByPrimaryKeySelective(ufoStorage);
public int update(Storage storage) {
return ufoStorageMapper.updateByPrimaryKeySelective(storage);
}
public int saveOrUpdate(UfoStorage ufoStorage) {
if (ufoStorage.getId() == null || ufoStorageMapper.selectByPrimaryKey(ufoStorage.getId()) == null) {
return ufoStorageMapper.insertSelective(ufoStorage);
public int saveOrUpdate(Storage storage) {
if (storage.getId() == null || ufoStorageMapper.selectByPrimaryKey(storage.getId()) == null) {
return ufoStorageMapper.insertSelective(storage);
} else {
return ufoStorageMapper.updateByPrimaryKeySelective(ufoStorage);
return ufoStorageMapper.updateByPrimaryKeySelective(storage);
}
}
... ...
... ... @@ -4,6 +4,11 @@ import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.yoho.search.dal.model.*;
import com.yoho.search.dal.model.Brand;
import com.yoho.search.dal.model.ProductColor;
import com.yoho.search.dal.model.ProductSort;
import com.yoho.search.dal.model.Size;
import com.yoho.search.dal.model.ufo_product.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -398,15 +403,15 @@ public class BasicDataCacheService {
}
//UFO品牌
LoadingCache<String, Map<Short, UfoBrand>> ufoBrandCache = CacheBuilder.newBuilder()
LoadingCache<String, Map<Short, com.yoho.search.dal.model.ufo_product.Brand>> ufoBrandCache = CacheBuilder.newBuilder()
.expireAfterWrite(10, TimeUnit.MINUTES)
.build(new CacheLoader<String, Map<Short, UfoBrand>>() {
public Map<Short, UfoBrand> load(String key) {
.build(new CacheLoader<String, Map<Short, com.yoho.search.dal.model.ufo_product.Brand>>() {
public Map<Short, com.yoho.search.dal.model.ufo_product.Brand> load(String key) {
return basicDataLogicService.getUfoBrandMap();
}
});
public Map<Short, UfoBrand> getUfoBrand() {
public Map<Short, com.yoho.search.dal.model.ufo_product.Brand> getUfoBrand() {
try {
return ufoBrandCache.get(UFO_BRAND_CACHE_KEY);
} catch (Exception e) {
... ... @@ -420,15 +425,15 @@ public class BasicDataCacheService {
}
//UFO系列
LoadingCache<String, Map<Short, UfoBrandSeries>> ufoBrandSeriesCache = CacheBuilder.newBuilder()
LoadingCache<String, Map<Short, BrandSeries>> ufoBrandSeriesCache = CacheBuilder.newBuilder()
.expireAfterWrite(10, TimeUnit.MINUTES)
.build(new CacheLoader<String, Map<Short, UfoBrandSeries>>() {
public Map<Short, UfoBrandSeries> load(String key) {
.build(new CacheLoader<String, Map<Short, BrandSeries>>() {
public Map<Short, BrandSeries> load(String key) {
return basicDataLogicService.getUfoBrandSeriesMap();
}
});
public Map<Short, UfoBrandSeries> getUfoBrandSeries() {
public Map<Short, BrandSeries> getUfoBrandSeries() {
try {
return ufoBrandSeriesCache.get(UFO_BRAND_SERIES_CACHE_KEY);
} catch (Exception e) {
... ... @@ -443,15 +448,15 @@ public class BasicDataCacheService {
//UFO尺码
LoadingCache<String, Map<Short, UfoSize>> ufoSizeCache = CacheBuilder.newBuilder()
LoadingCache<String, Map<Short, com.yoho.search.dal.model.ufo_product.Size>> ufoSizeCache = CacheBuilder.newBuilder()
.expireAfterWrite(10, TimeUnit.MINUTES)
.build(new CacheLoader<String, Map<Short, UfoSize>>() {
public Map<Short, UfoSize> load(String key) {
.build(new CacheLoader<String, Map<Short, com.yoho.search.dal.model.ufo_product.Size>>() {
public Map<Short, com.yoho.search.dal.model.ufo_product.Size> load(String key) {
return basicDataLogicService.getUfoSizeMap();
}
});
public Map<Short, UfoSize> getUfoSize() {
public Map<Short, com.yoho.search.dal.model.ufo_product.Size> getUfoSize() {
try {
return ufoSizeCache.get(UFO_SIZE_CACHE_KEY);
} catch (Exception e) {
... ... @@ -510,15 +515,15 @@ public class BasicDataCacheService {
}
//UFO品类映射
LoadingCache<String, Map<Integer, UfoSearchSortRelation>> ufoSortRelationCache = CacheBuilder.newBuilder()
LoadingCache<String, Map<Integer, SearchSortRelation>> ufoSortRelationCache = CacheBuilder.newBuilder()
.expireAfterWrite(10, TimeUnit.MINUTES)
.build(new CacheLoader<String, Map<Integer, UfoSearchSortRelation>>() {
public Map<Integer, UfoSearchSortRelation> load(String key) {
.build(new CacheLoader<String, Map<Integer, SearchSortRelation>>() {
public Map<Integer, SearchSortRelation> load(String key) {
return basicDataLogicService.getUfoYohoSortRelationMap();
}
});
public Map<Integer, UfoSearchSortRelation> getUfoSortRelationMap() {
public Map<Integer, SearchSortRelation> getUfoSortRelationMap() {
try {
return ufoSortRelationCache.get(UFO_SORT_RELATION_CACHE_KEY);
} catch (Exception e) {
... ...
... ... @@ -8,6 +8,11 @@ import com.yoho.search.consumer.service.logicService.tbl.TblSortRelationLogicSer
import com.yoho.search.consumer.service.utils.BrandRelationUtils;
import com.yoho.search.dal.*;
import com.yoho.search.dal.model.*;
import com.yoho.search.dal.model.Brand;
import com.yoho.search.dal.model.ProductColor;
import com.yoho.search.dal.model.ProductSort;
import com.yoho.search.dal.model.Size;
import com.yoho.search.dal.model.ufo_product.*;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -208,39 +213,39 @@ public class BasicDataLogicService {
return sortMapList;
}
public Map<Short, UfoBrand> getUfoBrandMap() {
Map<Short, UfoBrand> ufoBrandMap = new HashMap<>();
List<UfoBrand> ufoBrandList = ufoBrandMapper.selectPageList(0, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(ufoBrandList)) {
ufoBrandMap = ufoBrandList.stream().collect(Collectors.toMap(UfoBrand::getId, (p) -> p));
public Map<Short, com.yoho.search.dal.model.ufo_product.Brand> getUfoBrandMap() {
Map<Short, com.yoho.search.dal.model.ufo_product.Brand> ufoBrandMap = new HashMap<>();
List<com.yoho.search.dal.model.ufo_product.Brand> brandList = ufoBrandMapper.selectPageList(0, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(brandList)) {
ufoBrandMap = brandList.stream().collect(Collectors.toMap(com.yoho.search.dal.model.ufo_product.Brand::getId, (p) -> p));
}
return ufoBrandMap;
}
public Map<Short, UfoBrandSeries> getUfoBrandSeriesMap() {
Map<Short, UfoBrandSeries> ufoBrandSeriesMap = new HashMap<>();
List<UfoBrandSeries> ufoBrandSeriesList = ufoBrandSeriesMapper.selectPageList(0, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(ufoBrandSeriesList)) {
ufoBrandSeriesMap = ufoBrandSeriesList.stream().collect(Collectors.toMap(UfoBrandSeries::getId, (p) -> p));
public Map<Short, BrandSeries> getUfoBrandSeriesMap() {
Map<Short, BrandSeries> ufoBrandSeriesMap = new HashMap<>();
List<BrandSeries> brandSeriesList = ufoBrandSeriesMapper.selectPageList(0, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(brandSeriesList)) {
ufoBrandSeriesMap = brandSeriesList.stream().collect(Collectors.toMap(BrandSeries::getId, (p) -> p));
}
return ufoBrandSeriesMap;
}
public Map<Short, UfoSize> getUfoSizeMap() {
Map<Short, UfoSize> ufoSizeMap = new HashMap<>();
List<UfoSize> ufoSizeList = ufoSizeMapper.selectPageList(0, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(ufoSizeList)) {
ufoSizeMap = ufoSizeList.stream().collect(Collectors.toMap(UfoSize::getId, (p) -> p));
public Map<Short, com.yoho.search.dal.model.ufo_product.Size> getUfoSizeMap() {
Map<Short, com.yoho.search.dal.model.ufo_product.Size> ufoSizeMap = new HashMap<>();
List<com.yoho.search.dal.model.ufo_product.Size> sizeList = ufoSizeMapper.selectPageList(0, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(sizeList)) {
ufoSizeMap = sizeList.stream().collect(Collectors.toMap(com.yoho.search.dal.model.ufo_product.Size::getId, (p) -> p));
}
return ufoSizeMap;
}
public Map<Integer, UfoSearchSortRelation> getUfoYohoSortRelationMap() {
List<UfoSearchSortRelation> ufoSearchSortRelationList = ufoSearchSortRelationMapper.selectAll();
if (CollectionUtils.isEmpty(ufoSearchSortRelationList)) {
public Map<Integer, SearchSortRelation> getUfoYohoSortRelationMap() {
List<SearchSortRelation> searchSortRelationList = ufoSearchSortRelationMapper.selectAll();
if (CollectionUtils.isEmpty(searchSortRelationList)) {
return new HashMap<>();
}
return ufoSearchSortRelationList.stream().collect(Collectors.toMap(UfoSearchSortRelation::getUfoSortId, (t) -> t));
return searchSortRelationList.stream().collect(Collectors.toMap(SearchSortRelation::getUfoSortId, (t) -> t));
}
public Map<Integer, Integer> getTblRelationMap() {
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.service.logicService.ufo;
import com.yoho.search.consumer.service.bo.UfoProductIndexBO;
import com.yoho.search.dal.UfoBrandMapper;
import com.yoho.search.dal.model.UfoBrand;
import com.yoho.search.dal.model.ufo_product.Brand;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -28,22 +28,22 @@ public class UfoBrandFieldBuilder implements UfoIndexFieldBuilder {
if (CollectionUtils.isEmpty(brandIdList)) {
return;
}
List<UfoBrand> ufoBrandList = ufoBrandMapper.selectByIdList(brandIdList);
Map<Short, UfoBrand> ufoBrandMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoBrandList)) {
ufoBrandMap = ufoBrandList.stream().collect(Collectors.toMap(UfoBrand::getId, p -> p));
List<Brand> brandList = ufoBrandMapper.selectByIdList(brandIdList);
Map<Short, Brand> ufoBrandMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(brandList)) {
ufoBrandMap = brandList.stream().collect(Collectors.toMap(Brand::getId, p -> p));
}
for (UfoProductIndexBO ufoProductIndexBO : ufoProductIndexBOList) {
ufoProductIndexBO.setBrandName("");
ufoProductIndexBO.setBrandNameEn("");
ufoProductIndexBO.setBrandSearch("");
UfoBrand ufoBrand = ufoBrandMap.get(ufoProductIndexBO.getBrandId());
if (ufoBrand == null) {
Brand brand = ufoBrandMap.get(ufoProductIndexBO.getBrandId());
if (brand == null) {
continue;
}
ufoProductIndexBO.setBrandName(ufoBrand.getBrandName());
ufoProductIndexBO.setBrandNameEn(ufoBrand.getBrandNameEn());
ufoProductIndexBO.setBrandSearch(ufoBrand.getBrandSearch());
ufoProductIndexBO.setBrandName(brand.getBrandName());
ufoProductIndexBO.setBrandNameEn(brand.getBrandNameEn());
ufoProductIndexBO.setBrandSearch(brand.getBrandSearch());
}
}
}
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.service.logicService.ufo;
import com.yoho.search.consumer.service.bo.UfoProductIndexBO;
import com.yoho.search.dal.UfoBrandSeriesMapper;
import com.yoho.search.dal.model.UfoBrandSeries;
import com.yoho.search.dal.model.ufo_product.BrandSeries;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -28,20 +28,20 @@ public class UfoBrandSeriesFieldBuilder implements UfoIndexFieldBuilder {
if (CollectionUtils.isEmpty(seriesIdList)) {
return;
}
Map<Short, UfoBrandSeries> ufoBrandSeriesMap = new HashMap<>();
List<UfoBrandSeries> ufoBrandSeriesList = ufoBrandSeriesMapper.selectByIdList(seriesIdList);
if (CollectionUtils.isNotEmpty(ufoBrandSeriesList)) {
ufoBrandSeriesMap = ufoBrandSeriesList.stream().collect(Collectors.toMap(UfoBrandSeries::getId, p -> p));
Map<Short, BrandSeries> ufoBrandSeriesMap = new HashMap<>();
List<BrandSeries> brandSeriesList = ufoBrandSeriesMapper.selectByIdList(seriesIdList);
if (CollectionUtils.isNotEmpty(brandSeriesList)) {
ufoBrandSeriesMap = brandSeriesList.stream().collect(Collectors.toMap(BrandSeries::getId, p -> p));
}
for (UfoProductIndexBO ufoProductIndexBO : ufoProductIndexBOList) {
ufoProductIndexBO.setSeriesName("");
ufoProductIndexBO.setSeriesSearch("");
UfoBrandSeries ufoBrandSeries = ufoBrandSeriesMap.get(ufoProductIndexBO.getSeriesId());
if (ufoBrandSeries == null) {
BrandSeries brandSeries = ufoBrandSeriesMap.get(ufoProductIndexBO.getSeriesId());
if (brandSeries == null) {
continue;
}
ufoProductIndexBO.setSeriesName(ufoBrandSeries.getSeriesName());
ufoProductIndexBO.setSeriesSearch(ufoBrandSeries.getSeriesSearch());
ufoProductIndexBO.setSeriesName(brandSeries.getSeriesName());
ufoProductIndexBO.setSeriesSearch(brandSeries.getSeriesSearch());
}
}
}
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.service.logicService.ufo;
import com.yoho.search.consumer.service.bo.UfoProductIndexBO;
import com.yoho.search.dal.UfoGoodsMapper;
import com.yoho.search.dal.model.UfoGoods;
import com.yoho.search.dal.model.ufo_product.Goods;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -24,16 +24,16 @@ public class UfoGoodsFieldBuilder implements UfoIndexFieldBuilder {
@Override
public void build(List<UfoProductIndexBO> ufoProductIndexBOList, List<Integer> idList) {
List<UfoGoods> ufoGoodsList = ufoGoodsMapper.selectByProductIdList(idList);
Map<Integer, List<UfoGoods>> ufoGoodsMap = new HashMap<>();
List<Goods> ufoGoodsList = ufoGoodsMapper.selectByProductIdList(idList);
Map<Integer, List<Goods>> ufoGoodsMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoGoodsList)) {
ufoGoodsMap = ufoGoodsList.stream().collect(Collectors.groupingBy(UfoGoods::getProductId));
ufoGoodsMap = ufoGoodsList.stream().collect(Collectors.groupingBy(Goods::getProductId));
}
for (UfoProductIndexBO ufoProductIndexBO : ufoProductIndexBOList) {
ufoProductIndexBO.setDefaultImages("");
ufoProductIndexBO.setColorIds("");
ufoProductIndexBO.setColorNames("");
List<UfoGoods> goodsList = ufoGoodsMap.get(ufoProductIndexBO.getId());
List<Goods> goodsList = ufoGoodsMap.get(ufoProductIndexBO.getId());
if (CollectionUtils.isEmpty(goodsList)) {
continue;
}
... ... @@ -42,8 +42,8 @@ public class UfoGoodsFieldBuilder implements UfoIndexFieldBuilder {
ufoProductIndexBO.setDefaultImages(g.getColorImage());
}
});
String colorIds = goodsList.stream().map(UfoGoods::getColorId).map(s -> s.toString()).collect(Collectors.joining(","));
String colorNames = goodsList.stream().map(UfoGoods::getColorName).collect(Collectors.joining(","));
String colorIds = goodsList.stream().map(Goods::getColorId).map(s -> s.toString()).collect(Collectors.joining(","));
String colorNames = goodsList.stream().map(Goods::getColorName).collect(Collectors.joining(","));
ufoProductIndexBO.setColorIds(colorIds);
ufoProductIndexBO.setColorNames(colorNames);
}
... ...
... ... @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.search.consumer.service.bo.UfoProductIndexBO;
import com.yoho.search.consumer.service.bo.UfoProductPoolBO;
import com.yoho.search.dal.UfoProductPoolDetailMapper;
import com.yoho.search.dal.model.UfoProductPoolDetail;
import com.yoho.search.dal.model.ufo_product.ProductPoolDetail;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -44,14 +44,14 @@ public class UfoProductPoolDetailFieldBuilder implements UfoIndexFieldBuilder {
List<UfoProductPoolBO> ufoProductPoolBOList = new ArrayList<>();
for (Integer id : idList) {
Set<Integer> poolIdSet = new HashSet<>();
List<UfoProductPoolDetail> productPoolDetailsTemp = new ArrayList<>();
List<ProductPoolDetail> productPoolDetailsTemp = new ArrayList<>();
//把每个product对应的多个ProductPoolDetail的PoolId拼起来
List<UfoProductPoolDetail> productPoolDetails = ufoProductPoolDetailMapper.selectByProductId(id);
List<ProductPoolDetail> productPoolDetails = ufoProductPoolDetailMapper.selectByProductId(id);
if (CollectionUtils.isEmpty(productPoolDetails)) {
continue;
}
//先根据poolId去重
for (UfoProductPoolDetail productPoolDetail : productPoolDetails) {
for (ProductPoolDetail productPoolDetail : productPoolDetails) {
if (!poolIdSet.contains(productPoolDetail.getPoolId())) {
poolIdSet.add(productPoolDetail.getPoolId());
productPoolDetailsTemp.add(productPoolDetail);
... ... @@ -59,7 +59,7 @@ public class UfoProductPoolDetailFieldBuilder implements UfoIndexFieldBuilder {
}
StringBuilder poolIds = new StringBuilder();
JSONArray pools = new JSONArray();
for (UfoProductPoolDetail productPoolDetail : productPoolDetailsTemp) {
for (ProductPoolDetail productPoolDetail : productPoolDetailsTemp) {
poolIds.append(productPoolDetail.getPoolId());
poolIds.append(',');
JSONObject pool = new JSONObject();
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.service.logicService.ufo;
import com.yoho.search.consumer.service.bo.UfoProductIndexBO;
import com.yoho.search.dal.UfoProductSortMapper;
import com.yoho.search.dal.model.UfoProductSort;
import com.yoho.search.dal.model.ufo_product.ProductSort;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -34,13 +34,13 @@ public class UfoProductSortFieldBuilder implements UfoIndexFieldBuilder {
if (CollectionUtils.isNotEmpty(midSortIdList)) {
sortIdList.addAll(midSortIdList);
}
List<UfoProductSort> ufoProductSortList = ufoProductSortMapper.selectByIdList(sortIdList);
Map<Short, UfoProductSort> ufoProductSortMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoProductSortList)) {
ufoProductSortMap = ufoProductSortList.stream().collect(Collectors.toMap(UfoProductSort::getId, p -> p));
List<ProductSort> productSortList = ufoProductSortMapper.selectByIdList(sortIdList);
Map<Short, ProductSort> ufoProductSortMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(productSortList)) {
ufoProductSortMap = productSortList.stream().collect(Collectors.toMap(ProductSort::getId, p -> p));
}
for (UfoProductIndexBO ufoProductIndexBO : ufoProductIndexBOList) {
UfoProductSort maxSort = ufoProductSortMap.get(ufoProductIndexBO.getMaxSortId());
ProductSort maxSort = ufoProductSortMap.get(ufoProductIndexBO.getMaxSortId());
if (maxSort != null) {
ufoProductIndexBO.setMaxSortId(maxSort.getId());
ufoProductIndexBO.setMaxSortName(maxSort.getSortName());
... ... @@ -48,7 +48,7 @@ public class UfoProductSortFieldBuilder implements UfoIndexFieldBuilder {
ufoProductIndexBO.setMaxSortId((short) -1);
ufoProductIndexBO.setMaxSortName("");
}
UfoProductSort midSort = ufoProductSortMap.get(ufoProductIndexBO.getMidSortId());
ProductSort midSort = ufoProductSortMap.get(ufoProductIndexBO.getMidSortId());
if (midSort != null) {
ufoProductIndexBO.setMidSortId(midSort.getId());
ufoProductIndexBO.setMidSortName(midSort.getSortName());
... ...
... ... @@ -3,16 +3,14 @@ package com.yoho.search.consumer.service.logicService.ufo;
import com.yoho.search.consumer.service.bo.UfoProductIndexBO;
import com.yoho.search.dal.UfoBuyerOrderGoodsMapper;
import com.yoho.search.dal.UfoBuyerOrderMapper;
import com.yoho.search.dal.UfoStorageMapper;
import com.yoho.search.dal.UfoStoragePriceMapper;
import com.yoho.search.dal.model.UfoBuyerOrder;
import com.yoho.search.dal.model.UfoBuyerOrderGoods;
import com.yoho.search.dal.model.UfoStoragePrice;
import com.yoho.search.dal.model.ufo_order.BuyerOrder;
import com.yoho.search.dal.model.ufo_order.BuyerOrderGoods;
import com.yoho.search.dal.model.ufo_product.StoragePrice;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
... ... @@ -33,36 +31,36 @@ public class UfoSalesNumFieldBuilder implements UfoIndexFieldBuilder {
@Override
public void build(List<UfoProductIndexBO> ufoProductIndexBOList, List<Integer> idList) {
List<UfoStoragePrice> ufoStoragePriceList = ufoStoragePriceMapper.selectByProductIdList(idList);
Map<Integer, List<UfoStoragePrice>> ufoStoragePriceMap = new HashMap<>();
List<StoragePrice> ufoStoragePriceList = ufoStoragePriceMapper.selectByProductIdList(idList);
Map<Integer, List<StoragePrice>> ufoStoragePriceMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoStoragePriceList)) {
ufoStoragePriceMap = ufoStoragePriceList.stream().collect(Collectors.groupingBy(UfoStoragePrice::getProductId));
ufoStoragePriceMap = ufoStoragePriceList.stream().collect(Collectors.groupingBy(StoragePrice::getProductId));
}
for (UfoProductIndexBO ufoProductIndexBO : ufoProductIndexBOList) {
ufoProductIndexBO.setSalesNum(0);
List<UfoStoragePrice> storagePriceList = ufoStoragePriceMap.get(ufoProductIndexBO.getId());
List<StoragePrice> storagePriceList = ufoStoragePriceMap.get(ufoProductIndexBO.getId());
if (CollectionUtils.isEmpty(storagePriceList)) {
continue;
}
List<Integer> skupList = storagePriceList.stream().map(UfoStoragePrice::getSkup).collect(Collectors.toList());
List<Integer> skupList = storagePriceList.stream().map(StoragePrice::getSkup).collect(Collectors.toList());
if (CollectionUtils.isEmpty(storagePriceList)) {
continue;
}
List<UfoBuyerOrderGoods> ufoBuyerOrderGoodsList = ufoBuyerOrderGoodsMapper.selectBySkupList(skupList);
if (CollectionUtils.isEmpty(ufoBuyerOrderGoodsList)) {
List<BuyerOrderGoods> buyerOrderGoodsList = ufoBuyerOrderGoodsMapper.selectBySkupList(skupList);
if (CollectionUtils.isEmpty(buyerOrderGoodsList)) {
continue;
}
List<Long> orderCodeList = ufoBuyerOrderGoodsList.stream().map(UfoBuyerOrderGoods::getOrderCode).collect(Collectors.toList());
List<Long> orderCodeList = buyerOrderGoodsList.stream().map(BuyerOrderGoods::getOrderCode).collect(Collectors.toList());
if (CollectionUtils.isEmpty(orderCodeList)) {
continue;
}
List<UfoBuyerOrder> ufoBuyerOrderList = ufoBuyerOrderMapper.selectByOrderCodeList(orderCodeList);
if (CollectionUtils.isEmpty(ufoBuyerOrderList)) {
List<BuyerOrder> buyerOrderList = ufoBuyerOrderMapper.selectByOrderCodeList(orderCodeList);
if (CollectionUtils.isEmpty(buyerOrderList)) {
continue;
}
Integer saleNum = 0;
for(UfoBuyerOrder ufoBuyerOrder:ufoBuyerOrderList){
if(ufoBuyerOrder.getStatus()==1||ufoBuyerOrder.getStatus()==2||ufoBuyerOrder.getStatus()==3||ufoBuyerOrder.getStatus()==4||ufoBuyerOrder.getStatus()==5){
for(BuyerOrder buyerOrder : buyerOrderList){
if(buyerOrder.getStatus()==1|| buyerOrder.getStatus()==2|| buyerOrder.getStatus()==3|| buyerOrder.getStatus()==4|| buyerOrder.getStatus()==5){
saleNum++;
}
}
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.service.logicService.ufo;
import com.yoho.search.consumer.service.bo.UfoProductIndexBO;
import com.yoho.search.dal.UfoStorageMapper;
import com.yoho.search.dal.model.UfoStorage;
import com.yoho.search.dal.model.ufo_product.Storage;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -24,18 +24,18 @@ public class UfoStorageFieldBuilder implements UfoIndexFieldBuilder {
@Override
public void build(List<UfoProductIndexBO> ufoProductIndexBOList, List<Integer> idList) {
List<UfoStorage> ufoStorageList = ufoStorageMapper.selectByProductIdList(idList);
Map<Integer, List<UfoStorage>> ufoStorageMap = new HashMap<>();
List<Storage> ufoStorageList = ufoStorageMapper.selectByProductIdList(idList);
Map<Integer, List<Storage>> ufoStorageMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoStorageList)) {
ufoStorageMap = ufoStorageList.stream().collect(Collectors.groupingBy(UfoStorage::getProductId));
ufoStorageMap = ufoStorageList.stream().collect(Collectors.groupingBy(Storage::getProductId));
}
for (UfoProductIndexBO ufoProductIndexBO : ufoProductIndexBOList) {
ufoProductIndexBO.setSizeIds("");
List<UfoStorage> storageList = ufoStorageMap.get(ufoProductIndexBO.getId());
List<Storage> storageList = ufoStorageMap.get(ufoProductIndexBO.getId());
if (CollectionUtils.isEmpty(storageList)) {
continue;
}
String sizeIds = storageList.stream().map(UfoStorage::getSizeId).map(s -> s.toString()).collect(Collectors.joining(","));
String sizeIds = storageList.stream().map(Storage::getSizeId).map(s -> s.toString()).collect(Collectors.joining(","));
ufoProductIndexBO.setSizeIds(sizeIds);
}
... ...
... ... @@ -3,8 +3,8 @@ package com.yoho.search.consumer.service.logicService.ufo;
import com.yoho.search.consumer.service.bo.UfoProductIndexBO;
import com.yoho.search.dal.UfoStorageMapper;
import com.yoho.search.dal.UfoStoragePriceMapper;
import com.yoho.search.dal.model.UfoStorage;
import com.yoho.search.dal.model.UfoStoragePrice;
import com.yoho.search.dal.model.ufo_product.Storage;
import com.yoho.search.dal.model.ufo_product.StoragePrice;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -27,18 +27,18 @@ public class UfoStoragePriceFieldBuilder implements UfoIndexFieldBuilder {
@Override
public void build(List<UfoProductIndexBO> ufoProductIndexBOList, List<Integer> idList) {
List<UfoStorage> ufoStorageList = ufoStorageMapper.selectByProductIdList(idList);
Map<Integer, UfoStorage> ufoStorageMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoStorageList)) {
ufoStorageMap = ufoStorageList.stream().collect(Collectors.toMap(UfoStorage::getId, p -> p));
List<Storage> storageList = ufoStorageMapper.selectByProductIdList(idList);
Map<Integer, Storage> ufoStorageMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(storageList)) {
ufoStorageMap = storageList.stream().collect(Collectors.toMap(Storage::getId, p -> p));
}
List<UfoStoragePrice> ufoStoragePriceList = ufoStoragePriceMapper.selectByProductIdList(idList);
Map<Integer, List<UfoStoragePrice>> ufoStoragePriceMap = new HashMap<>();
List<StoragePrice> ufoStoragePriceList = ufoStoragePriceMapper.selectByProductIdList(idList);
Map<Integer, List<StoragePrice>> ufoStoragePriceMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoStoragePriceList)) {
ufoStoragePriceMap = ufoStoragePriceList.stream().collect(Collectors.groupingBy(UfoStoragePrice::getProductId));
ufoStoragePriceMap = ufoStoragePriceList.stream().collect(Collectors.groupingBy(StoragePrice::getProductId));
}
for (UfoProductIndexBO ufoProductIndexBO : ufoProductIndexBOList) {
List<UfoStoragePrice> storagePriceList = ufoStoragePriceMap.get(ufoProductIndexBO.getId());
List<StoragePrice> storagePriceList = ufoStoragePriceMap.get(ufoProductIndexBO.getId());
ufoProductIndexBO.setPrice(-1d);
if (CollectionUtils.isEmpty(storagePriceList)) {
continue;
... ... @@ -51,30 +51,30 @@ public class UfoStoragePriceFieldBuilder implements UfoIndexFieldBuilder {
}
}
public BigDecimal buildPrice(List<UfoStoragePrice> storagePriceList, Map<Integer, UfoStorage> ufoStorageMap) {
List<UfoStoragePrice> validStoragePriceList = new ArrayList<>();
for (UfoStoragePrice ufoStoragePrice : storagePriceList) {
if (ufoStoragePrice.getStatus() != 1) {
public BigDecimal buildPrice(List<StoragePrice> storagePriceList, Map<Integer, Storage> ufoStorageMap) {
List<StoragePrice> validStoragePriceList = new ArrayList<>();
for (StoragePrice storagePrice : storagePriceList) {
if (storagePrice.getStatus() != 1) {
continue;
}
Integer storageId = ufoStoragePrice.getStorageId();
Integer storageId = storagePrice.getStorageId();
if (!ufoStorageMap.containsKey(storageId)) {
continue;
}
UfoStorage ufoStorage = ufoStorageMap.get(storageId);
BigDecimal suggestHighPrice = ufoStorage.getSuggestHighPrice();
Storage storage = ufoStorageMap.get(storageId);
BigDecimal suggestHighPrice = storage.getSuggestHighPrice();
if (suggestHighPrice == null) {
validStoragePriceList.add(ufoStoragePrice);
validStoragePriceList.add(storagePrice);
continue;
}
if (ufoStoragePrice.getPrice().compareTo(suggestHighPrice) <= 0) {
validStoragePriceList.add(ufoStoragePrice);
if (storagePrice.getPrice().compareTo(suggestHighPrice) <= 0) {
validStoragePriceList.add(storagePrice);
}
}
if (CollectionUtils.isEmpty(validStoragePriceList)) {
return null;
}
validStoragePriceList = validStoragePriceList.stream().sorted(Comparator.comparing(UfoStoragePrice::getPrice)).collect(Collectors.toList());
validStoragePriceList = validStoragePriceList.stream().sorted(Comparator.comparing(StoragePrice::getPrice)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(validStoragePriceList)) {
return null;
}
... ...
... ... @@ -2,9 +2,8 @@ package com.yoho.search.consumer.service.logicService.ufo.yoho;
import com.yoho.search.consumer.service.bo.ProductIndexBO;
import com.yoho.search.consumer.service.utils.BrandNameUtils;
import com.yoho.search.dal.model.Brand;
import com.yoho.search.dal.model.UfoBrand;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.ufo_product.Brand;
import com.yoho.search.dal.model.ufo_product.Product;
import org.springframework.stereotype.Component;
import java.util.Map;
... ... @@ -18,8 +17,8 @@ import java.util.Map;
@Component
public class UfoToYohoBrandService {
public void build(ProductIndexBO productIndexBO, UfoProduct ufoProduct, Map<Integer, Brand> yohoBrandMap, Map<Short, UfoBrand> ufoBrandMap, Map<Integer, Integer> ufoBrandRelation) {
UfoBrand ufoBrand = ufoBrandMap.get(ufoProduct.getBrandId());
public void build(ProductIndexBO productIndexBO, Product product, Map<Integer, com.yoho.search.dal.model.Brand> yohoBrandMap, Map<Short, Brand> ufoBrandMap, Map<Integer, Integer> ufoBrandRelation) {
Brand ufoBrand = ufoBrandMap.get(product.getBrandId());
if (ufoBrand == null) {
return;
}
... ... @@ -27,7 +26,7 @@ public class UfoToYohoBrandService {
//融合到了用有货的品牌信息,否则用ufo的品牌信息
if (ufoBrandRelation.containsKey(ufoBrandId)) {
Integer yohoBrandId = ufoBrandRelation.get(ufoBrandId);
Brand brand = yohoBrandMap.get(yohoBrandId);
com.yoho.search.dal.model.Brand brand = yohoBrandMap.get(yohoBrandId);
if (brand == null) {
return;
}
... ...
... ... @@ -2,8 +2,8 @@ package com.yoho.search.consumer.service.logicService.ufo.yoho;
import com.yoho.search.consumer.service.bo.ProductIndexBO;
import com.yoho.search.dal.model.ProductColor;
import com.yoho.search.dal.model.UfoGoods;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.ufo_product.Goods;
import com.yoho.search.dal.model.ufo_product.Product;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
... ... @@ -19,22 +19,22 @@ import java.util.Map;
@Component
public class UfoToYohoColorService {
public void build(ProductIndexBO productIndexBO, UfoProduct ufoProduct, Map<String, ProductColor> productColorNameMap, Map<Integer, List<UfoGoods>> ufoGoodsMap) {
List<UfoGoods> ufoGoodsList = ufoGoodsMap.get(ufoProduct.getId());
if (CollectionUtils.isEmpty(ufoGoodsList)) {
public void build(ProductIndexBO productIndexBO, Product product, Map<String, ProductColor> productColorNameMap, Map<Integer, List<Goods>> ufoGoodsMap) {
List<Goods> goodsList = ufoGoodsMap.get(product.getId());
if (CollectionUtils.isEmpty(goodsList)) {
return;
}
StringBuilder ColorIds = new StringBuilder();
StringBuilder ColorNames = new StringBuilder();
for (UfoGoods ufoGoods : ufoGoodsList) {
if ("Y".equals(ufoGoods.getIsDefault())) {
productIndexBO.setDefaultImages(ufoGoods.getColorImage());
productIndexBO.setSknDefaultImg(ufoGoods.getColorImage());
productIndexBO.setCover_1(ufoGoods.getColorImage());
productIndexBO.setCover_2(ufoGoods.getColorImage());
for (Goods goods : goodsList) {
if ("Y".equals(goods.getIsDefault())) {
productIndexBO.setDefaultImages(goods.getColorImage());
productIndexBO.setSknDefaultImg(goods.getColorImage());
productIndexBO.setCover_1(goods.getColorImage());
productIndexBO.setCover_2(goods.getColorImage());
}
if (productColorNameMap.containsKey(ufoGoods.getColorName())) {
ProductColor productColor = productColorNameMap.get(ufoGoods.getColorName());
if (productColorNameMap.containsKey(goods.getColorName())) {
ProductColor productColor = productColorNameMap.get(goods.getColorName());
ColorIds.append(productColor.getId()).append(",");
ColorNames.append(productColor.getColorName()).append(",");
}
... ...
package com.yoho.search.consumer.service.logicService.ufo.yoho;
import com.yoho.search.consumer.service.bo.ProductIndexBO;
import com.yoho.search.dal.model.UfoBrandSeries;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.ufo_product.BrandSeries;
import com.yoho.search.dal.model.ufo_product.Product;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
... ... @@ -17,36 +17,36 @@ import java.util.Map;
@Component
public class UfoToYohoGeneralService {
public void build(ProductIndexBO productIndexBO, UfoProduct ufoProduct, Map<Short, UfoBrandSeries> ufoBrandSeriesMap) {
public void build(ProductIndexBO productIndexBO, Product product, Map<Short, BrandSeries> ufoBrandSeriesMap) {
//基本
productIndexBO.setIsUfo("Y");
productIndexBO.setId("ufo-" + ufoProduct.getId());
productIndexBO.setProductSkn(ufoProduct.getId());
productIndexBO.setProductName(ufoProduct.getProductName());
productIndexBO.setUfoProductCode(ufoProduct.getProductCode());
productIndexBO.setProductKeyword(ufoProduct.getKeyWords());
productIndexBO.setId("ufo-" + product.getId());
productIndexBO.setProductSkn(product.getId());
productIndexBO.setProductName(product.getProductName());
productIndexBO.setUfoProductCode(product.getProductCode());
productIndexBO.setProductKeyword(product.getKeyWords());
//状态
productIndexBO.setStatus(1);
if (ufoProduct.getDelStatus() != 0 || ufoProduct.getShelveStatus() == 0) {
if (product.getDelStatus() != 0 || product.getShelveStatus() == 0) {
productIndexBO.setStatus(0);
}
productIndexBO.setIsSales(productIndexBO.getStatus() == 1 ? "Y" : "N");
//系列
UfoBrandSeries ufoBrandSeries = ufoBrandSeriesMap.get(ufoProduct.getSeriesId());
if (ufoBrandSeries != null) {
productIndexBO.setSpecialSearchField(ufoBrandSeries.getSeriesName());
BrandSeries brandSeries = ufoBrandSeriesMap.get(product.getSeriesId());
if (brandSeries != null) {
productIndexBO.setSpecialSearchField(brandSeries.getSeriesName());
}
//库存
productIndexBO.setStorageNum(BigDecimal.valueOf(100));
//性别
if (ufoProduct.getGender() != null) {
productIndexBO.setGender(ufoProduct.getGender());
productIndexBO.setGenderS(ufoProduct.getGender().replace('1', '男').replace('2', '女').replace("3", "男/女"));
if (product.getGender() != null) {
productIndexBO.setGender(product.getGender());
productIndexBO.setGenderS(product.getGender().replace('1', '男').replace('2', '女').replace("3", "男/女"));
}
//发售时间
if (ufoProduct.getSaleTime() != null) {
productIndexBO.setFirstShelveTime(ufoProduct.getSaleTime());
productIndexBO.setShelveTime(ufoProduct.getSaleTime());
if (product.getSaleTime() != null) {
productIndexBO.setFirstShelveTime(product.getSaleTime());
productIndexBO.setShelveTime(product.getSaleTime());
}
//其他
productIndexBO.setShopId(-2);
... ...
... ... @@ -3,9 +3,9 @@ package com.yoho.search.consumer.service.logicService.ufo.yoho;
import com.yoho.search.consumer.service.bo.ProductIndexBO;
import com.yoho.search.consumer.service.bo.ProductPriceBO;
import com.yoho.search.consumer.service.logicService.ufo.UfoStoragePriceFieldBuilder;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.UfoStorage;
import com.yoho.search.dal.model.UfoStoragePrice;
import com.yoho.search.dal.model.ufo_product.Product;
import com.yoho.search.dal.model.ufo_product.Storage;
import com.yoho.search.dal.model.ufo_product.StoragePrice;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -27,22 +27,22 @@ public class UfoToYohoPriceService {
@Autowired
private UfoStoragePriceFieldBuilder ufoStoragePriceFieldBuilder;
public void build(ProductIndexBO productIndexBO, UfoProduct ufoProduct, Map<Integer, List<UfoStoragePrice>> ufoStoragePriceMap, Map<Integer, List<UfoStorage>> ufoStorageMap) {
List<UfoStorage> ufoStorageList = ufoStorageMap.get(ufoProduct.getId());
if (CollectionUtils.isEmpty(ufoStorageList)) {
public void build(ProductIndexBO productIndexBO, Product product, Map<Integer, List<StoragePrice>> ufoStoragePriceMap, Map<Integer, List<Storage>> ufoStorageMap) {
List<Storage> storageList = ufoStorageMap.get(product.getId());
if (CollectionUtils.isEmpty(storageList)) {
productIndexBO.setStatus(0);
return;
}
Map<Integer, UfoStorage> idStorageMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(ufoStorageList)) {
idStorageMap = ufoStorageList.stream().collect(Collectors.toMap(UfoStorage::getId, p -> p));
Map<Integer, Storage> idStorageMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(storageList)) {
idStorageMap = storageList.stream().collect(Collectors.toMap(Storage::getId, p -> p));
}
List<UfoStoragePrice> ufoStoragePriceList = ufoStoragePriceMap.get(ufoProduct.getId());
if (CollectionUtils.isEmpty(ufoStoragePriceList)) {
List<StoragePrice> storagePriceList = ufoStoragePriceMap.get(product.getId());
if (CollectionUtils.isEmpty(storagePriceList)) {
productIndexBO.setStatus(0);
return;
}
BigDecimal price = ufoStoragePriceFieldBuilder.buildPrice(ufoStoragePriceList, idStorageMap);
BigDecimal price = ufoStoragePriceFieldBuilder.buildPrice(storagePriceList, idStorageMap);
if (price == null) {
productIndexBO.setStatus(0);
return;
... ...
package com.yoho.search.consumer.service.logicService.ufo.yoho;
import com.yoho.search.consumer.service.bo.ProductIndexBO;
import com.yoho.search.dal.model.Size;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.UfoSize;
import com.yoho.search.dal.model.UfoStorage;
import com.yoho.search.dal.model.ufo_product.Product;
import com.yoho.search.dal.model.ufo_product.Size;
import com.yoho.search.dal.model.ufo_product.Storage;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Component;
... ... @@ -20,22 +19,22 @@ import java.util.Map;
@Component
public class UfoToYohoSizeService {
public void build(ProductIndexBO productIndexBO, UfoProduct ufoProduct, Map<Short, UfoSize> ufoSizeMap, Map<String, List<Size>> sizeNameMap, Map<Integer, List<UfoStorage>> ufoStorageMap) {
List<UfoStorage> ufoStorageList = ufoStorageMap.get(ufoProduct.getId());
if (CollectionUtils.isEmpty(ufoStorageList)) {
public void build(ProductIndexBO productIndexBO, Product product, Map<Short, Size> ufoSizeMap, Map<String, List<com.yoho.search.dal.model.Size>> sizeNameMap, Map<Integer, List<Storage>> ufoStorageMap) {
List<Storage> storageList = ufoStorageMap.get(product.getId());
if (CollectionUtils.isEmpty(storageList)) {
return;
}
StringBuilder sizeIds = new StringBuilder();
StringBuilder sizeNames = new StringBuilder();
for (UfoStorage ufoStorage : ufoStorageList) {
for (Storage storage : storageList) {
//通过sizeId查询到UFO的size信息
if (ufoSizeMap.containsKey(ufoStorage.getSizeId())) {
UfoSize ufoSize = ufoSizeMap.get(ufoStorage.getSizeId());
if (ufoSizeMap.containsKey(storage.getSizeId())) {
Size ufoSize = ufoSizeMap.get(storage.getSizeId());
//通过UFO size名称映射到有货的Size
if (sizeNameMap.containsKey(ufoSize.getSizeName())) {
List<Size> sizeList = sizeNameMap.get(ufoSize.getSizeName());
List<com.yoho.search.dal.model.Size> sizeList = sizeNameMap.get(ufoSize.getSizeName());
if (CollectionUtils.isNotEmpty(sizeList)) {
Size size = sizeList.get(0);
com.yoho.search.dal.model.Size size = sizeList.get(0);
sizeIds.append(size.getId()).append(",");
sizeNames.append(size.getSizeName()).append(",");
}
... ...
... ... @@ -2,8 +2,8 @@ package com.yoho.search.consumer.service.logicService.ufo.yoho;
import com.yoho.search.consumer.service.bo.ProductIndexBO;
import com.yoho.search.dal.model.ProductSort;
import com.yoho.search.dal.model.UfoProduct;
import com.yoho.search.dal.model.UfoSearchSortRelation;
import com.yoho.search.dal.model.ufo_product.Product;
import com.yoho.search.dal.model.ufo_product.SearchSortRelation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
... ... @@ -21,13 +21,13 @@ public class UfoToYohoSortService {
private static final Logger logger = LoggerFactory.getLogger(UfoToYohoSortService.class);
public void build(ProductIndexBO productIndexBO, UfoProduct ufoProduct, Map<Integer, ProductSort> productSortMap, Map<Integer, UfoSearchSortRelation> ufoSortRelationMap) {
public void build(ProductIndexBO productIndexBO, Product product, Map<Integer, ProductSort> productSortMap, Map<Integer, SearchSortRelation> ufoSortRelationMap) {
try {
//处理大分类
if (ufoSortRelationMap.containsKey(Integer.valueOf(ufoProduct.getMaxSortId()))) {
UfoSearchSortRelation ufoSearchSortRelation = ufoSortRelationMap.get(Integer.valueOf(ufoProduct.getMaxSortId()));
if (ufoSearchSortRelation != null) {
ProductSort productSort = productSortMap.get(ufoSearchSortRelation.getYohoSortId());
if (ufoSortRelationMap.containsKey(Integer.valueOf(product.getMaxSortId()))) {
SearchSortRelation searchSortRelation = ufoSortRelationMap.get(Integer.valueOf(product.getMaxSortId()));
if (searchSortRelation != null) {
ProductSort productSort = productSortMap.get(searchSortRelation.getYohoSortId());
if (productSort != null) {
productIndexBO.setMaxSortId(productSort.getId());
productIndexBO.setMaxSortName(productSort.getId() + ":" + productSort.getSortName() + ":" + productSort.getOrderBy());
... ... @@ -36,16 +36,16 @@ public class UfoToYohoSortService {
}
}
//处理中分类和小分类
if (ufoSortRelationMap.containsKey(Integer.valueOf(ufoProduct.getMidSortId()))) {
UfoSearchSortRelation ufoSearchSortRelation = ufoSortRelationMap.get(Integer.valueOf(ufoProduct.getMidSortId()));
if (ufoSearchSortRelation != null) {
ProductSort productSortMid = productSortMap.get(ufoSearchSortRelation.getYohoSortId());
if (ufoSortRelationMap.containsKey(Integer.valueOf(product.getMidSortId()))) {
SearchSortRelation searchSortRelation = ufoSortRelationMap.get(Integer.valueOf(product.getMidSortId()));
if (searchSortRelation != null) {
ProductSort productSortMid = productSortMap.get(searchSortRelation.getYohoSortId());
if (productSortMid != null) {
productIndexBO.setMiddleSortId(productSortMid.getId());
productIndexBO.setMiddleSortName(productSortMid.getId() + ":" + productSortMid.getSortName() + ":" + productSortMid.getOrderBy());
productIndexBO.setMiddleSort(productSortMid.getSortName());
}
ProductSort productSortSmall = productSortMap.get(ufoSearchSortRelation.getYohoSmallSortId());
ProductSort productSortSmall = productSortMap.get(searchSortRelation.getYohoSmallSortId());
if (productSortSmall != null) {
productIndexBO.setSmallSortId(productSortSmall.getId());
productIndexBO.setSmallSortName(productSortSmall.getId() + ":" + productSortSmall.getSortName() + ":" + productSortSmall.getOrderBy());
... ...
... ... @@ -8,7 +8,7 @@ import com.yoho.search.dal.TblBrandMapper;
import com.yoho.search.dal.UfoBrandMapper;
import com.yoho.search.dal.model.CsBrandRelation;
import com.yoho.search.dal.model.TblBrand;
import com.yoho.search.dal.model.UfoBrand;
import com.yoho.search.dal.model.ufo_product.Brand;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -46,7 +46,7 @@ public class BrandRelationUtils {
try {
Map<String, Integer> yohoBrandNameMap = basicDataLogicService.getBrandNameMap();
List<TblBrand> tblBrandList = tblBrandMapper.selectBrandPageList(0, Integer.MAX_VALUE);
List<UfoBrand> ufoBrandList = ufoBrandMapper.selectPageList(0, Integer.MAX_VALUE);
List<Brand> brandList = ufoBrandMapper.selectPageList(0, Integer.MAX_VALUE);
List<CsBrandRelation> csBrandRelationList = new ArrayList<>();
for (TblBrand tblBrand : tblBrandList) {
String tblBrandName = filterBrandName(tblBrand.getBrandNameEn());
... ... @@ -56,11 +56,11 @@ public class BrandRelationUtils {
csBrandRelationList.add(csBrandRelation);
}
}
for (UfoBrand ufoBrand : ufoBrandList) {
String ufoBrandName = filterBrandName(ufoBrand.getBrandName());
for (Brand brand : brandList) {
String ufoBrandName = filterBrandName(brand.getBrandName());
if (yohoBrandNameMap.containsKey(ufoBrandName)) {
Integer yohoBrandId = yohoBrandNameMap.get(ufoBrandName);
CsBrandRelation csBrandRelation = createCsBrandRelation(yohoBrandId, null, Integer.valueOf(ufoBrand.getId()));
CsBrandRelation csBrandRelation = createCsBrandRelation(yohoBrandId, null, Integer.valueOf(brand.getId()));
csBrandRelationList.add(csBrandRelation);
}
}
... ... @@ -89,7 +89,7 @@ public class BrandRelationUtils {
List<String> ufoNoRelationIdList = new ArrayList<>();
Map<String, Integer> yohoBrandNameMap = basicDataLogicService.getBrandNameMap();
List<TblBrand> tblBrandList = tblBrandMapper.selectBrandPageList(0, Integer.MAX_VALUE);
List<UfoBrand> ufoBrandList = ufoBrandMapper.selectPageList(0, Integer.MAX_VALUE);
List<Brand> brandList = ufoBrandMapper.selectPageList(0, Integer.MAX_VALUE);
for (TblBrand tblBrand : tblBrandList) {
String tblBrandName = filterBrandName(tblBrand.getBrandNameEn());
if (yohoBrandNameMap.containsKey(tblBrandName)) {
... ... @@ -99,13 +99,13 @@ public class BrandRelationUtils {
tblNoRelationIdList.add(tblBrand.getBrandNameEn() + "(" + tblBrand.getBrandId() + ")");
}
}
for (UfoBrand ufoBrand : ufoBrandList) {
String ufoBrandName = filterBrandName(ufoBrand.getBrandName());
for (Brand brand : brandList) {
String ufoBrandName = filterBrandName(brand.getBrandName());
if (yohoBrandNameMap.containsKey(ufoBrandName)) {
Integer yohoBrandId = yohoBrandNameMap.get(ufoBrandName);
ufoRelationList.add(ufoBrand.getBrandName() + "(" + ufoBrand.getId() + "<->" + yohoBrandId + ")");
ufoRelationList.add(brand.getBrandName() + "(" + brand.getId() + "<->" + yohoBrandId + ")");
} else {
ufoNoRelationIdList.add(ufoBrand.getBrandName() + "(" + ufoBrand.getId() + ")");
ufoNoRelationIdList.add(brand.getBrandName() + "(" + brand.getId() + ")");
}
}
JSONObject jsonObject = new JSONObject();
... ...