/**
   * This Method returns the 2D Array which is the list of the Items for the selected WorkOrder of
   * the Customer.
   *
   * @param workorderId - WorkOrder Id Foreign Key of WRK_ORDR_DETS table
   * @return Object[][] - 2D Array which is List of the Items for the WorkOrder
   */
  public Object[][] getWorkOrderItems(long workorderId) throws RemoteException {

    WrkOrdrDets wrkordrdts_obj = new WrkOrdrDets(conn);

    RHCCBlgKeys blgkeys_obj = new RHCCBlgKeys(conn);

    Vector workorderdetList = wrkordrdts_obj.getProductList(workorderId);

    // Hashtable BSysList = (Hashtable) USFEnv.getBillSystems();
    BlgSys blgsys = new BlgSys();

    Hashtable BSysList = (Hashtable) blgsys.searchBlgSys();

    Enumeration BSys = BSysList.keys();

    // The 2-Dimensional array to hold the Items Billing System wise.
    Object[][] prodList = new Object[BSysList.size()][workorderdetList.size() + 1];

    // The Number of Billing Systems are assumed to be equal to the
    // Static Load Billing Systems Hashtable size. The Billing Systems will
    // be in order starting from 1 and incrementing by one.
    for (int i = 0; i < BSysList.size(); i++) {
      // Set the 2D array to store the Billing System as the first element
      // of each row.
      prodList[i][0] = String.valueOf(i + 1);
    }

    // Loop throught the WorkOrder Items List and place them in the appropriate
    // positions in the 2D array.
    for (int j = 0; j < workorderdetList.size(); j++) {
      // Determine the Billing System of the Product
      Vector tmpVector = new Vector();

      WrkOrdrDets workorderObj = (WrkOrdrDets) workorderdetList.elementAt(j);

      RHCCBlgKeys bkObj =
          blgkeys_obj.searchRHCCBlgKeys(((WrkOrdrDets) workorderdetList.elementAt(j)).getRBKID());
      int bsid = (new Long(bkObj.getBsId())).intValue();

      tmpVector.addElement(bkObj);
      tmpVector.addElement(workorderObj);

      // Based on the Billing System Id retreived place the Product Object
      // in the 2D array.
      int k = 1;
      while (prodList[bsid - 1][k] != null) {
        k = k + 1;
      }
      prodList[bsid - 1][k] = tmpVector;
    }

    // Return the 2D array
    return prodList;
  }
示例#2
0
  /** Constructs a Level with no label */
  public Level() {
    draw = new LevelDraw();
    label = new JLabel("interface", JLabel.CENTER);

    TableLayout table = new TableLayout();
    this.setLayout(table);
    this.add("0 0 ", draw);
    this.add("0 1 hH", label);

    Vector v = new Vector(2);
    v.addElement(draw);
    v.addElement(label);
    table.sameWidth(v);
  }
示例#3
0
 /*
  * The Huffman class constructor
  */
 public Huffman(int Width, int Height) {
   bits = new Vector();
   bits.addElement(bitsDCluminance);
   bits.addElement(bitsACluminance);
   bits.addElement(bitsDCchrominance);
   bits.addElement(bitsACchrominance);
   val = new Vector();
   val.addElement(valDCluminance);
   val.addElement(valACluminance);
   val.addElement(valDCchrominance);
   val.addElement(valACchrominance);
   initHuf();
   code = code;
   ImageWidth = Width;
   ImageHeight = Height;
 }
示例#4
0
  /**
   * This method queries the database to get the list of the Billing Systems.
   *
   * @exception SQLException, if query fails
   * @author
   */
  public Vector getYears(String year) {
    String query;
    Vector years = new Vector();
    PreparedStatement pstmt = null;
    ResultSet rs = null;

    query = "select yr||'-'||(yr+1),yr from fung_yr where yr > ?";

    try {
      pstmt = conn.prepareStatement(query);
      pstmt.setString(1, year);

      rs = pstmt.executeQuery();
      while (rs.next()) {
        years.addElement(rs.getString(1));
        years.addElement(rs.getString(2));
      }
      if (rs != null) rs.close();
      if (pstmt != null) pstmt.close();
    } catch (SQLException ex) {
      USFEnv.getLog().writeCrit("Dinvjrnl: Years List not Retreived ", this, ex);
      try {
        if (rs != null) rs.close();
        if (pstmt != null) pstmt.close();
      } catch (SQLException e) {
        USFEnv.getLog().writeCrit("Unable to close the resultset/prepared statement", this, e);
      }
    }

    return years;
  }
