admin
2020-06-01 4d66b80a56cca390a0d06cc5bc5a9d8c8f790ff8
团队分红规则修改
18个文件已修改
271 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/dividents/TeamDividentsSourceUserMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/order/dividents/TeamDividentsRecord.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/order/dividents/TeamDividentsSourceUser.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/ConfigKeyEnum.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/dividents/TeamDividentsRecordMapper.xml 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/dividents/TeamDividentsSourceUserMapper.xml 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/dividents/TeamDividentsSourceUserServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/dividents/TeamDividentsSourceUserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/money/TeamEincomeManager.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/order/TeamDividentsManager.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/CommonGoodsFactory.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/money/TeamEincomeRecordFactory.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/UserVIPMessageListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
@@ -571,8 +571,7 @@
        else
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
    }
    @RequestMapping(value = "getKouBeiLink")
    public void getKouBeiLink(AcceptData acceptData, Long uid, String activityId, boolean share, boolean shareImg,
            String callback, PrintWriter out) {
@@ -597,7 +596,7 @@
            if (dto != null) {
                if (share) {// 生成口令
                    String token = TaoKeApiUtil.getTKToken("http://", "口碑",dto.getClick_url() );
                    String token = TaoKeApiUtil.getTKToken("http://", "口碑", dto.getClick_url());
                    dto.setToken(TaoBaoUtil.filterTaoToken(token));
                }
                redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
@@ -659,7 +658,28 @@
    public void userProtocolListen(AcceptData acceptData, Long uid, int type, PrintWriter out) {
        LogHelper.userProtocolListen(String.format("%s#%s#%s", acceptData.getDevice(), uid, type));
        out.print(JsonUtil.loadTrueResult(""));
    }
    /**
     * 是否显示广告
     * @Title: showAd
     * @Description:
     * @param acceptData
     * @param uid
     * @param out
     * void 返回类型
     * @throws
     */
    @RequestMapping(value = "getShowAd")
    public void showAd(AcceptData acceptData, Long uid, PrintWriter out) {
        String value = configService.get(ConfigKeyEnum.showSplashAd.getKey());
        JSONObject data = new JSONObject();
        if ("0".equalsIgnoreCase(value.trim())) {
            data.put("show", false);
        } else {
            data.put("show", true);
        }
        out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -450,7 +450,7 @@
        if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
            goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
            goodsDetail.getMoneyInfo().setShareMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods,
                    hongBaoManageService.getShareRate(UserLevelEnum.superVIP),true));
                    hongBaoManageService.getShareRate(UserLevelEnum.superVIP), true));
            goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
            goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
        }
@@ -552,7 +552,8 @@
            shareValid = false;
            helpLink = configService.get(ConfigKeyEnum.zigoulijianNofanliHelp.getKey());
            BigDecimal tljHongBao = TaoBaoUtil.getGoodsHongBaoMoney(goods, TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE,false);
            BigDecimal tljHongBao = TaoBaoUtil.getGoodsHongBaoMoney(goods, TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE,
                    false);
            ReduceHongBao reduceHongBao = new ReduceHongBao();
            reduceHongBao.setLeft(buyGoods.getLeftHongBaoCount());
@@ -854,11 +855,11 @@
        // 商品链接
        String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
                Constant.systemCommonConfig.getShareGoodsPagePathJD(), "", id + "");
        try {
            extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
        } catch (Exception e) {
//        try {
//            extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
//        } catch (Exception e) {
            extraVO.setH5Url(h5Url);
        }
//        }
        String helpLink = null;
        extraVO.setFanliValid(true);
@@ -1033,11 +1034,11 @@
        // 分享路径
        String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
                Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "", id + "");
        try {
            extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
        } catch (Exception e) {
//        try {
//            extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
//        } catch (Exception e) {
            extraVO.setH5Url(h5Url);
        }
//        }
        String helpLink = null;
        extraVO.setFanliValid(true);
@@ -1173,11 +1174,11 @@
        // 分享路径
        String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
                Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "", id + "");
        try {
            extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
        } catch (Exception e) {
//        try {
//            extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
//        } catch (Exception e) {
            extraVO.setH5Url(h5Url);
        }
//        }
        String helpLink = null;
        extraVO.setFanliValid(true);
