Ejemplo n.º 1
0
 public void reply() {
   String toUser = $V("ToUser");
   if (!StringUtil.checkID(toUser)) {
     this.Response.setLogInfo(0, "传入参数错误!");
     return;
   }
   if (MessageCache.addMessage($V("Subject"), $V("Content"), toUser))
     this.Response.setLogInfo(1, "添加回复成功!");
   else this.Response.setLogInfo(0, "添加回复失败!");
 }
Ejemplo n.º 2
0
  public void add() {
    String toUser = $V("ToUser");
    if (!StringUtil.checkID(toUser)) {
      this.Response.setLogInfo(0, "传入参数错误!");
      return;
    }
    String[] userList = toUser.split(",");

    String toRole = $V("ToRole");
    if (!StringUtil.checkID(toRole)) {
      this.Response.setLogInfo(0, "传入参数错误!");
      return;
    }
    String[] roleList = toRole.split(",");

    if (roleList.length > 0) {
      String roleStr = "";
      for (int j = 0; j < roleList.length; ++j) {
        if (StringUtil.isNotEmpty(roleList[j])) {
          if (j == 0) roleStr = roleStr + "'" + roleList[j] + "'";
          else {
            roleStr = roleStr + ",'" + roleList[j] + "'";
          }
        }
      }
      if (StringUtil.isNotEmpty(roleStr)) {
        DataTable dt =
            new QueryBuilder("select UserName from zduserRole where rolecode in (" + roleStr + ")")
                .executeDataTable();
        for (int k = 0; k < dt.getRowCount(); ++k) {
          String userName = dt.getString(k, "UserName");
          if ((!User.getUserName().equals(userName))
              && (!ArrayUtils.contains(userList, userName))) {
            userList = (String[]) ArrayUtils.add(userList, userName);
          }
        }
      }
    }

    if (MessageCache.addMessage($V("Subject"), $V("Content"), userList, User.getUserName()))
      this.Response.setLogInfo(1, "新建成功!");
    else this.Response.setLogInfo(0, "新建失败!");
  }