示例#5
0
  // Get a list of images that have been added, but not yet added into
  // the database.
  protected void doFlush() {
    SpyDB pdb = getDB();
    Vector v = null;
    try {
      Connection db = pdb.getConn();
      Statement st = db.createStatement();
      String query = "select * from upload_log where stored is null";
      ResultSet rs = st.executeQuery(query);
      v = new Vector();
      while (rs.next()) {
        v.addElement(rs.getString("photo_id"));
      }
    } catch (Exception e) {
      // Do nothing, we'll try again later.
    } finally {
      pdb.freeDBConn();
    }

    // Got the vector, now store the actual images.  This is done so
    // that we don't hold the database connection open whlie we're
    // making the list *and* getting another database connection to act
    // on it.
    if (v != null) {
      try {
        for (int i = 0; i < v.size(); i++) {
          String stmp = (String) v.elementAt(i);
          storeImage(Integer.valueOf(stmp).intValue());
        }
      } catch (Exception e) {
        // Don't care, we'll try again soon.
      }
    }
  }
示例#6
0
  /**
   * This method queries the database to get the details related to the bp_id passed.
   *
   * @exception SQLException, if query fails
   * @author
   */
  public Vector getBpdet(String bpid) {
    String query;
    Vector bpdet = new Vector();
    PreparedStatement pstmt = null;
    ResultSet rs = null;

    query = "select rtrim(bs_id_fk||bp_rgn),bp_month from blg_prd where bp_id = ?";

    try {
      pstmt = conn.prepareStatement(query);
      pstmt.setString(1, bpid);

      rs = pstmt.executeQuery();
      while (rs.next()) {
        bpdet.addElement(rs.getString(1));
        bpdet.addElement(rs.getString(2));
      }
      if (rs != null) rs.close();
      if (pstmt != null) pstmt.close();
    } catch (SQLException ex) {
      USFEnv.getLog().writeCrit("Dinvjrnl: BP_ID details not Retreived ", this, ex);
      try {
        if (rs != null) rs.close();
        if (pstmt != null) pstmt.close();
      } catch (SQLException e) {
        USFEnv.getLog().writeCrit("Unable to close the resultset/prepared statement", this, e);
      }
    }

    return bpdet;
  }
示例#7
0
  /**
   * Attach a DataSet to the graph. By attaching the data set the class can draw the data through
   * its paint method.
   */
  public void attachDataSet(DataSet d) {

    if (d != null) {
      dataset.addElement(d);
      d.g2d = this;
    }
  }
示例#8
0
  protected Vector /* of TTPNode */ queryPNodes1(String query) throws IOException {
    write(query);
    Vector lines = readlines();
    Vector r = new Vector();
    for (Enumeration e = lines.elements(); e.hasMoreElements(); ) {
      Vector line = stringToVector((String) e.nextElement(), ":");

      TTLexEntry le = new TTLexEntry();
      le.citationForm = (String) line.elementAt(0);
      le.features = (String) line.elementAt(1);
      le.inflection = (String) line.elementAt(2);
      le.inflFeatures = (String) line.elementAt(3);

      TTLexEntryToObj leo = new TTLexEntryToObj();
      leo.lexentry = le;
      leo.objname = (String) line.elementAt(4);
      leo.features = (String) line.elementAt(5);

      TTPNode pn = new TTPNode();
      pn.feature = TT.featureGet(le.features, TT.FT_POS, TT.F_NULL);
      pn.leo = leo;
      pn.startpos = TT.longParse((String) line.elementAt(8), true);
      pn.endpos = TT.longParse((String) line.elementAt(9), true);

      r.addElement(pn);
    }
    return r;
  }
