| | |
| | | |
| | | public ServerResponse reg(String yzmCode, String agentCode, String phone, String userPwd, HttpServletRequest request) { |
| | | if (StringUtils.isBlank(agentCode) || StringUtils.isBlank(phone) || |
| | | StringUtils.isBlank(userPwd) || StringUtils.isBlank(yzmCode)) |
| | | StringUtils.isBlank(userPwd)) |
| | | { |
| | | return ServerResponse.createByErrorMsg("注册失败, 参数不能为空"); |
| | | } |
| | |
| | | String uip = IpUtils.getIp(request); |
| | | user.setRegIp(uip); |
| | | String uadd = JuheIpApi.ip2Add(uip); |
| | | user.setRegAddress(uadd); |
| | | // user.setRegAddress(uadd); |
| | | |
| | | user.setIsLogin(Integer.valueOf(0)); |
| | | |
| | |
| | | String property = PropertiesUtil.getProperty("user.cookie.name"); |
| | | // System.out.println(property); |
| | | String loginToken = request.getHeader(property); |
| | | |
| | | // 如果header中没有token,尝试从cookie获取 |
| | | if (loginToken == null) { |
| | | javax.servlet.http.Cookie[] cookies = request.getCookies(); |
| | | if (cookies != null) { |
| | | for (javax.servlet.http.Cookie cookie : cookies) { |
| | | if (property != null && property.equals(cookie.getName())) { |
| | | loginToken = cookie.getValue(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 如果cookie中也没有token,尝试从URL参数获取(用于iframe等场景) |
| | | if (loginToken == null) { |
| | | loginToken = request.getParameter("token"); |
| | | } |
| | | |
| | | if (loginToken == null) { |
| | | return null; |
| | | } |
| | |
| | | return ServerResponse.createByErrorMsg("修改失败"); |
| | | } |
| | | |
| | | @Override |
| | | public void updateSignedContract(Integer userId, String signedContract) { |
| | | this.userMapper.updateSignedContract(userId,signedContract); |
| | | } |
| | | @Override |
| | | public void updateSignedAgreement(Integer userId, String signedAgreement) { |
| | | this.userMapper.updateSignedAgreement(userId,signedAgreement); |
| | | } |
| | | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public ServerResponse exchangeOp(BigDecimal amt, Integer type, HttpServletRequest request) throws Exception { |
| | |
| | | } |
| | | |
| | | |
| | | public ServerResponse auth(String realName, String idCard, String img1key, String img2key, String img3key, HttpServletRequest request) { |
| | | if (StringUtils.isBlank(realName) || StringUtils.isBlank(idCard)){ |
| | | public ServerResponse auth(String realName, String idCard, String address, String img1key, String img2key, String img3key, HttpServletRequest request) { |
| | | if (StringUtils.isBlank(realName) || StringUtils.isBlank(idCard) || StringUtils.isBlank(address)){ |
| | | // StringUtils.isBlank(img1key) || |
| | | // StringUtils.isBlank(img2key)) |
| | | return ServerResponse.createByErrorMsg("参数不能为空"); |
| | |
| | | user.setNickName(realName); |
| | | user.setRealName(realName); |
| | | user.setIdCard(idCard); |
| | | user.setRegAddress(address); |
| | | |
| | | user.setImg1Key(img1key); |
| | | user.setImg2Key(img2key); |
| | |
| | | |
| | | userInfoVO.setEnableIndexAmt(user.getEnableIndexAmt()); |
| | | userInfoVO.setEnaleWithdrawAmt(user.getEnaleWithdrawAmt()); |
| | | userInfoVO.setIsSignedContract(user.getIsSignedContract()); |
| | | userInfoVO.setIsSignedAgreement(user.getIsSignedAgreement()); |
| | | userInfoVO.setHkAmt(user.getHkAmt()); |
| | | |
| | | BigDecimal historyProfitLoss = new BigDecimal(0); |
| | | BigDecimal buyAmtAutual = new BigDecimal(0); |
| | | List<UserPosition> userPositionscc = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 0); |
| | | List<UserPosition> userPositionscc = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 1); |
| | | |
| | | if (userPositionscc.size() > 0) { |
| | | for (UserPosition position : userPositionscc) { |
| | |
| | | userAllAmt = userAllAmt.add(buyAmtAutual); |
| | | userInfoVO.setUserAmt(userAllAmt); |
| | | |
| | | List<UserPosition> userPositions = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 1); |
| | | List<UserPosition> userPositions = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), "", "", 2); |
| | | |
| | | if (userPositions.size() > 0) { |
| | | for (UserPosition position : userPositions) { |