hexiaohui
2019-04-03 d4b3ee96ac6093683fce254541b113fb6a762060
Merge remote-tracking branch 'origin/master'

Conflicts:
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
23个文件已修改
489 ■■■■ 已修改文件
.project 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/.classpath 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/SearchController.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoOrderMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/goods/CommonGoods.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBrief.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/UpdateCommonOrderJob.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/goods/CommonGoodsMapper.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoGoodsBriefMapper.xml 144 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoOrderMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/CommonGoodsFactory.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/MyBatisProduce.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/.classpath 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/.project 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.project
@@ -6,6 +6,11 @@
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.wst.common.project.facet.core.builder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
@@ -19,5 +24,6 @@
    <natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>org.eclipse.m2e.core.maven2Nature</nature>
        <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
    </natures>
</projectDescription>
fanli/.classpath
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resource">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java">
        <attributes>
            <attribute name="optional" value="true"/>
@@ -15,7 +10,6 @@
        <attributes>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
            <attribute name="test" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
@@ -24,20 +18,11 @@
            <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
    <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resource">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="lib" path="libs/aes-jre1.6.jar"/>
    <classpathentry kind="lib" path="libs/alipay-sdk-java20170324180803.jar"/>
    <classpathentry kind="lib" path="libs/HMS_SDK_2.6.0.301_ADT.jar"/>
    <classpathentry kind="lib" path="libs/HMSAgent_2.6.0.302.jar"/>
    <classpathentry kind="lib" path="libs/javapns-jdk16-2.3.1.jar"/>
    <classpathentry kind="lib" path="libs/MiPush_SDK_Server_2_2_18.jar"/>
    <classpathentry kind="lib" path="libs/open-api-sdk-2.0.jar"/>
    <classpathentry kind="lib" path="libs/PushJavaSDK.jar"/>
    <classpathentry kind="lib" path="libs/taobao-sdk-java-auto_1533536267316-20180829.jar"/>
    <classpathentry kind="lib" path="libs/ueditor-1.1.2.jar"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0_161"/>
    <classpathentry kind="output" path="target/classes"/>
</classpath>
fanli/src/main/java/com/yeshi/fanli/controller/client/SearchController.java
@@ -3,12 +3,14 @@
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import javax.print.attribute.standard.NumberUp;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Controller;
@@ -34,6 +36,7 @@
import com.yeshi.fanli.entity.taobao.TaoBaoSearchNav;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
@@ -47,6 +50,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.SearchFilterUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import net.sf.ehcache.Element;
import net.sf.json.JSONArray;
@@ -82,7 +86,8 @@
    @RequestMapping(value = "gethotsearch", method = RequestMethod.POST)
    public void getHotSearch(AcceptData acceptData, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
@@ -160,7 +165,8 @@
            String endprice, String fastFilter, PrintWriter out) {
        String bid = getHistorySearchBid(acceptData);
        historySearchService.addHistorySearch(kw, bid);
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
@@ -398,7 +404,8 @@
        historySearchService.addHistorySearch(kw, bid);
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
@@ -593,6 +600,25 @@
        if (result == null) {
            return null;
        }
        // 搜索是否在营销主商品库
        if (result != null && result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() > 0) {
            String numIds = "";
            for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
                numIds += goods.getAuctionId() + ",";
            }
            if (numIds.endsWith(","))
                numIds = numIds.substring(0, numIds.length() - 1);
            try {
                List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getBatchGoodsInfos(numIds);
                Map<Long, Integer> map = new HashMap<>();
                for (TaoBaoGoodsBrief g : goodsList)
                    map.put(g.getAuctionId(), g.getMaterialLibType());
                for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs())
                    goods.setMaterialLibType(map.get(goods.getAuctionId()));
            } catch (TaobaoGoodsDownException e) {
                e.printStackTrace();
            }
        }
        List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
        if (result.getNavList() != null)
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java
@@ -221,5 +221,12 @@
     */
    ThreeSale getRelationshipByBossIdAndWorkerId(@Param("bossId") Long bossId, @Param("workerId") Long workerId);
    
    /**
     * 根据下级查询成功的邀请关系
     * @param workerId
     * @return
     */
    ThreeSale selectSuccessByWorkerId(Long workerId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoOrderMapper.java
@@ -75,4 +75,11 @@
            @Param("startTime")String startTime, @Param("endTime")String endTime);
    
    /**
     * 获取长期未更新的订单
     * @param start
     * @param count
     * @return
     */
    List<TaoBaoOrder> listLongTimeNoUpdateOrders(@Param("start")long start,@Param("count")int count);
}
fanli/src/main/java/com/yeshi/fanli/entity/goods/CommonGoods.java
@@ -57,6 +57,8 @@
    private String videoCover;
    @Column(name = "cg_video_url")
    private String videoUrl;
    @Column(name = "cg_material_lib_type")
    private Integer materialLibType;// 物料库类型 1-营销商品库 0-非营销商品库
    @Column(name = "cg_createtime")
    private Date createTime;
    @Column(name = "cg_updatetime")
@@ -93,6 +95,14 @@
        this.goodsId = goodsId;
    }
    public Integer getMaterialLibType() {
        return materialLibType;
    }
    public void setMaterialLibType(Integer materialLibType) {
        this.materialLibType = materialLibType;
    }
    public Integer getGoodsType() {
        return goodsType;
    }
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBrief.java
@@ -268,6 +268,7 @@
    @Column
    private Integer state;// 0-正常 1-商品下架
    
    @org.yeshi.utils.mybatis.Column(name = "material_lib_type")
    @Transient
    private Integer materialLibType;//物料库类型
    