示例#9
0
  /**
   * This method queries the database to get the Journal Dates for the passed in Funding Year
   *
   * @exception SQLException, if query fails
   * @author
   */
  public Vector getJrnldts(String year) {
    String query;
    Vector jrnllst = new Vector();
    PreparedStatement pstmt = null;
    ResultSet rs = null;

    query =
        "select bp_id,decode(bs_nm,'CRIS','1','IABS','2','BART','3','SOFI','4','INFRANET','5','6') ord, ";
    query = query + "rtrim(bs_nm||' '||bp_rgn) nm, bp_month,decode(bp_month,1,'January',";
    query =
        query
            + "2,'February',3,'March',4,'April',5,'May',6,'June',7,'July',8,'August',9,'September',";
    query =
        query
            + "10,'October',11,'November',12,'December'), to_char(bp_strt_dat,'MM/DD/YYYY'),to_char(bp_end_dat,'MM/DD/YYYY') ";
    query = query + "from blg_prd,blg_sys ";
    query = query + "where bs_id=bs_id_fk and ( bp_strt_dat >= ";
    query = query + "(select strt_dat from fung_yr where yr = ?) and ";
    query = query + "bp_end_dat <= (select end_dat from fung_yr where yr = ?) ";
    query = query + "or ( bp_year =to_number(?) and bp_month=7) ) ";
    query = query + "order by ord,nm,bp_strt_dat ";

    USFEnv.getLog().writeDebug("Dinvjrnl: JRNL Dates Query :" + query, this, null);
    try {
      pstmt = conn.prepareStatement(query);
      pstmt.setString(1, year);
      pstmt.setString(2, year);
      pstmt.setString(3, year);

      rs = pstmt.executeQuery();
      while (rs.next()) {
        Dinvjrnl jrnldts = new Dinvjrnl(null);

        jrnldts.strBpid = rs.getString(1);
        jrnldts.strBlgsys = rs.getString(3);
        jrnldts.strBlgmnth = rs.getString(5);
        jrnldts.strBlgstrtdt = rs.getString(6);
        jrnldts.strBlgenddt = rs.getString(7);

        jrnllst.addElement(jrnldts);
        jrnldts = null;
      }
      if (rs != null) rs.close();
      if (pstmt != null) pstmt.close();
    } catch (SQLException ex) {
      USFEnv.getLog().writeCrit("Dinvjrnl: JRNL Dates not retreived for the Year ", this, ex);
      try {
        if (rs != null) rs.close();
        if (pstmt != null) pstmt.close();
      } catch (SQLException e) {
        USFEnv.getLog().writeCrit("Unable to close the resultset/prepared statement", this, e);
      }
    }

    USFEnv.getLog()
        .writeDebug("Dinvjrnl: Journal Dates Vector size :" + jrnllst.size(), this, null);
    return jrnllst;
  }
示例#10
0
 protected Vector /* of Object */ queryAssertionLines1(String query) throws IOException {
   write(query);
   Vector v = readlines();
   Vector r = new Vector();
   for (Enumeration e = v.elements(); e.hasMoreElements(); ) {
     r.addElement(TT.stringToObject((String) e.nextElement()));
   }
   return r;
 }
示例#11
0
 protected Vector /* of String */ readlines() throws IOException {
   Vector r = new Vector();
   while (true) {
     String s = in.readLine();
     if (DEBUG) dbg("FROM TT: <" + s + ">");
     if (s.equals(".")) break;
     if (s.startsWith("error:")) break;
     r.addElement(s);
   }
   return r;
 }
示例#12
0
  /**
   * Attach a previously created Axis. Only Axes that have been attached will be drawn
   *
   * @param the Axis to attach.
   */
  public void attachAxis(Axis a) {

    if (a == null) return;

    try {
      axis.addElement(a);
      a.g2d = this;
    } catch (Exception e) {
      System.out.println("Failed to attach Axis");
      e.printStackTrace();
    }
  }
示例#13
0
 protected static Vector /* of String */ stringToVector(String s, String delim) {
   Vector r = new Vector();
   int fromIndex = 0, len = s.length();
   ResultChar rc = new ResultChar();
   while (fromIndex < len) {
     rc.ch = 0;
     int i = indexOfAny(s, delim, fromIndex, rc);
     if (i == -1) {
       r.addElement(s.substring(fromIndex, len));
       break;
     }
     r.addElement(s.substring(fromIndex, i));
     /* Skip different delimiters. */
     i++;
     for (; i < len; i++) {
       if (s.charAt(i) == rc.ch || -1 == delim.indexOf(s.charAt(i))) break;
     }
     fromIndex = i;
   }
   return r;
 }
