yujian
2019-07-22 aa19f9216d592a4d9944f4833687154f48566557
推荐商品删除原因-后台列表显示
6个文件已修改
304 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/recommend/RecommendGoodsDeleteHistoryMapper.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/goods/recommend/RecommendGoodsDeleteHistoryMapper.xml 223 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/RecommendGoodsDeleteHistoryServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/recommend/RecommendGoodsDeleteHistoryService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -6,18 +6,13 @@
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -25,11 +20,9 @@
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.taobao.SearchFilter;
import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
@@ -47,7 +40,6 @@
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.Utils;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.factory.MonitorFactory;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -45,7 +45,6 @@
import com.yeshi.fanli.service.inter.user.HistorySearchService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.GsonUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.Utils;
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/recommend/RecommendGoodsDeleteHistoryMapper.java
@@ -1,20 +1,34 @@
package com.yeshi.fanli.dao.mybatis.goods.recommend;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
public interface RecommendGoodsDeleteHistoryMapper extends BaseMapper<RecommendGoodsDeleteHistory> {
    /**
     * 批量查询商品是否在删除队列中
     *
     * @param goodsList
     * @return
     */
    List<RecommendGoodsDeleteHistory> listByGoodsInfo(@Param("device") String device,
            @Param("goodsList") List<RecommendGoodsDeleteHistory> goodsList);
package com.yeshi.fanli.dao.mybatis.goods.recommend;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
public interface RecommendGoodsDeleteHistoryMapper extends BaseMapper<RecommendGoodsDeleteHistory> {
    /**
     * 批量查询商品是否在删除队列中
     *
     * @param goodsList
     * @return
     */
    List<RecommendGoodsDeleteHistory> listByGoodsInfo(@Param("device") String device,
            @Param("goodsList") List<RecommendGoodsDeleteHistory> goodsList);
    /**
     * 后台统计
     * @param start
     * @param count
     * @param key
     * @return
     */
    List<RecommendGoodsDeleteHistory> listBackStage(@Param("start") long start, @Param("count") int count,
            @Param("key") String key);
    long countBackStage(@Param("key") String key);
}
fanli/src/main/java/com/yeshi/fanli/mapping/goods/recommend/RecommendGoodsDeleteHistoryMapper.xml
@@ -1,104 +1,119 @@
<?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.yeshi.fanli.dao.mybatis.goods.recommend.RecommendGoodsDeleteHistoryMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">
        <id column="ud_id" property="id" jdbcType="BIGINT" />
        <result column="ud_device" property="device" jdbcType="VARCHAR" />
        <result column="ud_uid" property="uid" jdbcType="BIGINT" />
        <result column="ud_goods_id" property="goodsId" jdbcType="BIGINT" />
        <result column="ud_goods_source" property="goodsSource"
            jdbcType="INTEGER" />
        <result column="ud_reason" property="reason" jdbcType="VARCHAR" />
        <result column="ud_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="ud_beizhu" property="beiZhu" jdbcType="VARCHAR" />
    </resultMap>
    <sql id="Base_Column_List">ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_recommend_goods_user_delete where ud_id =
        #{id,jdbcType=BIGINT}
    </select>
    <select id="listByGoodsInfo" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_recommend_goods_user_delete where ud_device =
        #{device}
        <foreach collection="goodsList" item="item" open=" and ("
            close=")" separator=" or ">
            (
            ud_goods_id= #{item.goodsId} and ud_goods_source=#{item.goodsSource}
            )
        </foreach>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_recommend_goods_user_delete where ud_id =
        #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_recommend_goods_user_delete
        (ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu)
        values
        (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{goodsId,jdbcType=BIGINT},#{goodsSource,jdbcType=INTEGER},#{reason,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{beiZhu,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_recommend_goods_user_delete
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">ud_id,</if>
            <if test="device != null">ud_device,</if>
            <if test="uid != null">ud_uid,</if>
            <if test="goodsId != null">ud_goods_id,</if>
            <if test="goodsSource != null">ud_goods_source,</if>
            <if test="reason != null">ud_reason,</if>
            <if test="createTime != null">ud_create_time,</if>
            <if test="beiZhu != null">ud_beizhu,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="device != null">#{device,jdbcType=VARCHAR},</if>
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="goodsId != null">#{goodsId,jdbcType=BIGINT},</if>
            <if test="goodsSource != null">#{goodsSource,jdbcType=INTEGER},</if>
            <if test="reason != null">#{reason,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">update yeshi_ec_recommend_goods_user_delete set
        ud_device = #{device,jdbcType=VARCHAR},ud_uid =
        #{uid,jdbcType=BIGINT},ud_goods_id =
        #{goodsId,jdbcType=BIGINT},ud_goods_source =
        #{goodsSource,jdbcType=INTEGER},ud_reason =
        #{reason,jdbcType=VARCHAR},ud_create_time =
        #{createTime,jdbcType=TIMESTAMP},ud_beizhu =
        #{beiZhu,jdbcType=VARCHAR} where ud_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">
        update yeshi_ec_recommend_goods_user_delete
        <set>
            <if test="device != null">ud_device=#{device,jdbcType=VARCHAR},</if>
            <if test="uid != null">ud_uid=#{uid,jdbcType=BIGINT},</if>
            <if test="goodsId != null">ud_goods_id=#{goodsId,jdbcType=BIGINT},</if>
            <if test="goodsSource != null">ud_goods_source=#{goodsSource,jdbcType=INTEGER},</if>
            <if test="reason != null">ud_reason=#{reason,jdbcType=VARCHAR},</if>
            <if test="createTime != null">ud_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="beiZhu != null">ud_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
        </set>
        where ud_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
<?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.yeshi.fanli.dao.mybatis.goods.recommend.RecommendGoodsDeleteHistoryMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">
        <id column="ud_id" property="id" jdbcType="BIGINT" />
        <result column="ud_device" property="device" jdbcType="VARCHAR" />
        <result column="ud_uid" property="uid" jdbcType="BIGINT" />
        <result column="ud_goods_id" property="goodsId" jdbcType="BIGINT" />
        <result column="ud_goods_source" property="goodsSource"
            jdbcType="INTEGER" />
        <result column="ud_reason" property="reason" jdbcType="VARCHAR" />
        <result column="ud_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="ud_beizhu" property="beiZhu" jdbcType="VARCHAR" />
    </resultMap>
    <sql id="Base_Column_List">ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_recommend_goods_user_delete where ud_id =
        #{id,jdbcType=BIGINT}
    </select>
    <select id="listByGoodsInfo" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_recommend_goods_user_delete where ud_device =
        #{device}
        <foreach collection="goodsList" item="item" open=" and ("
            close=")" separator=" or ">
            (
            ud_goods_id= #{item.goodsId} and ud_goods_source=#{item.goodsSource}
            )
        </foreach>
    </select>
    <select id="listBackStage" resultMap="BaseResultMap">
        SELECT * FROM yeshi_ec_recommend_goods_user_delete
        WHERE 1=1  <if test="key != null ">
                    AND (t.`ud_uid` = ${key} OR t.`ud_reason` LIKE '%${key}%')
                   </if>
        LIMIT #{start},#{count}
    </select>
    <select id="countBackStage" resultMap="BaseResultMap">
        SELECT IFNULL(COUNT(t.`ud_id`),0) FROM yeshi_ec_recommend_goods_user_delete  t
        WHERE 1=1  <if test="key != null ">
                    AND (t.`ud_uid` = ${key} OR t.`ud_reason` LIKE '%${key}%')
                   </if>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_recommend_goods_user_delete where ud_id =
        #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_recommend_goods_user_delete
        (ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu)
        values
        (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{goodsId,jdbcType=BIGINT},#{goodsSource,jdbcType=INTEGER},#{reason,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{beiZhu,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_recommend_goods_user_delete
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">ud_id,</if>
            <if test="device != null">ud_device,</if>
            <if test="uid != null">ud_uid,</if>
            <if test="goodsId != null">ud_goods_id,</if>
            <if test="goodsSource != null">ud_goods_source,</if>
            <if test="reason != null">ud_reason,</if>
            <if test="createTime != null">ud_create_time,</if>
            <if test="beiZhu != null">ud_beizhu,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="device != null">#{device,jdbcType=VARCHAR},</if>
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="goodsId != null">#{goodsId,jdbcType=BIGINT},</if>
            <if test="goodsSource != null">#{goodsSource,jdbcType=INTEGER},</if>
            <if test="reason != null">#{reason,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">update yeshi_ec_recommend_goods_user_delete set
        ud_device = #{device,jdbcType=VARCHAR},ud_uid =
        #{uid,jdbcType=BIGINT},ud_goods_id =
        #{goodsId,jdbcType=BIGINT},ud_goods_source =
        #{goodsSource,jdbcType=INTEGER},ud_reason =
        #{reason,jdbcType=VARCHAR},ud_create_time =
        #{createTime,jdbcType=TIMESTAMP},ud_beizhu =
        #{beiZhu,jdbcType=VARCHAR} where ud_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">
        update yeshi_ec_recommend_goods_user_delete
        <set>
            <if test="device != null">ud_device=#{device,jdbcType=VARCHAR},</if>
            <if test="uid != null">ud_uid=#{uid,jdbcType=BIGINT},</if>
            <if test="goodsId != null">ud_goods_id=#{goodsId,jdbcType=BIGINT},</if>
            <if test="goodsSource != null">ud_goods_source=#{goodsSource,jdbcType=INTEGER},</if>
            <if test="reason != null">ud_reason=#{reason,jdbcType=VARCHAR},</if>
            <if test="createTime != null">ud_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="beiZhu != null">ud_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
        </set>
        where ud_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/RecommendGoodsDeleteHistoryServiceImpl.java
@@ -68,4 +68,13 @@
        return resultList;
    }
    @Override
    public List<RecommendGoodsDeleteHistory> listBackStage(long start, int count, String key) {
        return recommendGoodsDeleteHistoryMapper.listBackStage(start, count, key);
    }
    @Override
    public long countBackStage(String key) {
        return recommendGoodsDeleteHistoryMapper.countBackStage(key);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/recommend/RecommendGoodsDeleteHistoryService.java
@@ -23,4 +23,15 @@
     */
    public List<TaoBaoGoodsBrief> filterGoods(String device, List<TaoBaoGoodsBrief> goodsList);
    /**
     * 后台统计列表
     * @param start
     * @param count
     * @param key
     * @return
     */
    public List<RecommendGoodsDeleteHistory> listBackStage(long start, int count, String key);
    public long countBackStage(String key);
}