@@ -1304,11 +1305,11 @@
        // 分享路径
        String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
                Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "", id + "");
        try {
            extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
        } catch (Exception e) {
            extraVO.setH5Url(h5Url);
        }
        // try {
        // extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
        // } catch (Exception e) {
        extraVO.setH5Url(h5Url);
        // }
        String helpLink = null;
        extraVO.setFanliValid(true);
@@ -1431,10 +1432,10 @@
                out.print(JsonUtil.loadTrueResult(data));
                return;
            }
            if (goodsType == Constant.SOURCE_TYPE_SUNING) {
                //猜你喜欢
                // 猜你喜欢
            }
            List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.guessLikeByAuctionId(Long.parseLong(id), 10);
@@ -1718,8 +1719,8 @@
        String quanUrl = null;
        if (!StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl()))
            quanUrl = goods.getCouponInfo().getCouponUrl();
        String link = SuningApiUtil.convertLink(SuningUtil.getProductUrl(supplierCode, goodsCode),
                quanUrl, SuningApiUtil.PID_BUY, uid + "");
        String link = SuningApiUtil.convertLink(SuningUtil.getProductUrl(supplierCode, goodsCode), quanUrl,
                SuningApiUtil.PID_BUY, uid + "");
        JSONObject data = new JSONObject();
        data.put("native", false);
        data.put("jumpLink", link);
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/dividents/TeamDividentsSourceUserMapper.java
@@ -20,7 +20,8 @@
     * BigDecimal 返回类型
     * @throws
     */
    BigDecimal sumMoneyByTargetUidAndDay(@Param("uid") Long uid, @Param("day") String day);
    BigDecimal sumMoneyByTargetUidAndDayAndType(@Param("uid") Long uid, @Param("day") String day,@Param("type") Integer type);
    /**
     * 根据日期检索用户ID
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.entity.bus.homemodule;
import java.io.Serializable;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
@@ -16,8 +17,12 @@
 *
 */