示例#14
0
 /**
  * Load and Attach a DataSet from an array. The method loads the data into a DataSet class and
  * attaches the class to the graph for plotting.
  *
  * <p>The data is assumed to be stored in the form x,y,x,y,x,y.... A local copy of the data is
  * made.
  *
  * @param data The data to be loaded in the form x,y,x,y,...
  * @param n The number of (x,y) data points. This means that the minimum length of the data array
  *     is 2*n.
  * @return The DataSet constructed containing the data read.
  */
 public DataSet loadDataSet(double data[], int n) {
   DataSet d;
   try {
     d = new DataSet(data, n);
     dataset.addElement(d);
     d.g2d = this;
   } catch (Exception e) {
     System.out.println("Failed to load Data set ");
     e.printStackTrace();
     return null;
   }
   return d;
 }
示例#15
0
  /**
   * Create and attach an Axis to the graph. The position of the axis is one of Axis.TOP,
   * Axis.BOTTOM, Axis.LEFT or Axis.RIGHT.
   *
   * @param position Position of the axis in the drawing window.
   */
  public Axis createAxis(int position) {
    Axis a;

    try {
      a = new Axis(position);
      a.g2d = this;
      axis.addElement(a);
    } catch (Exception e) {
      System.out.println("Failed to create Axis");
      e.printStackTrace();
      return null;
    }

    return a;
  }
示例#16
0
  private Vector collist(ResultSetMetaData mdset) throws SQLException {
    Vector desc = new Vector();

    int j = 0;
    for (int i = 1; i <= mdset.getColumnCount(); i++) {
      String cn = mdset.getColumnName(i).toUpperCase();
      if (cl_size > 0 && with.get(cn) != null) {
        Integer t = (Integer) with.get(cn);
        clist[j] = i;
        ctype[j] = t.intValue();
        j++;
      }
      desc.addElement(cn);
    }
    cl_size = j;
    sort();

    return desc;
  }
示例#17
0
  /**
   * This method queries the database to get the Invoice Numbers list for a particular FRN in a
   * Funding Year
   *
   * @exception SQLException, if query fails
   * @author
   */
  public Vector getFrninvnos(String frn, String year) {
    String query;
    Vector invnos = new Vector();
    Statement stmt = null;
    ResultSet rs = null;

    USFEnv.getLog().writeWarn("Inside the block-->>RhccDinview Inview", this, null);

    query =
        " select distinct rhcc_inv_id_fk,rhcc_inv.inv_no||' - '||to_char(rhcc_inv.inv_dat,'Mon/DD/YYYY') ";
    query = query + " from wrk_ordr,wrk_ordr_dets,wo_det_hsties,rhcc_inv,fung_yr ";
    query = query + " where wo_id=wo_id_fk and wod_id=wod_id_fk and ";
    query = query + " wdh_stat='P' and ";
    query = query + " inv_stat is not null and ";
    query = query + " rhcc_inv_id_fk=rhcc_inv_id and ";
    query = query + " wrk_ordr_no='" + frn + "' and ";
    query = query + " wrk_ordr.yr_fk=fung_yr.yr and ";
    query = query + " wrk_ordr.yr_fk=" + year;

    USFEnv.getLog().writeCrit("RhccDinvview: The Invoice Number List Query:" + query, this, null);
    try {
      stmt = conn.createStatement();
      rs = stmt.executeQuery(query);
      while (rs.next()) {
        invnos.addElement(rs.getString(1));
        invnos.addElement(rs.getString(2));
      }
      if (rs != null) rs.close();
      if (stmt != null) stmt.close();
    } catch (SQLException ex) {
      USFEnv.getLog()
          .writeCrit("RhccDinvview: The Invoice Numbers List for FRN not retreived", this, ex);
      try {
        if (rs != null) rs.close();
        if (stmt != null) stmt.close();
      } catch (SQLException e) {
        USFEnv.getLog().writeCrit("Unable to close the resultset/statement", this, e);
      }
    }

    return invnos;
  }
 public ArrayList getXmlUIElements(Form f) throws InvalidTemplateException {
   Vector v = f.getUserInputs();
   Vector userInputVecArg = new Vector();
   int size = v.size();
   for (int i = 0; i < size; i++) {
     UserInput ui = (UserInput) v.elementAt(i);
     String satisfied = ui.getAttribute("satisfied");
     if (satisfied == null || (!satisfied.equals("false"))) {
       userInputVecArg.addElement(ui);
     }
   }
   ArrayList list = new ArrayList(userInputVecArg.size());
   for (int i = 0, j = userInputVecArg.size(); i < j; i++) {
     UserInput ui = (UserInput) userInputVecArg.elementAt(i);
     uiList.add(ui);
     XmlUIElement el = getXmlElement(ui);
     uiElementsList.add(el);
     list.add(el);
   }
   return list;
 }
