| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.user.UserInfoException;
|
| | | import com.yeshi.fanli.vo.user.UserInfoVO;
|
| | |
|
| | | public interface UserInfoService {
|
| | | /**
|
| | | * 通过openid和loginType,获取用户
|
| | | *
|
| | | * @param loginType 1:阿里系列(淘宝)账户
|
| | | * @param openid :登录淘宝后得到的openid
|
| | | * @param appid
|
| | | * @return 用户,如果不存在返回null
|
| | | */
|
| | | /**
|
| | | *
|
| | | * @param loginType
|
| | | * @param openid
|
| | | * @param sysetm
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, SystemEnum sysetm);
|
| | |
|
| | | /**
|
| | | * 添加用户
|
| | | *
|
| | | * @param form 用户信息
|
| | | * @return 用户, 添加失败返回null
|
| | | */
|
| | | public UserInfo addUser(UserInfo form, SystemEnum sysetm);
|
| | |
|
| | | /**
|
| | | * 通过用户id获取用户
|
| | | *
|
| | | * @param uid 用户id
|
| | | * @return 用户
|
| | | */
|
| | | public UserInfo getUserById(long uid);
|
| | |
|
| | | /**
|
| | | * Mybatis通过用户ID获取用户信息
|
| | | *
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserByIdWithMybatis(long uid);
|
| | |
|
| | | public void update(UserInfo user);
|
| | |
|
| | | public long getUserCount();
|
| | |
|
| | |
|
| | | public void unBindUserInfo(UserInfo find, int type);
|
| | |
|
| | | public void addMoney(UserInfo userInfo, BigDecimal money);
|
| | |
|
| | | public boolean createUser(UserInfo form, SystemEnum sysetm);
|
| | |
|
| | | public void updateLoginInfo(UserInfo user);
|
| | |
|
| | | public void cleanPassword(long id);
|
| | |
|
| | | public BigDecimal getNewPeopleHB(Long id);
|
| | |
|
| | | /**
|
| | | * 查询用户信息 -- 用户管理列表
|
| | | *
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param userType
|
| | | * @param days
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param orderMode
|
| | | * @return
|
| | | */
|
| | | public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType,
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,
|
| | | Integer userType, String level, Integer activeCode,SystemEnum system);
|
| | |
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime, Integer userType, String level, Integer activeCode,SystemEnum system);
|
| | |
|
| | | public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime);
|
| | |
|
| | | /**
|
| | | * 选择性更新
|
| | | *
|
| | | * @param record
|
| | | * @return
|
| | | */
|
| | | public int updateByPrimaryKeySelective(UserInfo record);
|
| | |
|
| | | /**
|
| | | * 其强制删除绑定信息
|
| | | *
|
| | | * @param user
|
| | | * @param type
|
| | | */
|
| | | public void deleteBindInfo(UserInfo user, int type);
|
| | |
|
| | | /**
|
| | | * 根据id查询用户信息
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public UserInfo selectByPKey(Long id);
|
| | |
|
| | | /**
|
| | | * 超过 daysNum 天未登陆的用户
|
| | | *
|
| | | * @param daysNum
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | public List<Long> longTimeNoLogin(int daysNum, List<Long> list);
|
| | |
|
| | | /**
|
| | | * 根据邀请码获取邀请用户
|
| | | *
|
| | | * @param inviteCode
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByInviteCode(String inviteCode);
|
| | |
|
| | | /**
|
| | | * 根据电话号码 获取有效用户
|
| | | *
|
| | | * @param phone
|
| | | * @return
|
| | | */
|
| | | public UserInfo getEffectiveUserInfoByPhone(String phone, SystemEnum sysetm);
|
| | |
|
| | | /**
|
| | | * 获取用户信息
|
| | | *
|
| | | * @param uid
|
| | | * @return
|
| | | * @throws UserInfoException
|
| | | */
|
| | | public UserInfo getUserInfo(Long uid) throws UserInfoException;
|
| | |
|
| | | /**
|
| | | * 根据微信获取有效用户
|
| | | *
|
| | | * @param unionId
|
| | | * @return
|
| | | */
|
| | | public UserInfo getEffectiveUserInfoByWXUnionId(String unionId, SystemEnum sysetm);
|
| | |
|
| | |
|
| | | /**
|
| | | * 获取有效用户(根据淘宝OpenId)
|
| | | * @param openId
|
| | | * @param sysetm
|
| | | * @return
|
| | | */
|
| | | public UserInfo getEffectiveUserInfoByOpenId(String openId, SystemEnum sysetm);
|
| | |
|
| | | /**
|
| | | * 获取用户余额
|
| | | *
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getBalance(Long uid);
|
| | |
|
| | | /**
|
| | | * 更换头像
|
| | | *
|
| | | * @param file
|
| | | * @param uid
|
| | | * @throws UserInfoException
|
| | | * @throws IOException
|
| | | */
|
| | | public void uploadPortrait(MultipartFile file, Long uid) throws UserInfoException, IOException;
|
| | |
|
| | | /**
|
| | | * 保存头像
|
| | | *
|
| | | * @param nickName
|
| | | * @param uid
|
| | | * @throws UserInfoException
|
| | | */
|
| | | public void saveUserInfo(String nickName, Long uid) throws UserInfoException;
|
| | |
|
| | | /**
|
| | | * 获取可提现用户列表
|
| | | *
|
| | | * @param page
|
| | | * @param count
|
| | | */
|
| | | public List<UserInfo> getAutoExtractUser(int page, int count, BigDecimal minSurplus, String beganDate,
|
| | | String endDate);
|
| | |
|
| | | /**
|
| | | * 根据类型获取
|
| | | *
|
| | | * @param type
|
| | | * @param page
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<UserInfo> listByType(int type, int page, int count);
|
| | |
|
| | | /**
|
| | | * 根据类型计数
|
| | | *
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public long countByType(int type);
|
| | |
|
| | | /**
|
| | | * 双12预售开启时,开启对休眠老用户的唤醒工作,在2019.1.1到2019.6.18期间产生过订单,并且2019.6.18号后未再活跃,
|
| | | * 并且账户余额大于1元,并且绑定了微信的用户有2468人
|
| | | *
|
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<UserInfo> getAutoExtractUserTo1212(int start, int count);
|
| | |
|
| | | /**
|
| | | * 根据用户ID检索
|
| | | *
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserInfo selectAvailableByPrimaryKey(Long uid);
|
| | |
|
| | |
|
| | | public long countInfo(Integer userState, String key, Integer keyType, String userRank, Integer days, String startTime,
|
| | | String endTime, Integer userType, String level, Integer activeCode,SystemEnum system);
|
| | |
|
| | | public List<UserInfoVO> queryInfo(long start, int count, Integer userState, String key, Integer keyType, String userRank,
|
| | | Integer days, String startTime, String endTime, Integer userType, String level, Integer activeCode,SystemEnum system);
|
| | |
|
| | |
|
| | | List<UserInfo> listBySystemAndWXUnionId(SystemEnum system, String unionId);
|
| | | List<UserInfo> listBySystemAndTaoBaoOpenId(SystemEnum system, String openId);
|
| | | List<UserInfo> listBySystemAndPhone(SystemEnum system, String phone);
|
| | |
|
| | | /**
|
| | | * 根据用户ID获取所在系统
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public SystemEnum getUserSystem(Long uid);
|
| | | }
|
| | | package com.yeshi.fanli.service.inter.user; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.exception.user.UserInfoException; |
| | | import com.yeshi.fanli.vo.user.UserInfoVO; |
| | | |
| | | public interface UserInfoService { |
| | | /** |
| | | * 通过openid和loginType,获取用户 |
| | | * |
| | | * @param loginType 1:阿里系列(淘宝)账户 |
| | | * @param openid :登录淘宝后得到的openid |
| | | * @param appid |
| | | * @return 用户,如果不存在返回null |
| | | */ |
| | | /** |
| | | * @param loginType |
| | | * @param openid |
| | | * @param sysetm |
| | | * @return |
| | | */ |
| | | public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, SystemEnum sysetm); |
| | | |
| | | /** |
| | | * 添加用户 |
| | | * |
| | | * @param form 用户信息 |
| | | * @return 用户, 添加失败返回null |
| | | */ |
| | | public UserInfo addUser(UserInfo form, SystemEnum sysetm); |
| | | |
| | | /** |
| | | * 通过用户id获取用户 |
| | | * |
| | | * @param uid 用户id |
| | | * @return 用户 |
| | | */ |
| | | public UserInfo getUserById(long uid); |
| | | |
| | | /** |
| | | * Mybatis通过用户ID获取用户信息 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public UserInfo getUserByIdWithMybatis(long uid); |
| | | |
| | | public void update(UserInfo user); |
| | | |
| | | public long getUserCount(); |
| | | |
| | | |
| | | public void unBindUserInfo(UserInfo find, int type); |
| | | |
| | | public void addMoney(UserInfo userInfo, BigDecimal money); |
| | | |
| | | public boolean createUser(UserInfo form, SystemEnum sysetm); |
| | | |
| | | public void updateLoginInfo(UserInfo user); |
| | | |
| | | public void cleanPassword(long id); |
| | | |
| | | public BigDecimal getNewPeopleHB(Long id); |
| | | |
| | | /** |
| | | * 查询用户信息 -- 用户管理列表 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param userType |
| | | * @param days |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param orderMode |
| | | * @return |
| | | */ |
| | | public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType, |
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode, |
| | | Integer userType, String level, Integer activeCode, SystemEnum system); |
| | | |
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days, |
| | | String startTime, String endTime, Integer userType, String level, Integer activeCode, SystemEnum system); |
| | | |
| | | public double querySumMoney(String key, Integer userType, Integer days, String startTime, String endTime); |
| | | |
| | | /** |
| | | * 选择性更新 |
| | | * |
| | | * @param record |
| | | * @return |
| | | */ |
| | | public int updateByPrimaryKeySelective(UserInfo record); |
| | | |
| | | /** |
| | | * 其强制删除绑定信息 |
| | | * |
| | | * @param user |
| | | * @param type |
| | | */ |
| | | public void deleteBindInfo(UserInfo user, int type); |
| | | |
| | | /** |
| | | * 根据id查询用户信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public UserInfo selectByPKey(Long id); |
| | | |
| | | /** |
| | | * 超过 daysNum 天未登陆的用户 |
| | | * |
| | | * @param daysNum |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public List<Long> longTimeNoLogin(int daysNum, List<Long> list); |
| | | |
| | | /** |
| | | * 根据邀请码获取邀请用户 |
| | | * |
| | | * @param inviteCode |
| | | * @return |
| | | */ |
| | | public UserInfo getUserInfoByInviteCode(String inviteCode); |
| | | |
| | | /** |
| | | * 根据电话号码 获取有效用户 |
| | | * |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | public UserInfo getEffectiveUserInfoByPhone(String phone, SystemEnum sysetm); |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws UserInfoException |
| | | */ |
| | | public UserInfo getUserInfo(Long uid) throws UserInfoException; |
| | | |
| | | /** |
| | | * 根据微信获取有效用户 |
| | | * |
| | | * @param unionId |
| | | * @return |
| | | */ |
| | | public UserInfo getEffectiveUserInfoByWXUnionId(String unionId, SystemEnum sysetm); |
| | | |
| | | |
| | | /** |
| | | * 根据QQ获取有效用户 |
| | | * |
| | | * @param opneId |
| | | * @param sysetm |
| | | * @return |
| | | */ |
| | | public UserInfo getEffectiveUserInfoByQQOpenId(String opneId, SystemEnum sysetm); |
| | | |
| | | |
| | | /** |
| | | * 获取有效用户(根据淘宝OpenId) |
| | | * |
| | | * @param openId |
| | | * @param sysetm |
| | | * @return |
| | | */ |
| | | public UserInfo getEffectiveUserInfoByOpenId(String openId, SystemEnum sysetm); |
| | | |
| | | /** |
| | | * 获取用户余额 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public BigDecimal getBalance(Long uid); |
| | | |
| | | /** |
| | | * 更换头像 |
| | | * |
| | | * @param file |
| | | * @param uid |
| | | * @throws UserInfoException |
| | | * @throws IOException |
| | | */ |
| | | public void uploadPortrait(MultipartFile file, Long uid) throws UserInfoException, IOException; |
| | | |
| | | /** |
| | | * 保存头像 |
| | | * |
| | | * @param nickName |
| | | * @param uid |
| | | * @throws UserInfoException |
| | | */ |
| | | public void saveUserInfo(String nickName, Long uid) throws UserInfoException; |
| | | |
| | | /** |
| | | * 获取可提现用户列表 |
| | | * |
| | | * @param page |
| | | * @param count |
| | | */ |
| | | public List<UserInfo> getAutoExtractUser(int page, int count, BigDecimal minSurplus, String beganDate, |
| | | String endDate); |
| | | |
| | | /** |
| | | * 根据类型获取 |
| | | * |
| | | * @param type |
| | | * @param page |
| | | * @param count |
| | | * @return |
| | | */ |
| | | public List<UserInfo> listByType(int type, int page, int count); |
| | | |
| | | /** |
| | | * 根据类型计数 |
| | | * |
| | | * @param type |
| | | * @return |
| | | */ |
| | | public long countByType(int type); |
| | | |
| | | /** |
| | | * 双12预售开启时,开启对休眠老用户的唤醒工作,在2019.1.1到2019.6.18期间产生过订单,并且2019.6.18号后未再活跃, |
| | | * 并且账户余额大于1元,并且绑定了微信的用户有2468人 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | public List<UserInfo> getAutoExtractUserTo1212(int start, int count); |
| | | |
| | | /** |
| | | * 根据用户ID检索 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public UserInfo selectAvailableByPrimaryKey(Long uid); |
| | | |
| | | |
| | | public long countInfo(Integer userState, String key, Integer keyType, String userRank, Integer days, String startTime, |
| | | String endTime, Integer userType, String level, Integer activeCode, SystemEnum system); |
| | | |
| | | public List<UserInfoVO> queryInfo(long start, int count, Integer userState, String key, Integer keyType, String userRank, |
| | | Integer days, String startTime, String endTime, Integer userType, String level, Integer activeCode, SystemEnum system); |
| | | |
| | | |
| | | List<UserInfo> listBySystemAndWXUnionId(SystemEnum system, String unionId); |
| | | |
| | | List<UserInfo> listBySystemAndTaoBaoOpenId(SystemEnum system, String openId); |
| | | |
| | | List<UserInfo> listBySystemAndPhone(SystemEnum system, String phone); |
| | | |
| | | /** |
| | | * 根据用户ID获取所在系统 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public SystemEnum getUserSystem(Long uid); |
| | | |
| | | |
| | | /** |
| | | * 获取默认昵称 |
| | | * @param system |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public String getDefaultNickName(SystemEnum system, Long uid); |
| | | |
| | | public String getDefaultNickName(Long uid); |
| | | |
| | | /** |
| | | * 获取默认头像 |
| | | * @param system |
| | | * @return |
| | | */ |
| | | public String getDefaultPortrait(SystemEnum system); |
| | | |
| | | public String getDefaultPortrait(Long uid); |
| | | |
| | | } |