fanli/src/main/java/com/yeshi/fanli/job/UpdateCommonOrderJob.java
@@ -10,6 +10,7 @@
import org.springframework.scheduling.annotation.Scheduled;
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
import com.yeshi.fanli.entity.bus.user.Order;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
import com.yeshi.fanli.log.LogHelper;
@@ -20,6 +21,7 @@
import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
import com.yeshi.fanli.util.BeanUtil;
import com.yeshi.fanli.util.CMQManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisManager;
@@ -62,6 +64,9 @@
    @Resource
    private OrderService orderService;
    @Resource
    private TaoBaoOrderMapper taoBaoOrderMapper;
    /**
     * 新版获取普通订单
@@ -207,4 +212,20 @@
        addOrderNew(orderList);
    }
    // 每晚10点执行漏单
    @Scheduled(cron = "0 0 22 * * ? ")
    public void doJob3() {
        List<TaoBaoOrder> orderList = taoBaoOrderMapper.listLongTimeNoUpdateOrders(0, 10);
        List<TaoBaoOrder> updateOrderList = new ArrayList<>();
        for (TaoBaoOrder order : orderList) {
            List<TaoBaoOrder> newList = TaoKeOrderApiUtil.getTaoBaoAllOrder(order.getCreateTime(), 60, 1,
                    Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
            for (TaoBaoOrder o : newList) {
                if (o.getOrderId().equalsIgnoreCase(order.getOrderId()))
                    updateOrderList.add(o);
            }
        }
        addOrderNew(updateOrderList);
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -155,7 +155,8 @@
    <delete id="deleteExpireRecord" parameterType="java.lang.Long">
        DELETE FROM
        yeshi_ec_threesale
        WHERE expire = 1 AND boss_id = #{bossId} AND worker_id = #{workerId}
        WHERE expire = 1 AND boss_id = #{bossId} AND
        worker_id = #{workerId}
    </delete>
    <!-- 查询一度队员集合 -->
@@ -392,7 +393,8 @@
        SELECT * FROM
        `yeshi_ec_threesale` ts
        LEFT JOIN `yeshi_ec_threesale_extra_info` ff
        ON ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`
        ON
        ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`
        WHERE ts.`boss_id` = #{uid}
        ORDER BY ts.state DESC, ts.expire,
        ts.createTime DESC
@@ -411,16 +413,22 @@
    <select id="listSecondTeam" resultMap="AllResultMap">
        SELECT yet.* FROM (
        SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
        LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
        WHERE tf.`boss_id` = #{uid})A
        SELECT
        DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
        LEFT JOIN
        yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
        WHERE tf.`boss_id`
        = #{uid})A
        LEFT JOIN yeshi_ec_threesale yet ON yet.id =
        A.id
        LEFT JOIN `yeshi_ec_threesale_extra_info` ff
        LEFT JOIN
        `yeshi_ec_threesale_extra_info` ff
        ON yet.`boss_id` =
        ff.`tf_boss_id` AND yet.`worker_id` =ff.`tf_worker_id`
        ff.`tf_boss_id`
        AND yet.`worker_id` =ff.`tf_worker_id`
        ORDER BY
        yet.state DESC, yet.expire, yet.createTime DESC
        yet.state DESC,
        yet.expire, yet.createTime DESC
        LIMIT ${start},${count}
    </select>
@@ -456,19 +464,31 @@
    </select>
    <select id="getSuccessRelationshipNum" resultType="java.lang.Integer">
        SELECT IFNULL (COUNT(*),0) FROM `yeshi_ec_threesale` t
        WHERE t.`state` = 1 AND (t.`worker_id` =${uid} OR t.`boss_id` = ${uid})
        SELECT IFNULL
        (COUNT(*),0) FROM `yeshi_ec_threesale` t
        WHERE t.`state` = 1 AND
        (t.`worker_id` =${uid} OR t.`boss_id` = ${uid})
    </select>
    <select id="getRelationshipByBossIdAndWorkerId" resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_threesale` t
        WHERE t.`boss_id` = ${bossId} AND t.`worker_id` = ${workerId}
        AND t.`state` = 0 AND (t.`expire` = 0 OR t.`expire`IS NULL)
        WHERE t.`boss_id` = ${bossId} AND
        t.`worker_id` = ${workerId}
        AND t.`state` = 0 AND (t.`expire` = 0 OR
        t.`expire`IS NULL)
        LIMIT 1
    </select>
    <select id="getExpireRecord" resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_threesale`
        WHERE expire = 1 AND boss_id = #{bossId} AND worker_id = #{workerId}
        SELECT * FROM
        `yeshi_ec_threesale`
        WHERE expire = 1 AND boss_id = #{bossId} AND
        worker_id = #{workerId}
    </select>
    <select id="selectSuccessByWorkerId" resultMap="BaseResultMap" parameterType="java.lang.Long">
        SELECT * FROM `yeshi_ec_threesale`
        WHERE `state` = 1 AND worker_id = #{0}  order by id desc
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/goods/CommonGoodsMapper.xml
@@ -13,7 +13,8 @@
        <result column="cg_sales" property="sales" jdbcType="INTEGER" />
        <result column="cg_rate" property="rate" jdbcType="DECIMAL" />
        <result column="cg_picture" property="picture" jdbcType="VARCHAR" />
        <result column="cg_picture_white" property="pictureWhite" jdbcType="VARCHAR" />
        <result column="cg_picture_white" property="pictureWhite"
            jdbcType="VARCHAR" />
        <result column="cg_state" property="state" jdbcType="INTEGER" />
        <result column="cg_price" property="price" jdbcType="DECIMAL" />
        <result column="cg_coupon_info" property="couponInfo" jdbcType="VARCHAR" />
@@ -29,8 +30,10 @@
        <result column="cg_video_url" property="videoUrl" jdbcType="VARCHAR" />
        <result column="cg_createtime" property="createTime" jdbcType="TIMESTAMP" />
        <result column="cg_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="cg_material_lib_type" property="materialLibType"
            jdbcType="INTEGER" />
    </resultMap>
    <sql id="Base_Column_List">cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime
    <sql id="Base_Column_List">cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime,cg_material_lib_type
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -38,24 +41,19 @@
        <include refid="Base_Column_List" />
        from yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByGoodsIdAndGoodsType" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_common_goods where cg_goods_id = #{goodsId} and
        cg_goods_type=#{goodsType}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT}
    </delete>
        yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.goods.CommonGoods"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_goods
        (cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime)
        (cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime,cg_material_lib_type)
        values
        (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{goodsType,jdbcType=INTEGER},#{shopType,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{sellerName,jdbcType=VARCHAR},#{sales,jdbcType=INTEGER},#{rate,jdbcType=DECIMAL},#{picture,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{couponInfo,jdbcType=VARCHAR},#{couponStartPrice,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{couponLeftCount,jdbcType=INTEGER},#{couponTotalCount,jdbcType=INTEGER},#{videoCover,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
        (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{goodsType,jdbcType=INTEGER},#{shopType,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{sellerName,jdbcType=VARCHAR},#{sales,jdbcType=INTEGER},#{rate,jdbcType=DECIMAL},#{picture,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{couponInfo,jdbcType=VARCHAR},#{couponStartPrice,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{couponLeftCount,jdbcType=INTEGER},#{couponTotalCount,jdbcType=INTEGER},#{videoCover,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{materialLibType,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.CommonGoods"
        useGeneratedKeys="true" keyProperty="id">
@@ -83,6 +81,7 @@
            <if test="videoUrl != null">cg_video_url,</if>
            <if test="createTime != null">cg_createtime,</if>
            <if test="updateTime != null">cg_updatetime,</if>
            <if test="materialLibType != null">cg_material_lib_type,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -108,6 +107,7 @@
            <if test="videoUrl != null">#{videoUrl,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="materialLibType != null">#{materialLibType,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.goods.CommonGoods">update
@@ -132,8 +132,9 @@
        #{videoCover,jdbcType=VARCHAR},cg_video_url =
        #{videoUrl,jdbcType=VARCHAR},cg_createtime =
        #{createTime,jdbcType=TIMESTAMP},cg_updatetime =
        #{updateTime,jdbcType=TIMESTAMP} where cg_id = #{id,jdbcType=BIGINT}
    </update>
        #{updateTime,jdbcType=TIMESTAMP} ,cg_material_lib_type
        =#{materialLibType,jdbcType=INTEGER} where cg_id =
        #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.goods.CommonGoods">
        update yeshi_ec_common_goods
        <set>
@@ -161,6 +162,9 @@
            <if test="videoUrl != null">cg_video_url=#{videoUrl,jdbcType=VARCHAR},</if>
            <if test="createTime != null">cg_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">cg_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="id !=null">cg_id =#{id,jdbcType=BIGINT},</if>
            <if test="materialLibType !=null">cg_material_lib_type
                =#{materialLibType,jdbcType=INTEGER},</if>
        </set>
        where cg_id = #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoGoodsBriefMapper.xml
@@ -69,8 +69,10 @@
        <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
        <result column="state" property="state" jdbcType="INTEGER" />
        <result column="totalSales" property="totalSales" jdbcType="INTEGER" />
        <result column="material_lib_type" property="materialLibType"
            jdbcType="INTEGER" />
    </resultMap>
    <sql id="Base_Column_List">id,rootCatId,eventCreatorId,leafCatId,debugInfo,rootCatScore,sellerId,userType,shopTitle,pictUrl,pictUrlWhite,title,auctionId,couponLink,couponLinkTaoToken,couponActivityId,biz30day,tkRate,nick,includeDxjh,reservePrice,tkCommFee,totalFee,totalNum,zkPrice,dayLeft,tk3rdRate,auctionUrl,rlRate,hasRecommended,hasSame,sameItemPid,couponTotalCount,couponLeftCount,couponAmount,eventRate,couponShortLink,couponInfo,couponStartFee,couponEffectiveStartTime,couponEffectiveEndTime,hasUmpBonus,isBizActivity,umpBonus,rootCategoryName,couponOriLink,userTypeName,createtime,tkMktStatus,updatetime,state,totalSales
    <sql id="Base_Column_List">id,rootCatId,eventCreatorId,leafCatId,debugInfo,rootCatScore,sellerId,userType,shopTitle,pictUrl,pictUrlWhite,title,auctionId,couponLink,couponLinkTaoToken,couponActivityId,biz30day,tkRate,nick,includeDxjh,reservePrice,tkCommFee,totalFee,totalNum,zkPrice,dayLeft,tk3rdRate,auctionUrl,rlRate,hasRecommended,hasSame,sameItemPid,couponTotalCount,couponLeftCount,couponAmount,eventRate,couponShortLink,couponInfo,couponStartFee,couponEffectiveStartTime,couponEffectiveEndTime,hasUmpBonus,isBizActivity,umpBonus,rootCategoryName,couponOriLink,userTypeName,createtime,tkMktStatus,updatetime,state,totalSales,material_lib_type
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -124,11 +126,13 @@
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_goods
        (id,rootCatId,eventCreatorId,leafCatId,debugInfo,rootCatScore,sellerId,userType,shopTitle,pictUrl,pictUrlWhite,title,auctionId,couponLink,couponLinkTaoToken,couponActivityId,biz30day,tkRate,nick,includeDxjh,reservePrice,tkCommFee,totalFee,totalNum,zkPrice,dayLeft,tk3rdRate,auctionUrl,rlRate,hasRecommended,hasSame,sameItemPid,couponTotalCount,couponLeftCount,couponAmount,eventRate,couponShortLink,couponInfo,couponStartFee,couponEffectiveStartTime,couponEffectiveEndTime,hasUmpBonus,isBizActivity,umpBonus,rootCategoryName,couponOriLink,userTypeName,createtime,tkMktStatus,updatetime,state,totalSales)
        (id,rootCatId,eventCreatorId,leafCatId,debugInfo,rootCatScore,sellerId,userType,shopTitle,pictUrl,pictUrlWhite,title,auctionId,couponLink,couponLinkTaoToken,couponActivityId,biz30day,tkRate,nick,includeDxjh,reservePrice,tkCommFee,totalFee,totalNum,zkPrice,dayLeft,tk3rdRate,auctionUrl,rlRate,hasRecommended,hasSame,sameItemPid,couponTotalCount,couponLeftCount,couponAmount,eventRate,couponShortLink,couponInfo,couponStartFee,couponEffectiveStartTime,couponEffectiveEndTime,hasUmpBonus,isBizActivity,umpBonus,rootCategoryName,couponOriLink,userTypeName,createtime,tkMktStatus,updatetime,state,totalSales,material_lib_type)
        values
        (#{id,jdbcType=BIGINT},#{rootCatId,jdbcType=INTEGER},#{eventCreatorId,jdbcType=INTEGER},#{leafCatId,jdbcType=INTEGER},#{debugInfo,jdbcType=VARCHAR},#{rootCatScore,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{userType,jdbcType=INTEGER},#{shopTitle,jdbcType=VARCHAR},#{pictUrl,jdbcType=VARCHAR},#{pictUrlWhite,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{couponLink,jdbcType=VARCHAR},#{couponLinkTaoToken,jdbcType=VARCHAR},#{couponActivityId,jdbcType=VARCHAR},#{biz30day,jdbcType=INTEGER},#{tkRate,jdbcType=DECIMAL},#{nick,jdbcType=VARCHAR},#{includeDxjh,jdbcType=INTEGER},#{reservePrice,jdbcType=DECIMAL},#{tkCommFee,jdbcType=DECIMAL},#{totalFee,jdbcType=DECIMAL},#{totalNum,jdbcType=INTEGER},#{zkPrice,jdbcType=DECIMAL},#{dayLeft,jdbcType=INTEGER},#{tk3rdRate,jdbcType=VARCHAR},#{auctionUrl,jdbcType=VARCHAR},#{rlRate,jdbcType=DECIMAL},#{hasRecommended,jdbcType=INTEGER},#{hasSame,jdbcType=INTEGER},#{sameItemPid,jdbcType=BIGINT},#{couponTotalCount,jdbcType=INTEGER},#{couponLeftCount,jdbcType=INTEGER},#{couponAmount,jdbcType=DECIMAL},#{eventRate,jdbcType=VARCHAR},#{couponShortLink,jdbcType=VARCHAR},#{couponInfo,jdbcType=VARCHAR},#{couponStartFee,jdbcType=DECIMAL},#{couponEffectiveStartTime,jdbcType=VARCHAR},#{couponEffectiveEndTime,jdbcType=VARCHAR},#{hasUmpBonus,jdbcType=VARCHAR},#{isBizActivity,jdbcType=VARCHAR},#{umpBonus,jdbcType=VARCHAR},#{rootCategoryName,jdbcType=VARCHAR},#{couponOriLink,jdbcType=VARCHAR},#{userTypeName,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{tkMktStatus,jdbcType=VARCHAR},#{updatetime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{totalSales,jdbcType=INTEGER})
        (#{id,jdbcType=BIGINT},#{rootCatId,jdbcType=INTEGER},#{eventCreatorId,jdbcType=INTEGER},#{leafCatId,jdbcType=INTEGER},#{debugInfo,jdbcType=VARCHAR},#{rootCatScore,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{userType,jdbcType=INTEGER},#{shopTitle,jdbcType=VARCHAR},#{pictUrl,jdbcType=VARCHAR},#{pictUrlWhite,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{couponLink,jdbcType=VARCHAR},#{couponLinkTaoToken,jdbcType=VARCHAR},#{couponActivityId,jdbcType=VARCHAR},#{biz30day,jdbcType=INTEGER},#{tkRate,jdbcType=DECIMAL},#{nick,jdbcType=VARCHAR},#{includeDxjh,jdbcType=INTEGER},#{reservePrice,jdbcType=DECIMAL},#{tkCommFee,jdbcType=DECIMAL},#{totalFee,jdbcType=DECIMAL},#{totalNum,jdbcType=INTEGER},#{zkPrice,jdbcType=DECIMAL},#{dayLeft,jdbcType=INTEGER},#{tk3rdRate,jdbcType=VARCHAR},#{auctionUrl,jdbcType=VARCHAR},#{rlRate,jdbcType=DECIMAL},#{hasRecommended,jdbcType=INTEGER},#{hasSame,jdbcType=INTEGER},#{sameItemPid,jdbcType=BIGINT},#{couponTotalCount,jdbcType=INTEGER},#{couponLeftCount,jdbcType=INTEGER},#{couponAmount,jdbcType=DECIMAL},#{eventRate,jdbcType=VARCHAR},#{couponShortLink,jdbcType=VARCHAR},#{couponInfo,jdbcType=VARCHAR},#{couponStartFee,jdbcType=DECIMAL},#{couponEffectiveStartTime,jdbcType=VARCHAR},#{couponEffectiveEndTime,jdbcType=VARCHAR},#{hasUmpBonus,jdbcType=VARCHAR},#{isBizActivity,jdbcType=VARCHAR},#{umpBonus,jdbcType=VARCHAR},#{rootCategoryName,jdbcType=VARCHAR},#{couponOriLink,jdbcType=VARCHAR},#{userTypeName,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{tkMktStatus,jdbcType=VARCHAR},#{updatetime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{totalSales,jdbcType=INTEGER},#{materialLibType,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief"
        useGeneratedKeys="true" keyProperty="id">
@@ -186,6 +190,7 @@
            <if test="updatetime != null">updatetime,</if>
            <if test="state != null">state,</if>
            <if test="totalSales != null">totalSales,</if>
            <if test="materialLibType != null">material_lib_type,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -241,62 +246,104 @@
            <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
            <if test="state != null">#{state,jdbcType=INTEGER}</if>
            <if test="totalSales != null">#{totalSales,jdbcType=INTEGER}</if>
            <if test="materialLibType != null">#{materialLibType,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief">update
        yeshi_ec_taobao_goods set 
        rootCatId =    #{rootCatId,jdbcType=INTEGER},
        eventCreatorId = #{eventCreatorId,jdbcType=INTEGER},
        leafCatId =    #{leafCatId,jdbcType=INTEGER},
        debugInfo =    #{debugInfo,jdbcType=VARCHAR},
        rootCatScore = #{rootCatScore,jdbcType=INTEGER},
        sellerId = #{sellerId,jdbcType=BIGINT},
        eventCreatorId =
        #{eventCreatorId,jdbcType=INTEGER},
        leafCatId =
        #{leafCatId,jdbcType=INTEGER},
        debugInfo =
        #{debugInfo,jdbcType=VARCHAR},
        rootCatScore =
        #{rootCatScore,jdbcType=INTEGER},
        sellerId =
        #{sellerId,jdbcType=BIGINT},
        userType = #{userType,jdbcType=INTEGER},
        shopTitle = #{shopTitle,jdbcType=VARCHAR},
        pictUrl = #{pictUrl,jdbcType=VARCHAR},
        pictUrlWhite = #{pictUrlWhite,jdbcType=VARCHAR},
        pictUrl =
        #{pictUrl,jdbcType=VARCHAR},
        pictUrlWhite =
        #{pictUrlWhite,jdbcType=VARCHAR},
        title =    #{title,jdbcType=VARCHAR},
        auctionId =    #{auctionId,jdbcType=BIGINT},
        couponLink = #{couponLink,jdbcType=VARCHAR},
        couponLinkTaoToken = #{couponLinkTaoToken,jdbcType=VARCHAR},
        couponActivityId = #{couponActivityId,jdbcType=VARCHAR},
        biz30day = #{biz30day,jdbcType=INTEGER},
        couponLink =
        #{couponLink,jdbcType=VARCHAR},
        couponLinkTaoToken =
        #{couponLinkTaoToken,jdbcType=VARCHAR},
        couponActivityId =
        #{couponActivityId,jdbcType=VARCHAR},
        biz30day =
        #{biz30day,jdbcType=INTEGER},
        tkRate = #{tkRate,jdbcType=DECIMAL},
        nick = #{nick,jdbcType=VARCHAR},
        includeDxjh = #{includeDxjh,jdbcType=INTEGER},
        reservePrice = #{reservePrice,jdbcType=DECIMAL},
        tkCommFee = #{tkCommFee,jdbcType=DECIMAL},
        nick
        = #{nick,jdbcType=VARCHAR},
        includeDxjh =
        #{includeDxjh,jdbcType=INTEGER},
        reservePrice =
        #{reservePrice,jdbcType=DECIMAL},
        tkCommFee =
        #{tkCommFee,jdbcType=DECIMAL},
        totalFee = #{totalFee,jdbcType=DECIMAL},
        totalNum = #{totalNum,jdbcType=INTEGER},
        zkPrice = #{zkPrice,jdbcType=DECIMAL},
        zkPrice =
        #{zkPrice,jdbcType=DECIMAL},
        dayLeft = #{dayLeft,jdbcType=INTEGER},
        tk3rdRate = #{tk3rdRate,jdbcType=VARCHAR},
        auctionUrl = #{auctionUrl,jdbcType=VARCHAR},
        auctionUrl =
        #{auctionUrl,jdbcType=VARCHAR},
        rlRate = #{rlRate,jdbcType=DECIMAL},
        hasRecommended = #{hasRecommended,jdbcType=INTEGER},
        hasSame = #{hasSame,jdbcType=INTEGER},
        sameItemPid = #{sameItemPid,jdbcType=BIGINT},
        couponTotalCount = #{couponTotalCount,jdbcType=INTEGER},
        couponLeftCount = #{couponLeftCount,jdbcType=INTEGER},
        couponAmount = #{couponAmount,jdbcType=DECIMAL},
        eventRate = #{eventRate,jdbcType=VARCHAR},
        couponShortLink = #{couponShortLink,jdbcType=VARCHAR},
        couponInfo = #{couponInfo,jdbcType=VARCHAR},
        couponStartFee = #{couponStartFee,jdbcType=DECIMAL},
        couponEffectiveStartTime = #{couponEffectiveStartTime,jdbcType=VARCHAR},
        couponEffectiveEndTime = #{couponEffectiveEndTime,jdbcType=VARCHAR},
        hasUmpBonus = #{hasUmpBonus,jdbcType=VARCHAR},
        isBizActivity =    #{isBizActivity,jdbcType=VARCHAR},
        umpBonus = #{umpBonus,jdbcType=VARCHAR},
        rootCategoryName = #{rootCategoryName,jdbcType=VARCHAR},
        ]couponOriLink = #{couponOriLink,jdbcType=VARCHAR},
        userTypeName = #{userTypeName,jdbcType=VARCHAR},
        createtime = #{createtime,jdbcType=TIMESTAMP},
        tkMktStatus = #{tkMktStatus,jdbcType=VARCHAR} ,
        updatetime = #{updatetime,jdbcType=TIMESTAMP},
        hasSame =
        #{hasSame,jdbcType=INTEGER},
        sameItemPid =
        #{sameItemPid,jdbcType=BIGINT},
        couponTotalCount =
        #{couponTotalCount,jdbcType=INTEGER},
        couponLeftCount =
        #{couponLeftCount,jdbcType=INTEGER},
        couponAmount =
        #{couponAmount,jdbcType=DECIMAL},
        eventRate =
        #{eventRate,jdbcType=VARCHAR},
        couponShortLink =
        #{couponShortLink,jdbcType=VARCHAR},
        couponInfo =
        #{couponInfo,jdbcType=VARCHAR},
        couponStartFee =
        #{couponStartFee,jdbcType=DECIMAL},
        couponEffectiveStartTime =
        #{couponEffectiveStartTime,jdbcType=VARCHAR},
        couponEffectiveEndTime =
        #{couponEffectiveEndTime,jdbcType=VARCHAR},
        hasUmpBonus =
        #{hasUmpBonus,jdbcType=VARCHAR},
        isBizActivity =
        #{isBizActivity,jdbcType=VARCHAR},
        umpBonus =
        #{umpBonus,jdbcType=VARCHAR},
        rootCategoryName =
        #{rootCategoryName,jdbcType=VARCHAR},
        ]couponOriLink =
        #{couponOriLink,jdbcType=VARCHAR},
        userTypeName =
        #{userTypeName,jdbcType=VARCHAR},
        createtime =
        #{createtime,jdbcType=TIMESTAMP},
        tkMktStatus =
        #{tkMktStatus,jdbcType=VARCHAR} ,
        updatetime =
        #{updatetime,jdbcType=TIMESTAMP},
        state =#{state,jdbcType=INTEGER},
        totalSales =#{totalSales,jdbcType=INTEGER}
        where id = #{id,jdbcType=BIGINT}
        totalSales =#{totalSales,jdbcType=INTEGER},
        material_lib_type =#{materialLibType,jdbcType=INTEGER}
        where id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief">
        update yeshi_ec_taobao_goods
@@ -358,6 +405,7 @@
            <if test="updatetime !=null">updatetime =#{updatetime,jdbcType=TIMESTAMP},</if>
            <if test="state !=null">state =#{state,jdbcType=INTEGER},</if>
            <if test="totalSales !=null">totalSales =#{totalSales,jdbcType=INTEGER},</if>
            <if test="materialLibType !=null">material_lib_type =#{materialLibType,jdbcType=INTEGER},</if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
@@ -426,7 +474,8 @@
            #{item.tkMktStatus,jdbcType=VARCHAR},
            #{item.updatetime,jdbcType=TIMESTAMP},
            #{item.state,jdbcType=INTEGER},
            #{item.totalSales,jdbcType=INTEGER}
            #{item.totalSales,jdbcType=INTEGER},
            #{item.materialLibType,jdbcType=INTEGER}
            )
        </foreach>
    </insert>
@@ -638,6 +687,15 @@
                </foreach>
            </trim>
            <trim prefix="materialLibType =case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                    <if test="item.materialLibType !=null">
                        when id=#{item.id} then #{item.materialLibType}
                    </if>
                </foreach>
            </trim>
            <trim prefix="createtime =case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                    <if test="item.createtime !=null">
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoOrderMapper.xml
@@ -82,6 +82,14 @@
        from yeshi_ec_taobao_order where to_trade_id = #{0}
    </select>
    
    <select id="listLongTimeNoUpdateOrders" resultMap="BaseResultMap">
        SELECT * FROM yeshi_ec_taobao_order t WHERE t.`to_order_state`='订单付款' AND UNIX_TIMESTAMP(t.`to_create_time`) <![CDATA[  <  ]]> UNIX_TIMESTAMP()-60*60*24*15 AND (t.`to_latest_updatetime` IS NULL OR UNIX_TIMESTAMP(t.`to_latest_updatetime`)<![CDATA[ < ]]>  UNIX_TIMESTAMP()-60*60*24*2) ORDER BY t.`to_create_time` DESC  limit #{start},#{count}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT}</delete>
    <delete id="deleteByOrderId" parameterType="java.lang.String">delete from
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java
@@ -27,6 +27,7 @@
import com.yeshi.fanli.dto.HongBaoDTO;
import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.order.CommonOrder;
@@ -337,7 +338,7 @@
            // 获取子红包
            List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
            if (children != null)
            if (children != null && children.size() > 0)
                for (HongBaoV2 child : children) {
                    HongBaoV2 childUpdate = new HongBaoV2(child.getId());
                    childUpdate.setState(hongBao.getState());
@@ -386,7 +387,110 @@
                    }
                }
            else {// 修复之前二级,三级订单未统计到的情况
                if (!mianDan) {
                    ThreeSale threeSale = threeSaleSerivce.selectByWorkerId(commonOrder.getUserInfo().getId());
                    if (threeSale != null && threeSale.getSucceedTime() != null
                            && threeSale.getSucceedTime() <= commonOrder.getThirdCreateTime().getTime()) {
                        UserInfo boss = threeSaleSerivce.getBoss(commonOrder.getUserInfo().getId());
                        // 插入一级子红包
                        BigDecimal firstRate = hongBaoManageService
                                .getFirstInviteRate(boss.getRank() == null ? 0 : boss.getRank());
                        if (firstRate.compareTo(new BigDecimal(0)) <= 0)
                            return;
                        HongBaoV2 firstHongbao = new HongBaoV2();
                        firstHongbao.setUserInfo(boss);
                        firstHongbao.setUrank(boss.getRank());
                        firstHongbao.setParent(hongBao);
                        firstHongbao.setCreateTime(new Date());
                        firstHongbao.setType(HongBaoV2.TYPE_YIJI);
                        firstHongbao.setVersion(2);
                        firstHongbao.setState(hongBao.getState());
                        if (hongBao.getState() == HongBaoV2.STATE_KELINGQU) {
                            firstHongbao.setMoney(
                                    MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100))));
                            Calendar calendar = Calendar.getInstance();
                            calendar.setTime(commonOrder.getSettleTime());
                            calendar.add(Calendar.MONTH, 1);
                            firstHongbao.setPreGetTime(new Date(TimeUtil.convertToTimeTemp(
                                    calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-25",
                                    "yyyy-M-dd")));
                        } else if (hongBao.getState() == HongBaoV2.STATE_BUKELINGQU) {
                            firstHongbao.setMoney(
                                    MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100))));
                        }
                        hongBaoV2Mapper.insertSelective(firstHongbao);
                        // 用户通知
                        if (notificationMap.get(HongBaoV2.TYPE_YIJI) == null) {
                            HongBaoV2 tempHongBao = new HongBaoV2(firstHongbao.getId());
                            tempHongBao.setUserInfo(firstHongbao.getUserInfo());
                            tempHongBao.setMoney(firstHongbao.getMoney());
                            CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
                            tempCommonOrder.setPayment(commonOrder.getPayment());
                            notificationMap.put(HongBaoV2.TYPE_YIJI, new HongBaoOrder(tempCommonOrder, tempHongBao));
                        } else {
                            // 增加付款金额与资金
                            HongBaoOrder tempHongBaoOrder = notificationMap.get(HongBaoV2.TYPE_YIJI);
                            tempHongBaoOrder.getCommonOrder().setPayment(
                                    tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment()));
                            tempHongBaoOrder.getHongBaoV2()
                                    .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(firstHongbao.getMoney()));
                            notificationMap.put(HongBaoV2.TYPE_YIJI, tempHongBaoOrder);
                        }
                        // 插入二级子红包
                        boss = threeSaleSerivce.getBoss(boss.getId());
                        if (boss != null) {// 二级BOSS存在
                            BigDecimal secondRate = hongBaoManageService
                                    .getSecondInviteRate(boss.getRank() == null ? 0 : boss.getRank());
                            if (secondRate.compareTo(new BigDecimal(0)) <= 0)
                                return;
                            HongBaoV2 secondHongbao = new HongBaoV2();
                            secondHongbao.setUserInfo(boss);
                            secondHongbao.setUrank(boss.getRank());
                            secondHongbao.setParent(hongBao);
                            secondHongbao.setCreateTime(new Date());
                            secondHongbao.setType(HongBaoV2.TYPE_ERJI);
                            secondHongbao.setVersion(2);
                            secondHongbao.setState(hongBao.getState());
                            if (hongBao.getState() == HongBaoV2.STATE_KELINGQU) {
                                secondHongbao.setMoney(MoneyBigDecimalUtil.mul(hongBao.getMoney(),
                                        secondRate.divide(new BigDecimal(100))));
                                Calendar calendar = Calendar.getInstance();
                                calendar.setTime(commonOrder.getSettleTime());
                                calendar.add(Calendar.MONTH, 1);
                                secondHongbao.setPreGetTime(new Date(TimeUtil.convertToTimeTemp(
                                        calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-25",
                                        "yyyy-M-dd")));
                            } else if (hongBao.getState() == HongBaoV2.STATE_BUKELINGQU) {
                                secondHongbao.setMoney(MoneyBigDecimalUtil.mul(hongBao.getMoney(),
                                        secondRate.divide(new BigDecimal(100))));
                            }
                            hongBaoV2Mapper.insertSelective(secondHongbao);
                            // 用户通知
                            if (notificationMap.get(HongBaoV2.TYPE_ERJI) == null) {
                                HongBaoV2 tempHongBao = new HongBaoV2(secondHongbao.getId());
                                tempHongBao.setUserInfo(secondHongbao.getUserInfo());
                                tempHongBao.setMoney(secondHongbao.getMoney());
                                CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
                                tempCommonOrder.setPayment(commonOrder.getPayment());
                                notificationMap.put(HongBaoV2.TYPE_ERJI,
                                        new HongBaoOrder(tempCommonOrder, tempHongBao));
                            } else {
                                // 增加付款金额与资金
                                HongBaoOrder tempHongBaoOrder = notificationMap.get(HongBaoV2.TYPE_ERJI);
                                tempHongBaoOrder.getCommonOrder().setPayment(
                                        tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment()));
                                tempHongBaoOrder.getHongBaoV2().setMoney(
                                        tempHongBaoOrder.getHongBaoV2().getMoney().add(secondHongbao.getMoney()));
                                notificationMap.put(HongBaoV2.TYPE_ERJI, tempHongBaoOrder);
                            }
                        }
                    }
                }
            }
        } else if (type == HongBaoV2.TYPE_SHARE_GOODS) {
            BigDecimal fanliRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
            List<ShareGoodsActivityOrder> list = shareGoodsActivityOrderService
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -535,4 +535,9 @@
        return threeSaleMapper.countFirstTeam(uid, 1);
    }
    @Override
    public ThreeSale selectByWorkerId(Long workerId) {
        return threeSaleMapper.selectSuccessByWorkerId(workerId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java
@@ -182,6 +182,7 @@
        updateGoods.setRootCategoryName(goods.getRootCategoryName());
        updateGoods.setLeafCatId(goods.getLeafCatId());
        updateGoods.setLeafName(goods.getLeafName());
        updateGoods.setMaterialLibType(goods.getMaterialLibType());
        return updateGoods;
    }
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java
@@ -23,6 +23,7 @@
    /**
     * 邀请关系生效
     *
     * @param worker
     */
    void effective(UserInfo worker);
