Пример #1
0
  private boolean hasNoneActiveDept(List<JboIFace> deptList) throws JxException {
    int size = deptList.size();
    for (int i = 0; i < size; i++) {
      JboIFace dept = deptList.get(i);
      if ("1".equals(dept.getString("STATE"))) {
        throw new JxException(JxLangResourcesUtil.getString("app.pubdepartment.HAS_ACTIVE_DEPT"));
      }
    }

    return true;
  }
Пример #2
0
  private boolean hasNoneActiveUser(List<JboIFace> userList) throws JxException {
    int size = userList.size();
    for (int i = 0; i < size; i++) {
      JboIFace user = userList.get(i);
      if ("1".equals(user.getString("ACTIVE"))) {
        throw new JxException(JxLangResourcesUtil.getString("app.pubdepartment.HAS_ACTIVE_USER"));
      }
    }

    return true;
  }
Пример #3
0
  @Override
  public List<JboIFace> query() throws JxException {
    App app = JxSession.getMainApp();
    if (app.getAppNameType().equalsIgnoreCase("PUBDEPARTMENT.LIST")) {
      DataQueryInfo queryInfo = getQueryInfo();

      App userApp = JxSession.getApp("pubdepartment.user");
      if (null != userApp) {
        JboIFace userJbo = userApp.getJbo();
        if (null != userJbo) {
          JboSetIFace userRoleJboSet = userJbo.getRelationJboSet("PUB_ROLE_USERUSER_IDP");
          if (null != userRoleJboSet) {
            List<JboIFace> userRoleList = userRoleJboSet.getJbolist();
            if (!userRoleList.isEmpty()) {
              StringBuffer sb = new StringBuffer();

              sb.append("ROLE_ID NOT IN (");
              int size = userRoleList.size();
              for (int i = 0; i < size; i++) {
                JboIFace tempJbo = userRoleList.get(i);
                sb.append("'").append(tempJbo.getString("ROLE_ID")).append("'");
                if (i < size - 1) {
                  sb.append(",");
                }
              }
              sb.append(")");

              queryInfo.setWhereCause(sb.toString());
            }
          }
        }
      }
    }

    getQueryInfo().setPageNum(0);
    getQueryInfo().setPageSize(40);
    return super.query();
  }