Commit d8974ab7 authored by smane's avatar smane

*** empty log message ***


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94151 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3f3f6bd2
...@@ -107,9 +107,12 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA ...@@ -107,9 +107,12 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA
String stScheme=""; String stScheme="";
String finVarValues=""; String finVarValues="";
String finValues[] = null; String finValues[] = null;
String siteValues[] = null;
String acctCode=""; String acctCode="";
String cctrCode=""; String cctrCode="";
String itemSer=""; String itemSer="";
String siteString="";
String siteCodeValues="";
boolean flagIntgrlQty=false; boolean flagIntgrlQty=false;
double currentStock=0.0; double currentStock=0.0;
double integralQty=0.0; double integralQty=0.0;
...@@ -132,7 +135,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA ...@@ -132,7 +135,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA
System.out.println("dom1--> "+dom1); System.out.println("dom1--> "+dom1);
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
siteCode = genericUtility.getColumnValue("site_code__req",dom1); siteCode = genericUtility.getColumnValue("site_code__req",dom1);
locationCode = genericUtility.getColumnValue("loc_code",dom1); locationCode = genericUtility.getColumnValue("loc_code",dom1);
System.out.println(">>>>>>>>>>>>>>>siteCode==>"+siteCode); System.out.println(">>>>>>>>>>>>>>>siteCode==>"+siteCode);
System.out.println(">>>>>>>>>>>>>>>LocationCode==>"+locationCode); System.out.println(">>>>>>>>>>>>>>>LocationCode==>"+locationCode);
...@@ -145,8 +148,44 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA ...@@ -145,8 +148,44 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
winName=getObjName(parentNode); winName=getObjName(parentNode);
System.out.println(">>>>>>>>>>>>>>>winName==>"+winName); System.out.println(">>>>>>>>>>>>>>>winName==>"+winName);
//get udf2
sql="SELECT (CASE WHEN udf2 IS NULL THEN ' ' ELSE udf2 END) as udf2 FROM site WHERE site_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
siteString=rs.getString("udf2");
System.out.println(">>>>>>>>>>>>>>>siteString in if==>"+siteString);
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>In item while integral_qty:"+integralQty);
}//end of while(rs.next();
rs.close();
rs = null;
pstmt.close();
pstmt = null;
siteValues = siteString.split(",");
System.out.println(">>>>>>>>>>>>>>>siteValues:" + siteValues.toString());
int siteValuesCnt=siteValues.length;
for(int i=0;i<siteValuesCnt;i++)
{
if(i==0)
{
siteCodeValues="('"+siteValues[i];
}
else
{
siteCodeValues=siteCodeValues+"','"+siteValues[i];
}
}
siteCodeValues=siteCodeValues+"')";
//siteCodeValues="('SP110','SP110')";
System.out.println(">>>>>>>>>>>>>>>siteVar:" + siteCodeValues);
// sql= "SELECT stk.item_code,itm.descr,itm.unit,sum(quantity) AS quantity FROM item itm ,stock stk WHERE itm.item_code=stk.item_code AND stk.site_code=? and stk.loc_code=? GROUP BY stk.item_code, itm.descr, itm.unit"; // sql= "SELECT stk.item_code,itm.descr,itm.unit,sum(quantity) AS quantity FROM item itm ,stock stk WHERE itm.item_code=stk.item_code AND stk.site_code=? and stk.loc_code=? GROUP BY stk.item_code, itm.descr, itm.unit";
sql="SELECT stk.item_code,itm.descr,itm.unit,itm.item_ser,(CASE WHEN sum((CASE WHEN quantity IS NULL THEN 0 ELSE quantity END) - (CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END)) IS NULL THEN 0 ELSE sum((CASE WHEN quantity IS NULL THEN 0 ELSE quantity END) - (CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END)) END) AS curr_stock FROM item itm ,stock stk WHERE itm.item_code=stk.item_code AND stk.site_code=? AND stk.loc_code=? GROUP BY stk.item_code, itm.descr,itm.unit,itm.item_ser"; sql="SELECT stk.item_code,itm.descr,itm.unit,itm.item_ser,(CASE WHEN sum((CASE WHEN quantity IS NULL THEN 0 ELSE quantity END) - (CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END)) IS NULL THEN 0 ELSE sum((CASE WHEN quantity IS NULL THEN 0 ELSE quantity END) - (CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END)) END) AS current_qty FROM item itm ,stock stk WHERE itm.item_code=stk.item_code AND stk.site_code=? AND stk.loc_code=? GROUP BY stk.item_code, itm.descr,itm.unit,itm.item_ser";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode); pstmt.setString(1, siteCode);
pstmt.setString(2, locationCode); pstmt.setString(2, locationCode);
...@@ -162,16 +201,17 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA ...@@ -162,16 +201,17 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA
flagIntgrlQty=false; flagIntgrlQty=false;
currentStock=0.0; currentStock=0.0;
integralQty=0.0; integralQty=0.0;
quantity=0.0;
itemCode = rs.getString("item_code"); itemCode = rs.getString("item_code");
itemDescr = rs.getString("descr"); itemDescr = rs.getString("descr");
unit = rs.getString("unit"); unit = rs.getString("unit");
currentStock = rs.getDouble("curr_stock"); quantity = rs.getDouble("current_qty");
itemSer = rs.getString("item_ser"); itemSer = rs.getString("item_ser");
totalCnt++; totalCnt++;
//get integral quantity //get integral quantity
if(currentStock > 0) //if(currentStock > 0)
{ //{
lineCntr++; lineCntr++;
sql="SELECT integral_qty FROM siteitem WHERE site_code=? AND item_code=?"; sql="SELECT integral_qty FROM siteitem WHERE site_code=? AND item_code=?";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
...@@ -182,7 +222,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA ...@@ -182,7 +222,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA
{ {
integralQty=rs1.getDouble("integral_qty"); integralQty=rs1.getDouble("integral_qty");
flagIntgrlQty=true; flagIntgrlQty=true;
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>In siteitem while integral_qty :"+integralQty); System.out.println(">>>>>>>>>>>>>>>>>>>>>>>In siteitem while integral_qty :"+integralQty);
}//end of while(rs.next(); }//end of while(rs.next();
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
...@@ -206,15 +246,53 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA ...@@ -206,15 +246,53 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
}
//get current stock..
if(siteString==null || siteString.trim().length()==0)
{
sql="SELECT sum(quantity - alloc_qty - CASE WHEN hold_qty IS NULL THEN 0 ELSE hold_qty END ) AS current_stock FROM stock stk, invstat istat where stk.inv_stat = istat.inv_stat and stk.item_code =? and istat.available = 'Y'";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,itemCode);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
currentStock=rs1.getDouble("current_stock");
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>In if currentStock:"+currentStock);
}//end of while(rs.next();
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
}
else
{
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>In ELSE If siteCodeValues:"+siteCodeValues);
sql="SELECT (CASE WHEN sum((CASE WHEN quantity IS NULL THEN 0 ELSE quantity END) - (CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END) - (CASE WHEN hold_qty IS NULL THEN 0 ELSE hold_qty END) ) IS NULL THEN 0 ELSE sum((CASE WHEN quantity IS NULL THEN 0 ELSE quantity END) - (CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END) - (CASE WHEN hold_qty IS NULL THEN 0 ELSE hold_qty END)) END) as current_stock FROM stock stk, invstat istat WHERE stk.inv_stat = istat.inv_stat AND stk.item_code =? and stk.site_code IN "+siteCodeValues+"";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,itemCode);
// pstmt1.setString(2, siteCodeValues);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
currentStock=rs1.getDouble("current_stock");
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>In if currentStock:"+currentStock);
}//end of while(rs.next();
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
} }
//set scheme using integral qty and current stock.. //set scheme using integral qty and current stock..
stScheme="Integral Quantity:"+integralQty+" "+"Current Stock:"+currentStock; stScheme="Integral Quantity:"+integralQty+" "+"Current Stock:"+currentStock;
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>stScheme of integral qty and current stock:"+stScheme); System.out.println(">>>>>>>>>>>>>>>>>>>>>>>stScheme of integral qty and current stock:"+stScheme);
// get acct_code and cctr_code form getFromAcctDetr() method... // get acct_code and cctr_code form getFromAcctDetr() method...
finVarValues=finCommon.getFromAcctDetr(itemCode,itemSer,"CISS", conn); finVarValues=finCommon.getFromAcctDetr(itemCode,itemSer,"CISS", conn);
...@@ -241,8 +319,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA ...@@ -241,8 +319,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA
System.out.println(">>>>>>>>>>>>>>>finValues for loop if:"+finValues[1]); System.out.println(">>>>>>>>>>>>>>>finValues for loop if:"+finValues[1]);
} }
} }
} }
...@@ -251,7 +328,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA ...@@ -251,7 +328,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA
valueXmlString.append("<item_code isSrvCallOnChg='0'>").append("<![CDATA[").append(itemCode.trim()).append("]]>").append("</item_code>\r\n"); valueXmlString.append("<item_code isSrvCallOnChg='0'>").append("<![CDATA[").append(itemCode.trim()).append("]]>").append("</item_code>\r\n");
valueXmlString.append("<item_descr>").append("<![CDATA[").append(itemDescr.trim()).append("]]>").append("</item_descr>\r\n"); valueXmlString.append("<item_descr>").append("<![CDATA[").append(itemDescr.trim()).append("]]>").append("</item_descr>\r\n");
valueXmlString.append("<unit>").append("<![CDATA[").append(unit.trim()).append("]]>").append("</unit>\r\n"); valueXmlString.append("<unit>").append("<![CDATA[").append(unit.trim()).append("]]>").append("</unit>\r\n");
valueXmlString.append("<quantity>").append("<![CDATA[").append(currentStock).append("]]>").append("</quantity>\r\n"); valueXmlString.append("<quantity>").append("<![CDATA[").append(quantity).append("]]>").append("</quantity>\r\n");
valueXmlString.append("<loc_code>").append("<![CDATA[").append(locationCode.trim()).append("]]>").append("</loc_code>\r\n"); valueXmlString.append("<loc_code>").append("<![CDATA[").append(locationCode.trim()).append("]]>").append("</loc_code>\r\n");
valueXmlString.append("<acct_code>").append("<![CDATA[").append(acctCode).append("]]>").append("</acct_code>\r\n"); valueXmlString.append("<acct_code>").append("<![CDATA[").append(acctCode).append("]]>").append("</acct_code>\r\n");
valueXmlString.append("<cctr_code>").append("<![CDATA[").append(cctrCode).append("]]>").append("</cctr_code>\r\n"); valueXmlString.append("<cctr_code>").append("<![CDATA[").append(cctrCode).append("]]>").append("</cctr_code>\r\n");
...@@ -259,7 +336,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA ...@@ -259,7 +336,7 @@ public class ConsumeOrdStkAct extends ActionHandlerEJB implements ConsumeOrdStkA
valueXmlString.append("</Detail>"); valueXmlString.append("</Detail>");
} //}
}//end of while(rs.next(); }//end of while(rs.next();
System.out.println("*********************In getStockDetails total item found:"+totalCnt); System.out.println("*********************In getStockDetails total item found:"+totalCnt);
......
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