@@ -222,9 +223,9 @@
     */
    public List<ThreeSale> listByWorkerId(Long workerId);
    
    /**
     * 获取成功邀请关系数量
     *
     * @param uid
     * @return
     */
@@ -232,6 +233,7 @@
    /**
     * 邀请码生成上下级关系
     *
     * @param invitee
     * @param inviter
     * @throws ThreeSaleException
@@ -240,9 +242,17 @@
    /**
     * 统计邀请成功队员数量
     *
     * @param uid
     * @return
     */
    public long countSuccessFirstTeam(Long uid);
    /**
     * 根据下级查找对象
     * @param workerId
     * @return
     */
    public ThreeSale selectByWorkerId(Long workerId);
}
fanli/src/main/java/com/yeshi/fanli/util/factory/CommonGoodsFactory.java
@@ -40,6 +40,7 @@
        cg.setVideoCover(null);
        cg.setVideoUrl(null);
        cg.setState(goods.getState());
        cg.setMaterialLibType(goods.getMaterialLibType());
        return cg;
    }
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -1310,9 +1310,9 @@
     * @return
     */
    public static String getGoodsHongBaoInfo(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) {
        if (goodsBrief.getMaterialLibType() == null || goodsBrief.getMaterialLibType() == 1) {
            return "¥0";
        } else
        if (goodsBrief != null && goodsBrief.getMaterialLibType() != null && goodsBrief.getMaterialLibType() == 0)
            return "¥0.00";
        else
            return "¥" + getGoodsHongBaoMoney(goodsBrief, rate).toString();
    }
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -224,6 +224,8 @@
            if (!StringUtil.isNullOrEmpty(item.optString("material_lib_type")))
                goods.setMaterialLibType(item.optInt("material_lib_type"));
            else
                goods.setMaterialLibType(0);
            return goods;
        }
