| | |
| | | import com.yeshi.fanli.dao.user.UserInfoDao;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.InviteUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.exception.ThreeSaleException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionAuthRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserRankService userRankService;
|
| | | |
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | | |
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | | |
| | | @Resource
|
| | | private TaoBaoUnionAuthRecordService taoBaoUnionAuthRecordService;
|
| | | |
| | |
|
| | |
|
| | | public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, String appid) {
|
| | |
| | | return userInfoMapper.getInfoByPhoneOrInviteCode(phone, inviteCode);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserInfo getEffectiveUserInfoByPhone(String phone) {
|
| | | return userInfoMapper.getEffectiveUserInfoByPhone(phone);
|
| | | }
|
| | | |
| | | @Override
|
| | | public UserInfo getEffectiveUserInfoByWXUnionId(String unionId) {
|
| | | return userInfoMapper.getEffectiveUserInfoByWXUnionId(unionId);
|
| | | }
|
| | | |
| | | @Override
|
| | | public UserInfo getUserInfo(Long uid) throws UserInfoException{
|
| | | if (uid == null) {
|
| | | throw new UserInfoException(1, "请求参数为空");
|
| | | }
|
| | | |
| | | UserInfo userInfo = userInfoMapper.selectByPKey(uid);
|
| | | if(userInfo == null) {
|
| | | throw new UserInfoException(1, "用户不存在");
|
| | | }
|
| | | |
| | | if (userInfo.getState() == UserInfo.STATE_FORBIDDEN) {
|
| | | throw new UserInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | | |
| | | if (userInfo.getState()!= UserInfo.STATE_NORMAL) {
|
| | | throw new UserInfoException(1, "用户不存在");
|
| | | }
|
| | | |
| | | // 淘宝昵称 组织
|
| | | boolean clearOpenid = true;
|
| | | UserExtraTaoBaoInfo extraTaoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (extraTaoBaoInfo != null) {
|
| | | String specialId = extraTaoBaoInfo.getSpecialId();
|
| | | String relationId = extraTaoBaoInfo.getRelationId();
|
| | | String taoBaoNickName = extraTaoBaoInfo.getTaoBaoNickName();
|
| | | |
| | | if(!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId)) {
|
| | | clearOpenid = false;
|
| | | userInfo.setOpenid(extraTaoBaoInfo.getTaoBaoUid());
|
| | | |
| | | if(!StringUtil.isNullOrEmpty(taoBaoNickName)) {
|
| | | userInfo.setTbName(taoBaoNickName);
|
| | | } else {
|
| | | String taoBaoUserNick = taoBaoUnionAuthRecordService.getTaoBaoUserNick(uid);
|
| | | if(!StringUtil.isNullOrEmpty(taoBaoUserNick)) {
|
| | | userInfo.setTbName(taoBaoUserNick);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if (clearOpenid) {
|
| | | userInfo.setOpenid(null);
|
| | | }
|
| | | |
| | | return userInfo;
|
| | | }
|
| | | |
| | | |
| | | }
|