@Action( value = "updateUserbyuserstate", results = {@Result(name = "json", type = "json")}) public String updateUserbyuserstate() { if (Validate.StrNotNull(this.getUserid())) { UserT user = new UserT(); user = this.getUsertService().findById(this.getUserid()); if (user != null) { if (user.getUserstate().equals("0")) { this.setSucflag(false); return "json"; } else { user.setUserstate(this.getUserstate()); this.getUsertService().updateUserstate(user); this.setSucflag(true); return "json"; } } this.setSucflag(false); return "json"; } this.setSucflag(false); return "json"; }
/** * 发送激活邮件 * * @param user * @throws MessagingException * @throws IOException * @throws TemplateException * @throws javax.mail.MessagingException */ @Action( value = "sendeMail", results = {@Result(name = "json", type = "json")}) public String sendeMail() throws MessagingException, IOException, TemplateException, javax.mail.MessagingException { this.findUserById(); if (beanlist.getUserstate().equals("1")) { this.setSlogin(false); return "json"; } else { sendSystemEmail.sendTextMail(beanlist); this.setSlogin(true); return "json"; } }
/** * 查询所有用户 * * @return */ @SuppressWarnings("unchecked") @Action( value = "findAllUsert", results = {@Result(name = "json", type = "json")}) public String findAllUsert() { int currentPage = page; int lineSize = rp; String queryString = "from UserT order by " + sortname + " " + sortorder + " "; if (Validate.StrNotNull(sortname) && Validate.StrNotNull(sortorder)) { List<UserT> list = this.getUsertService().sortAllUsert(currentPage, lineSize, queryString); if (list != null) { total = this.getUsertService().countfindAllUsert(); rows.clear(); for (Iterator it = list.iterator(); it.hasNext(); ) { UserT u = (UserT) it.next(); if ("0".equals(u.getSex())) { u.setSex("女"); } if ("1".equals(u.getSex())) { u.setSex("男"); } if ("1".equals(u.getState())) { u.setState("普通用户"); } if ("2".equals(u.getState())) { u.setState("管理员"); } if ("3".equals(u.getState())) { u.setState("超级管理员"); } if ("4".equals(u.getState())) { u.setState("手机用户"); } if ("0".equals(u.getUserstate())) { u.setUserstate("未激活"); } if ("1".equals(u.getUserstate())) { u.setUserstate("激活"); } if ("2".equals(u.getUserstate())) { u.setUserstate("禁止访问"); } if ("3".equals(u.getUserstate())) { u.setUserstate("禁止发帖"); } if (u.getGradetime() != null) { this.setGradetime(BaseTools.formateDbDate(u.getGradetime())); } else { this.setGradetime(""); } Map cellMap = new HashMap(); cellMap.put("id", u.getUserid()); cellMap.put( "cell", new Object[] { u.getUsername(), u.getRealname(), u.getEmail(), u.getSex(), u.getPoints(), u.getQq(), u.getMsn(), u.getGradename(), u.getUserstate(), u.getGradetime(), BaseTools.formateDbDate(u.getRegisttime()) }); rows.add(cellMap); } return "json"; } } this.setTotal(0); rows.clear(); return "json"; }