Package com.lgx8.right.entities

Examples of com.lgx8.right.entities.User


        ModelAndView model = new ModelAndView("gateway/login");
        model.addObject("username", username);
        model.addObject("codeMsg", "验证码错误");
        return model;
      }
      User authuser = userCardService.auth(new User(username, password));
     
      if(authuser != null && authuser.getLocked())
      {
        ModelAndView model = new ModelAndView("gateway/login");
        model.addObject("username", username);
        model.addObject("errMsg", "用户被锁定");
        return model;
      }
     
      if (authuser != null) {
        RunTimeUser rtUser = new RunTimeUser(authuser);
        rtUser.setUserIp(request.getRemoteAddr());
        rtUser.setSessionID(request.getSession().getId());
        String sid = request.getSession().getId();
        request.getSession().removeAttribute(sid);
        //request.getSession().setAttribute(sid, rtUser);
        if (!ArrayUtil.isEmptyCollection(rtUser.getRoles())) {
          rtUser.setIsmanager(true);
        }
        if(rtUser.getUsertype()==2){
          long _mid = rtUser.getOrganizationid();
          rtUser.setMerchant(true);
        }
        if(rtUser.getUsertype()==3){
          long _mid = rtUser.getOrganizationid();
          rtUser.setOrganization(true);
        }
        // 设置当前登录时间ip 下次登录时拿上次的登录时间ip
        authuser.setLastlogin(new Date());
        authuser.setIp(request.getRemoteAddr());
        userCardService.updateUser(authuser);
       
        String url = "/page/management/member/member_welcome.jsp";
        if (rtUser.isIsmanager()) {
          url = "/page/management/common/main.jsp";
View Full Code Here


      model.addObject("email", email);
      model.addObject("usernameMsg","该帐号已存");
      return model;
    }
    ModelAndView model = new ModelAndView("gateway/login");
    User user = new User();
    user.setMobile(mobile);
    user.setEmail(email);
    user.setUsername(username);
    user.setPassword(password);
    user.setRegistertime(new Date());
    user.setLastlogin(new Date());
    user.setUsertype(User.USER_TYPE_NORMAL);
    user.setEnabled(true);
    user.setLocked(false);
    user.setCardEnd("0");
    user.setCardStart("0");
    user.setCurMaxCard("0");
    userCardService.registerUser(user);
    model.addObject("registerSuc", "注册成功请登录");
   
    PrintWriter out = null;
    response.setContentType("text/html;charset=UTF-8");
View Full Code Here

          _orid = _or.getID();
        }
      }
    }
    if(_orid!=0){
      User user = new User();
      user.setEmail(email);
      user.setOpener(rtUser);
      user.setRegistertime(new Date());
      user.setLastlogin(new Date());
      user.setUsername(phoneNum);
      user.setPassword(password);
      user.setTruename(realName);
      user.setSex(Integer.parseInt(sex));
      user.setMobile(phoneNum);
      user.setUsertype(User.USER_TYPE_NORMAL);
      user.setParenttype(_type);
      user.setOrganizationid(_orid);
      user.setEnabled(true);
      user.setLocked(false);
      user.setCardEnd("0");
      user.setCardStart("0");
      user.setCurMaxCard("0");
      if(cardNum!=null&&cardNum.length()!=0){
        Card card = cardDao.findCard(cardNum);
        userCardService.createUser(user,card);
      }else{
//        User ru = userDao.findUserById(rtUser.getId());
View Full Code Here

  }
 
  @RequestMapping("/merchant/listCustmerConsume.do")
  public String queryCustmerConsumeByCondition(HttpServletRequest request,HttpServletResponse response){
    String name = request.getParameter("name");
    User u = RunTimeUser.getRunTimeUser(request);
    if(u.getUsertype()==User.USER_TYPE_MERCHANT){
      long m_id = u.getOrganizationid();
      if(m_id!=0){
        Merchant m = merchantDao.getMerchantById(m_id);
        name = m.getSJMC();
      }
    }
View Full Code Here

      _type = rtUser.getUsertype();
      if(_type==2){
        _m = (Merchant)userOrganizationMerchantService.getOrganizationOrMerchantByUser(rtUser);
      }
    }
    User _u = userDao.findUserByPhone(cardNum,cardNum);
    if(_u!=null&&_m!=null){
      _xf = custmerService.createCustmerXF(_m, _u, Double.parseDouble(xfje), Double.parseDouble(xfje));
      request.setAttribute("custmerxf", _xf);
    }
    response.setContentType("text/html;charset=UTF-8");
View Full Code Here

          _orid = _or.getID();
        }
      }
    }
    if(_orid!=0&&_type!=0&&_type!=1&&_type!=3){
      User u = new User();
      u.setUsername(userName);
      u.setPassword(password);
      u.setTruename(realName);
      u.setSex(Integer.parseInt(sex));
      u.setMobile(phoneNum);
      u.setRegistertime(new Date());
      u.setLastlogin(new Date());
      u.setEmail(email);
      u.setOpener(rtUser);
      u.setParent(rtUser);
      u.setParenttype(_type);
      u.setUsertype(_type);
      u.setOrganizationid(_orid);

      u.setEnabled(true);
      u.setLocked(false);
      u.setCardEnd("0");
      u.setCardStart("0");
      u.setCurMaxCard("0");
      userCardService.createUser(u);
      request.setAttribute("userXX", u);
    }
    return "/management/merchant/result_merchant_subcount";
  }