@@ -337,7 +339,9 @@
                    goods.setFreeShipment(1);
                if ("1".equalsIgnoreCase(item.optString("material_lib_type")))
                    ;
                    goods.setMaterialLibType(1);
                else
                    goods.setMaterialLibType(0);
                goodsList.add(goods);
            }
@@ -385,6 +389,7 @@
                        g.setCouponStartFee(new BigDecimal(0));
                    }
                    g.setCreatetime(new Date());
                    g.setMaterialLibType(goods.getMaterialLibType());
                    return g;
                }
            }
@@ -452,6 +457,7 @@
                        g.setCouponStartFee(new BigDecimal(0));
                    }
                    g.setCreatetime(new Date());
                    g.setMaterialLibType(goods.getMaterialLibType());
                    return g;
                }
            }
@@ -1780,6 +1786,7 @@
        }
        goods.setReservePrice(new BigDecimal(0));
        goods.setTotalFee(new BigDecimal("0"));
        goods.setPictUrlWhite(item.optString("white_image"));
        return goods;
    }
fanli/src/test/java/org/fanli/MyBatisProduce.java
@@ -7,6 +7,7 @@
import com.yeshi.fanli.entity.bus.invite.SpreadUserImg;
import com.yeshi.fanli.entity.bus.user.LostOrder;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
import com.yeshi.fanli.entity.taobao.TaoBaoOrderTradeMap;
//@Ignore
public class MyBatisProduce {
@@ -14,7 +15,7 @@
    @Test
    public void test3() {
        MyBatisMapperUtil.createMapper(LostOrder.class);
        MyBatisMapperUtil.createMapper(TaoBaoOrderTradeMap.class);
        // MyBatisMapperUtil.createMapper(TaoBaoUnionAuthRecord.class);
    }
pom.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.yeshi</groupId>
    <artifactId>FanLiMain</artifactId>
@@ -533,5 +532,7 @@
    <modules>
        <module>utils</module>
        <module>fanli</module>
    <module>test1</module>
    <module>test12</module>
    </modules>
</project>
utils/.classpath
@@ -18,10 +18,6 @@
            <attribute name="org.eclipse.jst.component.nondependency" value=""/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
        <attributes>
            <attribute name="owner.project.facets" value="java"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0_161"/>
    <classpathentry kind="output" path="target/classes"/>
</classpath>
utils/.project
@@ -16,12 +16,12 @@
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.m2e.core.maven2Builder</name>
            <name>org.eclipse.wst.validation.validationbuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.wst.validation.validationbuilder</name>
            <name>org.eclipse.m2e.core.maven2Builder</name>
            <arguments>
            </arguments>
        </buildCommand>