| | |
| | | import java.io.FileWriter;
|
| | | import java.io.IOException;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.BindingAccountMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.MoneyRecordMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.PidOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.ThreeSaleMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserConnectHistoryMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.hongbao.HongBaoMapper;
|
| | |
| | | import com.yeshi.fanli.exception.UserAccountException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | |
| | | private OrderItemMapper orderItemMapper;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleMapper threeSaleMapper;
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private PidOrderMapper pidOrderMapper;
|
| | |
| | | if (lastUser == null) {
|
| | | if (userInfo != null) {
|
| | | // 使分销关系生效
|
| | | threeSaleMapper.effectThreeSale(userInfo.getId());
|
| | | threeSaleSerivce.effective(userInfo);
|
| | | // 更新头像与昵称
|
| | | UserInfo updateUserInfo = new UserInfo(userInfo.getId());
|
| | | updateUserInfo.setNickName(weiXinUser.getNickname());
|
| | |
| | | session.removeAttribute("LAST_LOGIN_USER");
|
| | |
|
| | | // 使分销关系生效
|
| | | threeSaleMapper.effectThreeSale(userInfo.getId());
|
| | | threeSaleSerivce.effective(userInfo);
|
| | |
|
| | | return new LoginResult(LoginResult.TYPE_NORMAL, userInfo);
|
| | | } else {// 两个账号拥有不同的UID
|
| | |
| | | result.setLessUser(lastUser);
|
| | |
|
| | | // 使分销关系生效
|
| | | threeSaleMapper.effectThreeSale(userInfo.getId());
|
| | | threeSaleSerivce.effective(userInfo);
|
| | | return result;
|
| | | }
|
| | |
|
| | |
| | | if (!StringUtil.isNullOrEmpty(mainUser.getPhone()) && !StringUtil.isNullOrEmpty(lessUser.getPhone()))
|
| | | throw new UserAccountException(9, "两个账号都绑定了手机号码,请解绑其中一个");
|
| | |
|
| | | if (lessUser.getMyHongBao().compareTo(new BigDecimal("20")) >= 0
|
| | | && mainUser.getMyHongBao().compareTo(new BigDecimal("20")) > 0)
|
| | | throw new UserAccountException(10, String.format("账户ID:%s 的资金超过20元,为保证资金安全请联系客服打通", lessUser.getId() + ""));
|
| | | if (lessUser.getMyHongBao().compareTo(new BigDecimal("10")) >= 0
|
| | | && mainUser.getMyHongBao().compareTo(new BigDecimal("10")) > 0)
|
| | | throw new UserAccountException(10, String.format("账户ID:%s 的资金超过10元,为保证资金安全请联系客服打通", lessUser.getId() + ""));
|
| | |
|
| | | // 判定是否绑定了同一支付宝
|
| | | List<BindingAccount> mainUserAccountList = bindingAccountMapper.selectByUid(mainUser.getId());
|
| | |
| | | List<OrderItem> orderItemList = orderItemMapper.selectByUid(uid);
|
| | |
|
| | | // 备份邀请关系
|
| | | List<ThreeSale> threeSaleList = threeSaleMapper.selectByUid(uid);
|
| | | List<ThreeSale> threeSaleList = new ArrayList<>();
|
| | |
|
| | | // 备份分享赚
|
| | | List<PidOrder> pidOrderList = pidOrderMapper.selectByUid(uid);
|