示例#19
0
  protected Vector /* of TTLexEntryToObj */ queryLeos1(String query) throws IOException {
    write(query);
    Vector lines = readlines();
    Vector r = new Vector();
    for (Enumeration e = lines.elements(); e.hasMoreElements(); ) {
      Vector line = stringToVector((String) e.nextElement(), ":");

      TTLexEntry le = new TTLexEntry();
      le.citationForm = (String) line.elementAt(0);
      le.features = (String) line.elementAt(1);
      le.inflection = (String) line.elementAt(2);
      le.inflFeatures = (String) line.elementAt(3);

      TTLexEntryToObj leo = new TTLexEntryToObj();
      leo.lexentry = le;
      leo.objname = (String) line.elementAt(4);
      leo.features = (String) line.elementAt(5);

      r.addElement(leo);
    }
    return r;
  }
示例#20
0
  /**
   * This method queries the database to get the list of the Future Years.
   *
   * @exception SQLException, if query fails
   * @author
   */
  public Vector getFutureyears() {
    String query;
    Vector years = new Vector();
    Statement stmt = null;
    ResultSet rs = null;

    query = " select yr,yr ||'-'|| (yr+1) from fung_yr ";
    query = query + "where yr >= to_number( to_char(sysdate,'YYYY') ) ";
    query = query + "and yr not in ";
    query = query + "( select yr from fung_yr where ";
    query = query + "((sysdate between strt_dat and end_dat) or ";
    query = query + "(sysdate-365 between strt_dat and end_dat) or ";
    query = query + "(sysdate-730 between strt_dat and end_dat)) ) ";

    USFEnv.getLog().writeDebug("Dinvjrnl: Future Years Query :" + query, this, null);
    try {
      stmt = conn.createStatement();
      rs = stmt.executeQuery(query);
      while (rs.next()) {
        years.addElement(rs.getString(1));
        years.addElement(rs.getString(2));
      }
      if (rs != null) rs.close();
      if (stmt != null) stmt.close();
    } catch (SQLException ex) {
      USFEnv.getLog().writeCrit("Dinvjrnl: Future Years List not Retreived ", this, ex);
      try {
        if (rs != null) rs.close();
        if (stmt != null) stmt.close();
      } catch (SQLException e) {
        USFEnv.getLog().writeCrit("Unable to close the resultset/statement", this, e);
      }
    }

    USFEnv.getLog().writeDebug("Dinvjrnl: Future Years Vector size :" + years.size(), this, null);
    return years;
  }
示例#21
0
  /**
   * This method queries the database to get the list of the Billing Systems.
   *
   * @exception SQLException, if query fails
   * @author
   */
  public Vector getBlgsys() {
    String query;
    Vector blgsys = new Vector();
    Statement stmt = null;
    ResultSet rs = null;

    query =
        "select distinct decode(bs_nm,'CRIS','1','IABS','2','BART','3','SOFI','4','INFRANET','5','6') ord,";
    query =
        query
            + " rtrim(bs_nm||' '||bp_rgn),bs_id_fk||rtrim(bp_rgn) from blg_sys,blg_prd where bs_id=bs_id_fk order by ord";

    USFEnv.getLog().writeDebug("Dinvjrnl: Billing System Query :" + query, this, null);
    try {
      stmt = conn.createStatement();
      rs = stmt.executeQuery(query);
      while (rs.next()) {
        blgsys.addElement(rs.getString(3));
        blgsys.addElement(rs.getString(2));
      }
      if (rs != null) rs.close();
      if (stmt != null) stmt.close();
    } catch (SQLException ex) {
      USFEnv.getLog().writeCrit("Dinvjrnl: Billing System List not Retreived ", this, ex);
      try {
        if (rs != null) rs.close();
        if (stmt != null) stmt.close();
      } catch (SQLException e) {
        USFEnv.getLog().writeCrit("Unable to close the resultset/statement", this, e);
      }
      USFEnv.getLog()
          .writeDebug("Dinvjrnl: Billing System Vector size :" + blgsys.size(), this, null);
    }

    return blgsys;
  }
