Commit de30c297 authored by rtiwari's avatar rtiwari

updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94294 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b3cbe270
...@@ -92,7 +92,7 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -92,7 +92,7 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos
ResultSet rs = null; ResultSet rs = null;
Connection conn = null; Connection conn = null;
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n"); StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
double qtyFd =0d,billQty = 0d,procLossPerc = 0d,scrapPerc=0d,reqdRm=0d; double qtyFd =0d,billQty = 0d,procLossPerc = 0d,scrapPerc=0d,batchQty=0d;
double volatileQty = 0d,scrapQty = 0d ; double volatileQty = 0d,scrapQty = 0d ;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
...@@ -119,17 +119,17 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -119,17 +119,17 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos
String phyattScrabPerc = mfgComm.getEnvMfg("999999","ITEM_PERC_SCRAP", conn); String phyattScrabPerc = mfgComm.getEnvMfg("999999","ITEM_PERC_SCRAP", conn);
String phyattScrabItem = mfgComm.getEnvMfg("999999","SCRAP_ITEM_COL", conn); String phyattScrabItem = mfgComm.getEnvMfg("999999","SCRAP_ITEM_COL", conn);
sql = " select quantity from workorder_bill where work_order = ? and item_code = ? "; // sql = " select quantity from workorder_bill where work_order = ? and item_code = ? ";
pstmt = conn.prepareStatement(sql); // pstmt = conn.prepareStatement(sql);
pstmt.setString(1,worder); // pstmt.setString(1,worder);
pstmt.setString(2,itemCode); // pstmt.setString(2,itemCode);
rs = pstmt.executeQuery(); // rs = pstmt.executeQuery();
if(rs.next()) // if(rs.next())
{ // {
billQty = rs.getDouble(1); // billQty = rs.getDouble(1);
} // }
pstmt.close();pstmt = null; // pstmt.close();pstmt = null;
rs.close();rs = null; // rs.close();rs = null;
sql = " select batch_qty from bom where bom_code in (select bom_code from workorder where work_order = ?) "; sql = " select batch_qty from bom where bom_code in (select bom_code from workorder where work_order = ?) ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -137,12 +137,12 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -137,12 +137,12 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
reqdRm = rs.getDouble(1); batchQty = rs.getDouble(1);
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
rs.close();rs = null; rs.close();rs = null;
sql = " select proc_loss_perc,item_code from bomdet where bom_code in (select bom_code from workorder where work_order = ? ) "+ sql = " select qty_per,proc_loss_perc,item_code from bomdet where bom_code in (select bom_code from workorder where work_order = ? ) "+
" and (proc_loss_perc is not null or length(trim(proc_loss_perc)) > 0) "; " and (proc_loss_perc is not null or length(trim(proc_loss_perc)) > 0) ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -150,8 +150,9 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -150,8 +150,9 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
procLossPerc = rs.getDouble(1); billQty = rs.getDouble(1);
itemCodeBom = rs.getString(2) == null ?"":rs.getString(2); procLossPerc = rs.getDouble(2);
itemCodeBom = rs.getString(3) == null ?"":rs.getString(3);
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
rs.close();rs = null; rs.close();rs = null;
...@@ -178,7 +179,6 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -178,7 +179,6 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
rs.close();rs = null; rs.close();rs = null;
} }
sql = "select LOC_CODE__REJ from siteitem where site_code = ? "; sql = "select LOC_CODE__REJ from siteitem where site_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode); pstmt.setString(1,siteCode);
...@@ -192,7 +192,7 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -192,7 +192,7 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos
if(billQty > 0) if(billQty > 0)
{ {
volatileQty = ((reqdRm * qtyFd)/billQty)*(procLossPerc/100); volatileQty = ((billQty * qtyFd)/batchQty)*(procLossPerc/100);
valueXmlString.append("<Detail>\r\n"); valueXmlString.append("<Detail>\r\n");
valueXmlString.append("<quantity>").append("<![CDATA[").append(df.format(volatileQty)).append("]]>").append("</quantity>\r\n"); valueXmlString.append("<quantity>").append("<![CDATA[").append(df.format(volatileQty)).append("]]>").append("</quantity>\r\n");
...@@ -231,7 +231,7 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -231,7 +231,7 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos
rs.close();rs = null; rs.close();rs = null;
if(billQty > 0) if(billQty > 0)
{ {
scrapQty = ((reqdRm * qtyFd)/billQty)*(scrapPerc/100); scrapQty = ((billQty * qtyFd)/batchQty)*(scrapPerc/100);
valueXmlString.append("<Detail>\r\n"); valueXmlString.append("<Detail>\r\n");
valueXmlString.append("<quantity>").append("<![CDATA[").append(df.format(scrapQty)).append("]]>").append("</quantity>\r\n"); valueXmlString.append("<quantity>").append("<![CDATA[").append(df.format(scrapQty)).append("]]>").append("</quantity>\r\n");
......
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