package com.yeshi.fanli.service.inter.user.invite;
|
|
import java.util.List;
|
|
import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
import com.yeshi.fanli.entity.bus.user.UserInfo;
|
import com.yeshi.fanli.exception.user.ThreeSaleException;
|
|
import net.sf.json.JSONObject;
|
|
public interface ThreeSaleSerivce {
|
|
/**
|
* 获取该用户上级用户
|
*
|
* @param uid
|
* 用户ID
|
* @return
|
*/
|
UserInfo getBoss(long uid);
|
|
void bind(UserInfo worker, UserInfo boss) throws ThreeSaleException;
|
|
/**
|
* 邀请关系生效
|
*
|
* @param worker
|
*/
|
void effective(UserInfo worker);
|
|
// 获取一级用户数量
|
long getFirstUsersCount(Long uid);
|
|
// 获取二级用户数量
|
long getSecondUsersCount(Long uid);
|
|
/**
|
* 查询一度队员集合
|
*
|
* @param start
|
* @param count
|
* @param key
|
* @param uid
|
* @return
|
*/
|
public List<ThreeSale> queryMyFirstTeamList(int start, int count, String key, Long bossId);
|
|
public long queryCountMyFirstTeamList(String key, Long bossId);
|
|
/**
|
* 查询二度队员集合
|
*
|
* @param start
|
* @param count
|
* @param key
|
* @param uid
|
* @return
|
*/
|
public List<ThreeSale> queryMySecondTeamList(int start, int count, String key, Long bossId);
|
|
public long queryCountMySecondTeamList(String key, Long bossId);
|
|
/**
|
* 删除邀请关系id
|
*
|
* @param id
|
* @return
|
*/
|
public int deleteByPrimaryKey(Long id);
|
|
/**
|
* 长时间未邀请成功用户
|
*
|
* @param daysNum
|
* @return
|
*/
|
public List<Long> queryLongTimeFailed(int daysNum);
|
|
/**
|
* 长时间 邀请成功用户
|
*
|
* @param daysNum
|
* @return
|
*/
|
public List<ThreeSale> queryLongTimeSuccess(int daysNum);
|
|
/**
|
* 设置对应邀请过期
|
*
|
* @param list
|
* @return
|
*/
|
public int updateExpire(List<Long> list);
|
|
/**
|
* 一级查询
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @param startTime
|
* @param endTime
|
* @return
|
*/
|
public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
String endTime);
|
|
public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime);
|
|
/**
|
* 二级查询
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @param startTime
|
* @param endTime
|
* @return
|
*/
|
public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
String endTime);
|
|
public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime);
|
|
/**
|
* 上级查询
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @return
|
*/
|
public List<ThreeSale> listSuperiorQuery(long start, int count, Integer state, Long uid);
|
|
public long countSuperiorQuery(Integer state, Long uid);
|
|
|
/**
|
* 统计所有一级队员
|
*
|
* @param uid
|
* @param state
|
* 状态,值 为空时则统计所有
|
* @return
|
*/
|
public long countFirstTeam(Long uid, Integer state);
|
|
/**
|
* 统计二级队员
|
*
|
* @param uid
|
* @param state
|
* 状态,值 为空时则统计所有
|
* @return
|
*/
|
public long countSecondTeam(Long uid, Integer state);
|
|
/**
|
* 前端查询一级队员
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @return
|
*/
|
public JSONObject getMyFirstTeam(long start, int count, Long uid, Integer state);
|
|
/**
|
* 前端查询二级队员
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @return
|
*/
|
public JSONObject getMySecondTeam(long start, int count, Long uid, Integer state);
|
|
/**
|
* 获取上级
|
*
|
* @param uid
|
* @return
|
*/
|
public ThreeSale getMyBoss(Long uid);
|
|
public ThreeSale selectByPrimaryKey(Long id);
|
|
/**
|
* 查询队员记录 id+uid
|
*
|
* @param id
|
* @param uid
|
* @param expire
|
* 是否失效状态
|
* @return
|
*/
|
public List<ThreeSale> listbyIdAndBossId(Long id, Long uid, Integer expire);
|
|
/**
|
* 根据邀请者查询关系
|
*
|
* @param workerId
|
* @return
|
*/
|
public List<ThreeSale> listByWorkerId(Long workerId);
|
|
/**
|
* 获取成功邀请关系数量
|
*
|
* @param uid
|
* @return
|
*/
|
public int getSuccessRelationshipNum(Long uid);
|
|
/**
|
* 邀请码生成上下级关系
|
*
|
* @param invitee
|
* @param inviter
|
* @throws ThreeSaleException
|
*/
|
public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter) throws ThreeSaleException;
|
|
/**
|
* 统计邀请成功队员数量
|
*
|
* @param uid
|
* @return
|
*/
|
public long countSuccessFirstTeam(Long uid);
|
|
/**
|
* 根据邀请者查询关系
|
*
|
* @param workerId
|
* @return
|
*/
|
public ThreeSale getByWorkerId(Long workerId);
|
|
/**
|
* 微信激活邀请队员关系
|
* @param invitee
|
* @param inviterId
|
* @param threeSaleOld
|
* @throws ThreeSaleException
|
*/
|
public void bindRelationshipByWX(UserInfo invitee, Long inviterId) throws ThreeSaleException;
|
|
/**
|
* 根据下级查找对象
|
* @param workerId
|
* @return
|
*/
|
public ThreeSale selectByWorkerId(Long workerId);
|
|
|
/**
|
* 查询最近一条数据(根据下级用户ID与状态)
|
* @param workerId
|
* @param state
|
* @return
|
*/
|
public ThreeSale selectLatestByWorkerIdAndState(Long workerId,int state);
|
|
/**
|
* 时间段呢 邀请成功信息
|
* @param bossId
|
* @param minTime
|
* @param maxTime
|
* @return
|
*/
|
public List<ThreeSale> getSuccessByDate(Long bossId, Long minTime, Long maxTime);
|
|
/**
|
* 一级队员
|
* @param start
|
* @param count
|
* @param uid
|
* @param state
|
* @return
|
*/
|
public List<ThreeSale> listFirstTeam(long start, int count, Long uid, Integer state);
|
|
/**
|
* 二级队员
|
* @param start
|
* @param count
|
* @param uid
|
* @param state
|
* @return
|
*/
|
public List<ThreeSale> listSecondTeam(long start, int count, Long uid, Integer state);
|
|
/**
|
* 查询邀请关系 时间筛选
|
* @param workerId 下级id
|
* @param time
|
* @return
|
*/
|
public ThreeSale getByWorkerIdAndTime(Long workerId, long time);
|
|
/**
|
* 邀请关系脱离
|
* @param workerId
|
* @param bossId
|
*/
|
public void inviteSeparate(Long workerId, Long bossId);
|
|
|
/*
|
* 该队员 在队中排第几
|
*/
|
public long getTeamOrderNumByWorkerId(Long workerId);
|
|
/**
|
* 查询最近关系 - 有效则优先
|
* @param bossId
|
* @param workerId
|
* @return
|
*/
|
public ThreeSale getNearRelationByBossIdAndWorkerId(Long bossId, Long workerId);
|
|
/**
|
* 根据时间筛选出有效粉丝
|
* @param bossId
|
* @param limitTime
|
* @return
|
*/
|
public List<ThreeSale> getValidWorkerIdsByTime(Long bossId, long limitTime);
|
|
|
/**
|
* 获取上几级邀请人
|
* @Title: getMyBossDeepList
|
* @Description:
|
* @param uid
|
* @param deep 上deep级
|
* @return
|
* List<ThreeSale> 返回类型
|
* @throws
|
*/
|
public List<ThreeSale> getMyBossDeepList(Long uid,int deep);
|
|
}
|