示例#22
0
  public void go(SystemEnvironment sysEnv) throws SDMSException {
    Long sgId = null;
    Long ZERO = new Long(0);

    if (!sysEnv.cEnv.gid().contains(SDMSObject.adminGId)) {
      SDMSPrivilege p = new SDMSPrivilege();
      Vector v = SDMSMemberTable.idx_uId.getVector(sysEnv, sysEnv.cEnv.uid());
      for (int i = 0; i < v.size(); i++) {
        SDMSMember m = (SDMSMember) v.get(i);
        try {
          SDMSGrant gr =
              SDMSGrantTable.idx_objectId_gId_getUnique(
                  sysEnv, new SDMSKey(ZERO, m.getGId(sysEnv)));
          p.addPriv(sysEnv, gr.getPrivs(sysEnv).longValue());
        } catch (NotFoundException nfe) {

        }
      }
      try {
        if (sysEnv.selectGroup != null) {
          SDMSGroup sg = SDMSGroupTable.idx_name_getUnique(sysEnv, sysEnv.selectGroup);
          sgId = sg.getId(sysEnv);
        }
      } catch (NotFoundException nfe) {

      }
      if (!(p.can(SDMSPrivilege.MANAGE_SEL) || (sgId != null && sysEnv.cEnv.gid().contains(sgId))))
        throw new AccessViolationException(
            new SDMSMessage(sysEnv, "03003081235", "Insufficient Privileges"));
    }

    int read = 0;
    SDMSOutputContainer d_container = null;

    if (cl_size > 0) {
      clist = new int[cl_size];
      ctype = new int[cl_size];
    }

    try {
      Statement stmt = sysEnv.dbConnection.createStatement();
      ResultSet rset = stmt.executeQuery(selectCmd);
      ResultSetMetaData mdset = rset.getMetaData();
      Vector desc = collist(mdset);
      d_container = new SDMSOutputContainer(sysEnv, "Selected Values", desc);
      while (rset.next()) {
        Vector data = new Vector();
        int j = 0;
        for (int i = 1; i <= desc.size(); i++) {
          Object o = rset.getObject(i);
          if (cl_size > 0 && j < cl_size && i == clist[j]) {
            o = convert(sysEnv, o, j);
            j++;
          }
          data.addElement((rset.wasNull() ? null : o));
        }
        d_container.addData(sysEnv, data);
        read++;
      }
      stmt.close();
      sysEnv.dbConnection.commit();
    } catch (SQLException sqle) {

      try {

        sysEnv.dbConnection.rollback();
      } catch (SQLException sqle2) {

        throw new RecoverableException(new SDMSMessage(sysEnv, "03310281524", "Connection lost"));
      }

      throw new CommonErrorException(
          new SDMSMessage(sysEnv, "03204170024", "SQL Error : $1", sqle.toString()));
    }

    if (sv != null && sv.size() > 0) {
      int sca[] = new int[sv.size()];
      for (int i = 0; i < sv.size(); i++) {
        sca[i] = ((Integer) sv.get(i)).intValue();
        if (sca[i] >= d_container.columns)
          throw new CommonErrorException(
              new SDMSMessage(
                  sysEnv,
                  "03003081227",
                  "The sort column specified ($1) exceeds the number of columns in the output",
                  new Integer(sca[i])));
      }
      Collections.sort(d_container.dataset, d_container.getComparator(sysEnv, sca));
    }

    result.setOutputContainer(d_container);
    result.setFeedback(
        new SDMSMessage(sysEnv, "03204112153", "$1 Row(s) selected", new Integer(read)));
  }
示例#23
0
 public void addNeighbor(Variable v) {
   neighbors.addElement(v);
 }
