Package com.lgx8.right.entities

Examples of com.lgx8.right.entities.RunTimeUser


  IRoleDao roleDao;
 
  @RequestMapping(value="/pageQuery.do")
  public ModelAndView queryRolesByPage(HttpServletRequest request,HttpServletResponse response){
    String roleName = request.getParameter("roleName");
    RunTimeUser curUser = RunTimeUser.getRunTimeUser(request);
    PageArgument pageArgment = getPageInfo(request);
    String hql = "";
    Object[] o = null;
    if(null==roleName||"".equals(roleName.trim())){
      hql = "from Role r where r.uid = ?";
      o = new Object[]{curUser.getId()};
    }else{
      hql = "from Role r where r.name like ? and r.uid = ?";
      o = new Object[]{"%"+roleName+"%",curUser.getId()};
    }
   
    PageList pageList = roleService.queryRolesByPage(pageArgment, hql, o);
    printJSON(response, pageList.toJSON());
    return null;
View Full Code Here


   */
  @RequestMapping(value="/authzTree.do")
  public void authzTree(HttpServletRequest request,HttpServletResponse response){
    List<Module> modules = Constants.getMenuList();
    //获取当前登录用户权限
    RunTimeUser user = RunTimeUser.getRunTimeUser(request);
    String mids = (String) request.getSession().getAttribute("checkedModule");
    if(mids==null)mids = "";
      response.setContentType("text/html; charset=UTF-8");
        response.setCharacterEncoding("UTF-8");
      try {
View Full Code Here

        return isChecked;
    }
   
    @RequestMapping(value="/roleEdit.do")
    public ModelAndView roleEdit(HttpServletRequest request, HttpServletResponse response) {
      RunTimeUser user = RunTimeUser.getRunTimeUser(request);
      String roleName = request.getParameter("name");
      String modules = request.getParameter("module");
      String id = request.getParameter("roleId");
      Role role = new Role();
      role.setId(Integer.parseInt(id));
      role.setMids(modules);
      role.setName(roleName);
      role.setUid(user.getId());
      role.setCreateTime(new Date());
      roleDao.updateRole(role);
      return new ModelAndView(new RedirectView("page/management/systemRole/rolelist.jsp"));
    }
View Full Code Here

      return new ModelAndView("/management/systemRole/addrole");
    }
   
    @RequestMapping(value="/roleSave.do")
    public ModelAndView roleSave(HttpServletRequest request, HttpServletResponse response) {
      RunTimeUser user = RunTimeUser.getRunTimeUser(request);
      String roleName = request.getParameter("name");
      String modules = request.getParameter("module");
      Role role = new Role();
      role.setMids(modules);
      role.setName(roleName);
      role.setUid(user.getId());
      role.setCreateTime(new Date());
      roleDao.createRole(role);
      return new ModelAndView(new RedirectView("page/management/systemRole/rolelist.jsp"));
    }
View Full Code Here

   * @param response
   * @return
   */
  @RequestMapping("/member/memberPageQuery.do")
  public ModelAndView memberPageQuery(HttpServletRequest request,HttpServletResponse response){
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    PageArgument pageArgment = getPageInfo(request);
    String cardid = request.getParameter("cardid");
    String mobile = request.getParameter("mobile");
    String merchant = request.getParameter("merchant");
    String truename = request.getParameter("truename");
    String stime = request.getParameter("stime");
    String etime = request.getParameter("etime");
    long orid = 0;
    long type = rtUser.getUsertype();
    if(type==2){
      Merchant or = (Merchant)userOrganizationMerchantService.getOrganizationOrMerchantByUser(rtUser);
      if(or!=null){
        orid = or.getID();
      }
View Full Code Here

      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();
        }
View Full Code Here

    return new ModelAndView(new RedirectView("../page/management/member/list_member.jsp"));
  }
 
  @RequestMapping("/member/queryUsers.do")
  public ModelAndView queryUsers(HttpServletRequest request,HttpServletResponse response){
    RunTimeUser rtUser = RunTimeUser.getRunTimeUser(request);
    PageArgument pageArgment = getPageInfo(request);
    String type = request.getParameter("type");
    String username = request.getParameter("username");
    String merchantname = request.getParameter("merchantname");
   
    String hql = " ";
   
    if("2".equals(type))
    {
      if(rtUser.getUsertype() == 2)
      {
        hql = " select u from User u, Merchant m where u.enabled = true and u.locked = false and u.usertype = 2 and m.ID = u.organizationid and m.SJFRDB.id = u.id";
       
        if(!StringUtil.isEmptyStr(merchantname))
        {
          hql += " and  m.SJMC like '%"+merchantname+"%'";
        }
       
        hql += " order by u.id desc";
       
      }else if(rtUser.getUsertype() == 3)
      {
        hql = " select u from User u, Organization o where u.enabled = true and u.locked = false and u.usertype = 3 and o.ID = u.organizationid and o.jgfzr.id = u.id";
       
        if(!StringUtil.isEmptyStr(merchantname))
        {
          hql += " and  o.JGMC like '%"+merchantname+"%'";
        }
       
        hql += " order by u.id desc";
       
      }else
      {
        hql = " select u from User u, Merchant m where u.enabled = true and u.locked = false and u.usertype = 2 and m.ID = u.organizationid and m.SJFRDB.id = u.id";
       
        if(!StringUtil.isEmptyStr(merchantname))
        {
          hql += " and  m.SJMC like '%"+merchantname+"%'";
        }
       
        hql += " order by u.id desc";
       
        hql  += " union  select u from User u, Organization o where u.enabled = true and u.locked = false and u.usertype = 3 and o.ID = u.organizationid and o.jgfzr.id = u.id";
       
        if(!StringUtil.isEmptyStr(merchantname))
        {
          hql += " and  o.JGMC like '%"+merchantname+"%'";
        }
       
        hql += " order by u.id desc";
      }
    }else
    {
      hql = " from User u where u.enabled = true and u.locked = false";
     
      if(!StringUtil.isEmptyStr(username))
      {
        hql += " and (u.username like '%"+username+"%' or u.nickname like '%"+username+"%' or u.truename like '%"+username+"%'  or u.card.id like '%"+username+"%')";
      }
     
      if(rtUser != null && (rtUser.isMerchant()||rtUser.isOrganization()) )
      {
        hql += " and u.organizationid = " + rtUser.getOrganizationid()  + " and u.parent.id = " +rtUser.getId() ;
      }
     
      if(!StringUtil.isEmptyStr(merchantname))
      {
        hql += " and (exists (from Merchant m where m.ID= u.organizationid and m.SJMC like '%"+merchantname+"%' ) or";
View Full Code Here

    } catch (Exception e2) {
      areaCategoryId = 0;
    }
    root.put("areaCategoryId", areaCategoryId);
   
    RunTimeUser user = null;
    try {
      user = RunTimeUser.getRunTimeUser(request);
    } catch (Exception e1) {
      user = null;
    }
   
    ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
    IOrderService ordersService = (IOrderService) ac.getBean("orderService");
   
   
    if(user!=null) {
      root.put("user", user);
      Orders order = ordersService.findCartByUserId(user.getId());
      if(order!=null) {
        root.put("order", order);
      }
      root.put("delete_cart_product_url", Constants.DELETE_CART_PRODUCT_URL);
      root.put("show_cart_url", Constants.SHOW_CART_URL);
View Full Code Here

  /**
   * @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

    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.RunTimeUser

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.