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

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


   * @return
   */
  @RequestMapping(params = "menu")
  public void menu(HttpServletRequest request, HttpServletResponse response) {
    SetListSort sort = new SetListSort();
    TSUser u = ResourceUtil.getSessionUserName();
    // 登陆者的权限
    Set<TSFunction> loginActionlist = new HashSet();// 已有权限菜单
    List<TSRoleUser> rUsers = systemService.findByProperty(TSRoleUser.class, "TSUser.id", u.getId());
    for (TSRoleUser ru : rUsers) {
      TSRole role = ru.getTSRole();
      List<TSRoleFunction> roleFunctionList = systemService.findByProperty(TSRoleFunction.class, "TSRole.id", role.getId());
      if (roleFunctionList.size() > 0) {
        for (TSRoleFunction roleFunction : roleFunctionList) {
View Full Code Here


   *
   * @return
   */
  @RequestMapping(params = "userinfo")
  public String userinfo(HttpServletRequest request) {
    TSUser user = ResourceUtil.getSessionUserName();
    request.setAttribute("user", user);
    return "system/user/userinfo";
  }
View Full Code Here

   *
   * @return
   */
  @RequestMapping(params = "changepassword")
  public String changepassword(HttpServletRequest request) {
    TSUser user = ResourceUtil.getSessionUserName();
    request.setAttribute("user", user);
    return "system/user/changepassword";
  }
View Full Code Here

   */
  @RequestMapping(params = "savenewpwd")
  @ResponseBody
  public AjaxJson savenewpwd(HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    TSUser user = ResourceUtil.getSessionUserName();
    String password = oConvertUtils.getString(request.getParameter("password"));
    String newpassword = oConvertUtils.getString(request.getParameter("newpassword"));
    String pString = PasswordUtil.encrypt(user.getUserName(), password, PasswordUtil.getStaticSalt());
    if (!pString.equals(user.getPassword())) {
      j.setMsg("原密码不正确");
      j.setSuccess(false);
    } else {
      try {
        user.setPassword(PasswordUtil.encrypt(user.getUserName(), newpassword, PasswordUtil.getStaticSalt()));
      } catch (Exception e) {
        e.printStackTrace();
      }
      systemService.updateEntitie(user);
      j.setMsg("修改成功");
View Full Code Here

  public List<ComboBox> depart(HttpServletResponse response, HttpServletRequest request, ComboBox comboBox) {
    String id = request.getParameter("id");
    List<ComboBox> comboBoxs = new ArrayList<ComboBox>();
    List<TSDepart> departs = new ArrayList();
    if (StringUtil.isNotEmpty(id)) {
      TSUser user = systemService.get(TSUser.class, id);
      if (user.getTSDepart() != null) {
        TSDepart depart = systemService.get(TSDepart.class, user.getTSDepart().getId());
        departs.add(depart);
      }
    }
    List<TSDepart> departList = systemService.getList(TSDepart.class);
    comboBoxs = TagUtil.getComboBox(departList, departs, comboBox);
View Full Code Here

    AjaxJson j = new AjaxJson();
    // 得到用户的角色
    String roleid = oConvertUtils.getString(req.getParameter("roleid"));
    String password = oConvertUtils.getString(req.getParameter("password"));
    if (StringUtil.isNotEmpty(user.getId())) {
      TSUser users = systemService.getEntity(TSUser.class, user.getId());
      users.setEmail(user.getEmail());
      users.setOfficePhone(user.getOfficePhone());
      users.setMobilePhone(user.getMobilePhone());
      users.setTSDepart(user.getTSDepart());
      users.setRealName(user.getRealName());
      users.setStatus(Globals.User_Normal);
      users.setActivitiSync(user.getActivitiSync());
      systemService.updateEntitie(users);
      List<TSRoleUser> ru = systemService.findByProperty(TSRoleUser.class, "TSUser.id", user.getId());
      systemService.deleteAllEntitie(ru);
      message = "用户: " + users.getUserName() + "更新成功";
      if (StringUtil.isNotEmpty(roleid)) {
        saveRoleUser(users, roleid);
      }
      systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
    } else {
      TSUser users = systemService.findUniqueByProperty(TSUser.class, "userName",user.getUserName());
      if (users != null) {
        message = "用户: " + users.getUserName() + "已经存在";
      } else {
        user.setPassword(PasswordUtil.encrypt(user.getUserName(), password, PasswordUtil.getStaticSalt()));
        if (user.getTSDepart().equals("")) {
          user.setTSDepart(null);
        }
View Full Code Here

  @RequestMapping(params = "savesign", method = RequestMethod.POST)
  @ResponseBody
  public AjaxJson savesign(HttpServletRequest req) {
    UploadFile uploadFile = new UploadFile(req);
    String id = uploadFile.get("id");
    TSUser user = systemService.getEntity(TSUser.class, id);
    uploadFile.setRealPath("signatureFile");
    uploadFile.setCusPath("signature");
    uploadFile.setByteField("signature");
    uploadFile.setBasePath("resources");
    uploadFile.setRename(false);
    uploadFile.setObject(user);
    AjaxJson j = new AjaxJson();
    message = user.getUserName() + "设置签名成功";
    systemService.uploadFile(uploadFile);
    systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
    j.setMsg(message);

    return j;
View Full Code Here

    this.systemService.getDataGridReturn(cq, true);
    TagUtil.datagrid(response, dataGrid);
  }
  @RequestMapping(params = "changestyle")
  public String changeStyle(HttpServletRequest request) {
    TSUser user = ResourceUtil.getSessionUserName();
    if(user==null){
      return "login/login";
    }
    String indexStyle = "default";
    Cookie[] cookies = request.getCookies();
View Full Code Here

  @RequestMapping(params = "savestyle")
  @ResponseBody
  public AjaxJson saveStyle(HttpServletRequest request,HttpServletResponse response) {
    AjaxJson j = new AjaxJson();
    j.setSuccess(Boolean.FALSE);
    TSUser user = ResourceUtil.getSessionUserName();
    if(user!=null){
      String indexStyle = request.getParameter("indexStyle");
      if(StringUtils.isNotEmpty(indexStyle)){
        Cookie cookie = new Cookie("JEECGINDEXSTYLE", indexStyle);
        //设置cookie有效期为一个月
View Full Code Here

   * @return
   */
  @RequestMapping(params = "pwdInit")
  public ModelAndView pwdInit(HttpServletRequest request) {
    ModelAndView modelAndView = null;
    TSUser user = new TSUser();
    user.setUserName("admin");
    String newPwd = "123456";
    userService.pwdInit(user, newPwd);
    modelAndView = new ModelAndView(new RedirectView(
        "loginController.do?login"));
    return modelAndView;
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.