package org.fanli.facade.user.service.invite;
|
|
import java.util.List;
|
|
import org.fanli.facade.user.entity.invite.ThreeSale;
|
import org.fanli.facade.user.exception.invite.ThreeSaleException;
|
|
import com.yeshi.fanli.base.entity.user.UserInfo;
|
|
import net.sf.json.JSONObject;
|
|
public interface ThreeSaleSerivce {
|
|
/**
|
* 获取该用户上级用户
|
*
|
* @param uid
|
* 用户ID
|
* @return
|
*/
|
UserInfo getBoss(long uid);
|
|
void bind(UserInfo invitee, UserInfo inviter) throws ThreeSaleException;
|
|
void effective(UserInfo find);
|
/**
|
* 重新计算用户的等级
|
*
|
* @param uid
|
*/
|
void reComputeUserRank(Long uid);
|
|
// 获取下级用户
|
List<UserInfo> getFirstUsers(Long uid, int page);
|
|
// 获取一级用户数量
|
long getFirstUsersCount(Long uid);
|
|
// 获取下2级用户
|
List<UserInfo> getSecondUsers(Long uid, int page);
|
|
// 获取二级用户数量
|
long getSecondUsersCount(Long uid);
|
|
// 获取最近有效的分销列表
|
List<ThreeSale> getLastestThreeSaleList(int i, String key);
|
|
// 邀请关系
|
int getLastestThreeSaleCount(String key);
|
|
/**
|
* 查询一度队员集合
|
*
|
* @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);
|
|
/**
|
* app端一级查询1.4.1
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @return
|
*/
|
public List<ThreeSale> listFirstTeam(long start, int count, Long uid);
|
|
/**
|
* 统计所有一级队员
|
*
|
* @param uid
|
* @param state
|
* 状态,值 为空时则统计所有
|
* @return
|
*/
|
public long countFirstTeam(Long uid, Integer state);
|
|
/**
|
* app端二级查询1.4.1
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @return
|
*/
|
public List<ThreeSale> listSecondTeam(long start, int count, Long uid);
|
|
/**
|
* 统计二级队员
|
*
|
* @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);
|
|
/**
|
* 前端查询二级队员
|
*
|
* @param start
|
* @param count
|
* @param uid
|
* @return
|
*/
|
public JSONObject getMySecondTeam(long start, int count, Long uid);
|
|
/**
|
* 获取上级
|
*
|
* @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;
|
|
}
|