Commit 17f1e742 authored by steurwadkar's avatar steurwadkar

Changes made for sending size instead of sku in stock webservice response


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103976 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 86cceafe
......@@ -9,29 +9,46 @@ import javax.xml.bind.annotation.XmlRootElement;
public class Stock implements Serializable
{
private static final long serialVersionUID = 1L;
private String sku="";
//Changed by Santosh on 18/11/16 to add size in stock response
//private String sku="";
//Added by Santosh on 18/11/16 to add size in stock response
private String size="";
private int stockqty=0;
private int pendpoqty=0;
public Stock(){}
public Stock (String sku, int stockQty, int pendPOQty)
//Changed by Santosh on 18/11/16 to add size in stock response
//public Stock (String sku, int stockQty, int pendPOQty)
public Stock (String size, int stockQty, int pendPOQty)
{
this.sku = sku;
//Changed by Santosh on 18/11/16 to add size in stock response
//this.sku = sku;
this.size = size;
this.stockqty = stockQty;
this.pendpoqty = pendPOQty;
System.out.println("Stock getter setter sku ["+this.sku+"] stockQty ["+this.stockqty+"] pendPOQty ["+this.pendpoqty+"]");
System.out.println("Stock getter setter size ["+this.size+"] stockQty ["+this.stockqty+"] pendPOQty ["+this.pendpoqty+"]");
}
public String getSku() {
//Commented by Santosh on 18/11/16 to add size in stock response [Start]
/*public String getSku() {
return sku;
}
@XmlElement
public void setSku(String sku) {
this.sku = sku;
}*/
//Commented by Santosh on 18/11/16 to add size in stock response [End]
//Added by Santosh on 18/11/16 to add size in stock response [Start]
public String getSize() {
return size;
}
@XmlElement
public void setSize(String size) {
this.size = size;
}
//Added by Santosh on 18/11/16 to add size in stock response [End]
public int getStockqty() {
return stockqty;
}
......
......@@ -25,7 +25,9 @@ public class WMSWebServiceDao extends ValidatorEJB
{
System.out.println("itemParnt["+itemParnt+"] colorcode ["+colorCode+"]");
conn = getConnection();
stockSQL = "SELECT ITEM_CODE FROM ITEM WHERE ITEM_PARNT = ? AND PHY_ATTRIB_2 = ?";
//Changed by Santosh on 18/11/16 to add size in stock response
//stockSQL = "SELECT ITEM_CODE FROM ITEM WHERE ITEM_PARNT = ? AND PHY_ATTRIB_2 = ?";
stockSQL = "SELECT ITEM_CODE,PHY_ATTRIB_1 FROM ITEM WHERE ITEM_PARNT = ? AND PHY_ATTRIB_2 = ?";
pstmt = conn.prepareStatement(stockSQL);
pstmt.setString(1, itemParnt);
pstmt.setString(2, colorCode);
......@@ -36,6 +38,8 @@ public class WMSWebServiceDao extends ValidatorEJB
{
int stockQty = 0, pendPOQty = 0;
String sku = rs.getString("ITEM_CODE");
//Added by Santosh on 18/11/16 to add size in stock response
String size = rs.getString("PHY_ATTRIB_1");
sql = " SELECT S.ITEM_CODE, SUM(S.QUANTITY - S.ALLOC_QTY - CASE WHEN HOLD_QTY IS NULL THEN 0 ELSE HOLD_QTY END) AS STOCK_QTY"
+ " FROM STOCK S WHERE S.INV_STAT IN ('ACTPK','CASPK') AND S.ITEM_CODE = ? GROUP BY S.ITEM_CODE HAVING SUM(S.QUANTITY - S.ALLOC_QTY - CASE WHEN HOLD_QTY IS NULL THEN 0 ELSE HOLD_QTY END) > 0";
......@@ -81,8 +85,9 @@ public class WMSWebServiceDao extends ValidatorEJB
pstmt1.close();
pstmt1 = null;
}
stock = new Stock(sku.trim(),stockQty,pendPOQty);
//Changed by Santosh on 18/11/16 to add size in stock response
//stock = new Stock(sku.trim(),stockQty,pendPOQty);
stock = new Stock(size.trim(),stockQty,pendPOQty);
stockList.add(stock);
}
if(rs != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment