Add files via upload

This commit is contained in:
gopi17701 2018-08-22 14:59:03 -04:00 committed by GitHub
parent 7c3b333d69
commit b7f1883fa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View File

@ -96,11 +96,11 @@ public abstract class DAO {
public abstract List<PODetail> getPODetail(String PONum, int lineItemNo) throws AstuteException;
public abstract void updatePOMaster(String PONum, String contractNum, java.sql.Date PODate, Double contractAmt, String astuteProjectNumber) throws AstuteException;
public abstract void updatePOMaster(String PONum, String contractNum, java.sql.Date PODate, Double contractAmt, String astuteProjectNumber, String title) throws AstuteException;
public abstract void updatePODetail(String POnum, int lineItemNo, String serviceDesc, int feeTypeId, Double qty, Double fee, int serviceTypeId, Double remainingQuantity) throws AstuteException;
public abstract void createPOMaster(String PONum, String contractNum, java.sql.Date PODate, Double contractAmt, String customerId, String astuteProjectNumber) throws AstuteException;
public abstract void createPOMaster(String PONum, String contractNum, java.sql.Date PODate, Double contractAmt, String customerId, String astuteProjectNumber, String title) throws AstuteException;
public abstract void createPODetail(String POnum, int lineItemNo, String serviceDesc, int feeTypeId, Double qty, Double fee, int serviceTypeId, Double remainingQuantity) throws AstuteException;

View File

@ -40,7 +40,7 @@ public class SqlDAO extends DAO {
try {
List<PO> pos = new ArrayList<>();
Statement stmt = conn.createStatement();
String sql = "SELECT PO_num, contract_num, PO_date, customer_id, contract_amt, astute_project_num FROM PO ";
String sql = "SELECT PO_num, contract_num, PO_date, customer_id, contract_amt, astute_project_num , title FROM PO ";
if (PONum != null && !PONum.isEmpty()) {
sql += "WHERE UPPER(PO_num) = '" + PONum.toUpperCase() + "'";
} else if (contractNum != null && !contractNum.isEmpty()) {
@ -59,7 +59,8 @@ public class SqlDAO extends DAO {
String customerId = rs.getString(4);
Double contractAmt = rs.getDouble(5);
String astuteProjectNum = rs.getString(6);
PO po = new PO(poNum, cntrctNum, poDate, customerId, contractAmt,astuteProjectNum);
String title = rs.getString(7);
PO po = new PO(poNum, cntrctNum, poDate, customerId, contractAmt,astuteProjectNum,title);
pos.add(po);
}
return pos;
@ -108,7 +109,7 @@ public class SqlDAO extends DAO {
}
}
public void updatePOMaster(String PONum, String contractNum, Date PODate, Double contractAmt, String astuteProjectNumber) throws AstuteException {
public void updatePOMaster(String PONum, String contractNum, Date PODate, Double contractAmt, String astuteProjectNumber, String title) throws AstuteException {
try {
String sql = "UPDATE PO ";
String updateClause = " SET ";
@ -123,6 +124,7 @@ public class SqlDAO extends DAO {
updateClause = updateClause + " PO_Date = STR_TO_DATE(" + PODate + ", '%Y-%m-%d')" + ",";
updateClause = updateClause + " contract_amt = " + contractAmt+ ",";
updateClause = updateClause + " astute_project_num = '" + astuteProjectNumber +"'";
updateClause = updateClause + " title = '" + title +"'";
sql = sql+ updateClause + whereClause;
System.out.println(sql);
Statement stmt = conn.createStatement();
@ -185,15 +187,16 @@ public class SqlDAO extends DAO {
}
}
public void createPOMaster(String PONum, String contractNum, Date PODate, Double contractAmt, String customerId, String astuteProjectNumber) throws AstuteException {
public void createPOMaster(String PONum, String contractNum, Date PODate, Double contractAmt, String customerId, String astuteProjectNumber, String title) throws AstuteException {
try {
CallableStatement stmt = conn.prepareCall("{call create_PO(?,?,?,?,?,?)}");
CallableStatement stmt = conn.prepareCall("{call create_PO(?,?,?,?,?,?,?)}");
stmt.setString(1, PONum);
stmt.setString(2, contractNum);
stmt.setDate(3, PODate);
stmt.setDouble(4, contractAmt);
stmt.setString(5, customerId);
stmt.setString(6, astuteProjectNumber);
stmt.setString(7, title);
stmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
@ -536,8 +539,8 @@ public class SqlDAO extends DAO {
int zip = rs.getInt(8);
int ziplast4 = rs.getInt(9);
String email = rs.getString(10);
int phone = rs.getInt(11);
int fax = rs.getInt(12);
Long phone = rs.getLong(11);
Long fax = rs.getLong(12);
Customer customer = new Customer(customerID, customerName,billToDept, add1, add2, city, state, zip, ziplast4, email, phone, fax);
customers.add(customer);
}