Commit 5cd840e7 authored by msharma's avatar msharma

Changes done in getdata to resolve multiple sorting


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92698 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e1de0002
...@@ -166,6 +166,13 @@ public class ReceivablesTransPrc extends ProcessEJB implements ReceivablesTransP ...@@ -166,6 +166,13 @@ public class ReceivablesTransPrc extends ProcessEJB implements ReceivablesTransP
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
Connection conn= null; Connection conn= null;
retTabSepStrBuff.append("<?xml version = \"1.0\"?>");
retTabSepStrBuff.append("<DocumentRoot>");
retTabSepStrBuff.append("<description>").append("Datawindow Root").append("</description>");
retTabSepStrBuff.append("<group0>");
retTabSepStrBuff.append("<description>").append("Group0 description").append("</description>");
retTabSepStrBuff.append("<Header0>");
try try
{ {
if(conn==null) if(conn==null)
...@@ -429,84 +436,114 @@ public class ReceivablesTransPrc extends ProcessEJB implements ReceivablesTransP ...@@ -429,84 +436,114 @@ public class ReceivablesTransPrc extends ProcessEJB implements ReceivablesTransP
System.out.println("QUERY PROCESS FINISED......."); System.out.println("QUERY PROCESS FINISED.......");
while(rs1.next()) while(rs1.next())
{ {
retTabSepStrBuff.append("<Detail2>");
//tran_id //tran_id
retTabSepStrBuff.append((rs1.getString(1)==null?"":rs1.getString(1))).append("\t"); //retTabSepStrBuff.append((rs1.getString(1)==null?"":rs1.getString(1))).append("\t");
retTabSepStrBuff.append("<tran_id>").append("<![CDATA[" + (rs1.getString(1)==null?"":rs1.getString(1)) +"]]>").append("</tran_id>");
//tran_ser //tran_ser
retTabSepStrBuff.append((rs1.getString(2)==null?"":rs1.getString(2))).append("\t"); //retTabSepStrBuff.append((rs1.getString(2)==null?"":rs1.getString(2))).append("\t");
retTabSepStrBuff.append("<tran_ser>").append("<![CDATA[" + (rs1.getString(2)==null?"":rs1.getString(2)) +"]]>").append("</tran_ser>");
//tran_date //tran_date
if(rs1.getTimestamp(3)!=null) if(rs1.getTimestamp(3)!=null)
{ {
retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(3).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t"); //retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(3).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t");
retTabSepStrBuff.append("<tran_date>").append("<![CDATA[" + this.genericUtility.getValidDateString(rs1.getTimestamp(3).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat()) +"]]>").append("</tran_date>");
} }
else else
{ {
retTabSepStrBuff.append(" ").append("\t"); //retTabSepStrBuff.append(" ").append("\t");
retTabSepStrBuff.append("<tran_date>").append("<![CDATA[ ]]>").append("</tran_date>");
} }
//tran_type //tran_type
retTabSepStrBuff.append(tranType ==null?" ":tranType).append("\t"); //retTabSepStrBuff.append(tranType ==null?" ":tranType).append("\t");
//retTabSepStrBuff.append("<tran_type>").append("<![CDATA[" + tranType ==null?" ":tranType +"]]>").append("</tran_type>");
retTabSepStrBuff.append("<tran_type>").append("<![CDATA[" + (tranType==null?"":tranType) +"]]>").append("</tran_type>");
//cust_code //cust_code
retTabSepStrBuff.append((rs1.getString(4)==null?"":rs1.getString(4))).append("\t"); //retTabSepStrBuff.append((rs1.getString(4)==null?"":rs1.getString(4))).append("\t");
retTabSepStrBuff.append("<cust_code>").append("<![CDATA[" + (rs1.getString(4)==null?"":rs1.getString(4)) +"]]>").append("</cust_code>");
//ref_no,
//retTabSepStrBuff.append((rs1.getString(18)==null?"":rs1.getString(18))).append("\t");
retTabSepStrBuff.append("<ref_no>").append("<![CDATA[" + (rs1.getString(18)==null?"":rs1.getString(18)) +"]]>").append("</ref_no>");
//ref_date //ref_date
if(rs1.getTimestamp(5)!=null) if(rs1.getTimestamp(5)!=null)
{ {
retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(5).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t"); //retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(5).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t");
retTabSepStrBuff.append("<ref_date>").append("<![CDATA[" + this.genericUtility.getValidDateString(rs1.getTimestamp(5).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat()) +"]]>").append("</ref_date>");
} }
else else
{ {
retTabSepStrBuff.append(" ").append("\t"); //retTabSepStrBuff.append(" ").append("\t");
retTabSepStrBuff.append("<ref_date>").append("<![CDATA[ ]]>").append("</ref_date>");
} }
//curr_code //curr_code
retTabSepStrBuff.append((rs1.getString(6)==null?"":rs1.getString(6))).append("\t"); //retTabSepStrBuff.append((rs1.getString(6)==null?"":rs1.getString(6))).append("\t");
retTabSepStrBuff.append("<curr_code>").append("<![CDATA[" + (rs1.getString(6)==null?"":rs1.getString(6)) +"]]>").append("</curr_code>");
//exch_rate //exch_rate
retTabSepStrBuff.append((rs1.getString(7)==null?"":rs1.getDouble(7))).append("\t"); //retTabSepStrBuff.append((rs1.getString(7)==null?"":rs1.getDouble(7))).append("\t");
retTabSepStrBuff.append("<exch_rate>").append("<![CDATA[" + (rs1.getString(7)==null?"":rs1.getString(7)) +"]]>").append("</exch_rate>");
//site_code //site_code
retTabSepStrBuff.append((rs1.getString(8)==null?"":rs1.getString(8))).append("\t"); //retTabSepStrBuff.append((rs1.getString(8)==null?"":rs1.getString(8))).append("\t");
retTabSepStrBuff.append("<site_code>").append("<![CDATA[" + (rs1.getString(8)==null?"":rs1.getString(8)) +"]]>").append("</site_code>");
//fin_entity //fin_entity
retTabSepStrBuff.append((rs1.getString(9)==null?"":rs1.getString(9))).append("\t"); //retTabSepStrBuff.append((rs1.getString(9)==null?"":rs1.getString(9))).append("\t");
retTabSepStrBuff.append("<fin_entity>").append("<![CDATA[" + (rs1.getString(9)==null?"":rs1.getString(9)) +"]]>").append("</fin_entity>");
//tot_amt //tot_amt
retTabSepStrBuff.append(String.valueOf(rs1.getDouble(10))).append("\t"); //retTabSepStrBuff.append(String.valueOf(rs1.getDouble(10))).append("\t");
retTabSepStrBuff.append("<tot_amt>").append("<![CDATA[" + String.valueOf(rs1.getDouble(10)) +"]]>").append("</tot_amt>");
//adj_amt //adj_amt
retTabSepStrBuff.append(String.valueOf(rs1.getDouble(11))).append("\t"); //retTabSepStrBuff.append(String.valueOf(rs1.getDouble(11))).append("\t");
retTabSepStrBuff.append("<adj_amt>").append("<![CDATA[" + String.valueOf(rs1.getDouble(11)) +"]]>").append("</adj_amt>");
//due_date
if(rs1.getTimestamp(19)!=null)
{
//retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(19).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t");
retTabSepStrBuff.append("<due_date>").append("<![CDATA[" + this.genericUtility.getValidDateString(rs1.getTimestamp(19).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat()) +"]]>").append("</due_date>");
}
else
{
//retTabSepStrBuff.append(processDate).append("\t");
retTabSepStrBuff.append("<due_date>").append("<![CDATA[ ]]>").append("</due_date>");
}
//status //status
retTabSepStrBuff.append((rs1.getString(12)==null?"":rs1.getString(12))).append("\t"); //retTabSepStrBuff.append((rs1.getString(12)==null?"":rs1.getString(12))).append("\t");
retTabSepStrBuff.append("<status>").append("<![CDATA[" + (rs1.getString(12)==null?"":rs1.getString(12)) +"]]>").append("</status>");
//stat_date //stat_date
if(rs1.getTimestamp(13)!=null) if(rs1.getTimestamp(13)!=null)
{ {
retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(13).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t"); //retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(13).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t");
retTabSepStrBuff.append("<stat_date>").append("<![CDATA[" + this.genericUtility.getValidDateString(rs1.getTimestamp(13).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat()) +"]]>").append("</stat_date>");
} }
else else
{ {
retTabSepStrBuff.append(" ").append("\t"); //retTabSepStrBuff.append(" ").append("\t");
retTabSepStrBuff.append("<stat_date>").append("<![CDATA[ ]]>").append("</stat_date>");
} }
//reas_code //reas_code
retTabSepStrBuff.append(reasCode).append("\t"); //retTabSepStrBuff.append(reasCode).append("\t");
retTabSepStrBuff.append("<reas_code>").append("<![CDATA[" + reasCode +"]]>").append("</reas_code>");
//bank_code //bank_code
retTabSepStrBuff.append((rs1.getString(15)==null?"":rs1.getString(15))).append("\t"); //retTabSepStrBuff.append((rs1.getString(15)==null?"":rs1.getString(15))).append("\t");
retTabSepStrBuff.append("<bank_code>").append("<![CDATA[" + (rs1.getString(15)==null?"":rs1.getString(15)) +"]]>").append("</bank_code>");
//cust_ref_no, //cust_ref_no,
retTabSepStrBuff.append((rs1.getString(16)==null?"":rs1.getString(16))).append("\t"); //retTabSepStrBuff.append((rs1.getString(16)==null?"":rs1.getString(16))).append("\t");
retTabSepStrBuff.append("<cust_ref_no>").append("<![CDATA[" + (rs1.getString(16)==null?"":rs1.getString(16)) +"]]>").append("</cust_ref_no>");
//cust_ref_date //cust_ref_date
if(rs1.getTimestamp(17)!=null) if(rs1.getTimestamp(17)!=null)
{ {
retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(17).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t"); //retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(17).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t");
} retTabSepStrBuff.append("<cust_ref_date>").append("<![CDATA[" + this.genericUtility.getValidDateString(rs1.getTimestamp(17).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat()) +"]]>").append("</cust_ref_date>");
else
{
retTabSepStrBuff.append(" ").append("\t");
}
//ref_no,
retTabSepStrBuff.append((rs1.getString(18)==null?"":rs1.getString(18))).append("\t");
//due_date
if(rs1.getTimestamp(19)!=null)
{
retTabSepStrBuff.append(this.genericUtility.getValidDateString(rs1.getTimestamp(19).toString(),this.genericUtility.getDBDateFormat(),this.genericUtility.getApplDateFormat())).append("\t");
} }
else else
{ {
retTabSepStrBuff.append(processDate).append("\t"); //retTabSepStrBuff.append(" ").append("\t");
retTabSepStrBuff.append("<cust_ref_date>").append("<![CDATA[ ]]>").append("</cust_ref_date>");
} }
retTabSepStrBuff.append("\n");
//retTabSepStrBuff.append("\n");
retTabSepStrBuff.append("</Detail2>");
count++; count++;
...@@ -528,6 +565,11 @@ public class ReceivablesTransPrc extends ProcessEJB implements ReceivablesTransP ...@@ -528,6 +565,11 @@ public class ReceivablesTransPrc extends ProcessEJB implements ReceivablesTransP
pstmt.close(); pstmt.close();
rs1=null; rs1=null;
pstmt=null; pstmt=null;
retTabSepStrBuff.append("</Header0>");
retTabSepStrBuff.append("</group0>");
retTabSepStrBuff.append("</DocumentRoot>");
System.out.println("xml string::::"+retTabSepStrBuff);
if (count == 0 ) if (count == 0 )
{ {
errString = itmDBAccessEJB.getErrorString("","VTNOREC1","","",conn); errString = itmDBAccessEJB.getErrorString("","VTNOREC1","","",conn);
......
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