예제 #1
0
  /**
   * <br>
   * [機 能] 施設グループ区分一覧取得 <br>
   * [解 説] <br>
   * [備 考]
   *
   * @param con コネクション
   * @throws SQLException SQL実行時例外
   * @return 施設区分マップ
   */
  private Map<Integer, RsvSisKbnModel> __getReserveKbnMap(Connection con) throws SQLException {
    RsvSisKbnDao dao = new RsvSisKbnDao(con);
    ArrayList<RsvSisKbnModel> ret = null;
    ret = dao.selectAllGrpKbn();
    HashMap<Integer, RsvSisKbnModel> map = new HashMap<Integer, RsvSisKbnModel>();

    for (RsvSisKbnModel rsvSisKbnModel__ : ret) {
      map.put(rsvSisKbnModel__.getRskSid(), rsvSisKbnModel__);
    }
    return map;
  }
예제 #2
0
  @Override
  public Document createXml(
      ActionForm aForm,
      HttpServletRequest req,
      HttpServletResponse res,
      Connection con,
      BaseUserModel umodel)
      throws Exception {
    log__.debug("createXml start");
    // 施設予約プラグインアクセス権限確認
    if (!canAccsessSelectPlugin(GSConst.PLUGIN_ID_RESERVE)) {
      addErrors(req, addCantAccsessPluginError(req, null, GSConst.PLUGIN_ID_RESERVE));
      return null;
    }
    RequestModel reqMdl = getRequestModel(req);
    int sessionUsrSid = umodel.getUsrsid(); // セッションユーザSID

    CommonBiz cmnBiz = new CommonBiz();

    // 施設予約の管理者
    boolean rsvAdmin = cmnBiz.isPluginAdmin(con, umodel, GSConstSchedule.PLUGIN_ID_RESERVE);

    RsvCommonBiz rsvCmnBiz = new RsvCommonBiz();
    RsvUserModel rsvUserConf = rsvCmnBiz.getRevUserModel(sessionUsrSid, con);

    int dfReservGpSid = GSConstReserve.COMBO_DEFAULT_VALUE;
    if (rsvUserConf != null) {
      dfReservGpSid = rsvUserConf.getRsgSid();
    }

    List<RsvSisGrpModel> list = __getReserveGroupList(con, sessionUsrSid, rsvAdmin, reqMdl);
    Map<Integer, RsvSisKbnModel> kbnMap = __getReserveKbnMap(con);

    // ルートエレメントResultSet
    Element resultSet = new Element("ResultSet");
    Document doc = new Document(resultSet);

    if (list != null) {
      int index = 0;
      for (RsvSisGrpModel model : list) {
        Element result = new Element("Result");
        resultSet.addContent(result);

        // Rsgsid グループSID
        result.addContent(_createElement("RsgSid", model.getRsgSid()));

        // GrpName グループ名
        result.addContent(_createElement("RsgName", model.getRsgName()));

        // グループID
        result.addContent(_createElement("RsgId", NullDefault.getString(model.getRsgId(), "")));
        // 施設区分SID
        result.addContent(_createElement("RskSid", String.valueOf(model.getRskSid())));
        // 施設区分名
        if (kbnMap.containsKey(model.getRskSid())) {
          RsvSisKbnModel kbn = kbnMap.get(model.getRskSid());
          result.addContent(_createElement("RskName", kbn.getRskName()));
        } else {
          result.addContent(_createElement("RskName", ""));
        }
        if (dfReservGpSid == Integer.valueOf(model.getRsgSid())) {
          resultSet.setAttribute("DefaultIndex", String.valueOf(index));
        }
        index++;
      }
      resultSet.setAttribute("Count", String.valueOf(list.size()));
    }
    log__.debug("createXml end");

    return doc;
  }