예제 #1
0
  /**
   * Description:判断手机号码是否存在<br>
   *
   * @author yubin
   * @version 0.1 2015年9月17日
   * @param memberRegisterCnd
   * @param request
   * @param session
   * @return MessageBox
   */
  @RequestMapping(value = "/isMobileNumExist")
  public @ResponseBody MessageBox isMobileNumExist(String mobileNum) {
    String result = "success";
    try {

      if (null != mobileNum && !"".equals(mobileNum.trim())) {
        // 验证手机号是否存在
        MobileApproCnd mobileApproCnd = new MobileApproCnd();
        mobileApproCnd.setMobileNum(mobileNum);
        Integer usernameCount = mobileApproMapper.queryRepeatMobileApproCount(mobileApproCnd);
        if (null != usernameCount && usernameCount > 0) {
          return new MessageBox("2", "该手机号已经被使用!");
        }
      }

    } catch (Exception e) {
      result = "failer";
      logger.error("该手机号已经被使用!");
    }
    if (!BusinessConstants.SUCCESS.equals(result)) {
      return new MessageBox("0", result);
    }

    return new MessageBox("1", result);
  }
예제 #2
0
  /**
   * Description:找回密码第一步<br>
   *
   * @author yubin
   * @version 0.1 2015年12月29日
   * @param mobileNum
   * @return MessageBox
   */
  @RequestMapping(value = "/findMobileByOne")
  public @ResponseBody MessageBox findMobileByOne(String mobileNum, String validatecode) {
    String result = "success";
    try {

      if (null != mobileNum && !"".equals(mobileNum.trim())) {
        MobileApproCnd mobileApproCnd = new MobileApproCnd();
        mobileApproCnd.setMobileNum(mobileNum);
        Integer usernameCount = mobileApproMapper.queryRepeatMobileApproCount(mobileApproCnd);
        if (usernameCount == null || usernameCount.intValue() < 1) {
          return new MessageBox("0", "您的手机号码没有绑定账号");
        }
      }
      String randCode = (String) currentSession().getAttribute("randomCode");
      if (null == validatecode || null == randCode || !validatecode.equals(randCode)) {
        return new MessageBox("0", "验证码输入有误!");
      }

    } catch (Exception e) {
      result = "failer";
      logger.error("找回密码第一步:", e);
    }
    if (!BusinessConstants.SUCCESS.equals(result)) {
      return new MessageBox("0", result);
    }

    return new MessageBox("1", result);
  }