fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java
@@ -52,8 +52,8 @@ * @param out */ @RequestMapping(value = "save") public void save(String callback, GoodsSubClass goodsSubClass, Long pid, Integer type, HttpServletRequest request, PrintWriter out) { public void save(String callback, GoodsSubClass goodsSubClass, Long pid, Integer type, Long labelId, HttpServletRequest request, PrintWriter out) { if (goodsSubClass.getTaobaoCids() != null) goodsSubClass.setTaobaoCids(goodsSubClass.getTaobaoCids().replace(",", ",")); @@ -62,9 +62,9 @@ if (request instanceof MultipartHttpServletRequest) { MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request; goodsSubClassService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"), goodsSubClass, type, pid); goodsSubClass, type, pid, labelId); } else { goodsSubClassService.saveObject(null, null, goodsSubClass, type, pid); goodsSubClassService.saveObject(null, null, goodsSubClass, type, pid, labelId); } JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功")); fanli/src/main/java/com/yeshi/fanli/job/UpdateDaTaoKeJob.java
@@ -18,6 +18,7 @@ import com.yeshi.fanli.log.LogHelper; import com.yeshi.fanli.service.inter.lable.QualityFactoryService; import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService; import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.taobao.DaTaoKeUtil; import com.yeshi.fanli.util.taobao.TaoBaoUtil; @@ -34,6 +35,9 @@ @Resource private DaTaoKeGoodsDetailService daTaoKeGoodsService; @Resource private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service; /** * 限时秒杀 数据更新 @@ -113,7 +117,7 @@ @Override public void run() { daTaoKeGoodsService.startSyncGoods(); daTaoKeGoodsDetailV2Service.startSyncGoods(); } }).start(); fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml
@@ -23,7 +23,8 @@ <result column="b_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> <!-- 背景图片 --> <result column="cd_bottom_picture" property="bottomPicture" jdbcType="VARCHAR"/> <result column="cd_bottom_picture" property="bottomPicture" jdbcType="VARCHAR" /> <association property="jumpDetail" column="b_jumpid" select="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.selectByPrimaryKey"> @@ -31,12 +32,22 @@ </resultMap> <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime</sql> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select <include refid="Base_Column_List"/>from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT} <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long"> select <include refid="Base_Column_List" /> from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}</delete> <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}</delete> <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id"> insert into yeshi_ec_special <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">b_id,</if> <if test="name != null">b_name,</if> @@ -57,7 +68,8 @@ <if test="remark != null">b_remark,</if> <if test="createtime != null">b_createtime,</if> <if test="updatetime != null">b_updatetime,</if> </trim>values </trim> values <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">#{id,jdbcType=BIGINT},</if> <if test="name != null">#{name,jdbcType=VARCHAR},</if> @@ -80,8 +92,27 @@ <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if> </trim> </insert> <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special set b_name = #{name,jdbcType=VARCHAR},b_card = #{card,jdbcType=VARCHAR},b_card_id = #{cardId,jdbcType=BIGINT},b_main_picture = #{picture,jdbcType=VARCHAR},b_icon = #{icon,jdbcType=VARCHAR},b_sub_picture = #{subPicture,jdbcType=VARCHAR},b_jumpid = #{jumpDetail.id,jdbcType=BIGINT},b_params = #{params,jdbcType=VARCHAR},b_jump_login = #{jumpLogin,jdbcType=VARCHAR},b_orderby = #{orderby,jdbcType=INTEGER},b_order_man = #{orderMan,jdbcType=INTEGER},b_order_woman = #{orderWoman,jdbcType=INTEGER},b_state = #{state,jdbcType=BIGINT},b_show_type = #{showType,jdbcType=VARCHAR},b_remark = #{remark,jdbcType=VARCHAR},b_createtime = #{createtime,jdbcType=TIMESTAMP},b_updatetime = #{updatetime,jdbcType=TIMESTAMP} where b_id = #{id,jdbcType=BIGINT}</update> <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special set b_name = #{name,jdbcType=VARCHAR},b_card = #{card,jdbcType=VARCHAR},b_card_id = #{cardId,jdbcType=BIGINT},b_main_picture = #{picture,jdbcType=VARCHAR},b_icon = #{icon,jdbcType=VARCHAR},b_sub_picture = #{subPicture,jdbcType=VARCHAR},b_jumpid = #{jumpDetail.id,jdbcType=BIGINT},b_params = #{params,jdbcType=VARCHAR},b_jump_login = #{jumpLogin,jdbcType=VARCHAR},b_orderby = #{orderby,jdbcType=INTEGER},b_order_man = #{orderMan,jdbcType=INTEGER},b_order_woman = #{orderWoman,jdbcType=INTEGER},b_state = #{state,jdbcType=BIGINT},b_show_type = #{showType,jdbcType=VARCHAR},b_remark = #{remark,jdbcType=VARCHAR},b_createtime = #{createtime,jdbcType=TIMESTAMP},b_updatetime = #{updatetime,jdbcType=TIMESTAMP},b_sex=#{sex,jdbcType=INTEGER} where b_id = #{id,jdbcType=BIGINT}</update> <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special"> update yeshi_ec_special <set> <if test="name != null">b_name=#{name,jdbcType=VARCHAR},</if> <if test="card != null">b_card=#{card,jdbcType=VARCHAR},</if> @@ -96,28 +127,35 @@ <if test="orderMan != null">b_order_man=#{orderMan,jdbcType=INTEGER},</if> <if test="orderWoman != null">b_order_woman=#{orderWoman,jdbcType=INTEGER},</if> <if test="state != null">b_state=#{state,jdbcType=BIGINT},</if> <if test="sex != null">b_sex=#{orderby,jdbcType=INTEGER},</if> <if test="sex != null">b_sex=#{sex,jdbcType=INTEGER},</if> <if test="showType != null">b_show_type=#{showType,jdbcType=VARCHAR},</if> <if test="remark != null">b_remark=#{remark,jdbcType=VARCHAR},</if> <if test="createtime != null">b_createtime=#{createtime,jdbcType=TIMESTAMP},</if> <if test="updatetime != null">b_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> </set> where b_id = #{id,jdbcType=BIGINT} </set> where b_id = #{id,jdbcType=BIGINT} </update> <sql id="Sex_Screen"> <!-- 通用版 --> <if test="sex == 0"> AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR sp.`b_sex` = 20) AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR sp.`b_sex` = 20) ORDER BY sp.`b_orderby` </if> <!-- 女版 --> <if test="sex == 1"> AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR sp.`b_sex` = 12) AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR sp.`b_sex` = 12) ORDER BY sp.`b_order_woman` </if> <!-- 男版 --> <if test="sex == 2"> AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR sp.`b_sex` = 12) AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR sp.`b_sex` = 12) ORDER BY sp.`b_order_man` </if> </sql> @@ -135,22 +173,30 @@ separator=",">#{item}</foreach> </delete> <select id="queryByListPrimaryKey" parameterType="java.util.List" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_special <select id="queryByListPrimaryKey" parameterType="java.util.List" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_special WHERE b_id in <foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach> </select> <select id="queryByListCardID" parameterType="java.util.List" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_special <select id="queryByListCardID" parameterType="java.util.List" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_special WHERE b_card_id in <foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach> </select> <select id="listQueryByCard" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_special` sp SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_special` sp WHERE sp.`b_card_id` = #{cardId} <if test='key != null and key != ""'> AND sp.b_name like '%${key}%' @@ -161,7 +207,8 @@ <select id="countlistQueryByCard" resultType="java.lang.Long"> SELECT IFNULL(count(b_id),0) FROM `yeshi_ec_special` sp WHERE sp.`b_card_id` = #{cardId} WHERE sp.`b_card_id` = #{cardId} <if test='key != null and key != ""'> AND sp.b_name like '%${key}%' </if> @@ -169,28 +216,37 @@ </select> <select id="getDefaultMaxOrder" resultType="java.lang.Integer"> SELECT IFNULL(MAX(pp.b_orderby),0) FROM yeshi_ec_special pp WHERE pp.`b_card_id` = #{cardId} SELECT IFNULL(MAX(pp.b_orderby),0) FROM yeshi_ec_special pp WHERE pp.`b_card_id` = #{cardId} </select> <select id="getManMaxOrder" resultType="java.lang.Integer"> SELECT IFNULL(MAX(pp.b_order_man),0) FROM yeshi_ec_special pp WHERE pp.`b_card_id` = #{cardId} SELECT IFNULL(MAX(pp.b_order_man),0) FROM yeshi_ec_special pp WHERE pp.`b_card_id` = #{cardId} </select> <select id="getWomanMaxOrder" resultType="java.lang.Integer"> SELECT IFNULL(MAX(pp.b_order_woman),0) FROM yeshi_ec_special pp WHERE pp.`b_card_id` = #{cardId} SELECT IFNULL(MAX(pp.b_order_woman),0) FROM yeshi_ec_special pp WHERE pp.`b_card_id` = #{cardId} </select> <select id="getOrderByCardID" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_special sp SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_special sp WHERE sp.b_card_id = #{cardId} <!-- 通用版 --> <if test="sex == 0 or sex == 120"> AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR sp.`b_sex` = 20) AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR sp.`b_sex` = 20) <if test="type == -1"> <![CDATA[and sp.b_orderby < #{order}]]> order by sp.b_orderby desc @@ -202,7 +258,8 @@ </if> <!-- 女版 --> <if test="sex == 1"> AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR sp.`b_sex` = 12) AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR sp.`b_sex` = 12) <if test="type == -1"> <![CDATA[and sp.b_order_woman < #{order}]]> order by sp.b_order_woman desc @@ -214,7 +271,8 @@ </if> <!-- 男版 --> <if test="sex == 2"> AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR sp.`b_sex` = 12) AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR sp.`b_sex` = 12) <if test="type == -1"> <![CDATA[and sp.b_order_man < #{order}]]> order by sp.b_order_man desc @@ -228,28 +286,44 @@ </select> <select id="listBySystemAndCard" resultMap="BaseResultMap"> SELECT p.* FROM `yeshi_ec_special` p LEFT JOIN `yeshi_ec_special_card` c ON p.`b_card_id` = c.`cd_id` LEFT JOIN `yeshi_ec_super_special_card` s ON s.`sp_special_cid` = c.`cd_id` WHERE p.`b_state` = 0 AND c.`cd_state` = 0 SELECT p.* FROM `yeshi_ec_special` p LEFT JOIN `yeshi_ec_special_card` c ON p.`b_card_id` = c.`cd_id` LEFT JOIN `yeshi_ec_super_special_card` s ON s.`sp_special_cid` = c.`cd_id` WHERE p.`b_state` = 0 AND c.`cd_state` = 0 AND c.`cd_card` = #{card} AND s.`sp_system_id` = #{systemId} ORDER BY p.`b_orderby` ORDER BY p.`b_orderby` </select> <select id="listPageBySystemAndCard" resultMap="BaseResultMap"> SELECT p.* FROM `yeshi_ec_special` p LEFT JOIN `yeshi_ec_special_card` c ON p.`b_card_id` = c.`cd_id` LEFT JOIN `yeshi_ec_super_special_card` s ON s.`sp_special_cid` = c.`cd_id` WHERE p.`b_state` = 0 AND c.`cd_state` = 0 AND s.sp_id is not null AND c.`cd_card` = #{card} AND s.`sp_system_id` = #{systemId} ORDER BY p.`b_orderby` LIMIT ${start},${count} SELECT p.* FROM `yeshi_ec_special` p LEFT JOIN `yeshi_ec_special_card` c ON p.`b_card_id` = c.`cd_id` LEFT JOIN `yeshi_ec_super_special_card` s ON s.`sp_special_cid` = c.`cd_id` WHERE p.`b_state` = 0 AND c.`cd_state` = 0 AND s.sp_id is not null AND c.`cd_card` = #{card} AND s.`sp_system_id` = #{systemId} ORDER BY p.`b_orderby` LIMIT ${start},${count} </select> <select id="listByPlaceKey" resultMap="BaseResultMap"> SELECT sp.*,c.`cd_bottom_picture` FROM `yeshi_ec_special` sp RIGHT JOIN (SELECT c.* FROM yeshi_ec_special_card c LEFT JOIN `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id` WHERE c.`cd_state` = 0 AND IF(c.`cd_start_time` IS NULL,TRUE, c.`cd_start_time`<![CDATA[<=]]>NOW()) RIGHT JOIN (SELECT c.* FROM yeshi_ec_special_card c LEFT JOIN `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id` WHERE c.`cd_state` = 0 AND IF(c.`cd_start_time` IS NULL,TRUE, c.`cd_start_time`<![CDATA[<=]]>NOW()) AND IF(c.`cd_end_time` IS NULL,TRUE,c.`cd_end_time`<![CDATA[>=]]>NOW()) AND pc.`sp_key` = #{placeKey} LIMIT 1)c ON sp.`b_card_id` = c.`cd_id` fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml
@@ -65,7 +65,8 @@ </association> </resultMap> <resultMap id="GoodsResultMap" type="com.yeshi.fanli.entity.bus.lable.QualityFactory"> <resultMap id="GoodsResultMap" type="com.yeshi.fanli.entity.bus.lable.QualityFactory"> <id column="sg_id" property="id" jdbcType="BIGINT" /> <result column="sg_class_id" property="systemCid" jdbcType="BIGINT" /> <result column="sg_entry_mode" property="entryMode" jdbcType="INTEGER" /> @@ -296,7 +297,8 @@ <!-- 查询精选商品信息 --> <select id="query" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO" resultMap="ResultMap"> <select id="query" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO" resultMap="ResultMap"> SELECT ts.* FROM ( SELECT DISTINCT( tt.`sg_id`) AS id FROM @@ -458,7 +460,8 @@ </select> <select id="queryCount" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO" resultType="java.lang.Long"> <select id="queryCount" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO" resultType="java.lang.Long"> <!-- 根据条件统计所有标签数量 --> SELECT count(ts.sg_id) FROM ( SELECT DISTINCT( tt.`sg_id`) AS id FROM @@ -595,7 +598,8 @@ <!--查询精选商品信息 --> <select id="getByAuctionId" resultMap="BaseResultMap"> SELECT * FROM yeshi_ec_quality_factory SELECT * FROM yeshi_ec_quality_factory WHERE sg_goods_id = ${auctionId} limit 1 </select> @@ -630,7 +634,8 @@ </select> <delete id="deleteByGoodsId" parameterType="java.lang.Long"> delete from yeshi_ec_quality_factory where sg_goods_id = delete from yeshi_ec_quality_factory where sg_goods_id = #{goodsId,jdbcType=BIGINT} </delete> @@ -879,9 +884,13 @@ </select> <select id="listQueryByFlashSale" resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_quality_flash_sale s LEFT JOIN yeshi_ec_quality_factory h ON h.`sg_goods_id` = s.`fs_qfgoods_id` LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_quality_flash_sale s LEFT JOIN yeshi_ec_quality_factory h ON h.`sg_goods_id` = s.`fs_qfgoods_id` LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE <![CDATA[ tb.`couponTotalCount` > 0 AND tb.couponLeftCount<tb.couponTotalCount ]]> @@ -892,9 +901,11 @@ <select id="countQueryByFlashSale" resultType="java.lang.Long"> SELECT IFNULL(COUNT( h.`sg_id`),0) FROM yeshi_ec_quality_factory h RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_goods_id` = s.`fs_qfgoods_id` RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_goods_id` = s.`fs_qfgoods_id` LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE <![CDATA[ tb.`couponTotalCount` > 0 AND tb.couponLeftCount<tb.couponTotalCount]]> </select> @@ -902,12 +913,15 @@ <select id="listFlashSaleRandGoods" resultMap="GoodsResultMap"> SELECT h.*, tb.* FROM yeshi_ec_quality_factory h RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_goods_id` = s.`fs_qfgoods_id` RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_goods_id` = s.`fs_qfgoods_id` LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE s.`fs_id` IS NOT NULL AND tb.`biz30day` <![CDATA[>=]]> 10000 WHERE s.`fs_id` IS NOT NULL AND tb.`biz30day` <![CDATA[>=]]> 10000 AND tb.`couponTotalCount` <![CDATA[>]]>10 AND tb.couponLeftCount <![CDATA[<]]> tb.couponTotalCount AND tb.couponLeftCount <![CDATA[<]]> tb.couponTotalCount ORDER BY RAND() LIMIT 3 </select> @@ -1090,7 +1104,8 @@ <select id="getAuctionIdbyClassId" resultType="java.lang.Long"> SELECT h.`sg_goods_id` FROM `yeshi_ec_quality_factory` h WHERE h.`sg_goods_source` = #{goodsSource} AND h.`sg_updatetime` <![CDATA[<]]> #{beforeTime} AND h.`sg_updatetime` <![CDATA[<]]> #{beforeTime} <if test="systemCid != null">AND h.`sg_class_id` = #{systemCid}</if> </select> @@ -1268,29 +1283,41 @@ <select id="listByShopId" resultMap="GoodsResultMap"> SELECT * FROM yeshi_ec_quality_factory q LEFT JOIN `yeshi_ec_taobao_goods` t ON q.`sg_goods_id` = t.`id` SELECT * FROM yeshi_ec_quality_factory q LEFT JOIN `yeshi_ec_taobao_goods` t ON q.`sg_goods_id` = t.`id` WHERE t.`sellerId` = #{shopId} ORDER BY q.`sg_weight` DESC ORDER BY q.`sg_weight` DESC LIMIT #{start},#{count} </select> <select id="countByShopId" resultType="java.lang.Long"> SELECT ifnull(count(sg_id),0) FROM yeshi_ec_quality_factory q LEFT JOIN `yeshi_ec_taobao_goods` t ON q.`sg_goods_id` = t.`id` WHERE t.`sellerId` = #{shopId} SELECT ifnull(count(sg_id),0) FROM yeshi_ec_quality_factory q LEFT JOIN `yeshi_ec_taobao_goods` t ON q.`sg_goods_id` = t.`id` WHERE t.`sellerId` = #{shopId} </select> <select id="get9k9ClassGoods" resultMap="GoodsResultMap"> SELECT * FROM `yeshi_ec_quality_factory` h LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0 LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0 AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE) AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice} AND tb.`biz30day` <![CDATA[>=]]> #{biz30day} AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice} AND tb.`biz30day` <![CDATA[>=]]> #{biz30day} <!-- 券后价范围 --> AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> #{maxQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> #{maxQuanPrice} <!-- 多个分类id --> <if test='cids != null and cids != ""'> AND h.`sg_class_id` in (${cids}) @@ -1302,13 +1329,18 @@ <select id="count9k9ClassGoods" resultType="java.lang.Long"> SELECT IFNULL(COUNT(h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0 WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0 AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE) AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice} AND tb.`biz30day` <![CDATA[>=]]> #{biz30day} AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice} AND tb.`biz30day` <![CDATA[>=]]> #{biz30day} <!-- 券后价范围 --> AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> #{maxQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> #{maxQuanPrice} <!-- 多个分类id --> <if test='cids != null and cids != ""'> AND h.`sg_class_id` in (${cids}) @@ -1319,12 +1351,19 @@ <!-- 每日必抢 --> <select id="listQueryEverydayRob" resultMap="GoodsResultMap"> SELECT * FROM `yeshi_ec_quality_factory` h LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.`couponTotalCount` > 0 AND tb.couponAmount <![CDATA[>]]> 1 AND tb.couponAmount <![CDATA[<=]]> 50 LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.`couponTotalCount` > 0 AND tb.couponAmount <![CDATA[>]]> 1 AND tb.couponAmount <![CDATA[<=]]> 50 AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE) AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<=]]> #{maxQuanPrice} AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<=]]> #{maxQuanPrice} ORDER BY h.sg_createtime desc LIMIT ${start},${count} </select> @@ -1332,28 +1371,21 @@ <select id="countQueryEverydayRob" resultType="java.lang.Long"> SELECT IFNULL(COUNT(h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.`couponTotalCount` > 0 AND tb.couponAmount <![CDATA[>]]> 1 AND tb.couponAmount <![CDATA[<=]]> 50 WHERE tb.`couponTotalCount` > 0 AND tb.couponAmount <![CDATA[>]]> 1 AND tb.couponAmount <![CDATA[<=]]> 50 AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE) AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<=]]> #{maxQuanPrice} AND tb.`zkPrice` <![CDATA[<=]]> #{zkPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> #{minQuanPrice} AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<=]]> #{maxQuanPrice} </select> <select id="listFreeGoods" resultMap="GoodsResultMap"> SELECT * FROM `yeshi_ec_quality_factory` h LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` <![CDATA[>]]> 0 AND IF(tb.`zkPrice` - tb.`couponStartFee`<![CDATA[>=]]>0, TRUE, FALSE) AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> 0 AND tb.`tkRate` * (tb.`zkPrice` - tb.`couponAmount`) *0.05*0.01 <![CDATA[>]]> 1 ORDER BY h.sg_weight desc LIMIT ${start},${count} </select> <select id="countFreeGoods" resultType="java.lang.Long"> SELECT IFNULL(COUNT(h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0 AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE) @@ -1364,6 +1396,30 @@ AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> 9.9 <!-- 比例 20 --> AND tb.`tkRate` <![CDATA[>=]]> 20 ORDER BY h.sg_weight desc LIMIT ${start},${count} </select> <select id="countFreeGoods" resultType="java.lang.Long"> SELECT IFNULL(COUNT(h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0 AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE) <!-- 在售价 209.9 --> AND tb.`zkPrice` <![CDATA[<=]]> 209.9 <!-- 券后价范围 0~9.9 --> AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> 0 AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> 9.9 <!-- 比例 20 --> AND tb.`tkRate` <![CDATA[>=]]> 20 </select> fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java
@@ -18,7 +18,10 @@ import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.clazz.GoodsClass; import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass; import com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel; import com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabelMap; import com.yeshi.fanli.exception.GoodsSubClassException; import com.yeshi.fanli.service.inter.clazz.GoodsSubClassLabelService; import com.yeshi.fanli.service.inter.goods.GoodsSubClassService; import com.yeshi.fanli.service.inter.goods.TaoBaoClassService; import com.yeshi.fanli.service.inter.lable.LabelClassService; @@ -37,6 +40,9 @@ @Resource private TaoBaoClassService taoBaoClassService; @Resource private GoodsSubClassLabelService goodsSubClassLabelService; @Override public int deleteByPrimaryKey(Long id) { @@ -123,8 +129,8 @@ } @Override public void saveObject(MultipartFile file, MultipartFile file2, GoodsSubClass record, Integer type, Long pid) throws GoodsSubClassException, Exception { public void saveObject(MultipartFile file, MultipartFile file2, GoodsSubClass record, Integer type, Long pid, Long labelId) throws GoodsSubClassException, Exception { String name = record.getName(); if (name == null || name.trim().length() == 0) { @@ -189,6 +195,8 @@ record.setIosClick(0L); record.setCreatetime(new Date()); record.setUpdatetime(new Date()); if (labelId != null) record.setClassLabel(new GoodsSubClassLabel(labelId)); if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) { // 搜索条件:有券、在售价20-200、牛皮癣轻微 @@ -196,6 +204,13 @@ } goodsSubClassMapper.insert(record); if (labelId != null) { GoodsSubClassLabelMap map = new GoodsSubClassLabelMap(); map.setGoodsSubClass(record); map.setLabel(new GoodsSubClassLabel(labelId)); goodsSubClassLabelService.addSubClassLabelMap(map); } } else { // 修改 @@ -231,6 +246,13 @@ record.setAndroidClick(resultObj.getAndroidClick()); record.setCreatetime(resultObj.getCreatetime()); record.setUpdatetime(new Date()); if (labelId != null) { GoodsSubClassLabelMap map = new GoodsSubClassLabelMap(); map.setGoodsSubClass(record); map.setLabel(new GoodsSubClassLabel(labelId)); goodsSubClassLabelService.addSubClassLabelMap(map); } goodsSubClassMapper.updateByPrimaryKey(record); } fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/ShareHotGoodsServiceImpl.java
@@ -22,6 +22,7 @@ if (goods == null || StringUtil.isNullOrEmpty(goods.getDay()) || goods.getGoods() == null) return; goods.setId(StringUtil.Md5(goods.getDay() + "#" + goods.getGoods().getAuctionId())); if (goods.getUpdateTime() == null) goods.setUpdateTime(new Date()); shareHotGoodsDao.save(goods); } fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsSubClassService.java
@@ -123,7 +123,7 @@ * @throws GoodsSubClassException * @throws Exception */ public void saveObject(MultipartFile file,MultipartFile file2, GoodsSubClass record, Integer type, Long pid) public void saveObject(MultipartFile file,MultipartFile file2, GoodsSubClass record, Integer type, Long pid,Long labelId) throws GoodsSubClassException, Exception; } fanli/src/main/resource/ehcache.xml
@@ -196,4 +196,10 @@ maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" memoryStoreEvictionPolicy="LRU" /> <!-- 通用模板缓存 --> <cache name="commonContentCache" maxElementsInMemory="1000" maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" memoryStoreEvictionPolicy="LRU" /> </ehcache>