Add files via upload

This commit is contained in:
gopi17701 2018-08-15 14:49:14 -04:00 committed by GitHub
parent ab412737b0
commit 1ba9c99721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -98,11 +98,11 @@ public abstract class DAO {
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) throws AstuteException;
public abstract void updatePODetail(String POnum, int lineItemNo, String serviceDesc, int feeTypeId, Double qty, Double fee, int serviceTypeId) 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) throws AstuteException;
public abstract void createPODetail(String POnum, int lineItemNo, String serviceDesc, int feeTypeId, Double qty, Double fee, int serviceTypeId) 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 List<Invoice> getInvoiceMaster(String invoiceNumber, int pmtStatus) throws AstuteException; public abstract List<Invoice> getInvoiceMaster(String invoiceNumber, int pmtStatus) throws AstuteException;

View File

@ -75,7 +75,7 @@ public class SqlDAO extends DAO {
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
String whereClause = " WHERE "; String whereClause = " WHERE ";
boolean whereClauseCriteria = false; boolean whereClauseCriteria = false;
String sql = "SELECT PO_num, line_item_no, service_desc, fee_type_id, qty, fee, service_type_id, get_remaining_qty_fun(PO_num, line_item_no) as get_remaining_qty FROM PO_DETAIL "; String sql = "SELECT PO_num, line_item_no, service_desc, fee_type_id, qty, fee, service_type_id, remaining_qty FROM PO_DETAIL ";
if (PONum != null) { if (PONum != null) {
whereClause = whereClause + " UPPER(PO_num) = '" + PONum.toUpperCase() + "'"; whereClause = whereClause + " UPPER(PO_num) = '" + PONum.toUpperCase() + "'";
whereClauseCriteria = true; whereClauseCriteria = true;
@ -142,7 +142,7 @@ public class SqlDAO extends DAO {
} }
public void updatePODetail(String POnum, int lineItemNo, String serviceDesc, int feeTypeId, Double qty, Double fee, int serviceTypeId) throws AstuteException { public void updatePODetail(String POnum, int lineItemNo, String serviceDesc, int feeTypeId, Double qty, Double fee, int serviceTypeId, Double remainingQuantity) throws AstuteException {
try { try {
String sql = "UPDATE PO_DETAIL "; String sql = "UPDATE PO_DETAIL ";
@ -160,13 +160,15 @@ public class SqlDAO extends DAO {
List<PODetail> lineItem = getPODetail(POnum, lineItemNo); List<PODetail> lineItem = getPODetail(POnum, lineItemNo);
if (lineItem.size() == 0) { if (lineItem.size() == 0) {
// new line item // new line item
createPODetail(POnum, lineItemNo, serviceDesc, feeTypeId, qty, fee, serviceTypeId); createPODetail(POnum, lineItemNo, serviceDesc, feeTypeId, qty, fee, serviceTypeId, remainingQuantity);
} else { } else {
updateClause += " service_desc = '" + serviceDesc + "',"; updateClause += " service_desc = '" + serviceDesc + "',";
updateClause += " fee_type_id = " + feeTypeId + ","; updateClause += " fee_type_id = " + feeTypeId + ",";
updateClause += " qty = " + qty + ","; updateClause += " qty = " + qty + ",";
updateClause += " fee = " + fee + ","; updateClause += " fee = " + fee + ",";
updateClause += " service_type_id = " + serviceTypeId + ","; updateClause += " service_type_id = " + serviceTypeId + ",";
updateClause += " remaining_qty = " + remainingQuantity + ",";
if (!updateClause.equalsIgnoreCase(" SET ")) { if (!updateClause.equalsIgnoreCase(" SET ")) {
sql = sql + trimLastCharacter(updateClause, ",") + whereClause; sql = sql + trimLastCharacter(updateClause, ",") + whereClause;
@ -199,11 +201,11 @@ public class SqlDAO extends DAO {
} }
} }
public void createPODetail(String POnum, int lineItemNo, String serviceDesc, int feeTypeId, Double qty, Double fee, int serviceTypeId) throws AstuteException { public void createPODetail(String POnum, int lineItemNo, String serviceDesc, int feeTypeId, Double qty, Double fee, int serviceTypeId, Double remainingQuantity) throws AstuteException {
try { try {
System.out.println("Calling create_po_detail Procedure"); System.out.println("Calling create_po_detail Procedure");
System.out.println("POnum is " + POnum); System.out.println("POnum is " + POnum);
CallableStatement stmt = conn.prepareCall("{call create_po_detail(?,?,?,?,?,?,?)}"); CallableStatement stmt = conn.prepareCall("{call create_po_detail(?,?,?,?,?,?,?,?)}");
stmt.setString(1, POnum); stmt.setString(1, POnum);
stmt.setInt(2, lineItemNo); stmt.setInt(2, lineItemNo);
stmt.setString(3, serviceDesc); stmt.setString(3, serviceDesc);
@ -211,6 +213,8 @@ public class SqlDAO extends DAO {
stmt.setDouble(5, qty); stmt.setDouble(5, qty);
stmt.setDouble(6, fee); stmt.setDouble(6, fee);
stmt.setInt(7, serviceTypeId); stmt.setInt(7, serviceTypeId);
stmt.setDouble(8, remainingQuantity);
stmt.executeUpdate(); stmt.executeUpdate();
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();