Package com.lgx8.right.entities

Examples of com.lgx8.right.entities.User


  /**
   * @param args
   */
  public static void main(String[] args) {
    User user = new User();
    user.setUsername("czt");
    user.setPassword("czt");
    user.setEmail("www15119258@qq.com");
    user.setRegistertime(new Date());
    user.setLastlogin(new Date());
    user.setNickname("苍之涛");
    user.setTruename("李晖");
    user.setSex(User.SEX_NULL);
    user.setIp("127.0.0.1");
    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


    this.xfhy = xfhy;
  }
  public String toJSON() {
    JSONObject jObj = new JSONObject();
    Merchant _mr = getMerchant();
    User _u = getXfhy();
    try {
      jObj.put("id", getID());
      jObj.put("xfsjmc", _mr==null?"":_mr.getSJMC());
      jObj.put("hyxm", _u==null?"":_u.getUsername());
      jObj.put("hynickName", _u==null?"":_u.getTruename());
      jObj.put("hych", _u==null?"":(_u.getCard()==null?"":_u.getCard().getId()));
      jObj.put("xfje", getXFJE());
      jObj.put("zsjf", getHDJFS());
      jObj.put("xfsj", getXFSJ());
      //jObj.put("", arg1)
    } catch (JSONException e) {
View Full Code Here

  }
 
  public String toJSON(){
    JSONObject jObj = new JSONObject();
    Merchant _m = getMerchant();
    User _czyh = getCZYHBH();
    User _u = getCZQDR();
    try {
      jObj.put("id", getID());
      jObj.put("user_id", _czyh!=null?"":_czyh.getId());
      jObj.put("user_name", _czyh==null?"":_czyh.getUsername());
      jObj.put("merchat_id", _m==null?"":_m.getID());
      jObj.put("m_name", _m==null?"":_m.getSJMC());
      jObj.put("czlx", changetoCN(getRESERVATION01()));
      jObj.put("czje", getCZJE());
      jObj.put("dhjf", getCZDHJFS());
      jObj.put("czsj", getCZSJ());
      jObj.put("czzt", changeToCN(getCzzt()));
      jObj.put("czqdr", _u==null?"":_u.getUsername());
      jObj.put("czqrrq", getCzqdrq());
    } catch (JSONException e) {
      e.printStackTrace();
    }
    return jObj.toString();
View Full Code Here

    car.setScore(score);
    car.setPassword(password);
    this.getHibernateTemplate().persist(car);
   
    String md5Passwd = EncryptUtil.toMD5(password);
    User user = new User();
    user.setPassword(md5Passwd);
    user.setLocked(false);
    user.setEnabled(true);
    user.setOpener(opener);
    user.setParent(parent);
    user.setUsertype(usertype);
    user.setParenttype(parenttype);
    user.setOrganizationid(organizationid);
    user.setRegistertime(new Date());
    user.setCard(car);
    user.setUsername(card);
    user.setLastlogin(new Date());
    if(mobile != null && !"".equals(mobile))
      user.setMobile(mobile);
    if(email != null && !"".equals(email))
      user.setEmail(email);
    this.getHibernateTemplate().persist(user);

    return car;
  }
View Full Code Here

    String name = request.getParameter("name");
    String st_time = request.getParameter("st_time");
    String ed_time = request.getParameter("ed_time");
    String str_curPage = request.getParameter("curPage");
    int curPage = Integer.parseInt(str_curPage==null?"1":str_curPage);
    User user = RunTimeUser.getRunTimeUser(request);
    if(user.getUsertype()==User.USER_TYPE_MERCHANT){
      long m_id = user.getOrganizationid();
      if(m_id!=0){
        Merchant m = merchantDao.getMerchantById(m_id);
        name = m.getSJMC();
      }
    }
View Full Code Here

    String username = request.getParameter("username");
    String orgid = request.getParameter("orgid");
   
    String hql =  " select u from User u where u.enabled = true";
   
    User u = null;
   
    if("2".equals(type))
    {
      Merchant merchant = merchantDao.getMerchantById(Long.parseLong(orgid));
      if(merchant != null)
      {
        u = merchant.getSJFRDB();
      }
    }else if("3".equals(type))
    {
      Organization org = organizationDao.getOrganizationById(Long.parseLong(orgid));
      if(org != null)
      {
        u = org.getJgfzr();
      }
    }
   
    if(u != null)
    {
      String cardStart = u.getCardStart();
      String cardEnd = u.getCardEnd();
     
      String[] css = cardStart.split(",");
      String[] ces = cardEnd.split(",");
     
      if(css.length >0)
View Full Code Here

    String u_id = request.getParameter("u_id");
    String password_new = request.getParameter("new_password");
    String userName = request.getParameter("userName");
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    if(u_id!=null&&u_id.length()!=0&&rtUser!=null){
      User u = userCardService.findUserById(Integer.parseInt(u_id));
      u.setUsername(userName);
      u.setPassword(EncryptUtil.toMD5(password_new));
      userCardService.updateUser(u);
      long _oid = u.getOrganizationid();
      Organization or = organizationDao.getOrganizationById(_oid);
      String sid = request.getSession().getId();
      request.getSession().removeAttribute(sid);
      request.setAttribute("user", u);
      request.setAttribute("organization", or);
View Full Code Here

        Organization so = organizationDao.getOrganizationById(Long.parseLong(ssjg));
        uo.setSsjg(so);
      }
     
      //负责人
      User u = null;
      if(!StrUtil.isNullStr(jgfzr))
      {
        u = userDao.findUserByUserName(jgfzr);
        if(uo.getJgfzr() != null)
        {
          if(u.getId() != uo.getJgfzr().getId())
          {
            u.setUsertype(Long.parseLong(jglx));
          }
          uo.setJgfzr(u);
        }
      }
     
     
     
     
      organizationDao.updateOrganization(uo);
      if (!StrUtil.isNullStr(posturl)){
        return new ModelAndView(posturl).addObject("ErrMsg", "修改成功");
      }
      return new ModelAndView(new RedirectView("../page/management/organization/list_organization.jsp"));
    }
    Organization org = new Organization();
    org.setJGMC(jgmc);
    org.setJGDH(jgdh);
    org.setJGSZDZ(jgszdz);
    org.setJGSZQY(jgszqy);
    org.setJGLX(jglx);
    org.setJGTJR(rtUser);
    org.setJGTJSJ(new Date());
    org.setDELETEFLAG("0");
   
    User u = null;
   
    if(!StrUtil.isNullStr(jgfzr))
    {
      u = userDao.findUserByUserName(jgfzr);
     
      u.setUsertype(Long.parseLong(jglx));
     
      org.setJgfzr(u);
    }
   
    if(!StrUtil.isNullStr(ssjg) && !"0".equals(ssjg))
    {
      Organization sj = organizationDao.getOrganizationById(Long.parseLong(ssjg));
      org.setSsjg(sj);
    }
   
    organizationDao.createOrganization(org);
   
    if(u != null)
    {
      u.setOrganizationid(org.getID());
      userDao.updateUser(u);
    }
   
    return new ModelAndView(new RedirectView("../page/management/organization/list_organization.jsp"));
  }
View Full Code Here

    orderDao.createOrders(order);
  }

  @Transactional
  public Orders findCartByUserId(long userid) {
    User user = userDao.findUserById(userid);
    if (user == null) {
      return null;
    }
    return orderDao.findCartByUserId(user);
  }
View Full Code Here

   * 根据用户id找到用户的购物车,如果不存在,创建一个购物车,将用户所选商品加入购物车
   */
  @Transactional
  public Orders createOrderProduct(long userid, long productid, int count,
      String color, String clothesize, String shoesize) {
    User user = userDao.findUserById(userid);
    if (user == null) {
      return null;
    }
    Orders order = orderDao.findCartByUserId(user);

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.