View Full Code Here

  }
 
  @RequestMapping("/member/modifyUserIni.do")
  public ModelAndView modifyUserIni(HttpServletRequest request,HttpServletResponse response) {
    String uid = request.getParameter("id");//商家id
    User user = userDao.findUserById(Long.parseLong(uid));
    return new ModelAndView("/management/member/update_member").addObject("user", user);
  }
View Full Code Here

    String sex = request.getParameter("sex");
    String mobile = request.getParameter("mobile");
    String posturl = request.getParameter("posturl");
    String cardid = request.getParameter("cardid");
    if (posturl != null && !"".equals(posturl)) {
      User user = userCardService.findUserById(Long.parseLong(uid));
      user.setEmail(email);
      user.setMobile(mobile);
      user.setTruename(truename);
      userCardService.updateUser(user);
      return new ModelAndView(posturl).addObject("ErrMsg", "修改成功");
    }
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if (uid != null && !"".equals(uid)) {
      User user = userCardService.findUserById(Long.parseLong(uid));
      user.setEmail(email);
      user.setSex(Integer.parseInt(sex));
      user.setMobile(mobile);
      user.setTruename(truename);
      userCardService.updateUser(user);
      return new ModelAndView(new RedirectView("../page/management/member/list_member.jsp"));
    }
    long orid = 0;
    long type = 0l;
    if(rtUser!=null){
      type = rtUser.getUsertype();
      if(type==2){
        Merchant or = (Merchant)userOrganizationMerchantService.getOrganizationOrMerchantByUser(rtUser);
        if(or!=null){
          orid = or.getID();
        }
      }
      if(type==3){
        Organization or = (Organization)userOrganizationMerchantService.getOrganizationOrMerchantByUser(rtUser);
        if(or!=null){
          orid = or.getID();
        }
      }
    }
    if(orid!=0){
      User user = new User();
      user.setEmail(email);
      user.setOpener(rtUser);
      user.setRegistertime(new Date());
      user.setLastlogin(new Date());
      user.setUsername(mobile);
      user.setPassword(password);
      user.setTruename(truename);
      user.setSex(Integer.parseInt(sex));
      user.setMobile(mobile);
      user.setUsertype(User.USER_TYPE_NORMAL);
      user.setParenttype(type);
      user.setOrganizationid(orid);
      user.setEnabled(true);

      user.setLocked(false);
      user.setCardEnd("0");
      user.setCardStart("0");
      user.setCurMaxCard("0");
//      userCardService.createUser(user);
     
//      User ru = userDao.findUserById(rtUser.getId());
//      String cardStart = ru.getCardStart();
//      String cardCur = ru.getCurMaxCard();
//      if("0".equals(cardCur))
//      {
//        cardCur = cardStart;
//      }else
//      {
//        cardCur = Long.parseLong(cardCur)+1l+"";
//      }
      Card card = cardDao.findCard(cardid);
      if(card == null )card = cardDao.createCard(cardid);
       
      userCardService.createUser(user,card);

//      ru.setCurMaxCard(cardCur);
//      userCardService.updateUser(ru);
     
      //当开卡成功后发短信到手机
      //尊敬的会员您的乐共享登录名13036780222,卡/号818800010022密/码abc123,请登录www.lgx8.com【乐共享】
      String content = "尊敬的会员您的乐共享登录名"+user.getUsername()+",卡/号"+user.getCard().getId()+"密/码"+password+",请登录www.lgx8.com";
      SendSms.sendSms(user.getMobile(), content);
     
    }
   
    return new ModelAndView(new RedirectView("../page/management/member/list_member.jsp"));
  }
View Full Code Here

    String params = request.getParameter("params");
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IUserDao userDao = (IUserDao) ac.getBean("userDao");
   
    User user = userDao.getUserByMobileOrCard(params);
    response.setCharacterEncoding("UTF-8");
    PrintWriter pw = response.getWriter();
    if(user != null)
    {
      pw.write(user.getTruename() != null ? user.getTruename() : user.getUsername());
    }else
    {
      pw.write("0");
    }
  }
View Full Code Here

    user.setMobile("15015531354");
   
   
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
   
    IUserCardService userCardService = (IUserCardService) ac.getBean("userCardService");
//    userCardService.createUser(user);
//   
    user = userCardService.findUser("username", "czt");
   
    System.out.println(user.getCard().getScore());
   
//    IConfigDao dao = (IConfigDao) ac.getBean("configDao");
//    System.out.println(dao.findGatewayConfig());
View Full Code Here

TOP

Related Classes of com.lgx8.right.entities.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.