mirror of
https://github.com/dyiop/astute.git
synced 2025-04-06 21:30:20 -04:00
Add files via upload
This commit is contained in:
parent
7c3b333d69
commit
b7f1883fa2
|
@ -96,11 +96,11 @@ public abstract class DAO {
|
||||||
|
|
||||||
public abstract List<PODetail> getPODetail(String PONum, int lineItemNo) throws AstuteException;
|
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 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;
|
public abstract void createPODetail(String POnum, int lineItemNo, String serviceDesc, int feeTypeId, Double qty, Double fee, int serviceTypeId, Double remainingQuantity) throws AstuteException;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class SqlDAO extends DAO {
|
||||||
try {
|
try {
|
||||||
List<PO> pos = new ArrayList<>();
|
List<PO> pos = new ArrayList<>();
|
||||||
Statement stmt = conn.createStatement();
|
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()) {
|
if (PONum != null && !PONum.isEmpty()) {
|
||||||
sql += "WHERE UPPER(PO_num) = '" + PONum.toUpperCase() + "'";
|
sql += "WHERE UPPER(PO_num) = '" + PONum.toUpperCase() + "'";
|
||||||
} else if (contractNum != null && !contractNum.isEmpty()) {
|
} else if (contractNum != null && !contractNum.isEmpty()) {
|
||||||
|
@ -59,7 +59,8 @@ public class SqlDAO extends DAO {
|
||||||
String customerId = rs.getString(4);
|
String customerId = rs.getString(4);
|
||||||
Double contractAmt = rs.getDouble(5);
|
Double contractAmt = rs.getDouble(5);
|
||||||
String astuteProjectNum = rs.getString(6);
|
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);
|
pos.add(po);
|
||||||
}
|
}
|
||||||
return pos;
|
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 {
|
try {
|
||||||
String sql = "UPDATE PO ";
|
String sql = "UPDATE PO ";
|
||||||
String updateClause = " SET ";
|
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 + " PO_Date = STR_TO_DATE(" + PODate + ", '%Y-%m-%d')" + ",";
|
||||||
updateClause = updateClause + " contract_amt = " + contractAmt+ ",";
|
updateClause = updateClause + " contract_amt = " + contractAmt+ ",";
|
||||||
updateClause = updateClause + " astute_project_num = '" + astuteProjectNumber +"'";
|
updateClause = updateClause + " astute_project_num = '" + astuteProjectNumber +"'";
|
||||||
|
updateClause = updateClause + " title = '" + title +"'";
|
||||||
sql = sql+ updateClause + whereClause;
|
sql = sql+ updateClause + whereClause;
|
||||||
System.out.println(sql);
|
System.out.println(sql);
|
||||||
Statement stmt = conn.createStatement();
|
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 {
|
try {
|
||||||
CallableStatement stmt = conn.prepareCall("{call create_PO(?,?,?,?,?,?)}");
|
CallableStatement stmt = conn.prepareCall("{call create_PO(?,?,?,?,?,?,?)}");
|
||||||
stmt.setString(1, PONum);
|
stmt.setString(1, PONum);
|
||||||
stmt.setString(2, contractNum);
|
stmt.setString(2, contractNum);
|
||||||
stmt.setDate(3, PODate);
|
stmt.setDate(3, PODate);
|
||||||
stmt.setDouble(4, contractAmt);
|
stmt.setDouble(4, contractAmt);
|
||||||
stmt.setString(5, customerId);
|
stmt.setString(5, customerId);
|
||||||
stmt.setString(6, astuteProjectNumber);
|
stmt.setString(6, astuteProjectNumber);
|
||||||
|
stmt.setString(7, title);
|
||||||
stmt.executeUpdate();
|
stmt.executeUpdate();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -536,8 +539,8 @@ public class SqlDAO extends DAO {
|
||||||
int zip = rs.getInt(8);
|
int zip = rs.getInt(8);
|
||||||
int ziplast4 = rs.getInt(9);
|
int ziplast4 = rs.getInt(9);
|
||||||
String email = rs.getString(10);
|
String email = rs.getString(10);
|
||||||
int phone = rs.getInt(11);
|
Long phone = rs.getLong(11);
|
||||||
int fax = rs.getInt(12);
|
Long fax = rs.getLong(12);
|
||||||
Customer customer = new Customer(customerID, customerName,billToDept, add1, add2, city, state, zip, ziplast4, email, phone, fax);
|
Customer customer = new Customer(customerID, customerName,billToDept, add1, add2, city, state, zip, ziplast4, email, phone, fax);
|
||||||
customers.add(customer);
|
customers.add(customer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user