| | |
| | | @Autowired |
| | | IUserRechargeService userRechargeService; |
| | | |
| | | public ServerResponse reg(String phone, String userPwd, HttpServletRequest request) { |
| | | if (StringUtils.isBlank(phone) || |
| | | public ServerResponse reg(String agentCode,String phone, String userPwd, HttpServletRequest request) { |
| | | if (StringUtils.isBlank(phone) || StringUtils.isBlank(agentCode) || |
| | | StringUtils.isBlank(userPwd)) |
| | | { |
| | | return ServerResponse.createByErrorMsg("注册失败, 参数不能为空"); |
| | |
| | | String keys = "AliyunSmsCode:" + phone; |
| | | String redis_yzm = RedisShardedPoolUtils.get(keys); |
| | | |
| | | |
| | | AgentUser agentUser = this.iAgentUserService.findByCode(agentCode); |
| | | if (agentUser == null) { |
| | | return ServerResponse.createByErrorMsg("注册失败, 机构代码不存在"); |
| | | } |
| | | if (agentUser.getIsLock().intValue() == 1) { |
| | | return ServerResponse.createByErrorMsg("注册失败, 机构代码已被锁定"); |
| | | } |
| | | |
| | | |
| | | User dbuser = this.userMapper.findByPhone(phone); |
| | | if (dbuser != null) { |
| | | return ServerResponse.createByErrorMsg("注册失败, 手机号已注册"); |
| | |
| | | |
| | | User user = new User(); |
| | | user.setPhone(phone); |
| | | user.setAgentId(agentUser.getId()); |
| | | user.setAgentName(agentUser.getAgentName()); |
| | | user.setUserPwd(SymmetricCryptoUtil.encryptPassword(userPwd)); |
| | | |
| | | |
| | |
| | | |
| | | if (insertCount > 0) { |
| | | //用户注册成功重新代理机构码重新生成 |
| | | String newAgentCode = generateUniqueAgentCode(); |
| | | agentUser.setAgentCode(newAgentCode); |
| | | iAgentUserService.updateAgentCode(agentUser); |
| | | log.info("用户注册成功 手机 {} , ip = {} 地址 = {}", new Object[] { phone, uip, uadd }); |
| | | return ServerResponse.createBySuccessMsg("注册成功.请登录"); |
| | | } |
| | |
| | | userInfoVO.setBuyAmtAutual(buyAmtAutual); |
| | | userAllAmt = userAllAmt.add(buyAmtAutual); |
| | | userInfoVO.setUserAmt(userAllAmt); |
| | | |
| | | List<UserPosition> userPositions = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 1); |
| | | if (userPositions.size() > 0) { |
| | | for (UserPosition position : userPositions) { |
| | | UserPositionVO userPositionVO = assembleUserPositionVO(position); |
| | | historyProfitLoss = historyProfitLoss.add(userPositionVO.getProfitAndLose()); |
| | | } |
| | | } |
| | | userInfoVO.setHistoryProfitLoss(historyProfitLoss); |
| | | // List<UserPosition> userPositions = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 1); |
| | | // if (userPositions.size() > 0) { |
| | | // for (UserPosition position : userPositions) { |
| | | // UserPositionVO userPositionVO = assembleUserPositionVO(position); |
| | | // historyProfitLoss = historyProfitLoss.add(userPositionVO.getProfitAndLose()); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // IndexPositionVO indexPositionVO = this.iUserIndexPositionService.findUserIndexPositionAllProfitAndLose(user.getId()); |
| | | // BigDecimal allIndexProfitAndLose = indexPositionVO.getAllIndexProfitAndLose(); |