Package org.jeecgframework.web.system.pojo.base

Examples of org.jeecgframework.web.system.pojo.base.TSUser


    int users = userService.getList(TSUser.class).size();
    if (users == 0) {
      j.setMsg("a");
      j.setSuccess(false);
    } else {
      TSUser u = userService.checkUserExits(user);
      if (u != null) {
        // if (user.getUserKey().equals(u.getUserKey())) {
        if (true) {
          message = "用户: " + user.getUserName() + "["
              + u.getTSDepart().getDepartname() + "]" + "登录成功";
          Client client = new Client();
          client.setIp(IpUtil.getIpAddr(req));
          client.setLogindatetime(new Date());
          client.setUser(u);
          ClientManager.getInstance().addClinet(session.getId(),
View Full Code Here


   */
  @RequestMapping(params = "login")
  public String login(HttpServletRequest request) {
    DataSourceContextHolder
        .setDataSourceType(DataSourceType.dataSource_jeecg);
    TSUser user = ResourceUtil.getSessionUserName();
    String roles = "";
    if (user != null) {
      List<TSRoleUser> rUsers = systemService.findByProperty(
          TSRoleUser.class, "TSUser.id", user.getId());
      for (TSRoleUser ru : rUsers) {
        TSRole role = ru.getTSRole();
        roles += role.getRoleName() + ",";
      }
      if (roles.length() > 0) {
        roles = roles.substring(0, roles.length() - 1);
      }
      request.setAttribute("roleName", roles);
      request.setAttribute("userName", user.getUserName());
      request.getSession().setAttribute("CKFinder_UserRole", "admin");
      //获取一级菜单列表
      request.setAttribute("primaryMenuList", getPrimaryMenu(rUsers));
      // 默认风格
      String indexStyle = "shortcut";
View Full Code Here

   * @return
   */
  @RequestMapping(params = "logout")
  public ModelAndView logout(HttpServletRequest request) {
    HttpSession session = ContextHolderUtils.getSession();
    TSUser user = ResourceUtil.getSessionUserName();
    shortcutFunctionMap = null;
   
    systemService.addLog("用户" + user.getUserName() + "已退出",
        Globals.Log_Type_EXIT, Globals.Log_Leavel_INFO);
    ClientManager.getInstance().removeClinet(session.getId());
    ModelAndView modelAndView = new ModelAndView(new RedirectView(
        "loginController.do?login"));

View Full Code Here

   *
   * @return
   */
  @RequestMapping(params = "left")
  public ModelAndView left(HttpServletRequest request) {
    TSUser user = ResourceUtil.getSessionUserName();
    HttpSession session = ContextHolderUtils.getSession();
    // 登陆者的权限
    if (user.getId() == null) {
      session.removeAttribute(Globals.USER_SESSION);
      return new ModelAndView(
          new RedirectView("loginController.do?login"));
    }

View Full Code Here

   * @return ModelAndView
   * @throws
   */
  @RequestMapping(params = "top")
  public ModelAndView top(HttpServletRequest request) {
    TSUser user = ResourceUtil.getSessionUserName();
    HttpSession session = ContextHolderUtils.getSession();
    // 登陆者的权限
    if (user.getId() == null) {
      session.removeAttribute(Globals.USER_SESSION);
      return new ModelAndView(
          new RedirectView("loginController.do?login"));
    }
    request.setAttribute("menuMap", getFunctionMap(user));
View Full Code Here

   * @return ModelAndView
   * @throws
   */
  @RequestMapping(params = "shortcut_top")
  public ModelAndView shortcut_top(HttpServletRequest request) {
    TSUser user = ResourceUtil.getSessionUserName();
    HttpSession session = ContextHolderUtils.getSession();
    // 登陆者的权限
    if (user.getId() == null) {
      session.removeAttribute(Globals.USER_SESSION);
      return new ModelAndView(
          new RedirectView("loginController.do?login"));
    }
    request.setAttribute("menuMap", getFunctionMap(user));
View Full Code Here

            rs=st.executeQuery(sql5);
            List susers = new ArrayList();
            i=1;
            while(rs.next())
            {
                 TSUser suer = new TSUser();
                 suer.setId(i+"");
//                 org.jeecgframework.core.util.LogUtil.info(rs.getString("signaturefile"));
//                 suer.setSignatureFile(rs.getString("signaturefile"));
                 suer.setMobilePhone(rs.getString("mobilephone"));
                 suer.setOfficePhone(rs.getString("officephone"));
                 suer.setEmail(rs.getString("email"));
                 susers.add(suer);
                 i++;
            }
            root.put("suser", susers);
           
View Full Code Here



public boolean onSave(Object entity, Serializable id, Object[] state,
    String[] propertyNames, Type[] types) {
  TSUser currentUser = null;
  try {
    currentUser = ResourceUtil.getSessionUserName();
  } catch (RuntimeException e) {
    logger.warn("当前session为空,无法获取用户");
  }
  if(currentUser==null){
    return true;
  }
  try {
    //添加数据
     for (int index=0;index<propertyNames.length;index++)
     {
         /*找到名为"创建时间"的属性*/
         if ("createDate".equals(propertyNames[index]))
         {
             /*使用拦截器将对象的"创建时间"属性赋上值*/
           if(oConvertUtils.isEmpty(state[index])){
             state[index] = new Date();
           }
             continue;
         }
         /*找到名为"创建人"的属性*/
         else if ("createBy".equals(propertyNames[index]))
         {
             /*使用拦截器将对象的"创建人"属性赋上值*/
           if(oConvertUtils.isEmpty(state[index])){
              state[index] = currentUser.getUserName();
           }
             continue;
         }
         /*找到名为"创建人名称"的属性*/
         else if ("createName".equals(propertyNames[index]))
         {
             /*使用拦截器将对象的"创建人名称"属性赋上值*/
           if(oConvertUtils.isEmpty(state[index])){
             state[index] = currentUser.getRealName();
           }
             continue;
         }
     }
  } catch (RuntimeException e) {
View Full Code Here


public boolean onFlushDirty(Object entity, Serializable id,
    Object[] currentState, Object[] previousState,
    String[] propertyNames, Type[] types) {
  TSUser currentUser = null;
  try {
    currentUser = ResourceUtil.getSessionUserName();
  } catch (RuntimeException e1) {
    logger.warn("当前session为空,无法获取用户");
  }
  if(currentUser==null){
    return true;
  }
  //添加数据
     for (int index=0;index<propertyNames.length;index++)
     {
         /*找到名为"修改时间"的属性*/
         if ("updateDate".equals(propertyNames[index]))
         {
             /*使用拦截器将对象的"修改时间"属性赋上值*/
           currentState[index] = new Date();
             continue;
         }
         /*找到名为"修改人"的属性*/
         else if ("updateBy".equals(propertyNames[index]))
         {
             /*使用拦截器将对象的"修改人"属性赋上值*/
           currentState[index] = currentUser.getUserName();
           continue;
         }
         /*找到名为"修改人名称"的属性*/
         else if ("updateName".equals(propertyNames[index]))
         {
             /*使用拦截器将对象的"修改人名称"属性赋上值*/
           currentState[index] = currentUser.getRealName();
           continue;
         }
     }
   return true;
}
View Full Code Here

  /**
   * @Description 修复日志表
   * @author tanghan 2013-7-28
   */
  private void repairLog() {
    TSUser admin = commonDao.findByProperty(TSUser.class, "signatureFile",
        "images/renfang/qm/licf.gif").get(0);
    try {
      TSLog log1 = new TSLog();
      log1.setLogcontent("用户: admin登录成功");
      log1.setBroswer("Chrome");
View Full Code Here

TOP

Related Classes of org.jeecgframework.web.system.pojo.base.TSUser

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.