admin
2020-05-12 11dc10e5d72d0c8969294d55985882a0631354d0
队员统计表数据同步处理
12个文件已修改
1个文件已添加
497 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/vip/UserVIPPreInfoMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/user/invite/ThreeSaleDetailDao.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ThreeSaleDetail.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/vip/UserVIPPreInfoMapper.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleDetailSerivceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/ThreeSaleDetailService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/ThreeSaleSerivce.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/vip/UserVIPPreInfoService.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/user/UserTeamStatisticManager.java 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java
@@ -21,7 +21,6 @@
    ThreeSale selectByPrimaryKey(Long id);
    
    UserInfo selectBoss(Long uid);
    
    /**
@@ -32,14 +31,12 @@
     */
    ThreeSale getByWorkerId(Long workerId);
    
    /**
     * 
     * @param uid
     * @return
     */
    ThreeSale getMyBoss(@Param("uid") Long uid);
    /**
     * 根据下级查询成功的邀请关系
@@ -48,7 +45,6 @@
     */
    ThreeSale selectSuccessByWorkerId(Long workerId);
    /**
     * 根据邀请者ID查询关系
     * 
@@ -56,8 +52,6 @@
     * @return
     */
    List<ThreeSale> listByWorkerId(Long workerId);
    /**
     * 一级查询-后台查询
@@ -73,8 +67,9 @@
            @Param("state") Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime,
            @Param("validState") Integer validState);
    long countFirstTeamQuery(@Param("uid") Long uid, @Param("state") Integer state, @Param("startTime") String startTime,
            @Param("endTime") String endTime, @Param("validState") Integer validState);
    long countFirstTeamQuery(@Param("uid") Long uid, @Param("state") Integer state,
            @Param("startTime") String startTime, @Param("endTime") String endTime,
            @Param("validState") Integer validState);
    /**
     * 二级查询 -后台查询
@@ -87,11 +82,12 @@
     * @return
     */
    List<ThreeSale> listSecondTeamQuery(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
            @Param("state") Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime
            ,@Param("validState") Integer validState);
            @Param("state") Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime,
            @Param("validState") Integer validState);
    long countSecondTeamQuery(@Param("uid") Long uid, @Param("state") Integer state,
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("validState") Integer validState);
            @Param("startTime") String startTime, @Param("endTime") String endTime,
            @Param("validState") Integer validState);
    /**
     * 上级查询 -后台查询
@@ -105,8 +101,6 @@
            @Param("state") Integer state, @Param("uid") Long uid);
    long countSuperiorQuery(@Param("state") Integer state, @Param("uid") Long uid);
    
    /**
     * 查询一级队员
@@ -142,8 +136,6 @@
     */
    long countSecondTeam(@Param("uid") Long uid, @Param("listId")List<Long> listId);
    /**
     * 统计一级队员
     * @param uid
@@ -167,7 +159,6 @@
     */
    List<ThreeSale> listbyIdAndBossId(@Param("id") Long id, @Param("uid") Long uid, @Param("expire") Integer expire);
    /**
     * 获取成功邀请关系数量
     * 
@@ -175,7 +166,6 @@
     * @return
     */
    int getSuccessRelationshipNum(@Param("uid") Long uid);
    
    /**
     * 根据邀请者ID、bossID查询 有效关系
@@ -185,7 +175,6 @@
     */
    ThreeSale getRelationshipByBossIdAndWorkerId(@Param("bossId") Long bossId, @Param("workerId") Long workerId);
    
    /**
     * 最后一次关系记录 -无论
     * @param bossId
@@ -194,8 +183,6 @@
     */
    ThreeSale getNearRelationByBossIdAndWorkerId(@Param("bossId") Long bossId, @Param("workerId") Long workerId);
    
    /**
     * 查询时间段邀请成功人信息
     * @param bossId
@@ -203,7 +190,8 @@
     * @param maxTime
     * @return
     */
    List<ThreeSale> getSuccessByDate(@Param("bossId")Long bossId,@Param("minTime")Long minTime, @Param("maxTime")Long maxTime);
    List<ThreeSale> getSuccessByDate(@Param("bossId") Long bossId, @Param("minTime") Long minTime,
            @Param("maxTime") Long maxTime);
    
    /**
     * 查询最近的信息(根据下级ID与状态)
@@ -242,6 +230,7 @@
     * @return
     */
    List<ThreeSale> getValidWorkerIdsByTime(@Param("uid") Long uid,@Param("limitTime") long limitTime);
    /**
     * 查询所有列表
     * @Title: listAll
@@ -252,8 +241,9 @@
     * List<ThreeSale> 返回类型
     * @throws
     */
    List<ThreeSale> listAll(@Param("start")long start,@Param("count")int count);
    List<ThreeSale> listAll(@Param("minTime") Long minTime, @Param("maxTime") Long maxTime, @Param("start") long start,
            @Param("count") int count);
    
    long countAll(@Param("minTime") Long minTime, @Param("maxTime") Long maxTime);
    
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/vip/UserVIPPreInfoMapper.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.dao.mybatis.user.vip;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
@@ -26,4 +27,20 @@
     */
    List<UserVIPPreInfo> listByUid(@Param("uid") Long uid);
    /**
     * 根据进度查询
     * @Title: listByProcess
     * @Description:
     * @param process
     * @param start
     * @param count
     * @return
     * List<UserVIPPreInfo> 返回类型
     * @throws
     */
    List<UserVIPPreInfo> listByProcess(@Param("process") int process, @Param("minTime") Date minTime,
            @Param("maxTime") Date maxTime, @Param("start") long start, @Param("count") int count);
    long countByProcess(@Param("process") int process, @Param("minTime") Date minTime, @Param("maxTime") Date maxTime);
}
fanli/src/main/java/com/yeshi/fanli/dao/user/invite/ThreeSaleDetailDao.java
@@ -68,4 +68,10 @@
        return count(query);
    }
    public List<ThreeSaleDetail> listByWorkerUid(Long uid) {
        Query query = new Query();
        query.addCriteria(Criteria.where("workerUid").is(uid));
        return findList(query);
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ThreeSaleDetail.java
@@ -21,7 +21,8 @@
    private Long bossUid;
    @Indexed
    @Field
    private Long workUid;
    private Long workerUid;
    @Field
    private Integer level;// 第几级队员
    @Field
@@ -43,14 +44,6 @@
        this.bossUid = bossUid;
    }
    public Long getWorkUid() {
        return workUid;
    }
    public void setWorkUid(Long workUid) {
        this.workUid = workUid;
    }
    public Integer getLevel() {
        return level;
    }
