Commit c227108b authored by rtiwari's avatar rtiwari

updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94289 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d3c66396
...@@ -18,6 +18,8 @@ import ibase.webitm.utility.GenericUtility; ...@@ -18,6 +18,8 @@ import ibase.webitm.utility.GenericUtility;
import ibase.system.config.*; import ibase.system.config.*;
import javax.annotation.*; import javax.annotation.*;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import javax.ejb.Stateless; // added for ejb3 import javax.ejb.Stateless; // added for ejb3
...@@ -83,23 +85,24 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -83,23 +85,24 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos
private String getInvRcpAct(Document dom, Document dom1, String xtraParams, String actionType) throws RemoteException,ITMException //Added - - Gulzar 25/04/07 private String getInvRcpAct(Document dom, Document dom1, String xtraParams, String actionType) throws RemoteException,ITMException //Added - - Gulzar 25/04/07
{ {
String errCode = ""; String sql="";
String errString = "",sql="";
String worder = "",itemCode= "",qtyFdStr="",itemCodeBom=""; String worder = "",itemCode= "",qtyFdStr="",itemCodeBom="";
String VolatileItem= "",siteCode="",locCode="",VolatileItemDescr=""; String VolatileItem= "",siteCode="",locCode="",VolatileItemDescr="";
String scrapItem="",scrapItemDescr=""; String scrapItem="",scrapItemDescr="";
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; double qtyFd =0d,billQty = 0d,procLossPerc = 0d,scrapPerc=0d,reqdRm=0d;
double volatileQty = 0d,scrapQty = 0d ;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
ITMDBAccessEJB itmDBAccess =null; // ITMDBAccessEJB itmDBAccess =null;
MfgCommon mfgComm = new MfgCommon(); MfgCommon mfgComm = new MfgCommon();
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
DecimalFormat df = new DecimalFormat("0.000");
try try
{ {
itmDBAccess = new ITMDBAccessEJB(); // itmDBAccess = new ITMDBAccessEJB();
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
worder = genericUtility.getColumnValue("work_order",dom1) == null ? "" :genericUtility.getColumnValue("work_order",dom1); worder = genericUtility.getColumnValue("work_order",dom1) == null ? "" :genericUtility.getColumnValue("work_order",dom1);
itemCode = genericUtility.getColumnValue( "item_code", dom1 ) == null ?"":genericUtility.getColumnValue( "item_code", dom1 ); itemCode = genericUtility.getColumnValue( "item_code", dom1 ) == null ?"":genericUtility.getColumnValue( "item_code", dom1 );
...@@ -128,6 +131,17 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -128,6 +131,17 @@ 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 batch_qty from bom where bom_code in (select bom_code from workorder where work_order = ?) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,worder);
rs = pstmt.executeQuery();
if(rs.next())
{
reqdRm = rs.getDouble(1);
}
pstmt.close();pstmt = 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 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) ";
...@@ -178,8 +192,10 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -178,8 +192,10 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos
if(billQty > 0) if(billQty > 0)
{ {
volatileQty = ((reqdRm * qtyFd)/billQty)*(procLossPerc/100);
valueXmlString.append("<Detail>\r\n"); valueXmlString.append("<Detail>\r\n");
valueXmlString.append("<quantity>").append("<![CDATA[").append((billQty - (billQty * (procLossPerc/100)))-qtyFd).append("]]>").append("</quantity>\r\n"); valueXmlString.append("<quantity>").append("<![CDATA[").append(df.format(volatileQty)).append("]]>").append("</quantity>\r\n");
valueXmlString.append("<item_code>").append("<![CDATA[").append(VolatileItem).append("]]>").append("</item_code>\r\n"); valueXmlString.append("<item_code>").append("<![CDATA[").append(VolatileItem).append("]]>").append("</item_code>\r\n");
valueXmlString.append("<item_descr>").append("<![CDATA[").append(VolatileItemDescr).append("]]>").append("</item_descr>\r\n"); valueXmlString.append("<item_descr>").append("<![CDATA[").append(VolatileItemDescr).append("]]>").append("</item_descr>\r\n");
valueXmlString.append("<loc_code>").append("<![CDATA[").append(locCode).append("]]>").append("</loc_code>\r\n"); valueXmlString.append("<loc_code>").append("<![CDATA[").append(locCode).append("]]>").append("</loc_code>\r\n");
...@@ -215,8 +231,10 @@ public class WoVolatileLossAct extends ActionHandlerEJB implements WoVolatileLos ...@@ -215,8 +231,10 @@ 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);
valueXmlString.append("<Detail>\r\n"); valueXmlString.append("<Detail>\r\n");
valueXmlString.append("<quantity>").append("<![CDATA[").append((billQty - (billQty * (scrapPerc/100)))-qtyFd).append("]]>").append("</quantity>\r\n"); valueXmlString.append("<quantity>").append("<![CDATA[").append(df.format(scrapQty)).append("]]>").append("</quantity>\r\n");
valueXmlString.append("<item_code>").append("<![CDATA[").append(scrapItem).append("]]>").append("</item_code>\r\n"); valueXmlString.append("<item_code>").append("<![CDATA[").append(scrapItem).append("]]>").append("</item_code>\r\n");
valueXmlString.append("<item_descr>").append("<![CDATA[").append(scrapItemDescr).append("]]>").append("</item_descr>\r\n"); valueXmlString.append("<item_descr>").append("<![CDATA[").append(scrapItemDescr).append("]]>").append("</item_descr>\r\n");
valueXmlString.append("<loc_code>").append("<![CDATA[").append(locCode).append("]]>").append("</loc_code>\r\n"); valueXmlString.append("<loc_code>").append("<![CDATA[").append(locCode).append("]]>").append("</loc_code>\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