示例#24
0
 public void Add_VNode(Node n) {
   v_nodes.addElement((Object) n);
   // line added for testing purposes
   // System.out.println( "" + node_cnt );
 }
示例#25
0
  public Vector getFiledetails(String frn, String invid, String year) {

    String query;
    Vector inv = new Vector();
    Statement stmt = null;
    ResultSet rs = null;

    query = " SELECT rci_st, wrk_ordr_no, s.bs_nm, b.rbk_keys, rci_nm, wod_id, ";
    query = query + " srv_sub_cat_nm, h.bill_dat, TO_CHAR (h.bill_dat, 'MM/DD/YYYY'), ";
    query = query + " TO_CHAR (h.CRDT_AMT, 'FM999999990.00'), ";
    query = query + " inv_stat invstat ";
    query = query + " from ";
    query = query + " rhcc_cust_infos, ";
    query = query + " wo_det_hsties h, ";
    query = query + " wrk_ordr_dets, ";
    query = query + " wrk_ordr, ";
    query = query + " rhcc_blg_keys b, ";
    query = query + " srv_sub_cat, ";
    query = query + " fung_yr, ";
    query = query + " blg_sys s ";
    query = query + " WHERE wo_id = wo_id_fk ";
    query = query + " AND wod_id = wod_id_fk ";
    query = query + " AND rci_id = rci_id_fk ";
    query = query + " AND wdh_stat = 'P' ";
    query = query + " AND b.bs_id_fk != 2 ";
    query = query + " AND inv_stat IS NOT NULL ";
    query = query + " AND ssc_id = ssc_id_fk ";
    query = query + " AND wrk_ordr_dets.rbk_id_fk = b.rbk_id ";
    query = query + " AND b.bs_id_fk = s.bs_id ";
    query = query + " AND fung_yr.yr = wrk_ordr.yr_fk   and  ";

    query = query + "        fung_yr.yr=" + year + " and ";

    if ((frn != null) && (!(frn).equals(""))) {
      query = query + "        wrk_ordr_no='" + frn + "' and ";
    }

    query = query + "        rhcc_inv_id_fk=" + invid + " and  ";
    query = query + " wrk_ordr.sc_id_fk=5 ";

    query = query + " UNION ALL ";

    query = query + " select rci_st,wrk_ordr_no, s.bs_nm||'-'||substr(GETCONDITION( rm_rgn ";
    query = query + " , ";
    query = query + " substr(rbk_keys,1,3) ";
    query = query + " , ";
    query = query + " substr(rbk_keys,4,3) ";
    query = query + " ) ";
    query = query + " ,1,1),b.rbk_keys,rci_nm,wod_id,srv_sub_cat_nm,h.bill_dat, ";
    query =
        query
            + " to_char(h.bill_dat,'MM/DD/YYYY'),to_char(h.CRDT_AMT,'FM999999990.00'),inv_stat invstat ";
    query = query + " from rhcc_cust_infos,wo_det_hsties h,wrk_ordr_dets,wrk_ordr, ";
    query = query + " rhcc_blg_keys b,srv_sub_cat,rgn_map,fung_yr,blg_sys s ";
    query = query + " where wo_id = wo_id_fk ";
    query = query + " AND wod_id = wod_id_fk ";
    query = query + " AND rci_id = rci_id_fk and ";
    query = query + " wdh_stat='P' and ";
    query = query + " b.bs_id_fk=2 and ";
    query = query + " inv_stat is not null and ";
    query = query + " ssc_id=ssc_id_fk and ";
    query = query + " wrk_ordr_dets.RBK_ID_FK = b.RBK_ID AND ";
    query = query + " b.bs_id_fk=s.bs_id and ";
    query = query + " FUNG_YR.YR = wrk_ordr.YR_FK and ";

    query = query + "        fung_yr.yr=" + year + " and ";

    if ((frn != null) && (!(frn).equals(""))) {
      query = query + "        wrk_ordr_no='" + frn + "' and ";
    }

    query = query + "       rhcc_inv_id_fk=" + invid + " and ";
    query = query + " wrk_ordr.sc_id_fk='5' and ";
    query = query + " rm_npa = substr(b.rbk_keys,1,3) ";

    USFEnv.getLog().writeDebug("rhccDinvview:Query :" + query, this, null);

    try {
      stmt = conn.createStatement();
      rs = stmt.executeQuery(query);
      while (rs.next()) {
        RhccDinvview linedet = new RhccDinvview(null);

        linedet.strCuststate = rs.getString(1);
        linedet.strFRN = rs.getString(2);
        linedet.strBlgsys = rs.getString(3);
        linedet.strBlgkey = rs.getString(4);
        linedet.strCustnm = rs.getString(5);
        linedet.strReconkey = rs.getString(6);
        linedet.strProdnm = rs.getString(7);
        linedet.strBdate = rs.getString(9);
        linedet.strProdcost = rs.getString(10);
        linedet.strInvstatus = rs.getString(11);

        inv.addElement(linedet);
        linedet = null;
      }

      if (rs != null) rs.close();
      if (stmt != null) stmt.close();

    } catch (SQLException ex) {
      USFEnv.getLog()
          .writeCrit("RhccDinvgen: The Details of the Line Item not retreived", this, ex);
      try {
        if (rs != null) rs.close();
        if (stmt != null) stmt.close();
      } catch (SQLException e) {
        USFEnv.getLog().writeCrit("Unable to close the resultset/statement", this, e);
      }
    }
    return inv;
  }