@@ -67,4 +60,12 @@
        this.createTime = createTime;
    }
    public Long getWorkerUid() {
        return workerUid;
    }
    public void setWorkerUid(Long workerUid) {
        this.workerUid = workerUid;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -57,8 +57,10 @@
        resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap"
        parameterType="java.lang.Long">
        select u.* from yeshi_ec_threeSale s
        left join yeshi_ec_user u on u.id=s.boss_id
        where s.state = 1 AND s.worker_id = #{0}
        left join
        yeshi_ec_user u on u.id=s.boss_id
        where s.state = 1 AND s.worker_id =
        #{0}
        LIMIT 1
    </select>
@@ -154,7 +156,8 @@
    <update id="inviteSeparate">
        update yeshi_ec_threeSale t set t.state = 0,t.expire = 2,
        t.updateTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>
        t.updateTime
        = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>
        where t.worker_id=#{workerId} AND t.boss_id = #{bossId}
    </update>
@@ -217,7 +220,8 @@
    <select id="listSecondTeamQuery" resultMap="BaseResultMap">
        SELECT yet.*,d.`tvr_type` AS validState 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 1=1
        LEFT JOIN yeshi_ec_threesale tf ON
        ts.`boss_id`=tf.`worker_id` WHERE 1=1
        AND tf.`state` = 1
        <if test="uid != null">
            AND tf.`boss_id` = #{uid}
@@ -340,10 +344,13 @@
    <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`
        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 =
        LEFT JOIN
        yeshi_ec_threesale yet ON yet.id =
        A.id
        <if test="listId != null and listId.size > 0">
            WHERE yet.worker_id in
@@ -356,8 +363,10 @@
    <select id="countSecondTeam" resultType="java.lang.Long">
        SELECT COUNT(A.id) 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`
        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}
        <if test="listId != null and listId.size > 0">
            AND tf.worker_id in