@Table("yeshi_ec_float_ad")
public class FloatAD {
public class FloatAD implements Serializable{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    // 每天展示一次
    public static String MODE_ONCE_DAY = "everyday";
    // 每次打开首页都展示
fanli/src/main/java/com/yeshi/fanli/entity/order/dividents/TeamDividentsRecord.java
@@ -31,6 +31,16 @@
    private Date createTime;
    @Column(name = "td_update_time")
    private Date updateTime;
    @Column(name = "td_type")
    private Integer type;
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public Long getId() {
        return id;
fanli/src/main/java/com/yeshi/fanli/entity/order/dividents/TeamDividentsSourceUser.java
@@ -23,11 +23,22 @@
    private String day;
    @Column(name = "tdsu_money")
    private BigDecimal money;
    @Column(name = "tdsu_type")
    private Integer type;
    @Column(name = "tdsu_create_time")
    private Date createTime;
    @Column(name = "tdsu_update_time")
    private Date updateTime;
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public Long getId() {
        return id;
    }
fanli/src/main/java/com/yeshi/fanli/entity/system/ConfigKeyEnum.java
@@ -199,7 +199,9 @@
    activityDetailLink("activity_detail_link", "活动详情过渡页"),
    
    // 平台规则
    platformRule("platform_rule_link", "平台规则");
    platformRule("platform_rule_link", "平台规则"),
    showSplashAd("show_splash_ad","是否显示开屏广告");
    private final String key;
    private final String desc;
fanli/src/main/java/com/yeshi/fanli/mapping/order/dividents/TeamDividentsRecordMapper.xml
@@ -12,9 +12,9 @@
        <result column="td_state" property="state" jdbcType="INTEGER" />
        <result column="td_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="td_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="td_type" property="type" jdbcType="INTEGER" />
    </resultMap>
    <sql id="Base_Column_List">td_id,td_uid,td_day,td_money,td_state,td_create_time,td_update_time
    </sql>
    <sql id="Base_Column_List">td_id,td_uid,td_day,td_money,td_state,td_create_time,td_update_time,td_type</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
@@ -22,25 +22,21 @@
        from yeshi_ec_team_dividents_record where td_id =
        #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByUidAndDayForUpdate" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_team_dividents_record where td_uid =
        #{uid} and td_day=#{day} for update
        from yeshi_ec_team_dividents_record where td_uid = #{uid} and
        td_day=#{day} for update
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_team_dividents_record where td_id = #{id,jdbcType=BIGINT}
    </delete>
        yeshi_ec_team_dividents_record where td_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsRecord"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_team_dividents_record
        (td_id,td_uid,td_day,td_money,td_state,td_create_time,td_update_time)
        (td_id,td_uid,td_day,td_money,td_state,td_create_time,td_update_time,td_type)
        values
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{day,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{day,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{type,jdbcType=INTEGER})</insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsRecord"
        useGeneratedKeys="true" keyProperty="id">
@@ -53,6 +49,7 @@
            <if test="state != null">td_state,</if>
            <if test="createTime != null">td_create_time,</if>
            <if test="updateTime != null">td_update_time,</if>
            <if test="type != null">td_type,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -63,6 +60,7 @@
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="type != null">#{type,jdbcType=INTEGER},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
@@ -71,8 +69,8 @@
        #{money,jdbcType=DECIMAL},td_state =
        #{state,jdbcType=INTEGER},td_create_time =
        #{createTime,jdbcType=TIMESTAMP},td_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where td_id = #{id,jdbcType=BIGINT}
    </update>
        #{updateTime,jdbcType=TIMESTAMP} ,td_type =#{type,jdbcType=INTEGER}
        where td_id = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsRecord">
        update yeshi_ec_team_dividents_record
@@ -83,6 +81,7 @@
            <if test="state != null">td_state=#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">td_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">td_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="type !=null">td_type =#{type,jdbcType=INTEGER},</if>
        </set>
        where td_id = #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/mapping/order/dividents/TeamDividentsSourceUserMapper.xml
@@ -14,8 +14,9 @@
            jdbcType="TIMESTAMP" />
        <result column="tdsu_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
        <result column="tdsu_type" property="type" jdbcType="INTEGER" />
    </resultMap>
    <sql id="Base_Column_List">tdsu_id,tdsu_target_uid,tdsu_source_uid,tdsu_day,tdsu_money,tdsu_create_time,tdsu_update_time
    <sql id="Base_Column_List">tdsu_id,tdsu_target_uid,tdsu_source_uid,tdsu_day,tdsu_money,tdsu_create_time,tdsu_update_time,tdsu_type
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -32,9 +33,9 @@
        parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceUser"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_team_dividents_source_user
        (tdsu_id,tdsu_target_uid,tdsu_source_uid,tdsu_day,tdsu_money,tdsu_create_time,tdsu_update_time)
        (tdsu_id,tdsu_target_uid,tdsu_source_uid,tdsu_day,tdsu_money,tdsu_create_time,tdsu_update_time,tdsu_type)
        values
        (#{id,jdbcType=BIGINT},#{targetUid,jdbcType=BIGINT},#{sourceUid,jdbcType=BIGINT},#{day,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
        (#{id,jdbcType=BIGINT},#{targetUid,jdbcType=BIGINT},#{sourceUid,jdbcType=BIGINT},#{day,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{type,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceUser"
@@ -48,6 +49,7 @@
            <if test="money != null">tdsu_money,</if>
            <if test="createTime != null">tdsu_create_time,</if>
            <if test="updateTime != null">tdsu_update_time,</if>
            <if test="type != null">tdsu_type,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -58,6 +60,7 @@
            <if test="money != null">#{money,jdbcType=DECIMAL},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="type != null">#{type,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
@@ -67,7 +70,8 @@
        #{day,jdbcType=VARCHAR},tdsu_money =
        #{money,jdbcType=DECIMAL},tdsu_create_time =
        #{createTime,jdbcType=TIMESTAMP},tdsu_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where tdsu_id = #{id,jdbcType=BIGINT}
        #{updateTime,jdbcType=TIMESTAMP} ,tdsu_type =#{type,jdbcType=INTEGER}
        where tdsu_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceUser">
@@ -79,54 +83,38 @@
            <if test="money != null">tdsu_money=#{money,jdbcType=DECIMAL},</if>
            <if test="createTime != null">tdsu_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">tdsu_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="type !=null">tdsu_type =#{type,jdbcType=INTEGER},</if>
        </set>
        where tdsu_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="sumMoneyByTargetUidAndDay" resultType="java.math.BigDecimal">
    <select id="sumMoneyByTargetUidAndDayAndType" resultType="java.math.BigDecimal">
        select
        sum(tdsu_money)
        from yeshi_ec_team_dividents_source_user where
        sum(tdsu_money) from yeshi_ec_team_dividents_source_user where
        tdsu_target_uid =#{uid} and tdsu_day=#{day}
        <if test="type!=null">
            and tdsu_type=#{type}
        </if>
    </select>
    <select id="listTargetUidByDay" resultType="java.lang.Long">
        SELECT
        DISTINCT(u.`tdsu_target_uid`) FROM
        yeshi_ec_team_dividents_source_user
        u WHERE u.`tdsu_day`=#{day} limit
        #{start},#{count}
    <select id="listTargetUidByDay" resultType="java.lang.Long">SELECT
        DISTINCT(u.`tdsu_target_uid`) FROM yeshi_ec_team_dividents_source_user
        u WHERE u.`tdsu_day`=#{day} limit #{start},#{count}
    </select>
    <select id="countTargetUidByDay" resultType="java.lang.Long"
        parameterType="java.lang.String">
        SELECT count(DISTINCT(u.`tdsu_target_uid`)) FROM
        parameterType="java.lang.String">SELECT count(DISTINCT(u.`tdsu_target_uid`)) FROM
        yeshi_ec_team_dividents_source_user u WHERE u.`tdsu_day`=#{day}
    </select>
    <select id="listBySourceUidAndDay" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        FROM
        yeshi_ec_team_dividents_source_user WHERE
        FROM yeshi_ec_team_dividents_source_user WHERE
        `tdsu_source_uid`=#{sourceUid} and tdsu_day=#{day}
    </select>
    <select id="selectBySourceUidAndDayAndUid" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        FROM
        yeshi_ec_team_dividents_source_user WHERE
        FROM yeshi_ec_team_dividents_source_user WHERE
        `tdsu_source_uid`=#{sourceUid} and tdsu_day=#{day} and
        tdsu_target_uid=#{targetUid}
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/order/dividents/TeamDividentsSourceUserServiceImpl.java
@@ -32,8 +32,8 @@
    }
    @Override
    public BigDecimal sumMoneyByUidAndDay(Long uid, String day) {
        BigDecimal money = teamDividentsSourceUserMapper.sumMoneyByTargetUidAndDay(uid, day);
    public BigDecimal sumMoneyByUidAndDay(Long uid, String day,Integer type) {
        BigDecimal money = teamDividentsSourceUserMapper.sumMoneyByTargetUidAndDayAndType(uid, day,type);
        if (money == null)
            return new BigDecimal(0);
        return money;
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
@@ -131,6 +131,8 @@
            UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(info.getUid(), oldLevel,
                    UserLevelUtil.getByLevel(info.getProcess()), new Date());
            Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
            //延时10s发送
            message.setStartDeliverTime(System.currentTimeMillis()+1000*10L);
            producer.send(message);
        }
fanli/src/main/java/com/yeshi/fanli/service/inter/order/dividents/TeamDividentsSourceUserService.java
@@ -28,7 +28,7 @@
     * BigDecimal 返回类型
     * @throws
     */
    public BigDecimal sumMoneyByUidAndDay(Long uid, String day);
    public BigDecimal sumMoneyByUidAndDay(Long uid, String day,Integer type);
    /**
     * 查询目标用户列表
fanli/src/main/java/com/yeshi/fanli/service/manger/money/TeamEincomeManager.java
@@ -85,10 +85,10 @@
     * @throws
     */
    @Transactional(rollbackFor = Exception.class)
    public void addTeamDividents(Long uid, Date preSendTime, BigDecimal money)
    public void addTeamDividents(Long uid, Date preSendTime, BigDecimal money,int type)
            throws TeamEincomeRecordException, ParamsException {
        String day = TimeUtil.getGernalTime(preSendTime.getTime(), "yyyy-MM-dd");
        TeamEincomeRecord record = TeamEincomeRecordFactory.createTeamDividents(day, uid, money, null);
        TeamEincomeRecord record = TeamEincomeRecordFactory.createTeamDividents(day, uid, money,type, null);
        teamEincomeRecordService.addTeamEincomeRecord(record);
    }
fanli/src/main/java/com/yeshi/fanli/service/manger/order/TeamDividentsManager.java
@@ -106,22 +106,25 @@
                totalList.addAll(list);
        }
        Map<Long, BigDecimal> moneyMap = new HashMap<>();
        Map<String, BigDecimal> moneyMap = new HashMap<>();
        for (TeamDividentsSourceOrderUserMap order : totalList) {
            TeamDividentsSourceOrderUserMap map = teamDividentsSourceOrderUserMapService
                    .selectByPrimaryKeyForUpdate(order.getId());
            if (map != null && map.getState() == TeamDividentsSourceOrderUserMap.STATE_JS) {
                String key = map.getTargetUid() + "#" + map.getType();
                // 计算分红对应的资金
                if (moneyMap.get(map.getTargetUid()) == null)
                    moneyMap.put(map.getTargetUid(), new BigDecimal(0));
                moneyMap.put(map.getTargetUid(), moneyMap.get(map.getTargetUid()).add(map.getMoney()));
                if (moneyMap.get(key) == null)
                    moneyMap.put(key, new BigDecimal(0));
                moneyMap.put(key, moneyMap.get(key).add(map.getMoney()));
                teamDividentsSourceOrderUserMapService.send(map.getId());
            }
        }
        for (Iterator<Long> its = moneyMap.keySet().iterator(); its.hasNext();) {
            Long uid = its.next();
        for (Iterator<String> its = moneyMap.keySet().iterator(); its.hasNext();) {
            String key = its.next();
            Long uid = Long.parseLong(key.split("#")[0]);
            Integer type = Integer.parseInt(key.split("#")[1]);
            BigDecimal dividents = moneyMap.get(uid).setScale(2, BigDecimal.ROUND_DOWN);
            // 将资金分配到参与分红的用户
            TeamDividentsSourceUser teamDividentsSourceUser = new TeamDividentsSourceUser();
@@ -129,6 +132,7 @@
            teamDividentsSourceUser.setMoney(dividents);
            teamDividentsSourceUser.setSourceUid(sourceUid);
            teamDividentsSourceUser.setTargetUid(uid);
            teamDividentsSourceUser.setType(type);
            teamDividentsSourceUserService.addTeamDividentsSourceUser(teamDividentsSourceUser);
        }
    }
@@ -147,22 +151,10 @@
        return count == 0;
    }
    /**
     * @throws TeamDividentsDebtException
     * 添加分红记录
     * @Title: addDividentsRecord
     * @Description:
     * @param uid -用户ID
     * @param money -分红金额
     * @param day -分红日期
     * void 返回类型
     * @throws
     */
    @Transactional(rollbackFor = Exception.class)
    public void addToTeamEincome(Long uid, Date preSendTime) throws TeamDividentsRecordException,
    private void addToTeamEincome(Long uid, Date preSendTime, int type) throws TeamDividentsRecordException,
            TeamDividentsDebtException, UserMoneyDetailException, ParamsException, TeamEincomeRecordException {
        String day = TimeUtil.getGernalTime(preSendTime.getTime(), "yyyy-MM-dd");
        BigDecimal money = teamDividentsSourceUserService.sumMoneyByUidAndDay(uid, day);
        BigDecimal money = teamDividentsSourceUserService.sumMoneyByUidAndDay(uid, day, type);
        // 查询需要扣除的资金
        List<TeamDividentsDebt> list = teamDividentsDebtService.listNeedRepayDebt(uid, preSendTime, 1, 1000);
        for (TeamDividentsDebt debt : list) {
@@ -182,12 +174,33 @@
        record.setMoney(money);
        record.setState(TeamDividentsRecord.STATE_VALID);
        record.setUid(uid);
        record.setType(type);
        teamDividentsRecordService.addTeamDividentsRecord(record);
        // 有分红才显示资金明细
        if (money.compareTo(new BigDecimal(0)) > 0) {
            teamEincomeManager.addTeamDividents(uid, preSendTime, money);
            teamEincomeManager.addTeamDividents(uid, preSendTime, money, type);
        }
    }
    /**
     * @throws TeamDividentsDebtException
     * 添加分红记录
     * @Title: addDividentsRecord
     * @Description:
     * @param uid -用户ID
     * @param money -分红金额
     * @param day -分红日期
     * void 返回类型
     * @throws
     */
    @Transactional(rollbackFor = Exception.class)
    public void addToTeamEincome(Long uid, Date preSendTime) throws TeamDividentsRecordException,
            TeamDividentsDebtException, UserMoneyDetailException, ParamsException, TeamEincomeRecordException {
        addToTeamEincome(uid, preSendTime, TeamDividentsSourceOrderUserMap.TYPE_MORE_THAN_2);
        addToTeamEincome(uid, preSendTime, TeamDividentsSourceOrderUserMap.TYPE_TEAM_DIVIDENTS);
    }
    /**
fanli/src/main/java/com/yeshi/fanli/util/factory/CommonGoodsFactory.java
@@ -305,7 +305,7 @@
        cg.setRate(new BigDecimal(goods.getCommodityInfo().getRate()));
        cg.setSellerId(Long.parseLong(goods.getCommodityInfo().getSupplierCode()));
        cg.setSellerName(goods.getCommodityInfo().getSupplierName());
        cg.setShopType(CommonGoods.SHOP_TYPE_PDD);
        cg.setShopType(CommonGoods.SHOP_TYPE_SUNING);
        cg.setState(CommonGoods.STATE_NORMAL);
        cg.setTitle(goods.getCommodityInfo().getCommodityName());
        // 保留字段
fanli/src/main/java/com/yeshi/fanli/util/factory/money/TeamEincomeRecordFactory.java
@@ -4,6 +4,7 @@
import java.util.Date;
import com.yeshi.fanli.entity.money.TeamEincomeRecord;
import com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrderUserMap;
import com.yeshi.fanli.util.TimeUtil;
public class TeamEincomeRecordFactory {
@@ -76,7 +77,8 @@
     * TeamEincomeRecord 返回类型
     * @throws
     */
    public static TeamEincomeRecord createTeamDividents(String day, Long uid, BigDecimal money, String beiZhu) {
    public static TeamEincomeRecord createTeamDividents(String day, Long uid, BigDecimal money, int type,
            String beiZhu) {
        TeamEincomeRecord record = new TeamEincomeRecord();
        record.setBeiZhu(beiZhu);
        record.setCreateTime(new Date());
@@ -84,7 +86,10 @@
        record.setPreRecieveTime(new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")));
        record.setRecieveTime(null);
        record.setState(TeamEincomeRecord.STATE_NOT_RECIEVE);
        record.setType(TeamEincomeRecord.TYPE_TEAM_DIVIDENTS);
        if (type == TeamDividentsSourceOrderUserMap.TYPE_MORE_THAN_2) {
            record.setType(TeamEincomeRecord.TYPE_TEAM_SUBSIDY);
        } else
            record.setType(TeamEincomeRecord.TYPE_TEAM_DIVIDENTS);
        record.setUid(uid);
        return record;
    }
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/UserVIPMessageListener.java
@@ -76,6 +76,7 @@
                        return Action.CommitMessage;
                }
                // 更新上2级的邀请统计
                teamUserLevelStatisticService.updateUserLevel(msg.getUid());
                UserInfo boss = threeSaleSerivce.getBoss(msg.getUid());
@@ -85,7 +86,6 @@
                    if (boss != null) {
                        teamUserLevelStatisticService.initData(boss.getId());
                    }
                }
                return Action.CommitMessage;
            } 
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -2195,10 +2195,10 @@
    public static BigDecimal getCanShareMoney(Date createTime, BigDecimal estimate) {
        if (estimate == null)
            return null;
        if (createTime.getTime() < TimeUtil.convertToTimeTemp("2020-05-01", "yyyy-MM-dd")) {
        if (createTime.getTime() < TimeUtil.convertToTimeTemp("2020-06-01 12:30:00", "yyyy-MM-dd HH:mm:ss")) {
            return estimate;
        }
        BigDecimal rate = new BigDecimal("0.8876");
        BigDecimal rate = new BigDecimal("0.9101");
        return MoneyBigDecimalUtil.mul(estimate, rate);
    }