Commit b76d3d44 authored by cpatil's avatar cpatil

*** empty log message ***


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91924 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6bf91df5
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import java.util.*;
import java.util.Date;
import java.text.*;
import java.sql.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.ejb.*;
import ibase.webitm.utility.*;
import ibase.system.config.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.TransIDGenerator;//TID
import ibase.utility.CommonConstants;//TID
import javax.ejb.Stateless; // added for 3
@Stateless // added for 3
public class InvoiceDownloadIc extends ValidatorEJB implements InvoiceDownloadIcLocal, InvoiceDownloadIcRemote
{
java.sql.Connection conn=null;
GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
java.sql.PreparedStatement pstmt=null;
java.sql.ResultSet rs = null;
String sql = null;
/*public void Create() throws RemoteException, CreateException
{
System.out.println("InvoiceDownloadIc is in Process.ejb..ejb..ejb..ejb..ejb.");
}
public void Remove()
{
}
public void Activate()
{
}
public void Passivate()
{
}*/
public String itemChanged() throws RemoteException,ITMException
{
return "";
}
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String valueXmlString = "";
try
{
System.out.println("@@@@@..... itemChanged called......");
dom = parseString(xmlString);
System.out.println("xmlString["+ xmlString+"]");
dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0 )
{
dom2 = parseString(xmlString2);
}
valueXmlString = itemChanged(dom,dom1,dom2,objContext,currentColumn,editFlag,xtraParams);
}
catch(Exception e)
{
System.out.println("Exception : [InvoiceDownloadIc][itemChanged(String,String)] :==>\n"+e.getMessage());
}
return valueXmlString;
}
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
StringBuffer valueXmlString = new StringBuffer();
//String columnValue = "";
String loginSite = "",invoiceIdFrom="",invoiceIdTo="",invoiceDateFromStr="",invoiceDateToStr="";
Timestamp invoiceDateFrom = null,invoiceDateTo = null;
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
int currentFormNo = 0;
String columnValue = null;
NodeList parentNodeList = null;
Node parentNode = null;
Node childNode = null;
NodeList childNodeList = null;
String childNodeName = null;
int childNodeListLength = 0;
int ctr = 0;
loginSite = getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode");
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>");
valueXmlString.append("<Detail1>");
System.out.println("@@@@@ itemChanged called......");
try
{
//////////////
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
if(objContext != null && objContext.length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
loginSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
System.out.println("[invoicedownloadICEJB] [itemChanged] :currentFormNo ....." +currentFormNo);
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>");
valueXmlString.append("<Detail1>");
System.out.println("Current Form No ["+currentFormNo+"]");
switch (currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
ctr = 0;
childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equals(currentColumn))
{
if (childNode.getFirstChild() != null)
{
columnValue=childNode.getFirstChild().getNodeValue();
}
}
ctr++;
}while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'");
if (currentColumn.equals( "itm_default" ))
{
System.out.println("@@@@@ itm_default called......");
valueXmlString.append("<site_code_from>").append("00").append("</site_code_from>");
valueXmlString.append("<site_code_to>").append("ZZ").append("</site_code_to>");
valueXmlString.append("<cust_code_from>").append("00").append("</cust_code_from>");
valueXmlString.append("<cust_code_to>").append("ZZ").append("</cust_code_to>");
valueXmlString.append("<invoice_id_from>").append("00").append("</invoice_id_from>");
valueXmlString.append("<invoice_id_to>").append("ZZ").append("</invoice_id_to>");
valueXmlString.append("<invoice_date_from>").append(getCurrdateAppFormat()).append("</invoice_date_from>");
valueXmlString.append("<invoice_date_to>").append(getCurrdateAppFormat()).append("</invoice_date_to>");
}
else if(currentColumn.trim().equalsIgnoreCase("invoice_id_from"))
{
invoiceIdFrom = getColumnValue("invoice_id_from",dom);
sql = "select tran_date from invoice where invoice_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, invoiceIdFrom);
rs = pstmt.executeQuery();
if (rs.next())
{
invoiceDateFrom = rs.getTimestamp("tran_date");
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
System.out.println("@@@@@ invoiceDateFrom["+invoiceDateFrom+"]");
invoiceDateFromStr = new SimpleDateFormat(genericUtility.getApplDateFormat()).format(invoiceDateFrom).toString();
valueXmlString.append("<invoice_date_from>").append( invoiceDateFromStr ).append("</invoice_date_from>");
}
else if (currentColumn.trim().equalsIgnoreCase("invoice_id_to"))
{
invoiceIdTo = getColumnValue("invoice_id_to",dom);
sql = "select tran_date from invoice where invoice_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, invoiceIdTo);
rs = pstmt.executeQuery();
if (rs.next())
{
invoiceDateTo = rs.getTimestamp("tran_date");
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
System.out.println("@@@@@ invoiceDateTo["+invoiceDateTo+"]");
invoiceDateToStr = new SimpleDateFormat(genericUtility.getApplDateFormat()).format(invoiceDateTo).toString();
valueXmlString.append("<invoice_date_to>").append( invoiceDateToStr ).append("</invoice_date_to>");
}
valueXmlString.append("</Detail1>");
valueXmlString.append("</Root>");
}//END OF switch
}//END OF TRY
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception ::"+e.getMessage());
}
finally
{
try{conn.close();conn = null;}catch(Exception d){}
}
System.out.println("valueXmlString:::::"+valueXmlString.toString());
return valueXmlString.toString();
}//END OF ITEMCHNGE
private String getCurrdateAppFormat()
{
String currAppdate ="";
java.sql.Timestamp currDate = null;
try
{
Object date = null;
currDate =new java.sql.Timestamp(System.currentTimeMillis()) ;
System.out.println(genericUtility.getDBDateFormat());
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getDBDateFormat());
date = sdf.parse(currDate.toString());
currDate = java.sql.Timestamp.valueOf(sdf.format(date).toString() + " 00:00:00.0");
currAppdate = new SimpleDateFormat(genericUtility.getApplDateFormat()).format(currDate).toString();
}
catch(Exception e)
{
System.out.println("Exception in getCurrdateAppFormat"+e.getMessage());
}
return (currAppdate);
}
}
\ No newline at end of file
package ibase.webitm.ejb.fin;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface InvoiceDownloadIcLocal extends ValidatorLocal//,EJBObject
{
//public String wfValData() throws RemoteException,ITMException;
//public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
//public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.fin;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
@Remote // added for ejb3
public interface InvoiceDownloadIcRemote extends ValidatorRemote//,EJBObject
{
//public String wfValData() throws RemoteException,ITMException;
//public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
//public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
This diff is collapsed.
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface InvoiceDownloadPrcLocal extends ibase.webitm.ejb.ProcessLocal
{
@Override
public String process() throws RemoteException,ITMException;
@Override
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
@Override
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
@Remote // added for ejb3
public interface InvoiceDownloadPrcRemote extends ibase.webitm.ejb.ProcessRemote
{
@Override
public String process() throws RemoteException,ITMException;
@Override
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
@Override
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
}
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