示例#1
0
  @SuppressWarnings({"rawtypes", "unchecked"})
  public DSResponse fetchCustSearchResult(DSRequest req) throws Exception {
    Map criteria = req.getCriteria();
    criteria.put("only_building_ids", 1);
    criteria.put("for_building", 1);
    Object uuid = criteria.get("uuid");
    Map<?, ?> result = DMIUtils.findRecordByCriteria("CustomerDS", null, criteria);
    Object building_ids = result.get("cusname");
    if (building_ids == null) {
      building_ids = ""; // return new DSResponse(new ArrayList<Map<String,
      // Object>>());
    }
    Object srid = criteria.get("srid");
    Connection connMaps = null;
    try {
      connMaps = DBConnection.getConnection("MAP");
      String feature_text =
          saveSearchResult(
              uuid.toString(), building_ids.toString(), new Integer(srid.toString()), connMaps);
      Map<String, Object> rs = new TreeMap<String, Object>();
      rs.put("feature_text", feature_text);
      ArrayList<Map<String, Object>> res = new ArrayList<Map<String, Object>>();
      res.add(rs);
      connMaps.commit();
      return new DSResponse(res);
    } catch (Exception e) {

      try {
        connMaps.rollback();
      } catch (Exception e2) {
        // TODO: handle exception
      }
      throw new Exception(e.toString());
    } finally {

      try {
        DBConnection.freeConnection(connMaps);
      } catch (Exception e2) {
        // TODO: handle exception
      }
    }
  }