Commit 137df775 authored by caluka's avatar caluka

Inter Company Reconcilation module code is merged as per mahendra mail


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99478 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 86cdbbc5
......@@ -431,4 +431,89 @@ public class InterCompReconcileProcess extends ProcessEJB implements InterCompRe
return valueXmlString.toString();
}
/*-----------------Added by mahendra on dated 17-11-2015 (Add autofilter provision to pophelp)---------------*/
public String getValuesForPopHelp(String sundryType,String keyString){
System.out.println("in getValuesForPopHelp EJB called222---------------");
System.out.println("------changes for encoding-----------------");
System.out.println("SundryType222--->>["+sundryType+"]");
System.out.println("keyString->>["+keyString+"]");
String sql="",sundry;
Connection conn1 = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
GenericUtility genericUtility = GenericUtility.getInstance();
//StringBuffer valueXmlString = new StringBuffer();
/*valueXmlString.append("<?xml version='1.0' encoding='ISO-8859-1'?>" +
"<?xml-stylesheet type=\"text/xsl\" href=\"../xsl/popup.xsl\"?>" +
"<?xml-stylesheet type=\"text/css\" href=\"../css/xtree.css\"?>"); */
StringBuffer valueXmlString = new StringBuffer("<?xml version='1.0' encoding='UTF-8'?><Root>\r\n");
try
{
ConnDriver connDriver = new ConnDriver();
conn1 = connDriver.getConnectDB("DriverITM");
if("customer".equalsIgnoreCase(sundryType))
sql = "select cust_code,cust_name from customer where cust_code like '"+keyString+"%' ";
else if("supplier".equalsIgnoreCase(sundryType))
sql="select supp_code,sh_name from supplier where supp_code like '"+keyString+"%'";
else if("employee".equalsIgnoreCase(sundryType))
sql="select emp_code,emp_fname || ' ' || emp_lname from employee where emp_code like '"+keyString+"%' ";
else if("loan_party".equalsIgnoreCase(sundryType))
sql="select party_code,party_name from loanparty where party_code like '"+keyString+"%' ";
else if("tax_authority".equalsIgnoreCase(sundryType))
sql="select tauth_code,tauth_name from tax_authority where tauth_code like '"+keyString+"%' ";
else if("transporter".equalsIgnoreCase(sundryType))
sql="select tran_code,tran_name from transporter where tran_code like '"+keyString+"%' ";
else if("sales_pers".equalsIgnoreCase(sundryType))
sql="select sales_pers,sp_name from sales_pers where sales_pers like '"+keyString+"%' ";
else if("strg_customer".equalsIgnoreCase(sundryType))
sql="select sc_code,first_name || ' ' || last_name from strg_customer where sc_code like '"+keyString+"%' ";
System.out.println("Sql getValuesForPopHelp-->>["+sql+"]");
pstmt = conn1.prepareStatement(sql);
rs = pstmt.executeQuery();
int num = 1;
while (rs.next())
{
valueXmlString.append("<Detail domID='" + num + "'>\r\n");
valueXmlString.append("<sundry_code><![CDATA[").append(rs.getString(1)).append("]]></sundry_code>\r\n");
valueXmlString.append("<sundry_name><![CDATA[").append(rs.getString(2)).append("]]></sundry_name>\r\n");
valueXmlString.append("</Detail>\r\n");
num++;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null ;
}
catch(Exception e){
System.out.println("Exception in getValuesForPopHelp.............");
e.printStackTrace();
}
finally{
try{
if(conn1!=null){
conn1.close();
}
}
catch(Exception e){
e.printStackTrace();
}
}
valueXmlString.append("</Root>\r\n");
System.out.println("\n****ValueXmlString ::[[" + valueXmlString.toString() +"]]:********");
return valueXmlString.toString();
}
}
\ No newline at end of file
......@@ -16,4 +16,7 @@ public interface InterCompReconcileProcessLocal extends ProcessLocal {
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException, ITMException;
public String getValuesForPopHelp(String sundryType);
/*-----------------Added by mahendra on dated 17-11-2015 (Add autofilter provision to pophelp)---------------*/
public String getValuesForPopHelp(String sundryType,String keyString);
}
\ No newline at end of file
......@@ -16,4 +16,7 @@ public interface InterCompReconcileProcessRemote extends ProcessRemote {
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException, ITMException;
public String getValuesForPopHelp(String sundryType);
/*-----------------Added by mahendra on dated 17-11-2015 (Add autofilter provision to pophelp)---------------*/
public String getValuesForPopHelp(String sundryType,String keyString);
}
\ No newline at end of file
......@@ -35,6 +35,29 @@ public String getPophelp(String sundryType){
}
return xmlStringPopHelp;
}
/*-----------------Added by mahendra on dated 17-11-2015 (Add autofilter provision to pophelp)---------------*/
public String getPophelp(String sundryType,String keyString){
try{
System.out.println("In getPophelp--->>["+sundryType+"]");
System.out.println("keyString :"+keyString);
ctx = new InitialContext();
reconcileObj = (InterCompReconcileProcessLocal)ctx.lookup("ibase/InterCompReconcileProcess/local");
xmlStringPopHelp=reconcileObj.getValuesForPopHelp(sundryType,keyString);
//System.out.println("xmlStringPopHelp=====>>["+xmlStringPopHelp+"]");
String xslFileName = getXSLFileName( "reconcilepop.xsl" );
reconcileObj=null;
// xmlStringPopHelp = ( new ibase.webitm.utility.GenericUtility() ).transformToString( xslFileName, xmlStringPopHelp, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
}
catch(Exception e){
e.printStackTrace();
}
return xmlStringPopHelp;
}
private String getXSLFileName( String xslFileName )throws ITMException
{
String retFileName = 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