@@ -383,8 +392,10 @@
    <select id="countSecondTeamByDate" resultType="java.lang.Long">
        SELECT COUNT(A.id) 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`
        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}
        <if test="dayType == 1"> <!-- 今日 -->
            AND TO_DAYS(FROM_UNIXTIME(ts.createTime/1000)) = TO_DAYS(NOW())
@@ -468,8 +479,10 @@
        SELECT IFNULL(COUNT(d.`id`),0) FROM yeshi_ec_threesale d
        LEFT JOIN
        (SELECT t.`id`,t.`boss_id` FROM `yeshi_ec_threesale` t
        WHERE t.`state` = 1 AND t.`worker_id` = #{workerId} LIMIT 1)t ON
        t.`boss_id` = d.`boss_id`
        WHERE t.`state`
        = 1 AND t.`worker_id` = #{workerId} LIMIT 1)t ON
        t.`boss_id` =
        d.`boss_id`
        WHERE d.`id` <![CDATA[<=]]>t.id
        AND d.`state` = 1
    </select>
@@ -477,13 +490,42 @@
    <select id="getValidWorkerIdsByTime" resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_threesale` tr
        WHERE tr.`state` = 1 AND tr.`boss_id` = #{uid} AND tr.`succeedTime` <![CDATA[>=]]>
        WHERE tr.`state` = 1 AND
        tr.`boss_id` = #{uid} AND tr.`succeedTime` <![CDATA[>=]]>
        #{limitTime}
    </select>
    <select id="listAll" resultMap="BaseResultMap">
        SELECT * FROM
        `yeshi_ec_threesale` limit #{start},#{count}
        `yeshi_ec_threesale`
        where 1=1
        <if test="minTime!=null">
            and tr.`succeedTime` >=#{minTime}
        </if>
        <if test="maxTime!=null">
            and #{maxTime}>tr.`succeedTime`
        </if>
        limit #{start},#{count}
    </select>
    <select id="countAll" resultType="java.lang.Long">
        SELECT count(*) FROM
        `yeshi_ec_threesale`
        where 1=1
        <if test="minTime!=null">
            and tr.`succeedTime` >=#{minTime}
        </if>
        <if test="maxTime!=null">
            and #{maxTime}>tr.`succeedTime`
        </if>
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/vip/UserVIPPreInfoMapper.xml
@@ -89,4 +89,37 @@
        <include refid="Base_Column_List" />
        from yeshi_ec_user_vip_pre_info where vpi_uid = #{uid}
    </select>
    <select id="listByProcess" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_vip_pre_info where vpi_process = #{process}
        <if test="minTime!=null">
            vpi_create_time>=#{minTime}
        </if>
        <if test="maxTime!=null">
            #{maxTime}>vpi_create_time
        </if>
        limit #{start},#{count}
    </select>
    <select id="countByProcess" resultType="java.lang.Long">
        select
        count(*)
        from yeshi_ec_user_vip_pre_info where vpi_process = #{process}
        <if test="minTime!=null">
            vpi_create_time>=#{minTime}
        </if>
        <if test="maxTime!=null">
            #{maxTime}>vpi_create_time
        </if>
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleDetailSerivceImpl.java
@@ -25,11 +25,11 @@
    @Override
    public void addThreeSaleDetail(ThreeSaleDetail detail) throws ParamsException {
        if (detail.getBossUid() == null || detail.getWorkUid() == null || detail.getLevel() == null
        if (detail.getBossUid() == null || detail.getWorkerUid() == null || detail.getLevel() == null
                || detail.getCreateTime() == null) {
            throw new ParamsException(1, "参数不完整");
        }
        String id = detail.getBossUid() + "#" + detail.getWorkUid();
        String id = detail.getBossUid() + "#" + detail.getWorkerUid();
        detail.setId(id);
        // 根据主键查询
        ThreeSaleDetail old = threeSaleDetailDao.get(id);
@@ -66,7 +66,7 @@
            ThreeSaleDetail detail = new ThreeSaleDetail();
            detail.setBossUid(tts.getBoss().getId());
            detail.setLevel(level);
            detail.setWorkUid(workerUid);
            detail.setWorkerUid(workerUid);
            if (tts.getSucceedTime() != null)
                detail.setCreateTime(new Date(tts.getSucceedTime()));
            else
@@ -80,4 +80,9 @@
        }
    }
    @Override
    public List<ThreeSaleDetail> listByWorkerUid(Long uid) {
        return threeSaleDetailDao.listByWorkerUid(uid);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java
@@ -538,8 +538,6 @@
        return threeSaleMapper.countSecondTeamByDate(uid, dayType);
    }
    
    @Override
    public ThreeSale selectLatestByWorkerIdAndState(Long workerId, int state) {
        return threeSaleMapper.selectLatestByWorkerIdAndState(workerId, state);
@@ -597,8 +595,15 @@
    }
    @Override
    public List<ThreeSale> listAll(int page, int pageSize) {
        return threeSaleMapper.listAll((page-1)*pageSize, pageSize);
    public List<ThreeSale> listAll(Date minTime, Date maxTime, int page, int pageSize) {
        return threeSaleMapper.listAll(minTime == null ? null : minTime.getTime(),
                maxTime == null ? null : maxTime.getTime(), (page - 1) * pageSize, pageSize);
    }
    @Override
    public long countAll(Date minTime, Date maxTime) {
        return threeSaleMapper.countAll(minTime == null ? null : minTime.getTime(),
                maxTime == null ? null : maxTime.getTime());
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
@@ -331,6 +331,16 @@
    @Override
    public void deleteByPrimaryKey(Long id) {
        userVIPPreInfoMapper.deleteByPrimaryKey(id);
    }
    @Override
    public List<UserVIPPreInfo> listByProcess(int process, Date minTime, Date maxTime, int page, int pageSize) {
        return userVIPPreInfoMapper.listByProcess(process, minTime, maxTime, (page - 1) * pageSize, pageSize);
    }
    @Override
    public long countByProcess(int process, Date minTime, Date maxTime) {
        return userVIPPreInfoMapper.countByProcess(process, minTime, maxTime);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/ThreeSaleDetailService.java
@@ -61,5 +61,17 @@
    public List<ThreeSaleDetail> listByBossUidAndMinLevel(Long bossUid, int minLevel, int page, int pageSize);
    public long countByBossUidAndMinLevel(Long bossUid, int minLevel);
    /**
     * 根据下级ID查询
     * @Title: listByWorkerUid
     * @Description:
     * @param uid
     * @return
     * List<ThreeSaleDetail> 返回类型
     * @throws
     */
    public List<ThreeSaleDetail> listByWorkerUid(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/invite/ThreeSaleSerivce.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.inter.user.invite;
import java.util.Date;
import java.util.List;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
@@ -308,7 +309,9 @@
     * List<ThreeSale> 返回类型
     * @throws
     */
    public List<ThreeSale> listAll(int page,int pageSize);
    public List<ThreeSale> listAll(Date minTime,Date maxTime, int page,int pageSize);
    public long countAll(Date minTime,Date maxTime);
    /**
     * 根日期类型进行统计直接
fanli/src/main/java/com/yeshi/fanli/service/inter/user/vip/UserVIPPreInfoService.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.inter.user.vip;
import java.util.Date;
import java.util.List;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
@@ -38,7 +39,6 @@
     */
    public UserVIPPreInfo getProcessInfo(Long uid,Date time);
    /**
     * 根据用户ID与步骤查询
     * @Title: selectByUidAndProcess
@@ -52,7 +52,6 @@
    
    public UserVIPPreInfo selectByUidAndProcess(Long uid,int process);
    /**
     * 查询进度根据不同阶段
     * @param uid
@@ -62,14 +61,11 @@
     */
    public UserVIPPreInfo getVipByProcess(Long uid, int process);
    /**
     * 自购+ 分享订单到账 满足升级验证
     * @param uid
     */
    public void upgradeVipByMyOrder(Long uid);
    /**
     * 验证自身是否满足vip条件
@@ -77,15 +73,11 @@
     */
    public void upgradeVipByTeamNum(Long uid);
    
    /**
     * 粉丝完成收货-验证直接-间接粉丝
     * @param uid 粉丝id
     */
    public void upgradeBossVipByTeamNum(Long uid);
    
    /**
     * 根据主键删除
@@ -97,4 +89,21 @@
     */
    public void deleteByPrimaryKey(Long id);
    /**
     * 根据时间与过程查询
     * @Title: listByProcess
     * @Description:
     * @param process
     * @param minTime
     * @param maxTime
     * @param page
     * @param pageSize
     * @return
     * List<UserVIPPreInfo> 返回类型
     * @throws
     */
    public List<UserVIPPreInfo> listByProcess(int process, Date minTime, Date maxTime, int page, int pageSize);
    public long countByProcess(int process, Date minTime, Date maxTime);
}
fanli/src/main/java/com/yeshi/fanli/service/manger/user/UserTeamStatisticManager.java
New file
@@ -0,0 +1,236 @@
package com.yeshi.fanli.service.manger.user;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.ThreeSaleDetail;
import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleDetailService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.vip.TeamDailyRecordService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
import com.yeshi.fanli.util.TimeUtil;
/**
 * 团队成员统计
 * @author Administrator
 *
 */
@Component
public class UserTeamStatisticManager {
    @Resource
    private UserVIPPreInfoService userVIPPreInfoService;
    @Resource
    private ThreeSaleDetailService threeSaleDetailService;
    @Resource
    private TeamDailyRecordService teamDailyRecordService;
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    /**
     * 用户等级升级
     * @Title: userUpgraded
     * @Description:
     * @param uid
     * @param level
     * @param date
     * void 返回类型
     * @throws
     */
    public void userUpgraded(Long uid, UserLevelEnum level, Date date) {
        // 更新一级,二级,二级外响应的等级提升
        // 统计
    }
    /**
     * 同步会员信息(一级/二级/二级外)
     * @Title: statisticVIPData
     * @Description:
     * @param minTime
     * @param maxTime
     * @return
     * int 返回类型
     * @throws
     */
    private void syncVIPData(Date minTime, Date maxTime) {
        List<UserVIPPreInfo> totalList = new ArrayList<>();
        long count = userVIPPreInfoService.countByProcess(UserLevelEnum.highVIP.getLevel(), minTime, maxTime);
        int pageSize = 1000;
        int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
        for (int i = 0; i < page; i++) {
            List<UserVIPPreInfo> list = userVIPPreInfoService.listByProcess(UserLevelEnum.highVIP.getLevel(), minTime,
                    maxTime, page, pageSize);
            if (list != null)
                totalList.addAll(list);
        }
        count = userVIPPreInfoService.countByProcess(UserLevelEnum.superVIP.getLevel(), minTime, maxTime);
        page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
        for (int i = 0; i < page; i++) {
            List<UserVIPPreInfo> list = userVIPPreInfoService.listByProcess(UserLevelEnum.superVIP.getLevel(), minTime,
                    maxTime, page, pageSize);
            if (list != null)
                totalList.addAll(list);
        }
        Map<String, Integer> map = new HashMap<>();
        for (UserVIPPreInfo vipPre : totalList) {
            String day = TimeUtil.getGernalTime(vipPre.getCreateTime().getTime(), "yyyy-MM-dd");
            List<ThreeSaleDetail> list = threeSaleDetailService.listByWorkerUid(vipPre.getUid());
            for (ThreeSaleDetail ts : list) {
                String key = ts.getBossUid() + "#" + vipPre.getProcess() + "#" + day + "#";
                if (ts.getLevel() == 1) {
                    key += "1";
                } else if (ts.getLevel() == 2) {
                    key += "2";
                } else {
                    key += "3";
                }
                if (map.get(key) == null) {
                    map.put(key, 0);
                }
                map.put(key, map.get(key) + 1);
            }
        }
        for (java.util.Iterator<String> its = map.keySet().iterator(); its.hasNext();) {
            String key = its.next();
            Long uid = Long.parseLong(key.split("#")[0]);
            String day = key.split("#")[1];
            int process = Integer.parseInt(key.split("#")[2]);
            int level = Integer.parseInt(key.split("#")[3]);
            TeamDailyRecord record = new TeamDailyRecord();
            record.setUid(uid);
            record.setCountDay(new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")));
            if (level == 1) {
                String tempKey = uid + "#" + day + "#" + UserLevelEnum.highVIP.getLevel() + "#" + level;
                record.setFirstHighVIP(map.get(tempKey));
                tempKey = uid + "#" + day + "#" + UserLevelEnum.superVIP.getLevel() + "#" + level;
                record.setFirstSuperVIP(map.get(tempKey));
            } else if (level == 2) {
                String tempKey = uid + "#" + day + "#" + UserLevelEnum.highVIP.getLevel() + "#" + level;
                record.setSecondHighVIP(map.get(tempKey));
                tempKey = uid + "#" + day + "#" + UserLevelEnum.superVIP.getLevel() + "#" + level;
                record.setSecondSuperVIP(map.get(tempKey));
            } else {
                String tempKey = uid + "#" + day + "#" + UserLevelEnum.highVIP.getLevel() + "#" + level;
                record.setBeyondHighVIP(map.get(tempKey));
                tempKey = uid + "#" + day + "#" + UserLevelEnum.superVIP.getLevel() + "#" + level;
                record.setBeyondSuperVIP(map.get(tempKey));
            }
            // TODO 保存
            // teamDailyRecordService.
        }
    }
    /**
     * 同步注册信息
     * @Title: syncRegisterData
     * @Description:
     * @param minTime
     * @param maxTime
     * void 返回类型
     * @throws
     */
    private void syncData(Date minTime, Date maxTime) {
        List<ThreeSale> totalList = new ArrayList<>();
        long count = threeSaleSerivce.countAll(minTime, maxTime);
        int pageSize = 1000;
        int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
        for (int i = 0; i < page; i++) {
            List<ThreeSale> list = threeSaleSerivce.listAll(minTime, maxTime, page, pageSize);
            if (list != null)
                totalList.addAll(list);
        }
        Map<String, Integer> map = new HashMap<>();
        for (ThreeSale threeSale : totalList) {
            String day = TimeUtil.getGernalTime(threeSale.getSucceedTime(), "yyyy-MM-dd");
            List<ThreeSaleDetail> list = threeSaleDetailService.listByWorkerUid(threeSale.getWorker().getId());
            for (ThreeSaleDetail ts : list) {
                String key = ts.getBossUid() + "#" + day + "#";
                if (ts.getLevel() == 1) {
                    key += "1";
                } else if (ts.getLevel() == 2) {
                    key += "2";
                } else {
                    key += "3";
                }
                if (map.get(key) == null) {
                    map.put(key, 0);
                }
                map.put(key, map.get(key) + 1);
            }
        }
        for (java.util.Iterator<String> its = map.keySet().iterator(); its.hasNext();) {
            String key = its.next();
            Long uid = Long.parseLong(key.split("#")[0]);
            String day = key.split("#")[1];
            int level = Integer.parseInt(key.split("#")[2]);
            TeamDailyRecord record = new TeamDailyRecord();
            record.setUid(uid);
            record.setCountDay(new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")));
            if (level == 1) {
                record.setFirstDaRen(map.get(key));
            } else if (level == 2) {
                record.setSecondDaRen(map.get(key));
            } else {
                record.setBeyondDaRen(map.get(key));
            }
            // TODO 保存
            // teamDailyRecordService.
        }
    }
    /**
     * 邀请成功
     * @Title: inviteSuccess
     * @Description:
     * @param uid 被邀请人用户ID
     * @param date
     * void 返回类型
     * @throws
     */
    public void inviteSuccess(Long uid, Date date) {
    }
}