示例#26
0
  /**
   * parse the text. When the text is parsed the width, height, leading are all calculated. The text
   * will only be truly parsed if the graphics context has changed or the text has changed or the
   * font has changed. Otherwise nothing is done when this method is called.
   *
   * @param g Graphics context.
   */
  public void parseText(Graphics g) {
    FontMetrics fm;
    TextState current = new TextState();
    char ch;
    Stack state = new Stack();
    int w = 0;

    if (lg != g) parse = true;
    lg = g;

    if (!parse) return;

    parse = false;
    width = 0;
    leading = 0;
    ascent = 0;
    descent = 0;
    height = 0;
    maxAscent = 0;
    maxDescent = 0;

    if (text == null || g == null) return;

    list.removeAllElements();

    if (font == null) current.f = g.getFont();
    else current.f = font;

    state.push(current);
    list.addElement(current);

    fm = g.getFontMetrics(current.f);

    for (int i = 0; i < text.length(); i++) {
      ch = text.charAt(i);

      switch (ch) {
        case '$':
          i++;
          if (i < text.length()) current.s.append(text.charAt(i));
          break;
          /*
           **                    Push the current state onto the state stack
           **                    and start a new storage string
           */
        case '{':
          w = current.getWidth(g);
          if (!current.isEmpty()) {
            current = current.copyState();
            list.addElement(current);
          }

          state.push(current);
          current.x += w;
          break;
          /*
           **                    Pop the state off the state stack and set the current
           **                    state to the top of the state stack
           */
        case '}':
          w = current.x + current.getWidth(g);
          state.pop();
          current = ((TextState) state.peek()).copyState();
          list.addElement(current);
          current.x = w;
          break;
        case '^':
          w = current.getWidth(g);
          if (!current.isEmpty()) {
            current = current.copyState();
            list.addElement(current);
          }
          current.f = getScriptFont(current.f);
          current.x += w;
          current.y -= (int) ((double) (current.getAscent(g)) * sup_offset + 0.5);
          break;
        case '_':
          w = current.getWidth(g);
          if (!current.isEmpty()) {
            current = current.copyState();
            list.addElement(current);
          }
          current.f = getScriptFont(current.f);
          current.x += w;
          current.y += (int) ((double) (current.getDescent(g)) * sub_offset + 0.5);
          break;

        default:
          current.s.append(ch);
          break;
      }
    }

    for (int i = 0; i < list.size(); i++) {
      current = ((TextState) (list.elementAt(i)));

      if (!current.isEmpty()) {
        width += current.getWidth(g);
        ascent = Math.max(ascent, Math.abs(current.y) + current.getAscent(g));
        descent = Math.max(descent, Math.abs(current.y) + current.getDescent(g));
        leading = Math.max(leading, current.getLeading(g));

        maxDescent = Math.max(maxDescent, Math.abs(current.y) + current.getMaxDescent(g));
        maxAscent = Math.max(maxAscent, Math.abs(current.y) + current.getMaxAscent(g));
      }
    }

    height = ascent + descent + leading;

    return;
  }