Package com.eatle.persistent.pojo.system.useradmin

Examples of com.eatle.persistent.pojo.system.useradmin.User


  public String login()
  {
    String verifycode_s = (String) session.get("verifyCode_s");
    if(verifycode_c.equals(verifycode_s))
    {
      User user = userService.find(this.user);
      if(user == null)
      {
        resultMap.put("res", "0");
      }
      else
      {
        if(user.getPwd().equals(this.user.getPwd()))
        {
          // 移除验证码
          session.remove("verifyCode_s");
          // 设置权限,存入登录信息
          user.setAllPrivs(rolePrivilegeService
              .findPrivsByRoleId(user.getRoleId()));
          session.put("user", user);
          // 登陆日志
          writeLoginLog(user);
          // 验证结果
          resultMap.put("res", "1");
View Full Code Here


  private static IDistrictService districtService = (IDistrictService) ctx.getBean("districtService");

  @Test
  public void test()
  {
    User user = new User();
    user.setUserName("谭又中");
    user.setPwd("123");

    userService.add(user);
  }
View Full Code Here

        // 如果未传入商家ID则停止查询,否则会查询到所有的餐厅(安全漏洞)
        return new Pagination(pageSize, currentPage, 0, new ArrayList<UserMerchant>());
      }
      if (queryMap.containsKey("userName"))
      {
        User user = new User();
        user.setUserName((String) queryMap.get("userName"));
        user = userService.find(user);
        if(user != null)
        {
          criteria.andUserIdEqualTo(user.getId());
        }
      }
    }
    // 设置分页参数
    userMerchantCriteria.setPageSize(pageSize);
View Full Code Here

  private List<Restaurant> restaurants;
 
  public String index()
  {
    // 当前登陆用户
    User user = (User) session.get("user");
 
    // 当前登录用户所属角色拥有的权限集合
    Map<String, Priv> allPrivs = user.getAllPrivs();
    String contextPath = request.getContextPath();
    // 存入菜单HTML
    //String allMenuHtml = menuService.findAllMenu(allPrivs,contextPath);
    //request.setAt  tribute("allMenuHtml", allMenuHtml);
   
    //FIX 改为通过Priv里的is_show字段来显示
    String allMenuHtml = privService.findAllPrivMenu(contextPath, allPrivs);
    request.setAttribute("allMenuHtml", allMenuHtml);
   
    // 判定登陆用户是管理员还是商家
    if(user.getType() != Constants.UserType.USERTYPE_ADMINISTRATOR)
    {
      // 可管理的餐厅
      restaurants = userMerchantService
          .findRestaurantsByUserIdAndMerchantId(user.getId(),
              user.getMerchantId());
      // 切换管理餐厅
      if(session.get("currMgrRestaurantId") != null)
      {
        if(restaurant != null && restaurant.getId() != null// 选择切换
        {
View Full Code Here

  /**
   * @Description: 获取旧密码
   */
  public void queryOldPwd() throws IOException
  {
    User user = (User) session.get("user");
    Map<String, Object> json = DwzAjaxJsonUtil.getDefaultAjaxJson();
    if(user != null)
    {
      json.put("oldPwd", user.getPwd());
    }
    super.writeMap(json);
  }
View Full Code Here

      json.put(DwzAjaxJsonUtil.KEY_MESSAGE, "操作失败!");
    }
    else
    {
      // 重新构造一个User,防止用户构造注入其他属性值更新
      User newUser = new User();
      newUser.setId(user.getId());
      newUser.setPwd(user.getPwd());
      if(userService.update(newUser) == Constants.Base.FAIL)
      {
        json.put(DwzAjaxJsonUtil.KEY_STATUSCODE, 300);
        json.put(DwzAjaxJsonUtil.KEY_MESSAGE, "操作失败!");
      }
      else
      {
        // 更新Session
        user = (User) session.get("user");
        user.setPwd(newUser.getPwd());
        session.put("user", user);
      }
    }
    super.writeMap(json);
  }
View Full Code Here

    // 设置搜索条件参数
    if (queryMap != null)
    {
      if (queryMap.containsKey("userName"))
      {
        User user = new User();
        user.setUserName((String) queryMap.get("userName"));
        user = userMapper.find(user);
        if(user != null)
        {
          criteria.andIdentifyIdEqualTo(user.getId());
        }
      }
      if (queryMap.containsKey("startTime"))
      {
        if(queryMap.containsKey("endTime"))
View Full Code Here

TOP

Related Classes of com.eatle.persistent.pojo.system.useradmin.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.